When to check for EINTR and repeat the function call?

后端 未结 4 1930
攒了一身酷
攒了一身酷 2020-12-05 01:43

I am programming a user application for a embedded Linux system, and I am using the common functions such as open, close, read, ioctl, etc. for the devices. Now, I read abou

4条回答
  •  时光说笑
    2020-12-05 02:32

    Is your application event driven? (Meaning its main loop include select()/epoll_wait() call).

    In an event driven application you can block all signals and only unblock them for the duration of pselect()/epoll_pwait() call. This way the rest of your code never have to deal with EINTR.

提交回复
热议问题