linux: fix academic valgrind warning (#3960)

Fix a valgrind warning that only manifested with clang (not gcc!) by
explicitly passing 0L instead of plain 0 as the |sigsz| argument to
io_uring_enter(). That is, pass a long instead of an int.

On x86_64, |sigsz| is passed on the stack (the other arguments are
passed in registers) but where gcc emits a `push $0` that zeroes the
entire stack slot, clang emits a `movl $0,(%rsp)` that leaves the upper
32 bits untouched.

It's academic though since we don't pass IORING_ENTER_EXT_ARG and the
kernel therefore completely ignores the argument.

Refs: https://github.com/libuv/libuv/pull/3952
This commit is contained in:
Ben Noordhuis 2023-04-19 07:39:10 +02:00 committed by GitHub
parent d2c31f429b
commit a7ff759ca1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -348,7 +348,13 @@ int uv__io_uring_enter(int fd,
* in newer kernels unless IORING_ENTER_EXT_ARG is set,
* in which case it takes a struct io_uring_getevents_arg.
*/
return syscall(__NR_io_uring_enter, fd, to_submit, min_complete, flags, 0, 0);
return syscall(__NR_io_uring_enter,
fd,
to_submit,
min_complete,
flags,
NULL,
0L);
}