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

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