[Linux system programming] 14. Blocking and non-blocking

Table of contents

Blocking Scenarios

are attributes of device files and network files . Reading regular files has no concept of blocking.

Blocking Scenarios

  • read device file

  • read network files

Terminal file: /dev/tty

Set /dev/tty to non-blocking state, default to blocking state.

open("/dev/tty",O_RDWD|O_NONBLOCK);

 

Guess you like

Origin blog.csdn.net/CETET/article/details/130065254