.\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it)
.\" and Copyright 2004, 2005 Michael Kerrisk <mtk.manpages@gmail.com>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" Modified Tue Oct 22 17:53:56 1996 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified Fri Jun 19 10:59:15 1998 by Andries Brouwer <aeb@cwi.nl>
.\" Added semid_ds and ipc_perm structure definitions
.\" 2005-08-02, mtk: Added IPC_INFO, SEM_INFO, SEM_STAT descriptions.
.\"
-.TH SEMCTL 2 2009-09-27 "Linux" "Linux Programmer's Manual"
+.TH SEMCTL 2 2012-05-31 "Linux" "Linux Programmer's Manual"
.SH NAME
semctl \- semaphore control operations
.SH SYNOPSIS
.PP
The
.I ipc_perm
-structure is defined in \fI<sys/ipc.h>\fP as follows
+structure is defined as follows
(the highlighted fields are settable using
.BR IPC_SET ):
.PP
.BR semop (2)
calls in other processes to proceed, then those processes are woken up.
The calling process must have alter permission on the semaphore set.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
On failure
.BR semctl ()
returns \-1
is to be set (for some semaphore of the set) is less than 0
or greater than the implementation limit
.BR SEMVMX .
-.SH "CONFORMING TO"
+.SH CONFORMING TO
SVr4, POSIX.1-2001.
.\" SVr4 documents more error conditions EINVAL and EOVERFLOW.
.SH NOTES
+The inclusion of
+.I <sys/types.h>
+and
+.I <sys/ipc.h>
+isn't required on Linux or by any version of POSIX.
+However,
+some old implementations required the inclusion of these header files,
+and the SVID also documented their inclusion.
+Applications intended to be portable to such old systems may need
+to include these header files.
+.\" Like Linux, the FreeBSD man pages still document
+.\" the inclusion of these header files.
+
The
.BR IPC_INFO ,
.B SEM_STAT
For greater portability it is best to always call
.BR semctl ()
with four arguments.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR ipc (2),
.BR semget (2),
.BR semop (2),