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

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