---
name: "SP_poll"
section: "3"
platform: "linux"
package: "libspread1-dev"
version: "3.17.4-2+b1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/SP_poll"
---

# SP\_poll(3)

checks amount of data ready to be read

## NAME

SP\_poll - checks amount of data ready to be read

## SYNOPSIS

**#include \<sp.h\>**\
 **int SP\_poll( mailbox** *mbox***);**

## DESCRIPTION

**SP\_poll** is a way to poll a mailbox to see if any messages are available for receiving. The value returned will be \< 0 if error, 0 if nothing is available, and the number of bytes waiting if something is there.

## RETURN VALUES

Returns 0 if nothing is available or the number of bytes available, or one of the following errors ( \< 0 ):

- **ILLEGAL\_SESSION**

  The session specified by *mbox* is illegal. Usually because it is not active.

## BUGS

None.

## AUTHOR

Yair Amir \<yairamir@cnds.jhu.edu\>\
 Jonathan Stanton \<jonathan@cnds.jhu.edu\>\
 Commedia Project \<commedia@cnds.jhu.edu\>

## SEE ALSO

[**libsp**(3)](/libsp/3.md)
