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

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