kernel-features.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. /* These features were surely available with 2.4.12. */
  53. #if __LINUX_KERNEL_VERSION >= 132108 && defined __mc68000__
  54. # define __ASSUME_MMAP2_SYSCALL 1
  55. # define __ASSUME_TRUNCATE64_SYSCALL 1
  56. # define __ASSUME_STAT64_SYSCALL 1
  57. # define __ASSUME_FCNTL64 1
  58. # define __ASSUME_VFORK_SYSCALL 1
  59. #endif