|
|
Message-ID: <4e15e00d-367d-44d6-98f3-520bd66444fa@gmail.com>
Date: Sun, 29 Nov 2026 21:45:27 +0100
From: Bartosz Brachaczek <b.brachaczek@...il.com>
To: musl@...ts.openwall.com
Subject: Re: [RFC PATCH] pwrite/pwritev: extend fallback to EPERM
On 11/26/2026 1:49 AM, HAKJAE LEE wrote:
> |diff --git a/src/unistd/pwrite.c b/src/unistd/pwrite.c ---
> a/src/unistd/pwrite.c +++ b/src/unistd/pwrite.c @@ -10,9 +10,10 @@ int
> r = __syscall_cp(SYS_pwritev2, fd, (&(struct iovec){ .iov_base = (void
> *)buf, .iov_len = size }), 1, (long)(ofs), (long)(ofs>>32),
> RWF_NOAPPEND); - if (r != -EOPNOTSUPP && r != -ENOSYS) + if (r !=
> -EOPNOTSUPP && r != -ENOSYS && r != -EPERM) return __syscall_ret(r); -
> if (fcntl(fd, F_GETFL) & O_APPEND) - return __syscall_ret(-EOPNOTSUPP);|
|Sorry to hijack this thread, but in the current code on an old kernel,
if one passes an invalid fd, we'll fail with EOPNOTSUPP, whereas pwrite
has a "shall fail" EBADF error case. The attached should fix this.|
|Bartosz|
View attachment "0001-fix-pwrite-pwritev-EBADF-case-on-old-kernels.patch" of type "text/plain" (1806 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.