GETSID(2) Linux Programmer's Manual GETSID(2)NAME
getsid - get session ID
SYNOPSIS
#include <unistd.h>
pid_t getsid(pid_t pid);
DESCRIPTION getsid(0) returns the session ID of the calling process. getsid(p) returns the session ID of the process with process ID p. (The session
ID of a process is the process group ID of the session leader.) On error, (pid_t) -1 will be returned, and errno is set appropriately.
ERRORS
EPERM A process with process ID p exists, but it is not in the same session as the current process, and the implementation considers this
an error.
ESRCH No process with process ID p was found.
CONFORMING TO
SVr4, POSIX 1003.1-2001.
NOTES
Linux does not return EPERM.
Linux has this system call since Linux 1.3.44. There is libc support since libc 5.2.19.
To get the prototype under glibc, define both _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED, or use "#define _XOPEN_SOURCE n" for some integer n
larger than or equal to 500.
SEE ALSO getpgid(2), setsid(2)Linux 2.5.0 2001-12-17 GETSID(2)
Check Out this Related Man Page
GETSID(2) Linux Programmer's Manual GETSID(2)NAME
getsid - get session ID
SYNOPSIS
#include <unistd.h>
pid_t getsid(pid_t pid);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
getsid():
_XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
|| /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
DESCRIPTION getsid(0) returns the session ID of the calling process. getsid(p) returns the session ID of the process with process ID p. (The session
ID of a process is the process group ID of the session leader.)
RETURN VALUE
On success, a session ID is returned. On error, (pid_t) -1 will be returned, and errno is set appropriately.
ERRORS
EPERM A process with process ID p exists, but it is not in the same session as the calling process, and the implementation considers this
an error.
ESRCH No process with process ID p was found.
VERSIONS
This system call is available on Linux since version 2.0.
CONFORMING TO
SVr4, POSIX.1-2001.
NOTES
Linux does not return EPERM.
SEE ALSO getpgid(2), setsid(2), credentials(7)COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2010-09-26 GETSID(2)
1 . Thanks you for reading the letter
2 . I have programe a X-application .Sometimes, I run it from terminal of CDE ,it "kill" the CDE and I meet the login dialog . I debug it . I find that the SIGHUP caused the X-app died .I do not run it from terminal of CDE ,I run it "click button" from panel ,... (3 Replies)
I have a scenario where I need to find if a process is a daemon process or not. This check needs to be done from within the process. I know there are no direct API's to do so. I have explored these options.
1. ctermid() - this can be unsuccessful as per the man pages
2. int devtty; if ((devtty... (7 Replies)
When I run a script with truss it is exiting with error.
Without truss the script runs fine!
How to understand it?
I have used the truss to resolve a 'magic' disappearing, but it brings own questions.
The main problem is in a backgroun script, which on one server just disapeares,... (5 Replies)
Hello all,
I have read just about every rpcbind not starting thread and article on the internet it seems, but I have not found a solution to my problem as of yet. I have a solaris 10 server that has been running with no problems for a while. The other day it crashed and would not boot to the gui... (2 Replies)
Hello,
I am trying to use mutt in order to send emails. I have installed mutt using yum and pasted some details about it later in the post.
When I try to run:
echo test | mutt -s "Test Email" user@id.com
It doesn't do anything. I dont receive any emails. I have the SMTP details for... (1 Reply)