I think we can have the check that "if size == 0 return 0". The above
cited return-0-on-detch would still apply for enough sized buffers. So:
1) size == 0, return 0 (POSIX wants this)
2) size < sizeof(signalfd_siginfo), return EINVAL
3) size >= sizeof(signalfd_siginfo) && DETACH, return 0
The signalfd falls into what POSIX defined as "special file", and can
return a lower-than-size result.
Because it is a typically used value for still-unused/reserved members?
Better than random values I think ;)
Members validity is driven by si_code & SI_MASK anyway.
- Davide
-