]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - bits/sem.h
Make endian-conversion macros always return correct types (bug 16458).
[thirdparty/glibc.git] / bits / sem.h
index 8b9f97c62a3eb78b56a8af5f5d9de608c0d4100c..b7f1a35ddd88c18bbd518e0fe1d3c27f60b5ae36 100644 (file)
@@ -1,20 +1,19 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #ifndef _SYS_SEM_H
 # error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
@@ -44,11 +43,18 @@ struct semid_ds
   unsigned short int sem_nsems;                /* number of semaphores in set */
 };
 
-/* Union used for argument for `semctl'.  */
-union semun
-{
-  int val;                             /* value for SETVAL */
-  struct semid_ds *buf;                        /* buffer for IPC_STAT & IPC_SET */
-  unsigned short int *array;           /* array for GETALL & SETALL */
-  struct seminfo *__buf;               /* buffer for IPC_INFO */
- };
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;                          <= value for SETVAL
+     struct semid_ds *buf;             <= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;                <= array for GETALL & SETALL
+     struct seminfo *__buf;            <= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED   1