Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ semsys(2) — DG/UX 4.30

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

semget(2)

semctl(2)

semop(2)

intro(2)



     semsys(2)                  DG/UX 4.30                   semsys(2)



     NAME
          semsys - Perform a semaphore operation.

     SYNOPSIS
          #include <sys/types.h>
          #include <sys/ipc.h>
          #include <sys/sem.h>

          int   semsys  (P1, P2, P3, P4, P5)
             int         P1;
             int         P2;
             int         P3;
             int         P4;
             int         P5;

     PARAMETERS
          P1             An argument which indicates the type of
                         operation to be performed with a semaphore.
                         (0 - SEMCTL, 1 - SEMGET, 2 - SEMOP)

          P2             If the operation is SEMGET, P2 is equal to
                         the semaphore set key. Otherwise, P2 is equal
                         to the semaphore set id.

          P3             If the operation is SEMGET, P3 equals to the
                         number of semaphores in the set. In case of
                         SEMCTL, P3 equals to the number of some
                         semaphore in the set. In case of SEMOP , P3
                         equals a pointer to the semaphore operation
                         structures (sembuf).

          P4             If the operation is SEMGET, P4 equals to the
                         flag regulating the type of SEMGET operation
                         and the access to the semaphore set. SEMCTL -
                         P4 equals to the control command number.
                         SEMOP - P4 equals to the number of semaphore
                         operations to perform.

          P5             If the operation is SEMGET or SEMOP, P5 is
                         invalid.  In case of SEMCTL, P5 is a union of
                         semun type.

     DESCRIPTION
          The semsys system call performs a semaphore operation
          (SEMGET, SEMCTL, SEMOP) indicated by the value of P1.

     ACCESS CONTROL
          See the description of the exception condition EACCES in
          semget, semop, semctl.

     RETURN VALUE
          semid          A non-negative integer that identifies the



     Licensed material--property of copyright holder(s)         Page 1





     semsys(2)                  DG/UX 4.30                   semsys(2)



                         semaphore set identifies the semaphore set
                         associated with key.

          0              semctl or semop were successful.

          -1             An error occurred.  Errno is set to indicate
                         the error.

     EXCEPTIONS
          The error codes returned depend on the type of semaphore
          operations performed and are described in semget, semctl,
          semop.

          EINVAL         P1 argument is not in the range of 0 through
                         3.

     SEE ALSO
          semget(2), semctl(2), semop(2).
          intro(2).




































     Licensed material--property of copyright holder(s)         Page 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026