bin/78021: sem_open(3) doesn't mention fnctl.h include requirement
Robert Watson
rwatson at FreeBSD.org
Thu Feb 24 14:10:28 GMT 2005
>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:
More information about the freebsd-bugs
mailing list