sshhmmccttll() -- General Function (libc)

Manipulate shared memory
#iinncclluuddee <ssyyss/ttyyppeess.hh>
#iinncclluuddee <ssyyss/iippcc.hh>
#iinncclluuddee <ssyyss/sshhmm.hh>
sshhmmccttll(_s_h_m_i_d, _c_o_m_m_a_n_d, _b_u_f)
iinntt _s_h_m_i_d, _c_o_m_m_a_n_d; ssttrruucctt sshhmmiidd_ddss *_b_u_f;

sshhmmccttll() controls the  COHERENT system's shared-memory facility.  Note that
shared memory consists  of the segment of memory being  shared, plus a copy
of structure  sshhmmiidd_ddss, which is  defined in header  file <ssyyss/sshhmm.hh>. This
structure  describes  the  shared-memory  segment  and identifies  who  can
manipulate it, and how.

_c_o_m_m_a_n_d names the operation that you want sshhmmccttll() to perform, as follows:

IIPPCC_RRMMIIDD  Remove  the system  identifier _s_h_m_i_d  and destroy  its associated
          shared memory segment and sshhmmiidd_ddss structure.  Only the superuser
          rroooott or  the user  whose effective user  ID matches the  value of
          field uuiidd can invoke this command.

IIPPCC_SSEETT   Copy  fields sshhmm_ppeerrmm.uuiidd,  sshhmm_ppeerrmm.ggiidd, and  sshhmm_ppeerrmm.mmooddee (low
          nine bits only) from the iippcc_ppeerrmm associated with _s_h_m_i_d into that
          pointed  to by  _b_u_f.  Only the  superuser  rroooott or  the user  who
          created this shared-memory segment can invoke this command.

IIPPCC_SSTTAATT  Copy every element of the sshhmmiidd_ddss associated with _s_h_m_i_d into the
          one pointed to by _b_u_f.

SSHHMM_LLOOCCKK  Lock the shared-memory segment _s_h_m_i_d, to keep it from being paged
          out of memory.  Only  the superuser rroooott can invoke this command.
          Because COHERENT  does not  support paging, this  command present
          does nothing.

SSHHMM_UUNNLLOOCCKK
          Unlock the shared-memory segment  _s_h_m_i_d, to permit it to be paged
          out of memory.  Only  the superuser rroooott can invoke this command.
          Because COHERENT  does not  support paging, this  command present
          does nothing.

sshhmmccttll() fails if any of the following is true:

-> _s_h_m_i_d is  not a valid shared-memory identifier.   sshhmmggeett() sets eerrrrnnoo to
   EEIINNVVAALL.

-> _c_o_m_m_a_n_d is not a valid command (EEIINNVVAALL).

-> _c_o_m_m_a_n_d  equals IIPPCC_SSTTAATT  but  the owner  of the  calling process  lacks
   permission (EEAACCCCEESS).

-> _c_o_m_m_a_n_d equals IIPPCC_RRMMIIDD or IIPPCC_SSEETT  but the owner of the calling process
   lacks permission (EEPPEERRMM).

-> _b_u_f points to an illegal address (EEFFAAUULLTT).

sshhmmccttll() returns zero  if all went well; otherwise, it  returns -1 and sets
eerrrrnnoo to an appropriate value.

_E_x_a_m_p_l_e
For an example of this function, see the Lexicon entry for sshhmmggeett().

_F_i_l_e_s
/uussrr/iinncclluuddee/ssyyss/iippcc.hh
/uussrr/iinncclluuddee/ssyyss/sshhmm.hh

_S_e_e _A_l_s_o
lliibbcc, sshhmmaatt(), sshhmmddtt(), sshhmmggeett()

_N_o_t_e_s
For  information on  other methods of  interprocess communication,  see the
Lexicon entries for sseemmccttll() and mmssggccttll().
