From owner-man-jp-reviewer@jp.freebsd.org  Tue May 23 21:54:08 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id VAA67265;
	Tue, 23 May 2000 21:54:08 +0900 (JST)
	(envelope-from owner-man-jp-reviewer@jp.FreeBSD.org)
Received: from basil.veltec.co.jp (camomile.veltec.co.jp [211.2.223.5])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id VAA67260
	for <man-jp-reviewer@jp.freebsd.org>; Tue, 23 May 2000 21:54:07 +0900 (JST)
	(envelope-from yuko@veltec.co.jp)
Received: from jade ([192.168.0.66])
	by basil.veltec.co.jp (8.10.0.Beta6/3.7W03/20/00) with ESMTP
	id e4NCxWt22515
	for <man-jp-reviewer@jp.freebsd.org>; Tue, 23 May 2000 21:59:33 +0900 (JST)
To: man-jp-reviewer@jp.freebsd.org
X-SMIME-fingerprint: A7:AE:D4:83:9D:5B:A5:F2:24:8F:F4:DC:87:3C:72:89
From: Yuko Sasaki <yuko@veltec.co.jp>
Message-Id: <200005232155.FIF81959.PLZV@veltec.co.jp>
X-Mailer: Winbiff [Version 2.31 beta1]
Date: Tue, 23 May 2000 21:55:14 +0900
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-2022-jp
Reply-To: man-jp-reviewer@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: man-jp-reviewer 2551
Subject: [man-jp-reviewer 2551] (man2) setpgid.2
Errors-To: owner-man-jp-reviewer@jp.freebsd.org
Sender: owner-man-jp-reviewer@jp.freebsd.org
X-Originator: yuko@veltec.co.jp

$BK\F|$O!"(B4$B%U%!%$%k$G$9!#(B
------- $B$3$3$+$i(B --------------------------------------------------
.\" Copyright (c) 1980, 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)setpgid.2	8.1 (Berkeley) 6/4/93
.\"
.Dd June 4, 1993
.Dt SETPGID 2
.Os BSD 4
.Sh $BL>>N(B
.Nm setpgid ,
.Nm setpgrp
.Nd $B%W%m%;%9(B $B%0%k!<%W$r@_Dj$9$k(B
.Sh $B=q<0(B
.Fd #include <unistd.h>
.Ft int
.Fn setpgid "pid_t pid" "pid_t pgrp"
.Ft int
.Fn setpgrp "pid_t pid" "pid_t pgrp"
.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F$S=P$75,Ls8_49@-$N$?$a$KJ];}$5$l$F$$$^$9!#(B
------- $B$3$3$^$G(B --------------------------------------------------

------- $B86J8!&$3$3$+$i(B --------------------------------------------------
.\" Copyright (c) 1980, 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)setpgid.2	8.1 (Berkeley) 6/4/93
.\"
.Dd June 4, 1993
.Dt SETPGID 2
.Os BSD 4
.Sh NAME
.Nm setpgid ,
.Nm setpgrp
.Nd set process group
.Sh SYNOPSIS
.Fd #include <unistd.h>
.Ft int
.Fn setpgid "pid_t pid" "pid_t pgrp"
.Ft int
.Fn setpgrp "pid_t pid" "pid_t pgrp"
.Sh DESCRIPTION
.Fn Setpgid
sets the process group of the specified process
.Ar pid
to the specified
.Ar pgrp .
If
.Ar pid
is zero, then the call applies to the current process.
.Pp
If the invoker is not the super-user, then the affected process
must have the same effective user-id as the invoker or be a descendant
of the invoking process.
.Sh RETURN VALUES
.Fn Setpgid
returns 0 when the operation was successful.
If the request failed, -1 is returned and the global variable
.Va errno
indicates the reason.
.Sh ERRORS
.Fn Setpgid
will fail and the process group will not be altered if:
.Bl -tag -width indent
.It Bq Er ESRCH
The requested process does not exist.
.It Bq Er EPERM
The effective user ID of the requested process is different
>from that of the caller and the process is not a descendent
of the calling process.
.El
.Sh SEE ALSO
.Xr getpgrp 2
.Sh STANDARDS
The
.Fn setpgid
function call is expected to conform to 
.St -p1003.1-90 .
.Sh COMPATIBILITY
.Fn Setpgrp
is identical to
.Fn setpgid ,
and is retained for calling convention compatibility with historical
versions of
.Bx .
------- $B86J8!&$3$3$^$G(B --------------------------------------------------
