types.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
  3. * The President and Fellows of Harvard College.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the University nor the names of its contributors
  14. * may be used to endorse or promote products derived from this software
  15. * without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
  18. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. * ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
  21. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. * SUCH DAMAGE.
  28. */
  29. #ifndef _SYS_TYPES_H_
  30. #define _SYS_TYPES_H_
  31. /*
  32. * This header file is supposed to define standard system types,
  33. * stuff like size_t and pid_t, as well as define a few other
  34. * standard symbols like NULL.
  35. *
  36. * There are no such types that are user-level only.
  37. */
  38. /* Get the exported kernel definitions, protected with __ */
  39. #include <kern/types.h>
  40. /* Pick up stuff that needs to be defined individually due to standards. */
  41. #include <types/size_t.h>
  42. #include <sys/null.h>
  43. /*
  44. * Define the rest with user-visible names.
  45. *
  46. * Note that the standards-compliance stuff is not by any means
  47. * complete here yet...
  48. */
  49. typedef __ssize_t ssize_t;
  50. typedef __ptrdiff_t ptrdiff_t;
  51. /* ...and machine-independent from <kern/types.h>. */
  52. typedef __blkcnt_t blkcnt_t;
  53. typedef __blksize_t blksize_t;
  54. typedef __daddr_t daddr_t;
  55. typedef __dev_t dev_t;
  56. typedef __fsid_t fsid_t;
  57. typedef __gid_t gid_t;
  58. typedef __in_addr_t in_addr_t;
  59. typedef __in_port_t in_port_t;
  60. typedef __ino_t ino_t;
  61. typedef __mode_t mode_t;
  62. typedef __nlink_t nlink_t;
  63. typedef __off_t off_t;
  64. typedef __pid_t pid_t;
  65. typedef __rlim_t rlim_t;
  66. typedef __sa_family_t sa_family_t;
  67. typedef __time_t time_t;
  68. typedef __uid_t uid_t;
  69. typedef __nfds_t nfds_t;
  70. typedef __socklen_t socklen_t;
  71. /*
  72. * Number of bits per byte.
  73. */
  74. #define CHAR_BIT __CHAR_BIT
  75. #endif /* _SYS_TYPES_H_ */