From b50a78d34803deb12ecbe5b957f8f77b77c67d38 Mon Sep 17 00:00:00 2001 From: Xing Xue Date: Mon, 27 Oct 2025 09:24:27 -0400 Subject: [PATCH] Change errno EWOULDBLOCK to make it an alias of EAGAIN. --- libc-test/build.rs | 8 +++----- src/unix/aix/mod.rs | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index a6a98abc232a..440034bc9ad1 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -5180,11 +5180,9 @@ fn test_aix(target: &str) { // Skip 'sighandler_t' assignments. "SIG_DFL" | "SIG_ERR" | "SIG_IGN" => true, - // _ALL_SOURCE defines these errno values as aliases of other errno - // values, but POSIX requires each errno to be unique. Skip these - // values because non-unique values are being used which will - // fail the test when _ALL_SOURCE is defined. - "EWOULDBLOCK" | "ENOTEMPTY" => true, + // _ALL_SOURCE defines ENOTEMPTY as an alias of EEXIST, but POSIX + // requires its value to be unique. Skip. + "ENOTEMPTY" => true, // FIXME(ctest): These constants are intended for use as the 'int request' argument // to 'ioctl()'. However, the AIX headers do not explicitly define their types. If a diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index 51ef3768ac08..d20476c301d3 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -1275,7 +1275,8 @@ pub const ENOLCK: c_int = 49; pub const ENOCONNECT: c_int = 50; pub const ESTALE: c_int = 52; pub const EDIST: c_int = 53; -pub const EWOULDBLOCK: c_int = 54; +// POSIX allows EWOULDBLOCK to be the same value as EAGAIN. +pub const EWOULDBLOCK: c_int = EAGAIN; pub const EINPROGRESS: c_int = 55; pub const EALREADY: c_int = 56; pub const ENOTSOCK: c_int = 57;