home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / lemacs-19.6 / src / getpagesize.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-22  |  686 b   |  40 lines

  1. #ifdef BSD
  2. #ifndef BSD4_1
  3. #define HAVE_GETPAGESIZE
  4. #endif
  5. #endif
  6.  
  7. #ifdef __hpux
  8. #include <sys/types.h>
  9. static size_t getpagesize() { return( 4096 ); }
  10. #define HAVE_GETPAGESIZE
  11. #endif
  12.   
  13. #ifdef HAVE_SYSCONF
  14. #include <sys/unistd.h>
  15.  
  16. #define getpagesize() sysconf(_SC_PAGESIZE)
  17.  
  18. #else /* not HAVE_SYSCONF */
  19.  
  20. #ifndef HAVE_GETPAGESIZE
  21.  
  22. #include <sys/param.h>
  23.  
  24. #ifdef EXEC_PAGESIZE
  25. #define getpagesize() EXEC_PAGESIZE
  26. #else
  27. #ifdef NBPG
  28. #define getpagesize() NBPG * CLSIZE
  29. #ifndef CLSIZE
  30. #define CLSIZE 1
  31. #endif /* no CLSIZE */
  32. #else /* no NBPG */
  33. #define getpagesize() NBPC
  34. #endif /* no NBPG */
  35. #endif /* no EXEC_PAGESIZE */
  36.  
  37. #endif /* not HAVE_GETPAGESIZE */
  38.  
  39. #endif /* not HAVE_SYSCONF */
  40.