Contained WithinFind More DocumentationFeatured Support Resources | PDF로 이 문서 다운로드 (1785 KB)
semctl(2)Name | Synopsis | Description | Return Values | Errors | Attributes | See Also Name
Synopsis#include <sys/types.h> #include <sys/ipc.h> #include <sys/sem.h> int semctl(int semid, int semnum, int cmd...); DescriptionThe semctl() function provides a variety of semaphore control operations as specified by cmd. The fourth argument is optional, depending upon the operation requested. If required, it is of type union semun, which must be explicitly declared by the application program. union semun {
int val;
struct semid_ds *buf;
ushort_t *array;
} arg ;
The permission required for a semaphore operation is given as {token}, where token is the type of permission needed. The types of permission are interpreted as follows: 00400 READ by user 00200 ALTER by user 00040 READ by group 00020 ALTER by group 00004 READ by others 00002 ALTER by others See the Semaphore Operation Permissions subsection of the DEFINITIONS section of Intro(2) for more information. The following semaphore operations as specified by cmd are executed with respect to the semaphore specified by semid and semnum.
The following operations return and set, respectively, every semval in the set of semaphores.
The following operations are also available.
Return Values
Upon successful completion, the value returned depends on cmd as follows: All other successful completions return 0; otherwise, -1 is returned and errno is set to indicate the error. Errors
The semctl() function will fail if: AttributesSee attributes(5) for descriptions of the following attributes:
See AlsoSunOS 5.11 Last Revised 1 Feb 2003Name | Synopsis | Description | Return Values | Errors | Attributes | See Also |
||||