home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / types.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-21  |  2.9 KB  |  114 lines

  1. /*
  2.  *    @(#) types.h 2.3 88/06/21 
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
  5.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
  6.  *    This Module contains Proprietary Information of
  7.  *    The Santa Cruz Operation, Microsoft Corporation
  8.  *    and AT&T, and should be treated as Confidential.
  9.  */
  10.  
  11. /*
  12.  * THIS FILE CONTAINS CODE WHICH IS SPECIFIC TO THE
  13.  * INTEL 80286 CPU AND MAY REQUIRE MODIFICATION
  14.  * WHEN ADAPTING XENIX TO NEW HARDWARE.
  15.  */
  16.  
  17. typedef    struct { int r[1]; }    *physadr;
  18. typedef    long        daddr_t;
  19. typedef    char        *caddr_t;
  20. typedef    unsigned short    ushort;
  21. typedef    unsigned short    ino_t;
  22. typedef    char        cnt_t;
  23. typedef    long        time_t;
  24. #ifdef M_I386
  25. typedef    int        label_t[6];    /* return, sp, si, di, bp */
  26. #else
  27. typedef    int        label_t[6];    /* return, sp, si, di, bp */
  28. #endif
  29. typedef    short        dev_t;
  30. typedef    long        off_t;
  31. typedef    unsigned long    paddr_t;
  32. typedef    unsigned short    mloc_t;        /* memory region location */
  33. typedef    unsigned short    msize_t;    /* memory region size */
  34. typedef long        key_t;        /* IPC key          */
  35. typedef int         pfn_t;
  36. typedef unsigned int    uint;
  37.  
  38. #ifdef M_I386
  39. #define    inodep_t    struct inode *
  40. #define    inodepp_t    struct inode **
  41. #define    filep_t        struct file *
  42. #else
  43. #define    inodep_t    struct inode far *
  44. #define    inodepp_t    struct inode far * far *
  45. #define    filep_t        struct file far *
  46. #endif
  47.  
  48.  
  49. /* 80286 special types */
  50.  
  51. #ifdef M_I286
  52. #define    faddr_t        char far *
  53. #define    fdesc_t        struct desctab far    /* far ldt entry */
  54. #else
  55. #define    faddr_t        char *        /* same as caddr_t for 8086/386 */
  56. #endif
  57.  
  58.  
  59. /* 'void' type compatibility */
  60. #ifdef    M_OLDVOID
  61. typedef    int    void;
  62. #endif
  63.  
  64. /* 'unsigned' type compatibility */
  65. #ifdef    M_OLDSIGN    /* { */
  66.  
  67. typedef    char    uchar_t;
  68. typedef    long    ulong_t;
  69.  
  70. #define    GETUCHAR(uc)    (0xff & (uc))        /* extract value */
  71. /* WARNING: you will lose the high bit */
  72. #define    GETULONG(ul)    (0x7fffffffL & (ul))    /* extract value */
  73.  
  74. #else            /* }{ */
  75.  
  76. typedef unsigned char uchar_t;
  77. typedef unsigned long ulong_t;
  78. #define    GETUCHAR(uc)    (uc)
  79. #define    GETULONG(ul)    (ul)
  80.  
  81. #endif            /* } */
  82.  
  83. struct saddr {            
  84.     unsigned short    sa_seg;
  85.     long        sa_off;
  86. };
  87.  
  88. #define    NBBY    8        /* number of bits in a byte */
  89.  
  90. /*
  91.  * Select uses bit masks of file descriptors in longs.
  92.  * These macros manipulate such bit fields (the filesystem macros use chars).
  93.  * FD_SETSIZE may be defined by the user, but the default here
  94.  * should be >= NOFILE (param.h).
  95.  */
  96. #ifndef    FD_SETSIZE
  97. #define    FD_SETSIZE    60
  98. #endif
  99.  
  100. typedef long    fd_mask;
  101. #define NFDBITS    (sizeof(fd_mask) * NBBY)    /* bits per mask */
  102. #ifndef howmany
  103. #define    howmany(x, y)    (((x)+((y)-1))/(y))
  104. #endif
  105.  
  106. typedef    struct fd_set {
  107.     fd_mask    fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  108. } fd_set;
  109.  
  110. #define    FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
  111. #define    FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
  112. #define    FD_ISSET(n, p)    ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
  113. #define FD_ZERO(p)    bzero((caddr_t)(p), sizeof(*(p)))
  114.