home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lxapi32.zip / Include / Linux / posix_types.h < prev    next >
C/C++ Source or Header  |  2002-04-26  |  2KB  |  59 lines

  1. /* $Id: posix_types.h,v 1.2 2002/04/26 23:09:14 smilcke Exp $ */
  2.  
  3. #ifndef _LINUX_POSIX_TYPES_H
  4. #define _LINUX_POSIX_TYPES_H
  5.  
  6. /*
  7.  * This file is generally used by user-level software, so you need to
  8.  * be a little careful about namespace pollution etc.  Also, we cannot
  9.  * assume GCC is being used.
  10.  */
  11.  
  12. #ifndef NULL
  13. # define NULL        ((void *) 0)
  14. #endif
  15.  
  16. /*
  17.  * This allows for 1024 file descriptors: if NR_OPEN is ever grown
  18.  * beyond that you'll have to change this too. But 1024 fd's seem to be
  19.  * enough even for such "real" unices like OSF/1, so hopefully this is
  20.  * one limit that doesn't have to be changed [again].
  21.  *
  22.  * Note that POSIX wants the FD_CLEAR(fd,fdsetp) defines to be in
  23.  * <sys/time.h> (and thus <linux/time.h>) - but this is a more logical
  24.  * place for them. Solved by having dummy defines in <sys/time.h>.
  25.  */
  26.  
  27. /*
  28.  * Those macros may have been defined in <gnu/types.h>. But we always
  29.  * use the ones here.
  30.  */
  31. #undef __NFDBITS
  32. #define __NFDBITS    (8 * sizeof(unsigned long))
  33.  
  34. #undef __FD_SETSIZE
  35. #define __FD_SETSIZE    1024
  36.  
  37. #undef __FDSET_LONGS
  38. #define __FDSET_LONGS    (__FD_SETSIZE/__NFDBITS)
  39.  
  40. #undef __FDELT
  41. #define    __FDELT(d)    ((d) / __NFDBITS)
  42.  
  43. #undef __FDMASK
  44. #define    __FDMASK(d)    (1UL << ((d) % __NFDBITS))
  45.  
  46. typedef struct {
  47.     unsigned long fds_bits [__FDSET_LONGS];
  48. } __kernel_fd_set;
  49.  
  50. /* Type of a signal handler.  */
  51. typedef void (*__kernel_sighandler_t)(int);
  52.  
  53. /* Type of a SYSV IPC key.  */
  54. typedef int __kernel_key_t;
  55.  
  56. #include <asm/posix_types.h>
  57.  
  58. #endif /* _LINUX_POSIX_TYPES_H */
  59.