home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / e20313sr.zip / emacs / 20.3.1 / src / getpagesize.h < prev    next >
C/C++ Source or Header  |  1999-07-31  |  1KB  |  42 lines

  1. /* Emulate getpagesize on systems that lack it.  */
  2.  
  3. #ifndef HAVE_GETPAGESIZE
  4.  
  5. # ifdef VMS
  6. #  define getpagesize() 512
  7. # endif
  8.  
  9. # ifdef HAVE_UNISTD_H
  10. #  include <unistd.h>
  11. # endif
  12.  
  13. # ifdef _SC_PAGESIZE
  14. #  define getpagesize() sysconf(_SC_PAGESIZE)
  15. # else /* no _SC_PAGESIZE */
  16. #  ifdef HAVE_SYS_PARAM_H
  17. #   include <sys/param.h>
  18. #   ifdef EXEC_PAGESIZE
  19. #    define getpagesize() EXEC_PAGESIZE
  20. #   else /* no EXEC_PAGESIZE */
  21. #    ifdef NBPG
  22. #     define getpagesize() NBPG * CLSIZE
  23. #     ifndef CLSIZE
  24. #      define CLSIZE 1
  25. #     endif /* no CLSIZE */
  26. #    else /* no NBPG */
  27. #     ifdef NBPC
  28. #      define getpagesize() NBPC
  29. #     else /* no NBPC */
  30. #      ifdef PAGESIZE
  31. #       define getpagesize() PAGESIZE
  32. #      endif /* PAGESIZE */
  33. #     endif /* no NBPC */
  34. #    endif /* no NBPG */
  35. #   endif /* no EXEC_PAGESIZE */
  36. #  else /* no HAVE_SYS_PARAM_H */
  37. #   define getpagesize() 8192    /* punt totally */
  38. #  endif /* no HAVE_SYS_PARAM_H */
  39. # endif /* no _SC_PAGESIZE */
  40.  
  41. #endif /* no HAVE_GETPAGESIZE */
  42.