Files
oldlinux-files/Minix/2.0.0/wwwman/man2/setsid.2.html
2024-02-19 00:21:39 -05:00

74 lines
1.5 KiB
HTML

<HTML>
<HEAD>
<TITLE>setsid(2)</TITLE>
</HEAD>
<BODY>
<H1>setsid(2)</H1>
<HR>
<PRE>
</PRE>
<H2>NAME</H2><PRE>
setsid, getpgrp - create process group, get process group id
</PRE>
<H2>SYNOPSIS</H2><PRE>
<STRONG>#include</STRONG> <STRONG>&lt;sys/types.h&gt;</STRONG>
<STRONG>#include</STRONG> <STRONG>&lt;unistd.h&gt;</STRONG>
<STRONG>pid_t</STRONG> <STRONG>setsid(void)</STRONG>
<STRONG>pid_t</STRONG> <STRONG>getpgrp(void)</STRONG>
</PRE>
<H2>DESCRIPTION</H2><PRE>
<STRONG>Setsid()</STRONG> creates a new session if the calling process is not already a
session leader. The calling process becomes the session leader of a new
process group and the process group ID of this new process group will be
equal to the process ID of the new session leader. The process group ID
is inherited on a <STRONG>fork()</STRONG>.
<STRONG>Getpgrp()</STRONG> returns the process group ID of the calling process.
</PRE>
<H2>SEE ALSO</H2><PRE>
<STRONG><A HREF="../man2/kill.2.html">kill(2)</A></STRONG>, <STRONG><A HREF="../man3/termios.3.html">termios(3)</A></STRONG>, <STRONG><A HREF="../man4/tty.4.html">tty(4)</A></STRONG>.
</PRE>
<H2>DIAGNOSTICS</H2><PRE>
<STRONG>Setsid()</STRONG> returns the new process group ID on success, or -1 with <STRONG>errno</STRONG>
set to <STRONG>EPERM</STRONG> if the process is already a session leader.
</PRE>
<H2>AUTHOR</H2><PRE>
Kees J. Bot (kjb@cs.vu.nl)
</PRE>
</BODY>
</HTML>