[PATCH v2 20/25] Including <sys/syscall.h> and <unistd.h> unconditionally.

Alejandro Colomar alx.manpages at gmail.com
Mon Jun 20 07:11:03 UTC 2022


---
 src/nxt_capability.c  | 4 +++-
 src/nxt_port_memory.c | 7 +++----
 src/nxt_process.h     | 4 +++-
 src/nxt_unix.h        | 4 +++-
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/nxt_capability.c b/src/nxt_capability.c
index 24fd55d0..13e01329 100644
--- a/src/nxt_capability.c
+++ b/src/nxt_capability.c
@@ -3,12 +3,14 @@
  * Copyright (C) NGINX, Inc.
  */
 
+
 #include <nxt_main.h>
 
+#include <sys/syscall.h>
+
 #if (NXT_HAVE_LINUX_CAPABILITY)
 
 #include <linux/capability.h>
-#include <sys/syscall.h>
 
 
 #if (_LINUX_CAPABILITY_VERSION_3)
diff --git a/src/nxt_port_memory.c b/src/nxt_port_memory.c
index 0a4a6c53..84f5ebc2 100644
--- a/src/nxt_port_memory.c
+++ b/src/nxt_port_memory.c
@@ -6,12 +6,11 @@
 
 #include <nxt_main.h>
 
-#if (NXT_HAVE_MEMFD_CREATE)
-
-#include <linux/memfd.h>
-#include <unistd.h>
 #include <sys/syscall.h>
+#include <unistd.h>
 
+#if (NXT_HAVE_MEMFD_CREATE)
+#include <linux/memfd.h>
 #endif
 
 #include <nxt_port_memory_int.h>
diff --git a/src/nxt_process.h b/src/nxt_process.h
index 694f457e..a65bdddf 100644
--- a/src/nxt_process.h
+++ b/src/nxt_process.h
@@ -7,8 +7,10 @@
 #ifndef _NXT_PROCESS_H_INCLUDED_
 #define _NXT_PROCESS_H_INCLUDED_
 
-#if (NXT_HAVE_CLONE)
+
 #include <unistd.h>
+
+#if (NXT_HAVE_CLONE)
 #include <nxt_clone.h>
 #endif
 
diff --git a/src/nxt_unix.h b/src/nxt_unix.h
index 00f70e56..60062610 100644
--- a/src/nxt_unix.h
+++ b/src/nxt_unix.h
@@ -9,6 +9,9 @@
 #define _NXT_UNIX_H_INCLUDED_
 
 
+#include <sys/syscall.h>
+
+
 #if (NXT_LINUX)
 
 #ifdef _FORTIFY_SOURCE
@@ -30,7 +33,6 @@
 #define _FILE_OFFSET_BITS  64
 
 #include <malloc.h>                 /* malloc_usable_size(). */
-#include <sys/syscall.h>            /* syscall(SYS_gettid). */
 
 #if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 4)
 /*
-- 
2.36.1



More information about the unit mailing list