⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syscalls_62.html

📁 Linux系统调用
💻 HTML
字号:
<!-- This HTML file has been created by texi2html 1.29
     from syscalls.texi on 4 June 1994 -->

<TITLE>Syscall specifications of Linux - getpgrp</TITLE>
<P>Go to the <A HREF="syscalls_61.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_61.html">previous</A>, <A HREF="syscalls_63.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_63.html">next</A> section.<P>
<H2><A NAME="SEC62" HREF="syscalls_toc.html#SEC62" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_toc.html#SEC62">getpgrp, setpgid and setpgrp</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>pid_t getpgrp(void);</CODE>
<P>
<CODE>int setpgid(pid_t <VAR>pid</VAR>, pid_t <VAR>pgid</VAR>);</CODE>
<P>
<CODE>int setpgrp(void);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>pid</VAR>: [in] the task to modify (0 for the current task).
<P>
<VAR>pgid</VAR>: [in] the new process group id. If zero is specified, the
value of <VAR>pid</VAR> is taken.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>getpgrp</CODE> returns the current process group. <CODE>setpgid</CODE> sets
the process group id of the task specified by <VAR>pid</VAR> to <VAR>pgid</VAR>.
<CODE>setpgrp</CODE> sets the group id of the current task to its process id.
<P>
Note: <CODE>setpgrp</CODE> is implemented as <CODE>setpgid(0,0)</CODE>.
<P>
<H3>RETURN VALUE</H3>
<P>
<VAR>getpgrp</VAR> allways succeed and returns the current process group id.
<P>
On success, <CODE>setpgrp</CODE> and <CODE>setgpid</CODE> return zero. On error,
they return -1 and <CODE>errno</CODE> is set to one of the following values:
<P>
For <VAR>setpgid</VAR>:
<P>
<UL>
<LI><CODE>EINVAL</CODE>: pgid is less than 0.
<LI><CODE>ESRCH</CODE>.
</UL>
<P>
For both calls: <CODE>EPERM</CODE>.
<P>
<P>Go to the <A HREF="syscalls_61.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_61.html">previous</A>, <A HREF="syscalls_63.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_63.html">next</A> section.<P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -