Xinu7/man/man2/pcount.doc




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



NAME
     pcount - return the number of messages currently waiting at
     a port

SYNOPSIS
     int pcount(portid)
     int portid;

DESCRIPTION
     _P_c_o_u_n_t returns the message count associated with port _p_o_r_-
     _t_i_d.

     A positive count p means that there are p messages available
     for processing. This count includes the count of messages
     explicitly in the port and the count of the number of
     processes which attempted to send messages to the queue but
     are blocked (because the queue is full). A negative count p
     means that there are p processes awaiting messages from the
     port.  A zero count means that there are neither messages
     waiting nor processes waiting to consume messages.

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

BUGS
     In this version there is no way to distinguish SYSERR (which
     has value -1) from a legal port count.




























Version 6b               Printed 1/12/87                        1