osmacro.inc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {
  2. Copyright (c) 2000-2002 by Marco van de Voort
  3. The *BSD POSIX macro's that are used both in the Baseunix unit as the
  4. system unit. Not aliased via public names because I want these to be
  5. inlined as much as possible in the future.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************}
  18. function FPS_ISDIR(m : TMode): boolean;
  19. begin
  20. FPS_ISDIR:=((m and S_IFMT) = S_IFDIR);
  21. end;
  22. function FPS_ISCHR(m : TMode): boolean;
  23. begin
  24. FPS_ISCHR:=((m and S_IFMT) = S_IFCHR);
  25. end;
  26. function FPS_ISBLK(m : TMode): boolean;
  27. begin
  28. FPS_ISBLK:=((m and S_IFMT) = S_IFBLK);
  29. end;
  30. function FPS_ISREG(m : TMode): boolean;
  31. begin
  32. FPS_ISREG:=((m and S_IFMT) = S_IFREG);
  33. end;
  34. function FPS_ISFIFO(m : TMode): boolean;
  35. begin
  36. FPS_ISFIFO:=((m and S_IFMT) = S_IFIFO);
  37. end;
  38. Function FPS_ISLNK(m:TMode):boolean;
  39. begin
  40. FPS_ISLNK:=((m and S_IFMT) = S_IFLNK);
  41. end;
  42. Function FPS_ISSOCK(m:TMode):boolean;
  43. begin
  44. FPS_ISSOCK:=((m and S_IFMT) = S_IFSOCK);
  45. end;
  46. function wifexited(status : cint): boolean;
  47. begin
  48. wifexited:=(status AND 127) =0;
  49. end;
  50. function wexitstatus(status : cint): cint;
  51. begin
  52. wexitstatus:=status shr 8;
  53. end;
  54. function wstopsig(status : cint): cint;
  55. begin
  56. wstopsig:=status shr 8;
  57. end;
  58. const wstopped=127;
  59. function wifsignaled(status : cint): boolean;
  60. begin
  61. wifsignaled:=((status and 127)<>wstopped) and ((status and 127)<>0);
  62. end;
  63. function wtermsig(status : cint):cint;
  64. begin
  65. wtermsig:=cint(status and 127);
  66. end;