DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5 and SCO OpenServer

close(D2str)


close -- relinquish access to a STREAMS device

Syntax

See close(D2) for DDI syntax, arguments, return values, and basic usage information.

See close(D2oddi) for ODDI syntax, arguments, return values, and basic usage information.

Usage

This entry point is required in all drivers and STREAMS modules.

The close( ) routines of STREAMS drivers and modules are called when a stream is dismantled or a module popped. The steps for dismantling a stream are performed in the following order:

A close routine could perform any of the following general functions, depending on the type of device and the service provided:

Multithreaded STREAMS drivers and modules must call qprocsoff(D3str) to disable their put(D2str) and service (srv(D2str)) routines before returning from the close routine.

Synchronization constraints

The close routine has user context and can sleep. However, STREAMS drivers and modules must sleep such that signals do not cause the sleep to longjump as discussed on the sleep(D3) manual page. Also, if a close routine does sleep, it is important that the driver writer synchronize the driver's open and close routines, since a driver can be reopened while being closed.

If the FNDELAY or FNONBLOCK flags are specified in the flag argument, the driver should try to avoid sleeping, if possible, during close processing.

References

close(D2), close(D2mdi), close(D2oddi)

drv_priv(D3), errnos(D5), open(D2str), qprocsoff(D3str), queue(D4str), sleep(D3), unbufcall(D3str), untimeout(D3),


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005