|
NAMEtcgetwinsize , tcsetwinsize
—
get, set the size of a terminal window
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <termios.h>
struct winsize { unsigned short ws_row; /* number of rows, in characters */ unsigned short ws_col; /* number of columns, in characters */ unsigned short ws_xpixel; /* horizontal size, in pixels */ unsigned short ws_ypixel; /* vertical size, in pixels */ };
int
DESCRIPTIONThetcgetwinsize () function gets the terminal window
size of the terminal of which fd is an open file
descriptor and stores it in the winsize structure of
which w is a pointer.
The The above declaration of struct winsize may
not be literal. It is provided only to list the accessible members.
Therefore, before calling RETURN VALUEThetcgetwinsize () and
tcsetwinsize () functions return the value 0 if
successful; otherwise the value -1 is returned and the global variable
errno is set to indicate the error. The terminal window
size remains unchanged if tcsetwinsize () fails.
ERRORSThe following are the possible failure conditions:
SEE ALSOstty(1), ioctl(2), sigaction(2), termios(4), tty(4)STANDARDSThetcgetwinsize () and
tcsetwinsize () functions are expected to conform to
IEEE Std 1003.1 (“POSIX.1”) Base
Specifications, Issue 8. The ws_xpixel and
ws_ypixel members of struct
winsize are FreeBSD extensions.
Visit the GSP FreeBSD Man Page Interface. |