LINESIZE() The function attempts to find out the terminal width using a TIOCGWINSZ ioctl on the terminal, and returns the answer. If the ioctl returns an error (for instance because there is no controlling terminal), then zero is returned.