📄 getsid.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>getsid</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_005_740"> </a>NAME</h4><blockquote>getsid - get the process group ID of session leader</blockquote><h4><a name = "tag_000_005_741"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="unistd.h.html">unistd.h</a>>pid_t getsid(pid_t <i>pid</i>);</code></pre></blockquote><h4><a name = "tag_000_005_742"> </a>DESCRIPTION</h4><blockquote>The<i>getsid()</i>function obtains the process group ID of the process that is the sessionleader of the process specified by <i>pid</i>. If <i>pid</i> is(<b>pid_t</b>)0,it specifies the calling process.</blockquote><h4><a name = "tag_000_005_743"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>getsid()</i>returns the process group ID of the session leader of the specified process.Otherwise, it returns (<b>pid_t</b>)-1 and sets <i>errno</i> toindicate the error.</blockquote><h4><a name = "tag_000_005_744"> </a>ERRORS</h4><blockquote>The<i>getsid()</i>function will fail if:<dl compact><dt>[EPERM]<dd>The process specified by <i>pid</i> is not in the same session as the callingprocess, and the implementation does not allow access to the process group IDof the session leader of that process from the calling process.<dt>[ESRCH]<dd>There is no process with a process ID equal to <i>pid</i>.</dl></blockquote><h4><a name = "tag_000_005_745"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_746"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_747"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_748"> </a>SEE ALSO</h4><blockquote><i><a href="exec.html">exec</a></i>,<i><a href="fork.html">fork()</a></i>,<i><a href="getpid.html">getpid()</a></i>,<i><a href="getpgid.html">getpgid()</a></i>,<i><a href="setpgid.html">setpgid()</a></i>,<i><a href="setsid.html">setsid()</a></i>,<i><a href="unistd.h.html"><unistd.h></a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -