relinquish access to a device
void prefixclose(dev_t dev, int flag, int otyp);
entry point routine ends the connection
between the user process
and the previously-opened device
and prepares the device and software
so that they are ready to be opened again.
flag with which the file was opened.
The value is merely a reference to be used as needed;
it does not control how the file is closed.
The flag is taken from the
of the file structure.
lists the supported flags.
parameter used to determine how many times
a device was opened and for what reasons.
The flags assume that the
routine may be called many times, but the
routine is called by the kernel
only on the last close of a device.
for a list of supported values.
A device may be opened simultaneously
by multiple processes and the
driver routine is called for each open,
but, unless the OTYP_LYR otyp is used,
the device is closed only by the last
system call (after all forked processes have been closed).
The kernel calls the driver's
routine when the last process using the device
call or exits.
Block device close routines
can also be called when the device is being unmounted (see
routine should use the flag parameters
that are listed on the
manual page when applicable.
routine should make the device available
for later use by performing the following:
deallocate buffers from a private buffering scheme
unlock resources that were locked in the
notify the device of the close operation
Adhere to the following guidelines:
If an error occurs during the
routine, the driver should call the
or set the
user structure directly.
u.u_error before assigning a value;
if an error exists already, do not change the value.
routine in a TTY driver
should call the
function, then disconnect the link to the terminal
and return to the caller.
Multithreaded TTY drivers call
Context and synchronization
The driver can block but cannot do operations such as
that require access to
the requesting process's address space.
1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp
SVR5 DDI compatibility
entry point routine provides similar functionality
for DDI drivers,
although note that the syntax is different.
Drivers that contain a
routine must have a c in the function list of the
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005