11-06-2009
1. No
2. Depends on what scheduler the kernel uses.
3. Yes, but this has nothing to do with system or concurrent programming, but with counting how much output you already produced and waiting after a certain amount.
5. Sendmail, Postfix, Firefox, FTP, SSH, ... pretty much anything using a network.
6. It doesn't. By the time fork() finishes, there are already 2 separate processes. In the parent process it's returning the PID of the child. In the child it returns 0. If it can't spawn a child for any reason, it returns -1 and sets errno.
8 More Discussions You Might Find Interesting
1. Programming
I have a question regarding the recv syscall.
Suppose I have a client/server and the following exchange of message took place:
Client --> Server using multiple send syscalls one after another immediately:
send "Packet1"
send "Packet2"
send "Packet3"
Server receives in the... (2 Replies)
Discussion started by: heljy
2 Replies
2. UNIX for Advanced & Expert Users
Hi all,
I am using ptrace to keep track of clone syscalls in a program. However, I found that the traced syscall cant be paired. for example, there are some syscalls that have entry, but without exit showing up in the traced sequences. So, is there anyway to distinguish the entry and exit of a... (0 Replies)
Discussion started by: tristartom
0 Replies
3. UNIX for Dummies Questions & Answers
I saw somewhere that describe read() as a primitive. But when I lean signals, it says the read() may be interrupted by a signal.
My Question:
1, What is the diffence between primitive and reentrant?
2, Is read() a primitive or reentrant?
3, Are all system calls primitive or reentrant? (2 Replies)
Discussion started by: vistastar
2 Replies
4. UNIX for Advanced & Expert Users
Hello Experts,
If a Solaris process is calling some syscall, and right now execution is inside syscall doing only CPU work, for example the inside simplest times syscall,
-> app_func
=> times
<< we are here now, we have entered in the times, but not exited yet
<= times
<- app_func... (9 Replies)
Discussion started by: sant
9 Replies
5. Solaris
hi!:)
i got a problem....:wall::wall:
i got several disks in my diskarray. I attached new disk to allocate it to the swap space.
The problem is : how to recognise the newly attached disk?
I've one more requirement -:wall:- i want to run dns service on another port number.how can i do... (2 Replies)
Discussion started by: vamshigvk475
2 Replies
6. Red Hat
Hi,
I wanna add my own system call to Fedora 18 kernel 3.8.2.
From kernel 3.3 I heard there is a new system to add system calls.
So where i can find a guides ?
I wanna print this text: "Hello world!" in terminal, not dmesg. (4 Replies)
Discussion started by: googz
4 Replies
7. Programming
Hello to all
I want download a file in osx intel 64 with NASM , I want to use socket syscall
This is part of my code
section .data
command db "GET /test/2.gif HTTP/1.1\r\nHost: 10.1.1.187\r\n\r\n", 0
; url db "http://172.16.207.153/test/2.gif", 0
global main... (1 Reply)
Discussion started by: recher.jack
1 Replies
8. Emergency UNIX and Linux Support
Oflate we are finding a few servers experiencing severe slowness. What would be the commands that I need to try to postmortem the situation? (3 Replies)
Discussion started by: ggayathri
3 Replies
system(3S) system(3S)
NAME
system() - issue a shell command
SYNOPSIS
DESCRIPTION
executes the command specified by the string pointed to by command. The environment of the executed command is as if a child process were
created using (see fork(2)), and the child process invoked the sh-posix(1) utility via a call to (see exec(2)) as follows:
ignores the and signals, and blocks the signal, while waiting for the command to terminate. If this might cause the application to miss a
signal that would have killed it, the application should examine the return value from and take whatever action is appropriate to the
application if the command terminated due to receipt of a signal.
does not affect the termination status of any child of the calling processes other than the process or processes it itself creates.
does not return until the child process has terminated.
APPLICATION USAGE
If the return value of is not -1, its value can be decoded through the use of the macros described in For convenience, these macros are
also provided in
Note that, while must ignore and and block while waiting for the child to terminate, the handling of signals in the executed command is as
specified by fork(2) and exec(2). For example, if is being caught or is set to when is called, the child is started with handling set to
Ignoring and in the parent process prevents coordination problems (such as two processes reading from the same terminal) when the executed
command ignores or catches one of the signals.
RETURN VALUE
If command is null, returns non-zero.
If command is not null, returns the termination status of the command language interpreter in the format specified by wait(2). The termi-
nation status of the command language interpreter is as specified for sh-posix(1), except that if some error prevents the command language
interpreter from executing after the child process is created, the return value from is as if the command language interpreter had termi-
nated using If a child process cannot be created, or if the termination status for the command language interpreter cannot be obtained,
returns -1 and sets to indicate the error.
DIAGNOSTICS
forks to create a child process which, in turn, in order to execute string. If the fork fails, returns -1 and sets If the exec fails,
returns the status value returned by (see wait(2)) for a process that terminates with a call of
ERRORS
If errors are encountered, sets values as described by fork(2).
FILES
SEE ALSO
sh(1), fork(2), exec(2), wait(2), thread_safety(5).
STANDARDS CONFORMANCE
system(3S)