Xinu7/man/man2/preset.doc




PRESET(2)           Xinu Programmer's Manual            PRESET(2)



NAME
     preset  - reset a port

SYNOPSIS
     int preset(portid, dispose)
     int portid;
     int (*dispose)();

DESCRIPTION
     _P_r_e_s_e_t flushes all messages from a port and releases all
     processes waiting to send or receive messages.  _P_r_e_s_e_t
     returns SYSERR if _p_o_r_t_i_d is not a valid port id.

     _P_r_e_s_e_t has several effects, depending on the state of the
     port at the time the call is issued.  If processes are
     blocked waiting to receive messages from port _p_o_r_t_i_d, they
     are all made ready; each returns SYSERR to caller.  If mes-
     sages are in the port they are disposed of by passing them
     to function _d_i_s_p_o_s_e.  If process are blocked waiting to send
     messages they are made ready; each returns SYSERR to its
     caller (as though the port never existed).

     The effects of _p_r_e_s_e_t are the same as PDELETE(2) followed by
     PCREATE(2), except that the port is not deallocated.  The
     maximum message count remains the same as it was.

BUGS
     There is no way to change the maximum message count when the
     port is reset.

SEE ALSO
     pcount(2), pcreate(2), pdelete(2), preceive(2), psend(2)























Version 6b               Printed 1/12/87                        1