Annotation of coherent/f/usr/include.78/sys/sem.h, revision 1.1.1.1

1.1       root        1: /* (-lgl
                      2:  *     COHERENT Version 4.0
                      3:  *     Copyright (c) 1982, 1993 by Mark Williams Company.
                      4:  *     All rights reserved. May not be copied without permission.
                      5:  -lgl) */
                      6: /*
                      7:  * /usr/include/sys/sem.h
                      8:  *
                      9:  * IPC Semaphore Facility
                     10:  *
                     11:  * Revised: Mon Apr 19 13:52:49 1993 CDT
                     12:  */
                     13: #ifndef __SYS_SEM_H__
                     14: #define __SYS_SEM_H__
                     15: 
                     16: #include <sys/ipc.h>
                     17: #include <sys/_time.h>
                     18: 
                     19: /*
                     20:  * Permission Definitions.
                     21:  */
                     22: #define        SEM_A   0200            /* alter permission */
                     23: #define        SEM_R   0400            /* read permission */
                     24: 
                     25: /*
                     26:  * Semaphore Operation Flags.
                     27:  */
                     28: #define SEM_UNDO 010000                /* set up adjust on exit entry */
                     29: 
                     30: /*
                     31:  * Semctl Command Definitions.
                     32:  */
                     33: #define        GETNCNT 3               /* get semncnt */
                     34: #define        GETPID  4               /* get sempid  */
                     35: #define        GETVAL  5               /* get semval  */
                     36: #define        GETALL  6               /* get all semval's */
                     37: #define        GETZCNT 7               /* get semzcnt */
                     38: #define        SETVAL  8               /* set semval  */
                     39: #define        SETALL  9               /* set all semval's */
                     40: 
                     41: /*
                     42:  * Structure Definitions.
                     43:  */
                     44: 
                     45: /*
                     46:  * There is one semaphore structure for each semaphore in the system.
                     47:  */
                     48: struct sem {
                     49:        unsigned short  semval;         /* semaphore value */
                     50:        short           sempid;         /* pid of last operation */
                     51:        unsigned short  semncnt;        /* # awaiting semval > cval */
                     52:        unsigned short  semzcnt;        /* # awaiting semval = 0 */
                     53: };
                     54: 
                     55: /*
                     56:  * There is one semaphore id data structure for each set of semaphores
                     57:  * in the system.
                     58:  */
                     59: struct semid_ds {
                     60:        struct ipc_perm sem_perm;       /* semaphore permission struct */
                     61:        struct sem      *sem_base;      /* pointer to first semaphore in set */
                     62:        unsigned short  sem_nsems;      /* # of semaphores in set */
                     63:        time_t          sem_otime;      /* last semop time */
                     64:        time_t          sem_ctime;      /* last change time */
                     65: };
                     66: 
                     67: /*
                     68:  * There is one link list of undo structures per process.
                     69:  */
                     70: struct sem_undo {
                     71:        struct sem_undo *un_np;         /* ptr to next active undo structure */
                     72:        short           un_aoe;         /* adjust on exit values */
                     73:        short           un_num;         /* semaphore # */
                     74:        int             un_id;          /* semid */
                     75: };
                     76: 
                     77: /*
                     78:  * User semaphore template for semop system calls.
                     79:  */
                     80: struct sembuf {
                     81:        unsigned short  sem_num;        /* semaphore # */
                     82:        short           sem_op;         /* semaphore operation */
                     83:        short           sem_flg;        /* operation flags */
                     84: };
                     85: 
                     86: /*
                     87:  * Ioctl commands issued to Semaphore device driver (Coherent 286 specific).
                     88:  */
                     89: #define        SEMIOC  ('S'<<8)
                     90: #define        SEMCTL  (SEMIOC|0)
                     91: #define        SEMGET  (SEMIOC|1)
                     92: #define        SEMOP   (SEMIOC|2)
                     93: 
                     94: #endif /* __SYS_SEM_H__ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.