01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SEMCTL ( 2 ) SEMCTL ( 2 )<br />

NAME<br />

semctl - semaphore control operations<br />

SYNOPSIS<br />

#include <br />

#include <br />

#include <br />

int semctl (semid, semnum, cmd, arg)<br />

int semid, cmd;<br />

int semnum;<br />

union semun {<br />

int val;<br />

struct semid_ds •buf;<br />

ushort array[ ];<br />

} arg;<br />

DESCRIPTION<br />

Semctl provides a variety of semaphore control operations as<br />

specified by cmd.<br />

The following cmds are executed with respect to the semaphore<br />

specified by semid and semnum:<br />

GETV AL Return the value of semval (see intro(2)).<br />

{READ}<br />

SETVAL Set the value of semval to arg. val .<br />

{ALTER} When this cmd is successfully<br />

executed the semadj value corresponding to<br />

the specified semaphore in all processes is<br />

cleared.<br />

GETPID Return the value of sempid. {READ}<br />

GETNCNT Return the value of semncnt. {READ}<br />

GETZCNT Return the value of semzcnt. {READ}<br />

The following cmds return and set, respectively, every semval in<br />

the set of semaphores.<br />

GET ALL Place semvals into array pointed to by<br />

arg. array . {READ}<br />

SETALL Set semvals according to the array pointed<br />

to by arg.array. {ALTER} When this cmd<br />

is successfully executed the semadj values<br />

corresponding to each specified semaphore<br />

in all processes are cleared.<br />

The following cmds are also available:<br />

IPC_STAT Place the current value of each member of<br />

the data structure associated with semid<br />

into the structure pointed to by arg. buf.<br />

The contents of this structure are defined<br />

in intro(2). {READ}<br />

IPC_SET Set the value of the following members of<br />

the data structure associated with semid to<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!