Hello all.
I'm developing a filetransfer application, which is supposed to work sort of like dcc, with multiple transfers etc. Now i wonder what the best way to manage the transfers is. Should i fork() for each new transfer, hogging loads of memory or use pthreads? Maybe I can use select to see... (0 Replies)
hi all
About this code
for (i = 1; i < n; i++)
if ((childpid = fork()) <= 0)
break;
I really can't understand the output .
and the way fork () return the value .
how about the process Id ,the child process Id and the parent ID
in this case
so please answer me soon (5 Replies)
Hi everybody,
I wanna write a code to understand how fork works.
my target
--------------
-Parent creates a file(called temp) and writes into this file "1".Then it closes the file.
-Then parent creates a child and wait until execution of this child ends.
-Then child opens the same... (3 Replies)
I have never coded in perl before (just started today morning :). I need to write a perl program to automate a task.
Here is how I do it manually:
Start a program in my home dir. Now if I want to execute another program while this one is still running, what I would do is go to another... (6 Replies)
Hi, I want to exec three different functions in perl one per fork();
How can I determine that this it the third fork and I should use third function in it.
if ($pid = 0) { first();}
else (
#parent
second();
)
How to run third function? (1 Reply)
I'm trying to run a simple test on how to use fork(), i'm able to execute the child process first then the parent, but how can I execute parent then child..?
Thanks! (1 Reply)
I understand that fork create a child but I need very simple example that make child useful....
I mean how will make the program faster anyone explain with code plz
using C plz (2 Replies)
Hi,
I am breaking my head to understand the below line of code in perl:
next if $pid = fork; # Parent goes to next server.
die "fork failed: $!" unless defined $pid;
Can anyone please explain me in detail as I am a slow learner?
Thanks,
Ali. (2 Replies)
Discussion started by: liyakathali
2 Replies
LEARN ABOUT MOJAVE
system
SYSTEM(3) BSD Library Functions Manual SYSTEM(3)NAME
system -- pass a command to the shell
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdlib.h>
int
system(const char *command);
DESCRIPTION
The system() function hands the argument command to the command interpreter sh(1). The calling process waits for the shell to finish execut-
ing the command, ignoring SIGINT and SIGQUIT, and blocking SIGCHLD.
If command is a NULL pointer, system() will return non-zero if the command interpreter sh(1) is available, and zero if it is not.
RETURN VALUES
The system() function returns the exit status of the shell as returned by waitpid(2), or -1 if an error occurred when invoking fork(2) or
waitpid(2). A return value of 127 means the execution of the shell failed.
SEE ALSO sh(1), execve(2), fork(2), waitpid(2), popen(3)STANDARDS
The system() function conforms to ISO/IEC 9899:1990 (``ISO C90'') and is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
BSD June 4, 1993 BSD