~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/sem.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2 #ifndef _UAPI_LINUX_SEM_H
  3 #define _UAPI_LINUX_SEM_H
  4 
  5 #include <linux/ipc.h>
  6 
  7 /* semop flags */
  8 #define SEM_UNDO        0x1000  /* undo the operation on exit */
  9 
 10 /* semctl Command Definitions. */
 11 #define GETPID  11       /* get sempid */
 12 #define GETVAL  12       /* get semval */
 13 #define GETALL  13       /* get all semval's */
 14 #define GETNCNT 14       /* get semncnt */
 15 #define GETZCNT 15       /* get semzcnt */
 16 #define SETVAL  16       /* set semval */
 17 #define SETALL  17       /* set all semval's */
 18 
 19 /* ipcs ctl cmds */
 20 #define SEM_STAT 18
 21 #define SEM_INFO 19
 22 #define SEM_STAT_ANY 20
 23 
 24 /* Obsolete, used only for backwards compatibility and libc5 compiles */
 25 struct semid_ds {
 26         struct ipc_perm sem_perm;               /* permissions .. see ipc.h */
 27         __kernel_old_time_t sem_otime;          /* last semop time */
 28         __kernel_old_time_t sem_ctime;          /* create/last semctl() time */
 29         struct sem      *sem_base;              /* ptr to first semaphore in array */
 30         struct sem_queue *sem_pending;          /* pending operations to be processed */
 31         struct sem_queue **sem_pending_last;    /* last pending operation */
 32         struct sem_undo *undo;                  /* undo requests on this array */
 33         unsigned short  sem_nsems;              /* no. of semaphores in array */
 34 };
 35 
 36 /* Include the definition of semid64_ds */
 37 #include <asm/sembuf.h>
 38 
 39 /* semop system calls takes an array of these. */
 40 struct sembuf {
 41         unsigned short  sem_num;        /* semaphore index in array */
 42         short           sem_op;         /* semaphore operation */
 43         short           sem_flg;        /* operation flags */
 44 };
 45 
 46 /* arg for semctl system calls. */
 47 union semun {
 48         int val;                        /* value for SETVAL */
 49         struct semid_ds __user *buf;    /* buffer for IPC_STAT & IPC_SET */
 50         unsigned short __user *array;   /* array for GETALL & SETALL */
 51         struct seminfo __user *__buf;   /* buffer for IPC_INFO */
 52         void __user *__pad;
 53 };
 54 
 55 struct  seminfo {
 56         int semmap;
 57         int semmni;
 58         int semmns;
 59         int semmnu;
 60         int semmsl;
 61         int semopm;
 62         int semume;
 63         int semusz;
 64         int semvmx;
 65         int semaem;
 66 };
 67 
 68 /*
 69  * SEMMNI, SEMMSL and SEMMNS are default values which can be
 70  * modified by sysctl.
 71  * The values has been chosen to be larger than necessary for any
 72  * known configuration.
 73  *
 74  * SEMOPM should not be increased beyond 1000, otherwise there is the
 75  * risk that semop()/semtimedop() fails due to kernel memory fragmentation when
 76  * allocating the sop array.
 77  */
 78 
 79 
 80 #define SEMMNI  32000           /* <= IPCMNI  max # of semaphore identifiers */
 81 #define SEMMSL  32000           /* <= INT_MAX max num of semaphores per id */
 82 #define SEMMNS  (SEMMNI*SEMMSL) /* <= INT_MAX max # of semaphores in system */
 83 #define SEMOPM  500             /* <= 1 000 max num of ops per semop call */
 84 #define SEMVMX  32767           /* <= 32767 semaphore maximum value */
 85 #define SEMAEM  SEMVMX          /* adjust on exit max value */
 86 
 87 /* unused */
 88 #define SEMUME  SEMOPM          /* max num of undo entries per process */
 89 #define SEMMNU  SEMMNS          /* num of undo structures system wide */
 90 #define SEMMAP  SEMMNS          /* # of entries in semaphore map */
 91 #define SEMUSZ  20              /* sizeof struct sem_undo */
 92 
 93 
 94 #endif /* _UAPI_LINUX_SEM_H */
 95 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php