home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / W2KPRK.iso / apps / posix / source / INCLUDE / DF / MISC.H < prev   
C/C++ Source or Header  |  1999-11-17  |  3KB  |  100 lines

  1. #include <limits.h>
  2.  
  3. #define MACHINE "i386"
  4.  
  5. #define quad "struct _quad"
  6. #if 0
  7. #define emalloc malloc
  8. #endif
  9.  
  10. #define MAXNAMLEN NAME_MAX
  11. #define MAXPATHLEN PATH_MAX
  12.  
  13. /*
  14. * File system parameters and macros    //DF_DSC  May not be meaningful in NT
  15. *
  16. * The file system is made out of blocks of at most MAXBSIZE units, with
  17. * smaller units (fragments) only in the last direct block.    MAXBSIZE
  18. * primarily determines the size of buffers in the buffer pool.    It may be
  19. * made larger without any effect on existing file systems; however making
  20. * it smaller make make some file systems unmountable.
  21. */
  22.     #define MAXBSIZE    8192
  23.     #define MAXFRAG     8
  24.  
  25.  
  26. #define BLOCK_SIZE 512
  27. #define FD_SETSIZE 256
  28.  
  29. /* fnmatch() */
  30. #define    FNM_PATHNAME    0x01    /* match pathnames, not filenames */
  31. #define    FNM_QUOTE    0x02    /* escape special chars with \ */
  32.  
  33. typedef unsigned long fd_set;
  34. #define NFDBITS 32
  35.  
  36. #define    FD_SET(n, p)    (*p |= (1 << ((n) % NFDBITS)))
  37. #define    FD_CLR(n, p)    (*p &= ~(1 << ((n) % NFDBITS)))
  38. #define    FD_ISSET(n, p)    (*p & (1 << ((n) % NFDBITS)))
  39.  
  40. typedef unsigned char u_char;
  41. typedef unsigned int u_int;
  42. typedef unsigned short u_short;
  43. typedef unsigned long u_long;
  44. struct    _quad      {     long   val[2];  };
  45.  
  46. typedef    long *    qaddr_t;    /* should be typedef quad * qaddr_t; */
  47. extern int    optind;            /* character checked for validity */
  48. extern char    *optarg;        /* argument associated with option */
  49.  
  50.  
  51. #define LITTLE_ENDIAN 1
  52. #define BYTE_ORDER LITTLE_ENDIAN 
  53. union wait {
  54.     int    w_status;        /* used in syscall */
  55.     /*
  56.      * Terminated process status.
  57.      */
  58.     struct {
  59. #if BYTE_ORDER == LITTLE_ENDIAN 
  60.         unsigned int    w_termsig:7,    /* termination signal */
  61.                 w_Coredump:1,    /* core dump indicator */
  62.                 w_retcode:8,    /* exit code if w_termsig==0 */
  63.                 w_Filler:16;    /* upper bits filler */
  64. #endif
  65. #if BYTE_ORDER == BIG_ENDIAN 
  66.         unsigned int    w_Filler:16,    /* upper bits filler */
  67.                 w_retcode:8,    /* exit code if w_termsig==0 */
  68.                 w_Coredump:1,    /* core dump indicator */
  69.                 w_termsig:7;    /* termination signal */
  70. #endif
  71.     } w_T;
  72.     /*
  73.      * Stopped process status.  Returned
  74.      * only for traced children unless requested
  75.      * with the WUNTRACED option bit.
  76.      */
  77.     struct {
  78. #if BYTE_ORDER == LITTLE_ENDIAN 
  79.         unsigned int    w_Stopval:8,    /* == W_STOPPED if stopped */
  80.                 w_Stopsig:8,    /* signal that stopped us */
  81.                 w_Filler:16;    /* upper bits filler */
  82. #endif
  83. #if BYTE_ORDER == BIG_ENDIAN 
  84.         unsigned int    w_Filler:16,    /* upper bits filler */
  85.                 w_Stopsig:8,    /* signal that stopped us */
  86.                 w_Stopval:8;    /* == W_STOPPED if stopped */
  87. #endif
  88.     } w_S;
  89. };
  90.  
  91.  
  92. /*
  93.  * Structure returned by gettimeofday(2) system call,
  94.  * and used in other calls.
  95.  */
  96. struct timeval {
  97.     long    tv_sec;        /* seconds */
  98.     long    tv_usec;    /* and microseconds */
  99. };
  100.