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

📄 setpgid.3

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 3
字号:
.\" SCCSID: @(#)setpgid.3	2.3	9/9/88.TH setpgid 3.SH Namesetpgid \- set process group (POSIX).SH Syntax.ft B.nf#include <sys/types.h>intsetpgid(pid, pgrp).brpid_t pid, pgrp;.fi.ft R.SH Description.NXR "setpgid function".NXR "process group" "setting"The.PN setpgidfunctionis used to either join an existing process group or create a newprocess group within the session of the calling process (see .MS setsid 2 ). Upon successful completion, the process group ID of the process thathas a process ID which matches.I pidis set to.IR pgrp .If.I pidis zero, then the call applies to the current process. In addition, if.I pgrpis zero, the process ID of the indicated process is used..PPThis function is available only in the POSIX environment..SH Return ValuesThe .PN setpgidfunctionreturns 0 when the operation is successful.  If the request fails, \-1 is returned and the global variable.PN errnoindicates the reason..SH DiagnosticsThe.PN setpgidfunctionfails and the process group is not altered ifone of the following occurs:.TP 15[EACCES]The value of the .I pidargument matches the process ID of a child process of the calling process and the child process has successfully executed an.PN execfunction..TP 15[EINVAL]The value of the .I pgrpargument is less than zero or is not a supported value..TP 15[EPERM]The process indicated by the.I pidargument is a session leader..spThe value of the.I pidargument matches the process ID of a child process of the calling process and the child process is not in the same session as the calling process..spThe value of the.I pgrpargument does not match the process ID of the process indicated by the.I pidargument and there is no process with a process group ID that matches the value of the.I pgrpargument in the same session as the calling process..TP 15[ESRCH]The value of the.I pidargument does not match the process ID of the calling process of a child process of the calling process..SH See Alsogetpgrp(2), setsid(2)

⌨️ 快捷键说明

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