2
0

bunxmacr.inc 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {
  2. $Id$
  3. Copyright (c) 2000-2002 by Marco van de Voort
  4. The "linux" posixy macro's that are used both in the Baseunx unit as the
  5. system unit. Not aliased via public names because I want these to be
  6. inlined as much as possible in the future.
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. This program is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. You should have received a copy of the GNU General Public License along
  16. with this program; if not, write to the Free Software Foundation, Inc.,
  17. 675 Mass Ave, Cambridge, MA 02139, USA.
  18. ****************************************************************************
  19. }
  20. function FpISDIR(m : TMode): boolean;
  21. begin
  22. FpISDIR:=((m and _S_IFMT) = _S_IFDIR);
  23. end;
  24. function FpISCHR(m : TMode): boolean;
  25. begin
  26. FpISCHR:=((m and _S_IFMT) = _S_IFCHR);
  27. end;
  28. function FpISBLK(m : TMode): boolean;
  29. begin
  30. FpISBLK:=((m and _S_IFMT) = _S_IFBLK);
  31. end;
  32. function FpISREG(m : TMode): boolean;
  33. begin
  34. FpISREG:=((m and _S_IFMT) = _S_IFREG);
  35. end;
  36. function FpISFIFO(m : TMode): boolean;
  37. begin
  38. FpISFIFO:=((m and _S_IFMT) = _S_IFIFO);
  39. end;
  40. function wifexited(status : cint): cint;
  41. begin
  42. wifexited:=cint((status AND $7f) =0);
  43. end;
  44. function wexitstatus(status : cint): cint;
  45. begin
  46. wexitstatus:=(status and $FF00) shr 8;
  47. end;
  48. function wstopsig(status : cint): cint;
  49. begin
  50. wstopsig:=(status and $FF00) shr 8;
  51. end;
  52. const wstopped=127;
  53. function wifsignaled(status : cint): cint;
  54. begin
  55. wifsignaled:=cint(((status and $FF)<>wstopped) and ((status and 127)<>0));
  56. end;
  57. function wtermsig(status : cint):cint;
  58. begin
  59. wtermsig:=cint(status and 127);
  60. end;
  61. {
  62. $Log$
  63. Revision 1.1 2002-12-18 16:43:26 marco
  64. * new unix rtl, linux part.....
  65. Revision 1.2 2002/11/12 15:31:33 marco
  66. * Killed octal codes for 1.0.x compilability.
  67. Revision 1.1 2002/11/12 14:37:59 marco
  68. * Parts of new unix rtl
  69. }