Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

getsid(2) [netbsd man page]

GETSID(2)						      BSD System Calls Manual							 GETSID(2)

NAME
getsid -- get session ID LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> pid_t getsid(pid_t pid); DESCRIPTION
The getsid() function returns the session ID of the process specified by pid. If pid is 0, the session ID of the calling process is returned. The session ID is defined as the process group ID of the process that is the session leader. ERRORS
If an error occurs, getsid() returns -1 and the global variable errno is set to indicate the error, as follows: [ESRCH] No process can be found corresponding to that specified by pid. SEE ALSO
getpgid(2), setsid(2), termios(4) STANDARDS
The getsid() function conforms to X/Open Portability Guide Issue 4, Version 2 (``XPG4.2''). BSD
April 4, 2011 BSD

Check Out this Related Man Page

GETSID(2)						      BSD System Calls Manual							 GETSID(2)

NAME
getsid -- get process session LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> pid_t getsid(pid_t pid); DESCRIPTION
The session ID of the process identified by pid is returned by getsid(). If pid is zero, getsid() returns the session ID of the current process. RETURN VALUES
Upon successful completion, the function getsid() returns the session ID of the specified process; otherwise, it returns a value of -1 and sets errno to indicate an error. ERRORS
getsid() will succeed unless: [ESRCH] if there is no process with a process ID equal to pid. Note that an implementation may restrict this function call to processes within the same session ID as the calling process. SEE ALSO
getpgid(2), getpgrp(2), setpgid(2), setsid(2), termios(4) HISTORY
The getsid() function call appeared in FreeBSD 3.0. The getsid() function call is derived from its usage in AT&T System V UNIX. BSD
August 19, 1997 BSD
Man Page

6 More Discussions You Might Find Interesting

1. Programming

do you believe X-application will "kill" the CDE and come back to login dialog

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)
Discussion started by: chenhao_no1
3 Replies

2. Programming

How to find if a process a daemon ?

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)
Discussion started by: vino
7 Replies

3. UNIX for Advanced & Expert Users

truss: script runs without, but 'sysntax err' with it ?!

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)
Discussion started by: alex_5161
5 Replies

4. Solaris

Rpcbind service not starting

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)
Discussion started by: Madrox72
2 Replies

5. Shell Programming and Scripting

How to configure mutt to send emails on Linux.?

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)
Discussion started by: vaibhavraj
1 Replies

6. UNIX for Advanced & Expert Users

Login and logout time of a session

Hi, How can I find out the login and logout time of the old UNIX session/user?. (2 Replies)
Discussion started by: sharif
2 Replies