Get the owner of a file descriptor
#include <sys/dcmd_all.h> #define DCMD_ALL_GETOWN __DIOF(_DCMD_ALL, 4, pid_t)
Argument | Value |
---|---|
filedes | A file descriptor that you obtained by opening the device. |
dcmd | DCMD_ALL_GETOWN |
dev_data_ptr | A pointer to a pid_t where the device can store the owner. |
n_bytes | sizeof(pid_t) |
dev_info_ptr | NULL |
This command gets the owner of the given file descriptor. Clients usually use the fcntl() cover function to generate this request:
fcntl(fd, F_GETOWN);
It's generally used for sockets where the owner will receive SIGIO and SIGURG signals.
None.
The process ID of the current owner.
if(devctl(fd, DCMD_ALL_GETOWN, &pid, sizeof pid, NULL) != EOK) { /* Error */ }