From edee702a7fb48859d3bc58628617646439fc066f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= Date: Thu, 6 Feb 2025 10:00:48 +0100 Subject: [PATCH] generic glibc: guard pidfd_spawn(p) declarations --- lib/libc/include/generic-glibc/bits/spawn_ext.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libc/include/generic-glibc/bits/spawn_ext.h b/lib/libc/include/generic-glibc/bits/spawn_ext.h index 7955fd9f03..b396316575 100644 --- a/lib/libc/include/generic-glibc/bits/spawn_ext.h +++ b/lib/libc/include/generic-glibc/bits/spawn_ext.h @@ -35,6 +35,8 @@ extern int posix_spawnattr_setcgroup_np (posix_spawnattr_t *__attr, int __cgroup) __THROW __nonnull ((1)); +// zig patch: check target glibc version +#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 39) || __GLIBC__ > 2 /* Spawn a new process executing PATH with the attributes describes in *ATTRP. Before running the process perform the actions described in FACTS. Return a PID file descriptor in PIDFD if process creation was successful and the @@ -61,7 +63,8 @@ extern int pidfd_spawnp (int *__restrict __pidfd, char *const __argv[__restrict_arr], char *const __envp[__restrict_arr]) __nonnull ((1, 2, 5)); +#endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 39) || __GLIBC__ > 2 */ #endif /* __USE_MISC */ -__END_DECLS \ No newline at end of file +__END_DECLS