SETSID(2) BSD System Calls Manual SETSID(2)NAME
setsid -- create session and set process group ID
Standard C Library (libc, -lc)
The setsid() system call creates a new session. The calling process is the session leader of the new session, is the process group leader of
a new process group and has no controlling terminal. The calling process is the only process in either the session or the process group.
Upon successful completion, the setsid() system call returns the value of the process group ID of the new process group, which is the same as
the process ID of the calling process. If an error occurs, setsid() returns -1 and the global variable errno is set to indicate the error.
The setsid() system call will fail if:
[EPERM] The calling process is already a process group leader, or the process group ID of a process other than the calling process
matches the process ID of the calling process.
SEE ALSO setpgid(2), tcgetpgrp(3), tcsetpgrp(3)STANDARDS
The setsid() system call is expected to be compliant with the ISO/IEC 9945-1:1990 (``POSIX.1'') specification.
BSD June 4, 1993 BSD
Check Out this Related Man Page
setsid(2) System Calls Manual setsid(2)NAME
setsid - create session and set process group ID
If the calling process is not a process group leader, creates a new session. The calling process becomes the session leader of this new
session, it becomes the process group leader of a new process group, and it has no controlling terminal. The process group ID of the call-
ing process is set equal to the process ID of the calling process. The calling process is the only process in the new process group and
the only process in the new session.
Some or all of the actions associated with this system call may require privileges. See privileges(5) for more information.
Upon successful completion, returns the value of the new process group ID of the calling process. Otherwise, it returns a value of and
sets to indicate the error.
If fails, no changes occur and (see errno(2)) is set to one of the following values:
The calling process is already a process group leader, or
the process group ID of a process other than the calling process matches the process ID of the calling process.
The calling process does not have sufficient privileges.
was developed by HP and AT&T.
SEE ALSO exec(2), exit(2), fork(2), getpid(2), kill(2), setpgid(2), setpgrp(2), setpgrp3(2), signal(2), privileges(5), termio(7).
STANDARDS CONFORMANCE setsid(2)
I found that in my system , there are some strange process , it will make the system crash so I would like to control the system no such process is running ,
this is if the system process that its process name is "ora" AND its ppid is not "2" , then it will crash the system, can suggest how to... (2 Replies)
I'm here in the need of an experts' help!!! :-)
When does a process acquire a name ".noname"
In one of my applications I create a process using the following code,
the process is created with the given name 'executable', but the same process is not reachable with the same name.
It is only... (0 Replies)
Hello guys, i need to know how much i/o have a process?, for example when y use the command 'top' i have the i/o value in general of all process but i need to know only the i/o measure of a particular process. (1 Reply)
We are forking a process B from process A and the process B should display the details it reads from process C(daemon process) continuously.
Let us say that the process C sents 100 packets.The process B receives all the 100 packets from the process C before it prints all details of 31... (1 Reply)
My process is visible in 'ps' command but actually it is not working or it got hanged. This process is not generating any log. Now How can I know that my process got hanged.
Please help. (2 Replies)
I am trying to write my own Unix compliant (SUSv4) OS - Just a hobby OS, nothing serious. While going through the standard, I couldn't find any explicit information on process states. What I could find was (excluding the real-time considerations)-
From this it can be inferred that the... (2 Replies)
There is a column kthr:b in vmstat. How a process become blocked?
If the process calls system call pread and sleeps inside it, is the process blocked in that moment?
How a process sleeping because it has no work at all (as Notepad when we are not using it) differs from a... (3 Replies)
Hi all ! :)
What I want?
1. All child process must be in the same group of process. Parent is a leader of the group.
How to do this? I would be greatfull of some example of code, I read about setsid but I can't even start...
My code so far:
#include <stdlib.h>... (2 Replies)
I would like to create the following script:
run a python script with setsid
python may or may not fail with exception
check if all of the group processes were terminated correctly
if not, kill the remaining processes
How can I do that?
Thanks a lot (3 Replies)