PCOUNT(2)
NAME
pcount − return the number of messages currently waiting at a port
SYNOPSIS
int pcount(portid)
int portid;
DESCRIPTION
Pcount returns the message count associated with port portid.
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.
December 01, 1986 — Xinu Programmer’s Manual