From e0d0cf6e2909d815852aaf13698519c8fa6e4936 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Wed, 19 Nov 2025 11:24:36 -0800 Subject: [PATCH] helper marco for dealing with syscalls that are interrupted --- src/os/core/linux/os_core_linux.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/os/core/linux/os_core_linux.h b/src/os/core/linux/os_core_linux.h index b80f1ab3..d18a2a7e 100644 --- a/src/os/core/linux/os_core_linux.h +++ b/src/os/core/linux/os_core_linux.h @@ -38,6 +38,17 @@ int pthread_getname_np(pthread_t thread, char *name, size_t size); typedef struct tm tm; typedef struct timespec timespec; +//////////////////////////////// + +#define OS_LNX_RETRY_ON_EINTR(expr) \ + (__extension__({ \ + __typeof__(expr) __ret; \ + do { \ + __ret = (expr); \ + } while ((__ret == -1) && errno == EINTR); \ + __ret; \ + })) + //////////////////////////////// //~ rjf: File Iterator