8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libbc / inc / include / sys / sem.h
blobbe304cc72439a37293ae37b8bc8cb9b88945f4f3
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 1986 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984 AT&T */
28 /* All Rights Reserved */
30 #ifndef _sys_sem_h
31 #define _sys_sem_h
33 #pragma ident "%Z%%M% %I% %E% SMI"
36 * IPC Semaphore Facility.
40 * Semaphore Operation Flags.
42 #define SEM_UNDO 010000 /* set up adjust on exit entry */
45 * Semctl Command Definitions.
48 #define GETNCNT 3 /* get semncnt */
49 #define GETPID 4 /* get sempid */
50 #define GETVAL 5 /* get semval */
51 #define GETALL 6 /* get all semval's */
52 #define GETZCNT 7 /* get semzcnt */
53 #define SETVAL 8 /* set semval */
54 #define SETALL 9 /* set all semval's */
57 * Structure Definitions.
61 * There is one semaphore id data structure for each set of semaphores
62 * in the system.
65 struct semid_ds {
66 struct ipc_perm sem_perm; /* operation permission struct */
67 struct sem *sem_base; /* ptr to first semaphore in set */
68 ushort sem_nsems; /* # of semaphores in set */
69 time_t sem_otime; /* last semop time */
70 time_t sem_ctime; /* last change time */
74 * There is one semaphore structure for each semaphore in the system.
77 struct sem {
78 ushort semval; /* semaphore text map address */
79 short sempid; /* pid of last operation */
80 ushort semncnt; /* # awaiting semval > cval */
81 ushort semzcnt; /* # awaiting semval = 0 */
85 * User semaphore template for semop system calls.
88 struct sembuf {
89 short sem_num; /* semaphore # */
90 short sem_op; /* semaphore operation */
91 short sem_flg; /* operation flags */
95 * 'arg' argument template for semctl system calls.
97 union semun {
98 int val; /* value for SETVAL */
99 struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
100 ushort *array; /* array for GETALL & SETALL */
103 #endif /* !_sys_sem_h */