Re: [PATCH net-next] selftests: net/psock_lib: Handle EINTR and EAGAIN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Willem de Bruijn wrote:
> Did you observe actual issues or is this based on the comment in the
> existing code ("Should really handle EINTR and EAGAIN").

No, this patch was based purely off of the comment, and the examples of
similar code in other selftests, e.g. tools/testing/selftests/bpf/xsk.c:

> static int netlink_recvmsg(int sock, struct msghdr *mhdr, int flags)
> {
>       int len;
>
>       do {
>               len = recvmsg(sock, mhdr, flags);
>       } while (len < 0 && (errno == EINTR || errno == EAGAIN));
>
>       if (len < 0)
>               return -errno;
>       return len;
> }

> A simpler approach to dealing with EINTR is to ask glibc to restart
> with sigaction or siginterrupt.
> 

If we want to handle it that way, this patch is probably not necessary,
since there is no specific signal I would want to install a handler for.

Thanks for your feedback,
Leo





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux