Main index | Section 9 | Options |
#include <sys/param.h>
#include <sys/conf.h>
typedef void d_priv_dtor_t(void *data);
The devfs_set_cdevpriv() function associates a data pointed by priv with current calling context (filedescriptor). The data may be retrieved later, possibly from another call performed on this filedescriptor, by the devfs_get_cdevpriv() function. The devfs_clear_cdevpriv() disassociates previously attached data from context. Immediately after devfs_clear_cdevpriv() finished operating, the dtr callback is called, with private data supplied data argument. The devfs_clear_cdevpriv() function will be also be called if the open callback function returns an error code.
On the last filedescriptor close, system automatically arranges devfs_clear_cdevpriv() call.
If successful, the functions return 0.
The function devfs_set_cdevpriv() returns the following values on error:
[ENOENT] | |
The current call is not associated with some filedescriptor. | |
[EBUSY] | |
The private driver data is already associated with current filedescriptor. | |
The function devfs_get_cdevpriv() returns the following values on error:
[EBADF] | |
The current call is not associated with some filedescriptor. | |
[ENOENT] | |
The private driver data was not associated with current filedescriptor, or devfs_clear_cdevpriv() was called. | |
DEVFS_CDEVPRIV (9) | December 2, 2015 |
Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | To err is human...to really foul up requires the root password. | ” |