Which system calls can return EINTR or EAGAIN erro

2019-09-22 10:05发布

Which of the following system calls can return EINTR or EAGAIN/EWOULDBLOCK?

getsockname()
chdir()
bind()
fcntl()
listen()
setsid()
setsockopt()
socket()
stat()
unlink()
access()
accept()
open()
usleep()
dup2()
fork()
waitpid()
wait()
read()
write()

Some of these system calls return EINTR or EAGAIN on error (by the API of man pages).

Also some system calls exist that the API do not refer the EINTR/EAGAIN and however return these.

Please help.

1条回答
Ridiculous、
2楼-- · 2019-09-22 10:53

I have found the answer. This question should not have been deleted. As a rule only syscalls which are "slow" return EINTR. Slow things are terminal I/O and things which wait (select, wait, sleep, pause, etc).

查看更多
登录 后发表回答