I am trying my hand in networking programming in C, and got stuck in piping.
I was following some tutorial and did the forking like :
I want to have:
The client forks off a child. After the child is forked off, the parent process enters a second loop in which it continually reads and prints out status messages received from the child via a half-duplex pipe.
How to do the thing in bold?
Apologies , if it is a lame question..but how do we do that or some reference of the same would help me..
Dear All,
Would you tell me how I can passing a message along pipes?
I have built a token ring connected with pipes, but I don't know how to pass the message along it through the command line...
Thx.
Yours,
i- (1 Reply)
:(
Since I'm fairly new to the scene and don't have much experience in shell programming, I decided to check out the net for a useful script or two.
What I'm looking for is a script that would let me enter a PID and then show the process tree associated with it.
So it would display the (grand-)... (2 Replies)
Hi all,
I'm trying to write a program that has some data it wants to send through a filter program(in this case tr), and then recieve the output from that filter program. The way I'm trying to do it is by setting up two pipes between the programs and piping the data in through one pipe and back... (2 Replies)
Hello.
I have a global function name func1() that I am sourcing in from script A. I call the function from script B. Is there a way to find out which script called func1() dynamically so that the func1() can report it in the event there are errors?
Thanks (2 Replies)
Hi
I have written a script using ftp to get files from one server and copy them to 2 dirrerent servers. I wish to call this script from a parent script that will check the number of files copied and run a check sum for each file. As the filenames for the files in the get portion of the script... (3 Replies)
Hi guys, I'm having some problem here, I'm studying pipes, and i want to create a shell in C and at this point a don't want to use semaphores, instead I want to use tricks. Straight to the doubt: I've a parent and a child process, and both of them has some code to execute, and the child process... (5 Replies)
1. The problem statement, all variables and given/known data:
I need to make an program that in a loop creates one parent and five children with fork(). The problem i'm trying to solve is how to delete the parent and child of the childīs process.
2. Relevant commands, code, scripts,... (0 Replies)
Hi everyone
i am very new to linux , working on bash shell.
I am trying to solve the given problem
1. Create a process and then create children using fork
2. Check the Status of the application for successful running.
3. Kill all the process(threads) except parent and first child... (2 Replies)
I have a simple client/server program I am using for learning purposes.
I have it setup so that after server is setup and listening it than goes into a loop where it accepts incoming client connections. After each connection, the client socket is than passed to a thread routine where it can be... (3 Replies)
Hi Forum.
I have this challenging issue that I'm hoping someone can help me.
I have a file that contains 3 different types of segments (AM00, AM01, AM32) in a hierarchy structure and I want to be able to pass the column key from the parent record to the children records.
AM00 - parent key:... (13 Replies)
Discussion started by: pchang
13 Replies
LEARN ABOUT HPUX
setpgid
setpgid(2) System Calls Manual setpgid(2)NAME
setpgid(), setpgrp2() - set process group ID for job control
SYNOPSIS DESCRIPTION
The and system calls cause the process specified by pid to join an existing process group or create a new process group within the session
of the calling process. The process group ID of the process whose process ID is pid is set to pgid. If pid is zero, the process ID of the
calling process is used. If pgid is zero, the process ID of the indicated process is used. The process group ID of a session leader does
not change.
is provided for backward compatibility only.
Security Restrictions
Some or all of the actions associated with this system call are subject to compartmental restrictions.
See compartments(5) for more information about compartmentalization on systems that support that feature. Compartmental restrictions can
be overridden if the process possesses the privilege (COMMALLOWED). Processes owned by the superuser may not have this privilege. Pro-
cesses owned by any user may have this privilege, depending on system configuration.
See privileges(5) for more information about privileged access on systems that support fine-grained privileges.
RETURN VALUE
and return the following values:
Successful completion.
Failure.
is set to indicate the error.
ERRORS
If or fails, is set to one of the following values.
The value of pid matches the process ID of a child process of the calling process and the child process has successfully executed
one of the exec(2) functions.
The value of pgid is less than zero or is outside the range of valid process group ID values.
The process indicated by
pid is a session leader.
The value of pid is valid but matches the process ID of a child process of the calling process, and the child process is not in
the same session as the calling process.
The value of pgid does not match the process ID of the process indicated by pid and there is no process with a process group ID
that matches the value of pgid in the same session as the calling process.
The value of pid does not match the process ID of the calling process or of a child process of the calling process.
AUTHOR
and were developed by HP and the University of California, Berkeley.
SEE ALSO bsdproc(3C), exec(2), exit(2), fork(2), getpid(2), kill(2), setsid(2), signal(2), privileges(5), termio(7).
STANDARDS CONFORMANCE setpgid(2)