DCMD_CHR_WAITINFO

Get information about blocked processes

Synopsis:

#include <sys/dcmd_chr.h>

#define DCMD_CHR_WAITINFO   __DIOTF(_DCMD_CHR, 11, struct _ttywaitinfo)

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the device.
dcmd DCMD_CHR_WAITINFO
dev_data_ptr A pointer to a struct _ttywaitinfo
n_bytes sizeof(struct _ttywaitinfo) (see below)
dev_info_ptr NULL

Description:

This command gets information about blocked processes. The client passes in the queue to query and the number of blocked processes that it can handle seeing.

The associated data types are:

typedef enum _tty_queue {
        TTY_NULL_Q,
        TTY_DEVCTL_Q,
        TTY_DRAIN_Q,
        TTY_WRITE_Q,
        TTY_READ_Q,
        TTY_OPEN_Q     /* By definition we won't see see anything here,
                          since we have to open the device to query it */
} _ttyqueue;

struct _pidtid {
        pid_t pid;
        int   tid;
        int   offset;
        int   nbytes;
};

struct _ttywaitinfo {
        _ttyqueue      queue;
        unsigned int   num;
        struct _pidtid blocked[0];
};

Input:

A _ttywaitinfo structure, with:

Output:

A _ttywaitinfo structure, with the blocked array filled in, and num set to the number of entries that were filled in.

Errors:

The devctl() function can return the following, in addition to the error codes listed in its entry in the C Library Reference:

ENOTTY
You specified an invalid queue.

See also:

devctl() in the QNX Neutrino C Library Reference