root/include/linux/types.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _LINUX_TYPES_H
   2 #define _LINUX_TYPES_H
   3 
   4 #ifndef _SIZE_T
   5 #define _SIZE_T
   6 typedef unsigned int size_t;
   7 #endif
   8 
   9 #ifndef _SSIZE_T
  10 #define _SSIZE_T
  11 typedef int ssize_t;
  12 #endif
  13 
  14 #ifndef _TIME_T
  15 #define _TIME_T
  16 typedef long time_t;
  17 #endif
  18 
  19 #ifndef _CLOCK_T
  20 #define _CLOCK_T
  21 typedef long clock_t;
  22 #endif
  23 
  24 #ifndef _PTRDIFF_T
  25 #define _PTRDIFF_T
  26 typedef int ptrdiff_t;
  27 #endif
  28 
  29 #ifndef NULL
  30 #define NULL ((void *) 0)
  31 #endif
  32 
  33 typedef int pid_t;
  34 typedef unsigned short uid_t;
  35 typedef unsigned short gid_t;
  36 typedef unsigned short dev_t;
  37 #ifdef OLD_LINUX
  38 typedef unsigned short ino_t;
  39 #else
  40 typedef unsigned long ino_t;
  41 #endif
  42 typedef unsigned short mode_t;
  43 typedef unsigned short umode_t;
  44 typedef unsigned short nlink_t;
  45 typedef int daddr_t;
  46 typedef long off_t;
  47 #define _LOFF_T
  48 typedef long long loff_t;
  49 
  50 /* bsd */
  51 typedef unsigned char u_char;
  52 typedef unsigned short u_short;
  53 typedef unsigned int u_int;
  54 typedef unsigned long u_long;
  55 
  56 /* sysv */
  57 typedef unsigned char unchar;
  58 typedef unsigned short ushort;
  59 typedef unsigned int uint;
  60 typedef unsigned long ulong;
  61 
  62 typedef char *caddr_t;
  63 
  64 typedef unsigned char cc_t;
  65 typedef unsigned int speed_t;
  66 typedef unsigned long tcflag_t;
  67 
  68 /*
  69  * This allows for 256 file descriptors: if NR_OPEN is ever grown beyond that
  70  * you'll have to change this too. But 256 fd's seem to be enough even for such
  71  * "real" unices like SunOS, so hopefully this is one limit that doesn't have
  72  * to be changed.
  73  *
  74  * Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in <sys/time.h>
  75  * (and thus <linux/time.h>) - but this is a more logical place for them. Solved
  76  * by having dummy defines in <sys/time.h>.
  77  */
  78 
  79 /*
  80  * Those macros may have been defined in <gnu/types.h>. But we always
  81  * use the ones here. 
  82  */
  83 #undef __FDSET_LONGS
  84 #define __FDSET_LONGS 8
  85 
  86 typedef struct fd_set {
  87         unsigned long fds_bits [__FDSET_LONGS];
  88 } fd_set;
  89 
  90 #undef __NFDBITS
  91 #define __NFDBITS       (8 * sizeof(unsigned long))
  92 
  93 #undef __FD_SETSIZE
  94 #define __FD_SETSIZE    (__FDSET_LONGS*__NFDBITS)
  95 
  96 #undef  __FD_SET
  97 #define __FD_SET(fd,fdsetp) \
  98                 __asm__ __volatile__("btsl %1,%0": \
  99                         "=m" (*(fd_set *) (fdsetp)):"r" ((int) (fd)))
 100 
 101 #undef  __FD_CLR
 102 #define __FD_CLR(fd,fdsetp) \
 103                 __asm__ __volatile__("btrl %1,%0": \
 104                         "=m" (*(fd_set *) (fdsetp)):"r" ((int) (fd)))
 105 
 106 #undef  __FD_ISSET
 107 #define __FD_ISSET(fd,fdsetp) (__extension__ ({ \
 108                 unsigned char __result; \
 109                 __asm__ __volatile__("btl %1,%2 ; setb %0" \
 110                         :"=q" (__result) :"r" ((int) (fd)), \
 111                         "m" (*(fd_set *) (fdsetp))); \
 112                 __result; }))
 113 
 114 #undef  __FD_ZERO
 115 #define __FD_ZERO(fdsetp) \
 116                 __asm__ __volatile__("cld ; rep ; stosl" \
 117                         :"=m" (*(fd_set *) (fdsetp)) \
 118                         :"a" (0), "c" (__FDSET_LONGS), \
 119                         "D" ((fd_set *) (fdsetp)) :"cx","di")
 120 
 121 struct ustat {
 122         daddr_t f_tfree;
 123         ino_t f_tinode;
 124         char f_fname[6];
 125         char f_fpack[6];
 126 };
 127 
 128 #endif

/* [previous][next][first][last][top][bottom][index][help] */