kernel-features.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Set flags signalling availability of kernel features based on given
  2. kernel version number.
  3. Copyright (C) 1999-2003, 2004, 2005 Free Software Foundation, Inc.
  4. This file is part of the GNU C Library.
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with the GNU C Library; if not, write to the Free
  15. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  16. 02111-1307 USA. */
  17. /* This file must not contain any C code. At least it must be protected
  18. to allow using the file also in assembler files. */
  19. #if defined __mips__
  20. # include <sgidefs.h>
  21. #endif
  22. #include <linux/version.h>
  23. #define __LINUX_KERNEL_VERSION LINUX_VERSION_CODE
  24. /* Real-time signal became usable in 2.1.70. */
  25. #if __LINUX_KERNEL_VERSION >= 131398
  26. # define __ASSUME_REALTIME_SIGNALS 1
  27. #endif
  28. /* Beginning with 2.5.63 support for realtime and monotonic clocks and
  29. timers based on them is available. */
  30. #if __LINUX_KERNEL_VERSION >= 132415
  31. # define __ASSUME_POSIX_TIMERS 1
  32. #endif
  33. /* On x86, the set_thread_area syscall was introduced in 2.5.29, but its
  34. semantics was changed in 2.5.30, and again after 2.5.31. */
  35. #if __LINUX_KERNEL_VERSION >= 132384 && defined __i386__
  36. # define __ASSUME_SET_THREAD_AREA_SYSCALL 1
  37. #endif
  38. /* We can use the LDTs for threading with Linux 2.3.99 and newer. */
  39. #if __LINUX_KERNEL_VERSION >= 131939
  40. # define __ASSUME_LDT_WORKS 1
  41. #endif
  42. /* Starting with 2.4.5 kernels PPC passes the AUXV in the standard way
  43. and the vfork syscall made it into the official kernel. */
  44. #if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__
  45. # define __ASSUME_STD_AUXV 1
  46. # define __ASSUME_VFORK_SYSCALL 1
  47. #endif
  48. /* The vfork syscall on x86 and arm was definitely available in 2.4. */
  49. #if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __arm__)
  50. # define __ASSUME_VFORK_SYSCALL 1
  51. #endif
  52. /* Starting with version 2.6.4-rc1 the getdents syscall returns d_type
  53. * information as well and in between 2.6.5 and 2.6.8 most compat wrappers
  54. * were fixed too. Except s390{,x} which was fixed in 2.6.11. */
  55. #if (__LINUX_KERNEL_VERSION >= 0x020608 && !defined __s390__) \
  56. || (__LINUX_KERNEL_VERSION >= 0x02060b && defined __s390__)
  57. # define __ASSUME_GETDENTS32_D_TYPE 1
  58. #endif
  59. /* These features were surely available with 2.4.12. */
  60. #if __LINUX_KERNEL_VERSION >= 132108 && defined __mc68000__
  61. # define __ASSUME_MMAP2_SYSCALL 1
  62. # define __ASSUME_TRUNCATE64_SYSCALL 1
  63. # define __ASSUME_STAT64_SYSCALL 1
  64. # define __ASSUME_FCNTL64 1
  65. # define __ASSUME_VFORK_SYSCALL 1
  66. #endif