Sponsored Content
Full Discussion: Father & children
Top Forums Programming Father & children Post 97461 by Jariya on Monday 30th of January 2006 05:58:07 PM
Old 01-30-2006
Tools

I do a pipe and then another pipe because im creating a pipe, referred with "tubo2",for father process and another one in each iteratino for each child.

the program compile ok. but there is an execution error: "broken pipe". also i realize that father doesnt execute this code:

Code:
...
if (pid)
{
       /* father */
       printf("\nhello..."); /* this line is only an example. 
                                      the program executes it. Everything ok..*/
       for(i=0; i<2; i++)  /* it doest go into this loop. why?! */
       {
                /* modification of "frase" */
                ...
        }
}
else
{
         read(...); /* the function returns -1. Error */
         ...
}


Perderabo:
I didnt paste it well; yes, semicolon is needed. And im going to review rules again!

Mmm, sorry i dont have a high level as you can see... but why did you say that the other writes and reads are all zero?

Last edited by Jariya; 01-30-2006 at 07:10 PM..
 

8 More Discussions You Might Find Interesting

1. Programming

how to creat 1 parent to call 3 children

hi there, im trying to produce this program that would run at first, and when it runs it will fork one child process to a program and then another forking to run this other program, and then another one . i cant seem to get it right can someone help me please here is what is got so far: int... (1 Reply)
Discussion started by: zmanultra
1 Replies

2. UNIX for Advanced & Expert Users

How to follow processes and their children with ps

Hi, I often need to find the child processes of a parent process. There may be a string of 4-5. That is, PPID 884 spawns 890, which spawns 894, which spawns 1017. I'd like to be able to see all of them without having to type in a number of ps -ef commands. Process groups and session ID's are... (2 Replies)
Discussion started by: mschwage
2 Replies

3. Shell Programming and Scripting

Prepend name of directory to children folders

Hi, I am a shell scripting newbie. I am in need of a shell script that will prepend the name of the parent directory to the child directory. For example if the shell script called rename.sh is invoked with ">rename.sh /home/foobar/Simple" and the structure of the folder Simple is : Simple... (7 Replies)
Discussion started by: kalichar
7 Replies

4. UNIX for Advanced & Expert Users

Fork() 1 Parent 3 Children

Hi, as I understand fork(), it makes a copy of the parent which becomes a child. But is there anyway to make three children for that one parent. So in other words, if I look up the getppid() of the children, I want them to have the same value?? Thanks in advance to any help! (1 Reply)
Discussion started by: MS_CC
1 Replies

5. UNIX for Dummies Questions & Answers

How can i use fork,sleep,wait and write in a process with father and son..??

Hi.. I was unable to do (gcc code) which refers to the fork,wait,sleep and write.. what i want to do: A process of father create (fork) a son and will sleep 90 seconds..After this, son process create a grandchild and will sleep 60 seconds..Grandchild process will sleep for 30 seconds..After... (3 Replies)
Discussion started by: gumlucin
3 Replies

6. Shell Programming and Scripting

Killing process and children

Hi all, I have been searching all day for a nice solution to this problem. I have three scripts. A start script, a child script and a stop script. Script A (scripta.sh) Its Child Script B (scriptb.sh) Script C (kill_process.sh $PID) Script A correctly traps the kill command sent from... (6 Replies)
Discussion started by: mark007
6 Replies

7. Shell Programming and Scripting

Doing simple math for children.

Hello! I saw that there were a few differente ways to do math within bash scripts. expr and bc are possibilities. But which one to use when? I want to make an simple bash script for children to do math. The script must ask only questions like 1*1= till 10*10= ... No + or - or /... (10 Replies)
Discussion started by: ugurgazi
10 Replies

8. Shell Programming and Scripting

pstree but without other children of ancestors

Hi, I want to display the process tree of a given PID, however, I don't want to see other children of the ancestors that don't reach the current PID. My goal is, from the tree result, i have to fetch a particular parent process by keyword, and if any other children from parents have the same... (2 Replies)
Discussion started by: ysrini
2 Replies
EvmCallback(5)							File Formats Manual						    EvmCallback(5)

NAME
EvmCallback() - event management (EVM) callback function SYNOPSIS
DESCRIPTION
An EVM callback function is a function that you provide to allow your program to handle messages arriving on an EVM connection. Most mes- sages are incoming events or responses to requests you have made to the EVM daemon, but you may also get a callback for other reasons. Specify the name (EventCB) of the callback function in the callback parameter when you create an EVM connection with a response mode of callback. Your callback function is invoked by which you must call whenever you detect activity pending on the connection. An EVM callback function must conform to the prototype shown. Callback Function Parameters o The connection parameter contains the connection context pertaining to this callback. This value was returned by when the connection was created. If you have one callback function servicing multiple connections, you might test this to determine which connection a particular invocation is handling. o The callbackArg parameter contains the value you specified as the callbackArg parameter to when you created the connection. For exam- ple, you might use it to hold a pointer to your own context data for the connection. o The callbackData parameter points to a structure containing the details of the callback. The structure includes a callback reason code, an event, and a union containing data specific to each possible reason. The event member may contain NULL if it is not applica- ble to the reason. You may get these reasons: This callback reason indicates that the daemon was unable to deliver one or more events, probably because the client process had not finished processing earlier events, causing the connec- tion buffer to overflow. If necessary, you can use to increase the size of the receive buffer. See the EvmConnControl(3) reference page. This callback reason indicates that an EVM event has been received from the daemon. The event is available in the structure. You must use to free the event when you have finished with it. See the EvmEventDestroy(3) reference page. This callback reason indicates that a prior call has completed, usually with a response from the daemon if the responseMode was specified as when the connection was cre- ated. The posting status is available in the structure. This callback reason indicates that a requested template has been delivered in response to an request. You must use to free the template when you have finished with it. This callback reason indicates that a prior call has completed, usually with a response from the daemon. This callback reason indicates that event template information has been delivered in response to an request. The template is available in the structure. You must use to free the template when you have finished with it. FILES
Header file that contains the event declaration, structures, and prototype for the callback function SEE ALSO
Routines EvmConnCheck(3), EvmConnCreate(3), EvmConnSubscribe(3), EvmEventPost(3). Event Management EVM(5). Event Connection EvmConnection(5). EVM Events EvmEvent(5). EvmCallback(5)
All times are GMT -4. The time now is 08:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy