Explorar el Código

LibC: Add `WIFCONTINUED` macro

Like other systems, we can encode the continued state with 0xffff in the
status value. This is needed for some ports.
SeekingBlues hace 3 años
padre
commit
8730e56e88
Se han modificado 2 ficheros con 2 adiciones y 1 borrados
  1. 1 0
      Kernel/API/POSIX/sys/wait.h
  2. 1 1
      Userland/Libraries/LibC/sys/wait.cpp

+ 1 - 0
Kernel/API/POSIX/sys/wait.h

@@ -18,6 +18,7 @@ extern "C" {
 #define WIFEXITED(status) (WTERMSIG(status) == 0)
 #define WIFSTOPPED(status) (((status)&0xff) == 0x7f)
 #define WIFSIGNALED(status) (((char)(((status)&0x7f) + 1) >> 1) > 0)
+#define WIFCONTINUED(status) ((status) == 0xffff)
 
 #define WNOHANG 1
 #define WUNTRACED 2

+ 1 - 1
Userland/Libraries/LibC/sys/wait.cpp

@@ -64,7 +64,7 @@ pid_t waitpid(pid_t waitee, int* wstatus, int options)
             *wstatus = siginfo.si_status << 8 | 0x7f;
             break;
         case CLD_CONTINUED:
-            *wstatus = 0;
+            *wstatus = 0xffff;
             return 0; // return 0 if running
         default:
             VERIFY_NOT_REACHED();