sem.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1986 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* IPC Semaphore Facility.
*/
#ifndef _sys_sem_h
#define _sys_sem_h
/*
* Semaphore Operation Flags.
*/
/*
* Semctl Command Definitions.
*/
/*
* Structure Definitions.
*/
/*
* There is one semaphore id data structure for each set of semaphores
* in the system.
*/
struct semid_ds {
};
/*
* There is one semaphore structure for each semaphore in the system.
*/
struct sem {
short sempid; /* pid of last operation */
};
/*
* User semaphore template for semop system calls.
*/
struct sembuf {
short sem_num; /* semaphore # */
short sem_op; /* semaphore operation */
short sem_flg; /* operation flags */
};
/*
* 'arg' argument template for semctl system calls.
*/
union semun {
int val; /* value for SETVAL */
};
#ifdef KERNEL
/*
* Implementation Constants.
*/
/*
* Permission Definitions.
*/
/*
* There is one undo structure per process in the system.
*/
struct sem_undo {
short un_cnt; /* # of active entries */
struct undo {
short un_aoe; /* adjust on exit values */
short un_num; /* semaphore # */
int un_id; /* semid */
};
/*
* semaphore information structure
*/
struct seminfo {
int semmap, /* # of entries in semaphore map */
semmni, /* # of semaphore identifiers */
semmns, /* # of semaphores in system */
semmnu, /* # of undo structures in system */
semmsl, /* max # of semaphores per id */
semopm, /* max # of operations per semop call */
semume, /* max # of undo entries per process */
semusz, /* size in bytes of undo structure */
semvmx, /* semaphore maximum value */
semaem; /* adjust on exit max value */
};
/*
* Configuration Parameters
* These parameters are tuned by editing the system configuration file.
* The following lines establish the default values.
*/
#ifndef SEMMNI
#endif
#ifndef SEMMNS
#endif
#ifndef SEMUME
#endif
#ifndef SEMMNU
#endif
/* The following parameters are assumed not to require tuning */
#ifndef SEMMAP
#endif
#ifndef SEMMSL
#endif
#ifndef SEMOPM
#endif
/* size in bytes of undo structure */
/*
* Structures allocated in machdep.c
*/
int *semu; /* undo structure pool */
#endif KERNEL
#endif /*!_sys_sem_h*/