SIO_create
Application Program Interface
2-389
C Interface
Syntax
stream = SIO_create(name, mode, bufsize, attrs);
Parameters
String
name;
/* name of device */
Int
mode;
/* SIO_INPUT or SIO_OUTPUT */
size_t
bufsize;
/* stream buffer size */
SIO_Attrs
*attrs;
/* pointer to stream attributes */
Return Value
SIO_Handle stream;
/* stream object handle */
Description
SIO_create creates a new stream object and opens the device specified
by name. If successful, SIO_create returns the handle of the new stream
object. If unsuccessful, SIO_create returns NULL unless it aborts (for
example, because it directly or indirectly calls SYS_error, and SYS_error
is configured to abort).
Internally, SIO_create calls Dxx_open to open a device.
The mode parameter specifies whether the stream is to be used for input
(SIO_INPUT) or output (SIO_OUTPUT).
If the stream is being opened in SIO_STANDARD mode, SIO_create
allocates buffers of size bufsize for use by the stream. Initially these
buffers are placed on the device todevice queue for input streams, and
the device fromdevice queue for output streams.
If the stream is being opened in SIO_ISSUERECLAIM mode, SIO_create
does not allocate any buffers for the stream. In SIO_ISSUERECLAIM
mode all buffers must be supplied by the client via the SIO_issue call. It
does, however, prepare the stream for a maximum number of buffers of
the specified size.
If the attrs parameter is NULL, the new stream is assigned the default set
of attributes specified by SIO_ATTRS. The following stream attributes
are currently supported:
SIO_create
Open a stream