]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vsock/test: add timeout_usleep() to allow sleeping in timeout sections
authorStefano Garzarella <sgarzare@redhat.com>
Wed, 14 May 2025 14:19:25 +0000 (16:19 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 17 May 2025 01:01:32 +0000 (18:01 -0700)
commita7262ed4b163c411b450d74f2c7b34bde19ac78e
treef9792c0b0c9bc1ca98a1fb4383cf396dde9e809d
parent9e1f7a3119cd4c5678f226033a9b9fb98917700b
vsock/test: add timeout_usleep() to allow sleeping in timeout sections

The timeout API uses signals, so we have documented not to use sleep(),
but we can use nanosleep(2) since POSIX.1 explicitly specifies that it
does not interact with signals.

Let's provide timeout_usleep() for that.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20250514141927.159456-2-sgarzare@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/vsock/timeout.c
tools/testing/vsock/timeout.h