]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-process: Make header definitions conditional to PIDS
authorMichalis Pappas <michalis@unikraft.io>
Tue, 18 Mar 2025 10:16:59 +0000 (11:16 +0100)
committerUnikraft Bot <monkey@unikraft.io>
Wed, 26 Mar 2025 08:05:34 +0000 (08:05 +0000)
Make definitions in private process.h conditional to
CONFIG_LIBPOSIX_PROCESS_PIDS to prevent compile errors if that header
is if that header is included by files compiled unconditionally to
CONFIG_LIBPOSIX_PROCESS_PIDS.

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Ioan-Teodor Teugea <ioan_teodor.teugea@stud.acs.upb.ro>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
Approved-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1248

lib/posix-process/process.h

index f08685c8f853e0978ac6f9fcdb7840c0179c0936..d214a8e3f3de4e1e22c770c6f8e70331c5745731 100644 (file)
@@ -43,7 +43,6 @@
 
 #if CONFIG_LIBPOSIX_PROCESS_PIDS
 #include <uk/thread.h>
-#endif /* CONFIG_LIBPOSIX_PROCESS_PIDS */
 
 #define TIDMAP_SIZE (CONFIG_LIBPOSIX_PROCESS_MAX_PID + 1)
 
@@ -111,16 +110,15 @@ extern __uk_tls struct posix_thread *pthread_self;
 #define uk_pprocess_current()                                          \
        uk_pthread_current()->process
 
-#if CONFIG_LIBPOSIX_PROCESS_PIDS
 struct posix_process *pid2pprocess(pid_t pid);
 struct uk_thread *tid2ukthread(pid_t tid);
 struct posix_thread *tid2pthread(pid_t tid);
 struct posix_process *tid2pprocess(pid_t tid);
 pid_t ukthread2tid(struct uk_thread *thread);
 pid_t ukthread2pid(struct uk_thread *thread);
-#endif /* CONFIG_LIBPOSIX_PROCESS_PIDS */
 
 void pprocess_kill_siblings(struct uk_thread *thread);
+#endif /* CONFIG_LIBPOSIX_PROCESS_PIDS */
 
 #if CONFIG_LIBPOSIX_PROCESS_CLONE
 int uk_clone(struct clone_args *cl_args, size_t cl_args_len,