* Get a count of the number of unread characters in the message buffer. */
| 129 | * Get a count of the number of unread characters in the message buffer. |
| 130 | */ |
| 131 | int |
| 132 | msgbuf_getcount(struct msgbuf *mbp) |
| 133 | { |
| 134 | u_int len; |
| 135 | |
| 136 | len = MSGBUF_SEQSUB(mbp, mbp->msg_wseq, mbp->msg_rseq); |
| 137 | if (len > mbp->msg_size) |
| 138 | len = mbp->msg_size; |
| 139 | return (len); |
| 140 | } |
| 141 | |
| 142 | /* |
| 143 | * Add a character into the message buffer, and update the checksum and |