bunxmacr.inc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. {
  2. $Id$
  3. Copyright (c) 2000-2002 by Marco van de Voort
  4. The *BSD POSIX macro's that are used both in the Baseunix 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
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. ****************************************************************************
  19. }
  20. function FPISDIR(m : mode_t): boolean;
  21. begin
  22. FPISDIR:=((m and %001111000000000000) = %100000000000000);
  23. end;
  24. function FPISCHR(m : mode_t): boolean;
  25. begin
  26. FPISCHR:=((m and %001111000000000000) = %10000000000000);
  27. end;
  28. function FPISBLK(m : mode_t): boolean;
  29. begin
  30. FPISBLK:=((m and %001111000000000000) = %110000000000000);
  31. end;
  32. function FPISREG(m : mode_t): boolean;
  33. begin
  34. FPISREG:=((m and %001111000000000000) = %1000000000000000);
  35. end;
  36. function FPISFIFO(m : mode_t): boolean;
  37. begin
  38. FPISFIFO:=((m and %001111000000000000) = %1000000000000);
  39. end;
  40. function wifexited(status : cint): cint;
  41. begin
  42. wifexited:=cint((status AND 127) =0);
  43. end;
  44. function wexitstatus(status : cint): cint;
  45. begin
  46. wexitstatus:=(status and 127) shr 8;
  47. end;
  48. function wstopsig(status : cint): cint;
  49. begin
  50. wstopsig:=(status and 127) shr 8;
  51. end;
  52. const wstopped=127;
  53. function wifsignaled(status : cint): cint;
  54. begin
  55. wifsignaled:=cint(((status and 127)<>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.2 2003-01-21 15:34:59 marco
  64. * fix octal that broke 1.0.x
  65. Revision 1.1 2003/01/05 19:01:28 marco
  66. * FreeBSD compiles now with baseunix mods.
  67. Revision 1.4 2002/11/12 14:19:46 marco
  68. * fixes to macro
  69. Revision 1.3 2002/10/26 18:27:51 marco
  70. * First series POSIX calls commits. Including getcwd.
  71. Revision 1.2 2002/09/07 16:01:17 peter
  72. * old logs removed and tabs fixed
  73. Revision 1.1 2002/08/19 12:29:11 marco
  74. * First working POSIX *BSD system unit.
  75. }