3 ms·
glibc, Debian package version 2.31-3, without any special defines. Here is the program I used: https://gist.github.com/comex/58ba394588478bb1d506a998850b9436
by comex 6y ago
glibc, Debian package version 2.31-3, without any special defines. Here is the program I used:
https://gist.github.com/comex/58ba394588478bb1d506a998850b9436 https://gist.github.com/comex/58ba394588478bb1d506a998850b94...
If I run the program and press Ctrl-C, it prints "interrupted" but then keeps going. However, if I add `siginterrupt(SIGINT, 1)` after the call to signal(), interrupting the read() produces EINTR as expected.
Interestingly, the glibc manual used to state that the default behavior depended on the presence of _BSD_SOURCE or _GNU_SOURCE, but in 2014 it was changed to state that the default is always to use EINTR:
https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=manual/signal.texi;h=51f68b5d3ec59ea8a662c18360a3ba15cebe80ef;hp=f0e57ddbe41af3b0948d64c1dea420c6b1db9928;hb=c941736c92fa3a319221f65f6755659b2a5e0a20;hpb=e8d8d7ec98af7c3777fd664adca8be5630afbc90 https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=manual/...
- saagarjha 6y agoOh, huh, that’s really interesting! I didn’t realize that glibc had changed their behavior; I wonder if this broke any applications…