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

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