STREAMS does not provide a Transport Layer Interface (TLI) library. User-mode programs, such as routing or plumbing daemons, can access STREAMS drivers and modules directly with the following functions listed below, which block synchronously.
These functions operate only on handles to STREAMS drivers. To close a handle, call the Win32 CloseHandle API. These functions are defined in Further Readings on Streams, Reference 1. Windows NT adds the s_ prefix to the last two due to a name conflict with the C runtime functions of the same name.
These functions are not recommended for general application access to transports. The Windows Sockets interface is more appropriate for general use.
INT getmsg( IN HANDLE fd, IN OUT struct strbuf *ctrlptr OPTIONAL, IN OUT struct strbuf *dataptr OPTIONAL, IN OUT int *flagsp );
INT putmsg( IN HANDLE fd, IN struct strbuf *ctrlptr OPTIONAL, IN struct strbuf *dataptr OPTIONAL, IN int flags );
INT poll( IN OUT struct pollfd *fds, IN unsigned int nfds, IN int timeout );
struct pollfd { HANDLE fd; // file handle to poll short events; // events of interest on fd short revents; // events that occurred on fd }; INT s_ioctl( IN HANDLE fd, IN int cmd, IN OUT void *arg OPTIONAL );
HANDLE s_open( IN CHAR *path, IN INT oflag, IN INT ignored );
The s_poll function allows the caller to query several streams for information. For STREAMS, the flags listed below can be used to specify the events of interest to poll:
(1) New in UNIX SVR4
STREAMS does not support the following flags: