Bug 26520

Summary: getpgid(2) doesn't describe error conditions for getpgid()
Product: Documentation Reporter: Robert Watson <rwatson>
Component: Books & ArticlesAssignee: dd <dd>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Robert Watson freebsd_committer freebsd_triage 2001-04-12 20:50:01 UTC
Most system call man pages make an effort to describe potential error
return conditions for the call.  getpgid(2), however, neglects to note that
the returned pid can be (-1), indicating that errno should be inspected,
in the style of getsid(2).

Fix: 

Probably need to copy the relevant part of getsid(2) into getpgid(2).
However, this probably involves first consulting relevant specs defining
getpgid(2) to determine if our implementation complies or not.
How-To-Repeat: 
man 2 getpgid
Comment 1 dima 2001-04-13 08:22:32 UTC
[ cc'd to bde since he has (some copy of) the POSIX spec ]

rwatson@freebsd.org writes:
> Most system call man pages make an effort to describe potential error
> return conditions for the call.  getpgid(2), however, neglects to note that
> the returned pid can be (-1), indicating that errno should be inspected,
> in the style of getsid(2).
> 
> >Fix:
> 
> Probably need to copy the relevant part of getsid(2) into getpgid(2).
> However, this probably involves first consulting relevant specs defining
> getpgid(2) to determine if our implementation complies or not.

Bruce, can you check if this is true?  If that's the case, I'll fix
the man page.

Thanks,

					Dima Dorfman
					dima@unixfreak.org
Comment 2 Bruce Evans 2001-04-13 12:08:47 UTC
On Fri, 13 Apr 2001, Dima Dorfman wrote:

> [ cc'd to bde since he has (some copy of) the POSIX spec ]
> 
> rwatson@freebsd.org writes:
> > Most system call man pages make an effort to describe potential error
> > return conditions for the call.  getpgid(2), however, neglects to note that
> > the returned pid can be (-1), indicating that errno should be inspected,
> > in the style of getsid(2).
> > 
> > >Fix:
> > 
> > Probably need to copy the relevant part of getsid(2) into getpgid(2).
> > However, this probably involves first consulting relevant specs defining
> > getpgid(2) to determine if our implementation complies or not.
> 
> Bruce, can you check if this is true?  If that's the case, I'll fix
> the man page.

SUSv2 says that getpgid() returns (pid_t)-1 and sets errno on error.

(The cast is not really necessary in this case, unlike for ((time_t)-1),
since -1 is small and pid_t is signed.)

Bruce
Comment 3 dd freebsd_committer freebsd_triage 2001-04-14 03:35:34 UTC
State Changed
From-To: open->analyzed

Fixed in -current, thanks!  I'll MFC this after the code freeze. 


Comment 4 dd freebsd_committer freebsd_triage 2001-04-14 03:35:34 UTC
Responsible Changed
From-To: freebsd-doc->dd

I'll MFC it.
Comment 5 dd freebsd_committer freebsd_triage 2001-04-26 03:04:33 UTC
State Changed
From-To: analyzed->closed

MFC'd.