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 
  48 #ifndef __STRICT_ANSI__
  49 #define _LOFF_T
  50 typedef long long loff_t;
  51 #endif
  52 
  53 /* bsd */
  54 typedef unsigned char u_char;
  55 typedef unsigned short u_short;
  56 typedef unsigned int u_int;
  57 typedef unsigned long u_long;
  58 
  59 /* sysv */
  60 typedef unsigned char unchar;
  61 typedef unsigned short ushort;
  62 typedef unsigned int uint;
  63 typedef unsigned long ulong;
  64 
  65 typedef char *caddr_t;
  66 
  67 typedef unsigned char cc_t;
  68 typedef unsigned int speed_t;
  69 typedef unsigned long tcflag_t;
  70 
  71 /*
  72  * This allows for 256 file descriptors: if NR_OPEN is ever grown beyond that
  73  * you'll have to change this too. But 256 fd's seem to be enough even for such
  74  * "real" unices like SunOS, so hopefully this is one limit that doesn't have
  75  * to be changed.
  76  *
  77  * Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in <sys/time.h>
  78  * (and thus <linux/time.h>) - but this is a more logical place for them. Solved
  79  * by having dummy defines in <sys/time.h>.
  80  */
  81 
  82 /*
  83  * Those macros may have been defined in <gnu/types.h>. But we always
  84  * use the ones here. 
  85  */
  86 #undef __FDSET_LONGS
  87 #define __FDSET_LONGS 8
  88 
  89 typedef struct fd_set {
  90         unsigned long fds_bits [__FDSET_LONGS];
  91 } fd_set;
  92 
  93 #undef __NFDBITS
  94 #define __NFDBITS       (8 * sizeof(unsigned long))
  95 
  96 #undef __FD_SETSIZE
  97 #define __FD_SETSIZE    (__FDSET_LONGS*__NFDBITS)
  98 
  99 #undef  __FD_SET
 100 #define __FD_SET(fd,fdsetp) \
 101                 __asm__ __volatile__("btsl %1,%0": \
 102                         "=m" (*(fd_set *) (fdsetp)):"r" ((int) (fd)))
 103 
 104 #undef  __FD_CLR
 105 #define __FD_CLR(fd,fdsetp) \
 106                 __asm__ __volatile__("btrl %1,%0": \
 107                         "=m" (*(fd_set *) (fdsetp)):"r" ((int) (fd)))
 108 
 109 #undef  __FD_ISSET
 110 #define __FD_ISSET(fd,fdsetp) (__extension__ ({ \
 111                 unsigned char __result; \
 112                 __asm__ __volatile__("btl %1,%2 ; setb %0" \
 113                         :"=q" (__result) :"r" ((int) (fd)), \
 114                         "m" (*(fd_set *) (fdsetp))); \
 115                 __result; }))
 116 
 117 #undef  __FD_ZERO
 118 #define __FD_ZERO(fdsetp) \
 119                 __asm__ __volatile__("cld ; rep ; stosl" \
 120                         :"=m" (*(fd_set *) (fdsetp)) \
 121                         :"a" (0), "c" (__FDSET_LONGS), \
 122                         "D" ((fd_set *) (fdsetp)) :"cx","di")
 123 
 124 struct ustat {
 125         daddr_t f_tfree;
 126         ino_t f_tinode;
 127         char f_fname[6];
 128         char f_fpack[6];
 129 };
 130 
 131 #endif

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