Back to index

glibc  2.9
kernel-features.h
Go to the documentation of this file.
00001 /* Set flags signalling availability of kernel features based on given
00002    kernel version number.
00003    Copyright (C) 1999-2006, 2007, 2008 Free Software Foundation, Inc.
00004    This file is part of the GNU C Library.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 /* This file must not contain any C code.  At least it must be protected
00022    to allow using the file also in assembler files.  */
00023 
00024 #ifndef __LINUX_KERNEL_VERSION
00025 /* We assume the worst; all kernels should be supported.  */
00026 # define __LINUX_KERNEL_VERSION    0
00027 #endif
00028 
00029 /* We assume for __LINUX_KERNEL_VERSION the same encoding used in
00030    linux/version.h.  I.e., the major, minor, and subminor all get a
00031    byte with the major number being in the highest byte.  This means
00032    we can do numeric comparisons.
00033 
00034    In the following we will define certain symbols depending on
00035    whether the describes kernel feature is available in the kernel
00036    version given by __LINUX_KERNEL_VERSION.  We are not always exactly
00037    recording the correct versions in which the features were
00038    introduced.  If somebody cares these values can afterwards be
00039    corrected.  Most of the numbers here are set corresponding to
00040    2.2.0.  */
00041 
00042 /* `getcwd' system call.  */
00043 #if __LINUX_KERNEL_VERSION >= 131584
00044 # define __ASSUME_GETCWD_SYSCALL   1
00045 #endif
00046 
00047 /* Real-time signal became usable in 2.1.70.  */
00048 #if __LINUX_KERNEL_VERSION >= 131398
00049 # define __ASSUME_REALTIME_SIGNALS 1
00050 #endif
00051 
00052 /* When were the `pread'/`pwrite' syscalls introduced?  */
00053 #if __LINUX_KERNEL_VERSION >= 131584
00054 # define __ASSUME_PREAD_SYSCALL           1
00055 # define __ASSUME_PWRITE_SYSCALL   1
00056 #endif
00057 
00058 /* When was `poll' introduced?  */
00059 #if __LINUX_KERNEL_VERSION >= 131584
00060 # define __ASSUME_POLL_SYSCALL            1
00061 #endif
00062 
00063 /* The `lchown' syscall was introduced in 2.1.80.  */
00064 #if __LINUX_KERNEL_VERSION >= 131408
00065 # define __ASSUME_LCHOWN_SYSCALL   1
00066 #endif
00067 
00068 /* When did the `setresuid' sysall became available?  */
00069 #if __LINUX_KERNEL_VERSION >= 131584 && !defined __sparc__
00070 # define __ASSUME_SETRESUID_SYSCALL       1
00071 #endif
00072 
00073 /* The SIOCGIFNAME ioctl is available starting with 2.1.50.  */
00074 #if __LINUX_KERNEL_VERSION >= 131408
00075 # define __ASSUME_SIOCGIFNAME             1
00076 #endif
00077 
00078 /* MSG_NOSIGNAL was at least available with Linux 2.2.0.  */
00079 #if __LINUX_KERNEL_VERSION >= 131584
00080 # define __ASSUME_MSG_NOSIGNAL            1
00081 #endif
00082 
00083 /* The sendfile syscall was introduced in 2.2.0.  */
00084 #if __LINUX_KERNEL_VERSION >= 131584
00085 # define __ASSUME_SENDFILE         1
00086 #endif
00087 
00088 /* Only very old kernels had no real symlinks for terminal descriptors
00089    in /proc/self/fd.  */
00090 #if __LINUX_KERNEL_VERSION >= 131584
00091 # define __ASSUME_PROC_SELF_FD_SYMLINK    1
00092 #endif
00093 
00094 /* On x86 another `getrlimit' syscall was added in 2.3.25.  */
00095 #if __LINUX_KERNEL_VERSION >= 131865 && defined __i386__
00096 # define __ASSUME_NEW_GETRLIMIT_SYSCALL   1
00097 #endif
00098 
00099 /* On x86 the truncate64/ftruncate64 syscalls were introduced in 2.3.31.  */
00100 #if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__
00101 # define __ASSUME_TRUNCATE64_SYSCALL      1
00102 #endif
00103 
00104 /* On x86 the mmap2 syscall was introduced in 2.3.31.  */
00105 #if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__
00106 # define __ASSUME_MMAP2_SYSCALL    1
00107 #endif
00108 
00109 /* On x86 the stat64/lstat64/fstat64 syscalls were introduced in 2.3.34.  */
00110 #if __LINUX_KERNEL_VERSION >= 131874 && defined __i386__
00111 # define __ASSUME_STAT64_SYSCALL   1
00112 #endif
00113 
00114 /* On sparc the truncate64/ftruncate64/mmap2/stat64/lstat64/fstat64
00115    syscalls were introduced in 2.3.35.  */
00116 #if __LINUX_KERNEL_VERSION >= 131875 \
00117     && (defined __sparc__ && !defined __arch64__)
00118 # define __ASSUME_TRUNCATE64_SYSCALL      1
00119 # define __ASSUME_MMAP2_SYSCALL           1
00120 # define __ASSUME_STAT64_SYSCALL   1
00121 #endif
00122 
00123 /* I know for sure that getrlimit are in 2.3.35 on powerpc.  */
00124 #if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__
00125 # define __ASSUME_NEW_GETRLIMIT_SYSCALL   1
00126 #endif
00127 
00128 /* I know for sure that these are in 2.3.35 on powerpc. But PowerPC64 does not
00129    support separate 64-bit syscalls, already 64-bit */
00130 #if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__ \
00131     && !defined __powerpc64__
00132 # define __ASSUME_TRUNCATE64_SYSCALL      1
00133 # define __ASSUME_STAT64_SYSCALL   1
00134 #endif
00135 
00136 /* Linux 2.3.39 introduced 32bit UID/GIDs.  Some platforms had 32
00137    bit type all along.  */
00138 #if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__
00139 # define __ASSUME_32BITUIDS        1
00140 #endif
00141 
00142 /* Linux 2.3.39 sparc added setresuid.  */
00143 #if __LINUX_KERNEL_VERSION >= 131879 && defined __sparc__
00144 # define __ASSUME_SETRESUID_SYSCALL       1
00145 #endif
00146 
00147 #if __LINUX_KERNEL_VERSION >= 131879
00148 # define __ASSUME_SETRESGID_SYSCALL       1
00149 #endif
00150 
00151 /* Linux 2.3.39 introduced IPC64.  Except for powerpc.  */
00152 #if __LINUX_KERNEL_VERSION >= 131879 && !defined __powerpc__
00153 # define __ASSUME_IPC64            1
00154 #endif
00155 
00156 /* We can use the LDTs for threading with Linux 2.3.99 and newer.  */
00157 #if __LINUX_KERNEL_VERSION >= 131939
00158 # define __ASSUME_LDT_WORKS        1
00159 #endif
00160 
00161 /* Linux 2.4.0 on PPC introduced a correct IPC64. But PowerPC64 does not
00162    support a separate 64-bit sys call, already 64-bit */
00163 #if __LINUX_KERNEL_VERSION >= 132096 && defined __powerpc__ \
00164     && !defined __powerpc64__
00165 # define __ASSUME_IPC64                   1
00166 #endif
00167 
00168 /* SH kernels got stat64, mmap2, and truncate64 during 2.4.0-test.  */
00169 #if __LINUX_KERNEL_VERSION >= 132096 && defined __sh__
00170 # define __ASSUME_TRUNCATE64_SYSCALL      1
00171 # define __ASSUME_MMAP2_SYSCALL           1
00172 # define __ASSUME_STAT64_SYSCALL   1
00173 #endif
00174 
00175 /* The changed st_ino field appeared in 2.4.0-test6.  But we cannot
00176    distinguish this version from other 2.4.0 releases.  Therefore play
00177    save and assume it available is for 2.4.1 and up.  However, SH is lame,
00178    and still does not have a 64-bit inode field.  */
00179 #if __LINUX_KERNEL_VERSION >= 132097 && !defined __alpha__ && !defined __sh__
00180 # define __ASSUME_ST_INO_64_BIT           1
00181 #endif
00182 
00183 /* To support locking of large files a new fcntl() syscall was introduced
00184    in 2.4.0-test7.  We test for 2.4.1 for the earliest version we know
00185    the syscall is available.  */
00186 #if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __sparc__)
00187 # define __ASSUME_FCNTL64          1
00188 #endif
00189 
00190 /* The AT_CLKTCK auxiliary vector entry was introduction in the 2.4.0
00191    series.  */
00192 #if __LINUX_KERNEL_VERSION >= 132097
00193 # define __ASSUME_AT_CLKTCK        1
00194 #endif
00195 
00196 /* Arm got fcntl64 in 2.4.4, PowerPC and SH have it also in 2.4.4 (I
00197    don't know when it got introduced).  But PowerPC64 does not support
00198    separate FCNTL64 call, FCNTL is already 64-bit */
00199 #if __LINUX_KERNEL_VERSION >= 132100 \
00200     && (defined __powerpc__ || defined __sh__) \
00201     && !defined __powerpc64__
00202 # define __ASSUME_FCNTL64          1
00203 #endif
00204 
00205 /* The getdents64 syscall was introduced in 2.4.0-test7.  We test for
00206    2.4.1 for the earliest version we know the syscall is available.  */
00207 #if __LINUX_KERNEL_VERSION >= 132097
00208 # define __ASSUME_GETDENTS64_SYSCALL      1
00209 #endif
00210 
00211 /* When did O_DIRECTORY became available?  Early in 2.3 but when?
00212    Be safe, use 2.3.99.  */
00213 #if __LINUX_KERNEL_VERSION >= 131939
00214 # define __ASSUME_O_DIRECTORY             1
00215 #endif
00216 
00217 /* Starting with one of the 2.4.0 pre-releases the Linux kernel passes
00218    up the page size information.  */
00219 #if __LINUX_KERNEL_VERSION >= 132097
00220 # define __ASSUME_AT_PAGESIZE             1
00221 #endif
00222 
00223 /* Starting with at least 2.4.0 the kernel passes the uid/gid unconditionally
00224    up to the child.  */
00225 #if __LINUX_KERNEL_VERSION >= 132097
00226 # define __ASSUME_AT_XID           1
00227 #endif
00228 
00229 /* Starting with 2.4.5 kernels PPC passes the AUXV in the standard way
00230    and the vfork syscall made it into the official kernel.  */
00231 #if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__
00232 # define __ASSUME_STD_AUXV         1
00233 # define __ASSUME_VFORK_SYSCALL           1
00234 #endif
00235 
00236 /* Starting with 2.4.5 kernels the mmap2 syscall made it into the official
00237    kernel.  But PowerPC64 does not support a separate MMAP2 call.  */
00238 #if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__ \
00239     && !defined __powerpc64__
00240 # define __ASSUME_MMAP2_SYSCALL           1
00241 #endif
00242 
00243 /* Starting with 2.4.21 PowerPC implements the new prctl syscall.
00244    This allows applications to get/set the Floating Point Exception Mode.  */
00245 #if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__
00246 # define __ASSUME_NEW_PRCTL_SYSCALL              1
00247 #endif
00248 
00249 /* Starting with 2.4.21 the PowerPC32 clone syscall works as expected.  */
00250 #if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc__ \
00251     && !defined __powerpc64__
00252 # define __ASSUME_FIXED_CLONE_SYSCALL            1
00253 #endif
00254 
00255 /* Starting with 2.4.21 PowerPC64 implements the new rt_sigreturn syscall.
00256    The new rt_sigreturn takes an ucontext pointer allowing rt_sigreturn
00257    to be used in the set/swapcontext implementation.  */
00258 #if __LINUX_KERNEL_VERSION >= (132096+21) && defined __powerpc64__
00259 # define __ASSUME_NEW_RT_SIGRETURN_SYSCALL              1
00260 #endif
00261 
00262 /* On x86, the set_thread_area syscall was introduced in 2.5.29, but its
00263    semantics was changed in 2.5.30, and again after 2.5.31.  */
00264 #if __LINUX_KERNEL_VERSION >= 132384 && defined __i386__
00265 # define __ASSUME_SET_THREAD_AREA_SYSCALL 1
00266 #endif
00267 
00268 /* The vfork syscall on x86 and arm was definitely available in 2.4.  */
00269 #if __LINUX_KERNEL_VERSION >= 132097 && defined __i386__
00270 # define __ASSUME_VFORK_SYSCALL           1
00271 #endif
00272 
00273 /* Alpha switched to a 64-bit timeval sometime before 2.2.0.  */
00274 #if __LINUX_KERNEL_VERSION >= 131584 && defined __alpha__
00275 # define __ASSUME_TIMEVAL64        1
00276 #endif
00277 
00278 /* The late 2.5 kernels saw a lot of new CLONE_* flags.  Summarize
00279    their availability with one define.  The changes were made first
00280    for i386 and the have to be done separately for the other archs.
00281    For i386 we pick 2.5.50 as the first version with support.
00282    For ia64, s390*, PPC, x86-64, and SH we pick 2.5.64 as the first
00283    version with support.  */
00284 #if ((__LINUX_KERNEL_VERSION >= 132402 && defined __i386__)           \
00285      || (__LINUX_KERNEL_VERSION >= 132416                      \
00286         && (defined __ia64__ || defined __s390__               \
00287             || defined __powerpc__ || defined __x86_64__ || defined __sh__)))
00288 # define __ASSUME_CLONE_THREAD_FLAGS      1
00289 #endif
00290 
00291 /* Beginning with 2.5.63 support for realtime and monotonic clocks and
00292    timers based on them is available.  */
00293 #if __LINUX_KERNEL_VERSION >= 132415
00294 # define __ASSUME_POSIX_TIMERS            1
00295 #endif
00296 
00297 /* Beginning with 2.6.12 the clock and timer supports CPU clocks.  */
00298 #if __LINUX_KERNEL_VERSION >= 0x2060c
00299 # define __ASSUME_POSIX_CPU_TIMERS 1
00300 #endif
00301 
00302 /* With kernel 2.4.17 we always have netlink support.  */
00303 #if __LINUX_KERNEL_VERSION >= (132096+17)
00304 # define __ASSUME_NETLINK_SUPPORT  1
00305 #endif
00306 
00307 /* The requeue futex functionality was introduced in 2.5.70.  */
00308 #if __LINUX_KERNEL_VERSION >= 132422
00309 # define __ASSUME_FUTEX_REQUEUE    1
00310 #endif
00311 
00312 /* The statfs64 syscalls are available in 2.5.74.  */
00313 #if __LINUX_KERNEL_VERSION >= 132426
00314 # define __ASSUME_STATFS64  1
00315 #endif
00316 
00317 /* Starting with at least 2.5.74 the kernel passes the setuid-like exec
00318    flag unconditionally up to the child.  */
00319 #if __LINUX_KERNEL_VERSION >= 132426
00320 # define __ASSUME_AT_SECURE 1
00321 #endif
00322 
00323 /* Starting with the 2.5.75 kernel the kernel fills in the correct value
00324    in the si_pid field passed as part of the siginfo_t struct to signal
00325    handlers.  */
00326 #if __LINUX_KERNEL_VERSION >= 132427
00327 # define __ASSUME_CORRECT_SI_PID   1
00328 #endif
00329 
00330 /* The tgkill syscall was instroduced for i386 in 2.5.75.  For Alpha
00331    it was introduced in 2.6.0-test1 which unfortunately cannot be
00332    distinguished from 2.6.0.  On x86-64, ppc, and ppc64 it was
00333    introduced in 2.6.0-test3. */
00334 #if (__LINUX_KERNEL_VERSION >= 132427 && defined __i386__) \
00335     || (__LINUX_KERNEL_VERSION >= 132609 && defined __alpha__) \
00336     || (__LINUX_KERNEL_VERSION >= 132609 && defined __x86_64__) \
00337     || (__LINUX_KERNEL_VERSION >= 132609 && defined __powerpc__) \
00338     || (__LINUX_KERNEL_VERSION >= 132609 && defined __sh__)
00339 # define __ASSUME_TGKILL    1
00340 #endif
00341 
00342 /* The utimes syscall has been available for some architectures
00343    forever.  For x86 it was introduced after 2.5.75, for x86-64,
00344    ppc, and ppc64 it was introduced in 2.6.0-test3.  */
00345 #if defined __alpha__ || defined __ia64__ \
00346     || defined __sparc__ \
00347     || (__LINUX_KERNEL_VERSION > 132427 && defined __i386__) \
00348     || (__LINUX_KERNEL_VERSION > 132609 && defined __x86_64__) \
00349     || (__LINUX_KERNEL_VERSION >= 132609 && defined __powerpc__) \
00350     || (__LINUX_KERNEL_VERSION >= 132609 && defined __sh__)
00351 # define __ASSUME_UTIMES    1
00352 #endif
00353 
00354 // XXX Disabled for now since the semantics we want is not achieved.
00355 #if 0
00356 /* The CLONE_STOPPED flag was introduced in the 2.6.0-test1 series.  */
00357 #if __LINUX_KERNEL_VERSION >= 132609
00358 # define __ASSUME_CLONE_STOPPED    1
00359 #endif
00360 #endif
00361 
00362 /* The fixed version of the posix_fadvise64 syscall appeared in
00363    2.6.0-test3.  At least for x86.  Powerpc support appeared in
00364    2.6.2, but for 32-bit userspace only.  */
00365 #if (__LINUX_KERNEL_VERSION >= 132609 && defined __i386__) \
00366     || (__LINUX_KERNEL_VERSION >= 132610 && defined __powerpc__ \
00367        && !defined __powerpc64__)
00368 # define __ASSUME_FADVISE64_64_SYSCALL    1
00369 #endif
00370 
00371 /* The PROT_GROWSDOWN/PROT_GROWSUP flags were introduced in the 2.6.0-test
00372    series.  */
00373 #if __LINUX_KERNEL_VERSION >= 132609
00374 # define __ASSUME_PROT_GROWSUPDOWN 1
00375 #endif
00376 
00377 /* Starting with 2.6.0 PowerPC adds signal/swapcontext support for Vector
00378    SIMD (AKA Altivec, VMX) instructions and register state.  This changes
00379    the overall size of the sigcontext and adds the swapcontext syscall.  */
00380 #if __LINUX_KERNEL_VERSION >= 132608 && defined __powerpc__
00381 # define __ASSUME_SWAPCONTEXT_SYSCALL     1
00382 #endif
00383 
00384 /* The CLONE_DETACHED flag is not necessary in 2.6.2 kernels, it is
00385    implied.  */
00386 #if __LINUX_KERNEL_VERSION >= 132610
00387 # define __ASSUME_NO_CLONE_DETACHED       1
00388 #endif
00389 
00390 /* Starting with version 2.6.4-rc1 the getdents syscall returns d_type
00391    information as well and in between 2.6.5 and 2.6.8 most compat wrappers
00392    were fixed too.  Except s390{,x} which was fixed in 2.6.11.  */
00393 #if (__LINUX_KERNEL_VERSION >= 0x020608 && !defined __s390__) \
00394     || (__LINUX_KERNEL_VERSION >= 0x02060b && defined __s390__)
00395 # define __ASSUME_GETDENTS32_D_TYPE       1
00396 #endif
00397 
00398 /* Starting with version 2.5.3, the initial location returned by `brk'
00399    after exec is always rounded up to the next page.  */
00400 #if __LINUX_KERNEL_VERSION >= 132355
00401 # define __ASSUME_BRK_PAGE_ROUNDED 1
00402 #endif
00403 
00404 /* Starting with version 2.6.9, the waitid system call is available.
00405    Except for powerpc{,64} and s390{,x}, where it is available in 2.6.12.  */
00406 #if (__LINUX_KERNEL_VERSION >= 0x020609 \
00407      && !defined __powerpc__ && !defined __s390__) \
00408     || (__LINUX_KERNEL_VERSION >= 0x02060c \
00409        && (defined __powerpc__ || defined __s390__))
00410 # define __ASSUME_WAITID_SYSCALL   1
00411 #endif
00412 
00413 /* Starting with version 2.6.9, SSI_IEEE_RAISE_EXCEPTION exists.  */
00414 #if __LINUX_KERNEL_VERSION >= 0x020609 && defined __alpha__
00415 #define __ASSUME_IEEE_RAISE_EXCEPTION     1
00416 #endif
00417 
00418 /* On sparc64 stat64/lstat64/fstat64 syscalls were introduced in 2.6.12.  */
00419 #if __LINUX_KERNEL_VERSION >= 0x02060c && defined __sparc__ \
00420     && defined __arch64__
00421 # define __ASSUME_STAT64_SYSCALL   1
00422 #endif
00423 
00424 /* Early kernel used "shm" as the filesystem name for the filesystem used
00425    for shm_open etc.  Later it is "tmpfs".  2.4.20 is a safe bet for the
00426    cutover.  */
00427 #if __LINUX_KERNEL_VERSION >= 0x02041a
00428 # define __ASSUME_TMPFS_NAME       1
00429 #endif
00430 
00431 /* pselect/ppoll were introduced just after 2.6.16-rc1.  Due to the way
00432    the kernel versions are advertised we can only rely on 2.6.17 to have
00433    the code.  On x86_64 and SH this appeared first in 2.6.19-rc1,
00434    on ia64 in 2.6.22-rc1 and on alpha just after 2.6.22-rc1.  */
00435 #if __LINUX_KERNEL_VERSION >= 0x020611 \
00436     && ((!defined __x86_64__ && !defined __sh__ && !defined __ia64__ \
00437         && !defined __alpha__) \
00438        || (__LINUX_KERNEL_VERSION >= 0x020613 \
00439            && (defined __x86_64__ || defined __sh__)) \
00440        || (__LINUX_KERNEL_VERSION >= 0x020616 && defined __ia64__) \
00441        || (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
00442 # define __ASSUME_PSELECT   1
00443 # define __ASSUME_PPOLL            1
00444 #endif
00445 
00446 /* The *at syscalls were introduced just after 2.6.16-rc1.  Due to the way the
00447    kernel versions are advertised we can only rely on 2.6.17 to have
00448    the code.  On PPC they were introduced in 2.6.17-rc1, on SH in 2.6.19-rc1
00449    and on Alpha just after 2.6.22-rc1.  */
00450 #if __LINUX_KERNEL_VERSION >= 0x020611 \
00451     && ((!defined __sh__ && !defined __alpha__) \
00452        || (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__) \
00453        || (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
00454 # define __ASSUME_ATFCTS    1
00455 #endif
00456 
00457 /* Support for inter-process robust mutexes was added in 2.6.17.  */
00458 #if __LINUX_KERNEL_VERSION >= 0x020611 \
00459     && ((!defined __sh__ && !defined __alpha__) \
00460        || (__LINUX_KERNEL_VERSION >= 0x020613 && defined __sh__) \
00461        || (__LINUX_KERNEL_VERSION >= 0x020617 && defined __alpha__))
00462 # define __ASSUME_SET_ROBUST_LIST  1
00463 #endif
00464 
00465 /* Support for PI futexes was added in 2.6.18.  */
00466 #if __LINUX_KERNEL_VERSION >= 0x020612
00467 # define __ASSUME_FUTEX_LOCK_PI    1
00468 #endif
00469 
00470 /* Support for utimensat syscall was added in 2.6.22, on alpha and s390
00471    only after 2.6.22-rc1.  */
00472 #if __LINUX_KERNEL_VERSION >= 0x020616 \
00473     && ((!defined __sh__ && !defined __alpha__) \
00474        || __LINUX_KERNEL_VERSION >= 0x020617)
00475 # define __ASSUME_UTIMENSAT 1
00476 #endif
00477 
00478 /* Support for private futexes was added in 2.6.22.  */
00479 #if __LINUX_KERNEL_VERSION >= 0x020616
00480 # define __ASSUME_PRIVATE_FUTEX    1
00481 #endif
00482 
00483 /* Support for fallocate was added in 2.6.23, on s390
00484    only after 2.6.23-rc1.  */
00485 #if __LINUX_KERNEL_VERSION >= 0x020617 \
00486     && ((!defined __s390__ && !defined __alpha__) \
00487        || (__LINUX_KERNEL_VERSION >= 0x020618 && defined __s390__))
00488 # define __ASSUME_FALLOCATE 1
00489 #endif
00490 
00491 /* Support for various CLOEXEC and NONBLOCK flags was added for x86,
00492    x86-64, PPC, IA-64, SPARC< and S390 in 2.6.23.  */
00493 #if __LINUX_KERNEL_VERSION >= 0x020617 \
00494     && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
00495        || defined __ia64__ || defined __sparc__ || defined __s390__)
00496 # define __ASSUME_O_CLOEXEC 1
00497 #endif
00498 
00499 /* Support for ADJ_OFFSET_SS_READ was added in 2.6.24.  */
00500 #if __LINUX_KERNEL_VERSION >= 0x020618
00501 # define __ASSUME_ADJ_OFFSET_SS_READ      1
00502 #endif
00503 
00504 /* Support for various CLOEXEC and NONBLOCK flags was added for x86,
00505    x86-64, PPC, IA-64, and SPARC in 2.6.27.  */
00506 #if __LINUX_KERNEL_VERSION >= 0x02061b \
00507     && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
00508        || defined __ia64__ || defined __sparc__ || __s390__)
00509 # define __ASSUME_SOCK_CLOEXEC     1
00510 # define __ASSUME_IN_NONBLOCK      1
00511 # define __ASSUME_PIPE2            1
00512 # define __ASSUME_PACCEPT   1
00513 #endif