clang-format

This commit is contained in:
2024-09-10 13:03:02 -04:00
parent 53c617d779
commit d66450e427
381 changed files with 28864 additions and 34170 deletions

View File

@@ -34,14 +34,13 @@
* Definitions for wait().
*/
/* Flags for waitpid() and equivalent. */
#define WNOHANG 1 /* Nonblocking. */
#define WUNTRACED 2 /* Report stopping as well as exiting processes. */
#define WNOHANG 1 /* Nonblocking. */
#define WUNTRACED 2 /* Report stopping as well as exiting processes. */
/* Special "pids" to wait for. */
#define WAIT_ANY (-1) /* Any child process. */
#define WAIT_MYPGRP 0 /* Any process in the same process group. */
#define WAIT_ANY (-1) /* Any child process. */
#define WAIT_MYPGRP 0 /* Any process in the same process group. */
/*
* Result encoding.
@@ -51,29 +50,29 @@
* is different, wastes most of the bits and can only transmit 8 bits
* of exit code...
*/
#define _WWHAT(x) ((x)&3) /* lower two bits say what happened */
#define _WVAL(x) ((x)>>2) /* the rest is the value */
#define _MKWVAL(x) ((x)<<2) /* encode a value */
#define _WWHAT(x) ((x) & 3) /* lower two bits say what happened */
#define _WVAL(x) ((x) >> 2) /* the rest is the value */
#define _MKWVAL(x) ((x) << 2) /* encode a value */
/* Four things can happen... */
#define __WEXITED 0 /* Process exited by calling _exit(). */
#define __WSIGNALED 1 /* Process received a fatal signal. */
#define __WCORED 2 /* Process dumped core on a fatal signal. */
#define __WSTOPPED 3 /* Process stopped (and didn't exit). */
#define __WEXITED 0 /* Process exited by calling _exit(). */
#define __WSIGNALED 1 /* Process received a fatal signal. */
#define __WCORED 2 /* Process dumped core on a fatal signal. */
#define __WSTOPPED 3 /* Process stopped (and didn't exit). */
/* Test macros, used by applications. */
#define WIFEXITED(x) (_WWHAT(x)==__WEXITED)
#define WIFSIGNALED(x) (_WWHAT(x)==__WSIGNALED || _WWHAT(x)==__WCORED)
#define WIFSTOPPED(x) (_WWHAT(x)==__WSTOPPED)
#define WIFEXITED(x) (_WWHAT(x) == __WEXITED)
#define WIFSIGNALED(x) (_WWHAT(x) == __WSIGNALED || _WWHAT(x) == __WCORED)
#define WIFSTOPPED(x) (_WWHAT(x) == __WSTOPPED)
#define WEXITSTATUS(x) (_WVAL(x))
#define WTERMSIG(x) (_WVAL(x))
#define WSTOPSIG(x) (_WVAL(x))
#define WCOREDUMP(x) (_WWHAT(x)==__WCORED)
#define WTERMSIG(x) (_WVAL(x))
#define WSTOPSIG(x) (_WVAL(x))
#define WCOREDUMP(x) (_WWHAT(x) == __WCORED)
/* Encoding macros, used by the kernel to generate the wait result. */
#define _MKWAIT_EXIT(x) (_MKWVAL(x)|__WEXITED)
#define _MKWAIT_SIG(x) (_MKWVAL(x)|__WSIGNALED)
#define _MKWAIT_CORE(x) (_MKWVAL(x)|__WCORED)
#define _MKWAIT_STOP(x) (_MKWVAL(x)|__WSTOPPED)
#define _MKWAIT_EXIT(x) (_MKWVAL(x) | __WEXITED)
#define _MKWAIT_SIG(x) (_MKWVAL(x) | __WSIGNALED)
#define _MKWAIT_CORE(x) (_MKWVAL(x) | __WCORED)
#define _MKWAIT_STOP(x) (_MKWVAL(x) | __WSTOPPED)
#endif /* _KERN_WAIT_H_ */