bwaitflags.inc 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. function WEXITSTATUS(Status: Integer): Integer;
  2. begin
  3. Result := (Status and $FF00) shr 8;
  4. end;
  5. function WTERMSIG(Status: Integer): Integer;
  6. begin
  7. Result := (Status and $7F);
  8. end;
  9. function WSTOPSIG(Status: Integer): Integer;
  10. begin
  11. Result := WEXITSTATUS(Status);
  12. end;
  13. function WIFEXITED(Status: Integer): Boolean;
  14. begin
  15. Result := (WTERMSIG(Status) = 0);
  16. end;
  17. function WIFSIGNALED(Status: Integer): Boolean;
  18. begin
  19. Result := (not WIFSTOPPED(Status)) and (not WIFEXITED(Status));
  20. end;
  21. function WIFSTOPPED(Status: Integer): Boolean;
  22. begin
  23. Result := ((Status and $FF) = $7F);
  24. end;
  25. function WCOREDUMP(Status: Integer): Boolean;
  26. begin
  27. Result := ((Status and WCOREFLAG) <> 0);
  28. end;
  29. function W_EXITCODE(ReturnCode, Signal: Integer): Integer;
  30. begin
  31. Result := (ReturnCode shl 8) or Signal;
  32. end;
  33. function W_STOPCODE(Signal: Integer): Integer;
  34. begin
  35. Result := (Signal shl 8) or $7F;
  36. end;