Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Feb 2005 14:04:47 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/78021: sem_open(3) doesn't mention fnctl.h include requirement
Message-ID:  <200502241404.j1OE4l3j016916@fledge.watson.org>
Resent-Message-ID: <200502241410.j1OEARTM056826@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         78021
>Category:       bin
>Synopsis:       sem_open(3) doesn't mention fnctl.h include requirement
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 24 14:10:27 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Robert Watson
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
>Environment:

FreeBSD 5.x and FreeBSD 6.x

>Description:

sem_open(3) identifies semaphore.h as an include requirement for sem_open();
however, sem_open()'s oflag argument can take on values of O_CREAT or O_EXCL,
which are defined in fcntl.h.

>How-To-Repeat:

#include <err.h>
#include <semaphore.h>

...
	if (sem_open(name, O_CREAT, 0) < 0)
		err(-1, "sem_open: %s", name);
...

>Fix:

The fix is either to document the include dependency, or remove it, perhaps
via a nested include.  I don't know which is the right one from a standards
perspective.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502241404.j1OE4l3j016916>