

shmctl()               COHERENT System Call              shmctl()




Control shared-memory operations

#include <sys/shm.h>
sshhmmccttll(_s_h_m_i_d, _c_m_d, _b_u_f)
iinntt _s_h_m_i_d, _c_m_d; ssttrruucctt sshhmmiidd_ddss *_b_u_f;

shmctl  provides  controls  the COHERENT  system's  shared-memory
facility.  cmd specifies the operation to perform, as follows:

IIPPCC_SSTTAATT   Place the  current value  of each  member of  the data
          structure  associated  with  shmid into  the  structure
          pointed to by buf.

IIPPCC_SSEETT    Set the  value of  the following  members of  the data
          structure  associated with  shmid to  the corresponding
          value found in the structure pointed to by buf:

          shm_perm.uid
          shm_perm.gid
          shm_perm.mode /* only low 9 bits */

          This  cmd  can be executed only by  a process whose ef-
          fective user ID  equals either that of the superuser or
          shm_perm.uid  in  the  data structure  associated  with
          shmid.

IIPPCC_RRMMIIDD  Remove  the system  identifier specified by  shmid from
          the system  and destroy  the shared memory  segment and
          data structure associated with it.  This cmd can be ex-
          ecuted only by a process whose effective user ID equalS
          either  that of  the superuser  or shm_perm.uid  in the
          data structure associated with shmid.

shmctl fails if any of the following is true:

*  shmid is not a  valid shared memory identifier shmget sets er-
   rno to EEIINNVVAALL.

*  cmd is not a valid command (EEIINNVVAALL).

*  cmd equals IPC_STAT  and operation permission is denied to the
   calling process (EEAACCCCEESS).

*  cmd  equals IPC_RMID or  IPC_SET and the  effective user iden-
   tifier of the calling  process does equals neither that of the
   superuser  nor shm_perm.uid in  the data  structure associated
   with shmid (EEPPEERRMM).

*  buf points to an illegal address (EEFFAAUULLTT).

***** Return Value *****

Upon  successful completion, shmctl  returns zero;  otherwise, it
returns -1 and sets errno to an appropriate value.


COHERENT Lexicon                                           Page 1




shmctl()               COHERENT System Call              shmctl()




***** Files *****

/usr/include/sys/ipc.h
/usr/include/sys/shm.h
/dev/shm
/drv/shm

***** See Also *****

COHERENT system calls, shm, shmget()

***** Notes *****

To  improve  portability,  the  COHERENT  system  implements  its
shared-memory functions  as a device driver instead  of as an ac-
tual system call.








































COHERENT Lexicon                                           Page 2


