Blame bits/sem.h

Packit 6c4009
/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _SYS_SEM_H
Packit 6c4009
# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
Packit 6c4009
/* Flags for `semop'.  */
Packit 6c4009
#define SEM_UNDO	0x1000		/* undo the operation on exit */
Packit 6c4009
Packit 6c4009
/* Commands for `semctl'.  */
Packit 6c4009
#define GETPID		11		/* get sempid */
Packit 6c4009
#define GETVAL		12		/* get semval */
Packit 6c4009
#define GETALL		13		/* get all semval's */
Packit 6c4009
#define GETNCNT		14		/* get semncnt */
Packit 6c4009
#define GETZCNT		15		/* get semzcnt */
Packit 6c4009
#define SETVAL		16		/* set semval */
Packit 6c4009
#define SETALL		17		/* set all semval's */
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Data structure describing a set of semaphores.  */
Packit 6c4009
struct semid_ds
Packit 6c4009
{
Packit 6c4009
  struct ipc_perm sem_perm;		/* operation permission struct */
Packit 6c4009
  __time_t sem_otime;			/* last semop() time */
Packit 6c4009
  __time_t sem_ctime;			/* last time changed by semctl() */
Packit 6c4009
  unsigned short int sem_nsems;		/* number of semaphores in set */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
/* The user should define a union like the following to use it for arguments
Packit 6c4009
   for `semctl'.
Packit 6c4009
Packit 6c4009
   union semun
Packit 6c4009
   {
Packit 6c4009
     int val;				<= value for SETVAL
Packit 6c4009
     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
Packit 6c4009
     unsigned short int *array;		<= array for GETALL & SETALL
Packit 6c4009
     struct seminfo *__buf;		<= buffer for IPC_INFO
Packit 6c4009
   };
Packit 6c4009
Packit 6c4009
   Previous versions of this file used to define this union but this is
Packit 6c4009
   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
Packit 6c4009
   one must define the union or not.  */
Packit 6c4009
#define _SEM_SEMUN_UNDEFINED	1