SETSID(2) BSD System Calls Manual SETSID(2)NAME
setsid -- create session and set process group ID
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
pid_t
setsid(void);
DESCRIPTION
The setsid() function 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() function 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.
ERRORS
If an error occurs, setsid() returns -1 and the global variable errno is set to indicate the error, as follows:
[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 getsid(2), setpgid(2), tcgetpgrp(3), tcsetpgrp(3)STANDARDS
The setsid() function conforms to ISO/IEC 9945-1:1990 (``POSIX.1'').
BSD April 4, 2011 BSD
Check Out this Related Man Page
SETSID(2) BSD System Calls Manual SETSID(2)NAME
setsid -- create session and set process group ID
SYNOPSIS
#include <unistd.h>
pid_t
setsid(void);
DESCRIPTION
The setsid function 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 function 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.
ERRORS
If an error occurs, setsid returns -1 and the global variable errno is set to indicate the error, as follows:
[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.
LEGACY SYNOPSIS
#include <sys/types.h>
#include <unistd.h>
The include file <sys/types.h> is necessary.
SEE ALSO setpgid(3), tcgetpgrp(3), tcsetpgrp(3), compat(5)STANDARDS
The setsid function is expected to be compliant with the IEEE Std 1003.1-1988 (``POSIX.1'') specification.
BSD June 4, 1993 BSD
Is it possible to set owner to a group? I need to have a group own a process, because there will be 3 diffrent persons that will start and stop this process. They can not use the same users cause och back logging. we need to know who end when a certian user start/stops processes. (1 Reply)
Ther are two process in my program and i want both to constantly running. So i have written the following code. But one of this process which is calling function wsJobCheck() is getting terminated with giving message : Program exited normally.
Can any one suggest why this is happing.
Code :
... (1 Reply)
Hi Everybody,
I want to create a shell script named as say "jip" and it is runned.
And i want that when i do ps + grep for the process than this jip should be shown as process.
Infact there might be process with name jip which is already running. (3 Replies)
if i am finding out that a process has a more cpu usage before killing the process what are the commands to find out the files which are used by the process.
can anyone help this
thanks (1 Reply)
hello
i have direcotry in which i will be getting a number of input files with different names and i need to write a script where i need to process the older file first and then come out of the loop.
can any one throw some light
appreciate (2 Replies)
i want a command to display all the process running for partical user and in all process i want to see only particular process details.. pls suggest comand like ps -ef (1 Reply)
hi to everyone reading,
I have an assignment, I should make a process that should start a second process, and reseiving a signal from it to create a third process and close the second one... and the other things i will do on myself :)
Do you have an Idea ?:confused: (2 Replies)
Hi,
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)
Can someone tell me what the output of 'who -d' is ?
What's causing the process in the list to be there ?
What can be done to get rid of / fix those process ?
Are those process simple problems, important or urgent onces ?
I am asking because while looking for another 'who' option, I... (2 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 <stdio.h>
#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)