Remember the different Linux manual sections.
man 1  ->  user commands
man 2  ->  Linux system calls
man 3  ->  C library functions (but not necessarily C Standard Library functions)
man 4  ->  special files
man 5  ->  file formats
man 8  ->  administration and privileged commands

Note: These are the current manual sections. Our textbook uses an
older numbering for manual sections. For example, the book considers
Section 4 to be file formats, but that is now Section 5.

You can get an introduction to section n with the command
$ man n intro


--------------------------------------------------------------------------
Chapter 5

The example programs from this chapter should be used in the following order.

write0.c      (from page 143)
write1.c      (from page 168, Ex 5.22?)
whereami.c
listchars.c   (from page 152)
echostate.c   (from page 159)
setecho.c     (from page 160)
showtty.c     (from page 161)


--------------------------------------------------------------------------
Section 5.2

Section 4 of the man pages describe device files in the /dev directory.
http://man7.org/linux/man-pages/man4/intro.4.html
http://man7.org/linux/man-pages/dir_section_4.html

The "controlling terminal"
man 1 tty
man 4 tty


The stat(2) system call tells you what kind of file a file really
is (for example, a "regular file" or a "device").
man 2 stat


--------------------------------------------------------------------------
Section 5.4

The fcntl(2) system call sets attributes of an open file. Some of these
attributes belong to a file descriptor in the process's "file descriptor
array" and some of these attributes belong to the open file's entry in the
kernel's "open file table".
man 2 fcntl

The open(2) system call creates an new entry in the kernel's "open file table"
and it sets many of the same attributes that can be set with fcntl(2).
man 2 open


--------------------------------------------------------------------------
Section 5.5

man 1 stty


The tcgetattr(), tcsetattr(), termios() function get and set attributes
of open terminal devices.
man 3 termios


--------------------------------------------------------------------------
Section 5.6

The ioctl(2) system call sets attributes of an open special file (kind
of like fcntl(2) but for "special files").
man 2 ioctl