Cambridge, MA 02139, USA. */
#include <sysdep.h>
+#include <errnos.h>
.globl C_SYMBOL_NAME(errno)
.globl syscall_error
#else
syscall_error:
#endif
- movl %eax, C_SYMBOL_NAME(errno)
+#ifdef EWOULDBLOCK_sys
+ /* We translate the system's EWOULDBLOCK error into EAGAIN.
+ The GNU C library always defines EWOULDBLOCK==EAGAIN.
+ EWOULDBLOCK_sys is the original number. */
+ cmpl %eax, $EWOULDBLOCK_sys /* Is it the old EWOULDBLOCK? */
+ jne 0f /* Branch if not. */
+ move $EAGAIN, %eax /* Yes; translate it to EAGAIN. */
+#endif
+0: movl %eax, C_SYMBOL_NAME(errno)
movl $-1, %eax
ret