Which system calls can return EINTR or EAGAIN error codes? [closed]

若如初见. 提交于 2019-12-13 11:29:52

问题


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:


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).



来源:https://stackoverflow.com/questions/25714578/which-system-calls-can-return-eintr-or-eagain-error-codes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!