1sem.h(3HEAD)                        Headers                       sem.h(3HEAD)
2
3
4

NAME

6       sem.h, sem -  semaphore facility
7

SYNOPSIS

9       #include <sys/sem.h>
10
11

DESCRIPTION

13       The <sys/sem.h> header defines the following constants and structures.
14
15
16       Semaphore operation flags:
17
18       SEM_UNDO    Set up adjust on exit entry.
19
20
21
22       Command  definitions  for  the semctl() function are provided as listed
23       below. See semctl(2).
24
25       GETNCNT    Get semncnt.
26
27
28       GETPID     Get sempid.
29
30
31       GETVAL     Get semval.
32
33
34       GETALL     Get all cases of semval.
35
36
37       GETZCNT    Get semzcnt.
38
39
40       SETVAL     Set semval.
41
42
43       SETALL     Set all cases of semval.
44
45
46
47       The semid_ds structure contains the following members:
48
49         struct ipc_perm sem_perm     /* operation permission structure */
50         unsigned short  sem_nsems    /* number of semaphores in set */
51         time_t          sem_otime    /* last semop() time */
52         time_t          sem_ctime    /* last time changed by semctl() */
53
54
55
56       The pid_t, time_t, key_t, and size_t types are defined as described  in
57       <sys/types.h>. See types.h(3HEAD).
58
59
60       A  semaphore  is  represented  by an anonymous structure containing the
61       following members:
62
63         unsigned short semval     /* semaphore value */
64         pid_t          sempid     /* process ID of last operation */
65         unsigned short semncnt    /* number of processes waiting for semval
66                                      to become greater than current value */
67         unsigned short semzcnt    /* number of processes waiting for semval
68                                      to become 0 */
69
70
71
72       The sembuf structure contains the following members:
73
74         unsigned short sem_num     /* semaphore number */
75         short          sem_op      /* semaphore operation */
76         short          sem_flg     /* operation flags */
77
78
79
80       All of the symbols from <sys/ipc.h> are defined  when  this  header  is
81       included. See ipc.h(3HEAD).
82

ATTRIBUTES

84       See attributes(5) for descriptions of the following attributes:
85
86
87
88
89       ┌─────────────────────────────┬─────────────────────────────┐
90       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
91       ├─────────────────────────────┼─────────────────────────────┤
92       │Interface Stability          │Standard                     │
93       └─────────────────────────────┴─────────────────────────────┘
94

SEE ALSO

96       semctl(2),    semget(2),    semop(2),   ipc.h(3HEAD),   types.h(3HEAD),
97       attributes(5), standards(5)
98
99
100
101SunOS 5.11                        10 Sep 2004                     sem.h(3HEAD)
Impressum