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 #define __FDSET_LONGS 8
  77 typedef struct fd_set {
  78         unsigned long fd_mask[__FDSET_LONGS];
  79 } fd_set;
  80 
  81 #define __FD_SETSIZE (__FDSET_LONGS*32)
  82 
  83 #define __FD_SET(fd,fdsetp) \
  84 __asm__ __volatile__("btsl %1,%0":"=m" (*(struct fd_set *)fdsetp):"r" ((int) fd))
  85 
  86 #define __FD_CLR(fd,fdsetp) \
  87 __asm__ __volatile__("btrl %1,%0":"=m" (*(struct fd_set *)fdsetp):"r" ((int) fd))
  88 
  89 #define __FD_ISSET(fd,fdsetp) \
  90 ({ char __result; \
  91 __asm__ __volatile__("btl %1,%2 ; setb %0" \
  92         :"=q" (__result) \
  93         :"r" ((int) fd),"m" (*(struct fd_set *) fdsetp)); \
  94 __result; })
  95 
  96 #define __FD_ZERO(fdsetp) \
  97 __asm__ __volatile__("cld ; rep ; stosl" \
  98         :"=m" (*(struct fd_set *) fdsetp) \
  99         :"a" (0), "c" (__FDSET_LONGS), "D" ((struct fd_set *) fdsetp) \
 100         :"cx","di")
 101 
 102 struct ustat {
 103         daddr_t f_tfree;
 104         ino_t f_tinode;
 105         char f_fname[6];
 106         char f_fpack[6];
 107 };
 108 
 109 #endif

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