Set the size of a character device
#include <sys/ioctl.h> #define TIOCSSIZE TIOCSWINSZ #define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
Argument | Value |
---|---|
fd | A file descriptor that you obtained by opening the device |
request | TIOCSWINSZ |
Additional argument | A pointer to a struct winsize |
This command sets the size of a character device (also known as the window size). It's also implemented as the DCMD_CHR_SETSIZE devctl() command.
None.
The winsize structure is defined in <sys/ioctl.h> as follows:
struct winsize { unsigned short ws_row; unsigned short ws_col; unsigned short ws_xpixel; unsigned short ws_ypixel; };