| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2014 The Android Open Source Project | 
|  | 3 | * All rights reserved. | 
|  | 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 | *  * Redistributions of source code must retain the above copyright | 
|  | 9 | *    notice, this list of conditions and the following disclaimer. | 
|  | 10 | *  * Redistributions in binary form must reproduce the above copyright | 
|  | 11 | *    notice, this list of conditions and the following disclaimer in | 
|  | 12 | *    the documentation and/or other materials provided with the | 
|  | 13 | *    distribution. | 
|  | 14 | * | 
|  | 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 
|  | 16 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 
|  | 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 
|  | 18 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | 
|  | 19 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | 
|  | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 
|  | 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | 
|  | 22 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 
|  | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 
|  | 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | 
|  | 25 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 
|  | 26 | * SUCH DAMAGE. | 
|  | 27 | */ | 
|  | 28 |  | 
| Elliott Hughes | 5704c42 | 2016-01-25 18:06:24 -0800 | [diff] [blame] | 29 | #ifndef _BITS_POSIX_LIMITS_H_ | 
|  | 30 | #define _BITS_POSIX_LIMITS_H_ | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 31 |  | 
| Elliott Hughes | 203e13d | 2016-07-22 14:56:18 -0700 | [diff] [blame] | 32 | #include <sys/cdefs.h> | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 33 |  | 
| Elliott Hughes | 06d7f2c | 2017-03-21 11:24:13 -0700 | [diff] [blame] | 34 | #define __BIONIC_POSIX_FEATURE_SINCE(level) (((__ANDROID_API__) >= level) ? 200809L : -1) | 
|  | 35 |  | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 36 | /* Any constant values here other than -1 or 200809L are explicitly specified by POSIX.1-2008. */ | 
| Elliott Hughes | 73c44a4 | 2016-10-19 09:27:02 -0700 | [diff] [blame] | 37 | /* Keep this list sorted by name. */ | 
| Elliott Hughes | 06d7f2c | 2017-03-21 11:24:13 -0700 | [diff] [blame] | 38 | #define _POSIX_ADVISORY_INFO __BIONIC_POSIX_FEATURE_SINCE(23) /* posix_memadvise arrived late. */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 39 | #define _POSIX_AIO_LISTIO_MAX       2 | 
|  | 40 | #define _POSIX_AIO_MAX              1 | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 41 | #define _POSIX_ARG_MAX              4096 | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 42 | #define _POSIX_ASYNCHRONOUS_IO      -1  /* not implemented */ | 
| Elliott Hughes | 06d7f2c | 2017-03-21 11:24:13 -0700 | [diff] [blame] | 43 | #define _POSIX_BARRIERS __BIONIC_POSIX_FEATURE_SINCE(24) | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 44 | #define _POSIX_CHILD_MAX            25 | 
|  | 45 | #define _POSIX_CHOWN_RESTRICTED     1  /* yes, chown requires appropriate privileges */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 46 | #define _POSIX_CLOCK_SELECTION      200809L | 
| Yabin Cui | 7257560 | 2014-12-08 11:54:12 -0800 | [diff] [blame] | 47 | #define _POSIX_CPUTIME              0  /* Use sysconf to detect support at runtime. */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 48 | #define _POSIX_DELAYTIMER_MAX       32 | 
| Elliott Hughes | 06d7f2c | 2017-03-21 11:24:13 -0700 | [diff] [blame] | 49 | #define _POSIX_FSYNC 200809L | 
| Yongqin Liu | 0589777 | 2014-10-29 14:47:47 +0800 | [diff] [blame] | 50 | #define _POSIX_HOST_NAME_MAX        255 | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 51 | #define _POSIX_IPV6                 200809L | 
|  | 52 | #define _POSIX_JOB_CONTROL          1  /* job control is a Linux feature */ | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 53 | #define _POSIX_LINK_MAX             8 | 
|  | 54 | #define _POSIX_LOGIN_NAME_MAX       9  /* includes trailing NUL */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 55 | #define _POSIX_MAPPED_FILES         200809L  /* mmap-ed files supported */ | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 56 | #define _POSIX_MAX_CANON            255 | 
|  | 57 | #define _POSIX_MAX_INPUT            255 | 
| Elliott Hughes | 06d7f2c | 2017-03-21 11:24:13 -0700 | [diff] [blame] | 58 | #define _POSIX_MEMLOCK __BIONIC_POSIX_FEATURE_SINCE(17) /* mlockall. */ | 
|  | 59 | #define _POSIX_MEMLOCK_RANGE        200809L /* mlock. */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 60 | #define _POSIX_MEMORY_PROTECTION    200809L | 
|  | 61 | #define _POSIX_MESSAGE_PASSING      -1  /* not implemented */ | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 62 | #define _POSIX_MONOTONIC_CLOCK      0  /* the monotonic clock may be available; ask sysconf */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 63 | #define _POSIX_MQ_OPEN_MAX          8 | 
|  | 64 | #define _POSIX_MQ_PRIO_MAX          32 | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 65 | #define _POSIX_NAME_MAX             14 | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 66 | #define _POSIX_NGROUPS_MAX          8 | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 67 | #define _POSIX_NO_TRUNC             1  /* very long pathnames generate an error */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 68 | #define _POSIX_OPEN_MAX             20 | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 69 | #define _POSIX_PATH_MAX             256 | 
|  | 70 | #define _POSIX_PIPE_BUF             512 | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 71 | #define _POSIX_PRIORITY_SCHEDULING  200809L  /* priority scheduling is a Linux feature */ | 
|  | 72 | #define _POSIX_PRIORITIZED_IO       -1  /* not implemented */ | 
|  | 73 | #define _POSIX_RAW_SOCKETS          200809L | 
|  | 74 | #define _POSIX_READER_WRITER_LOCKS  200809L | 
| Yabin Cui | 6348160 | 2014-12-01 17:41:04 -0800 | [diff] [blame] | 75 | #define _POSIX_REALTIME_SIGNALS     200809L | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 76 | #define _POSIX_REGEXP               1 | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 77 | #define _POSIX_RE_DUP_MAX           255 | 
|  | 78 | #define _POSIX_SAVED_IDS            1  /* saved user ids is a Linux feature */ | 
|  | 79 | #define _POSIX_SEMAPHORES           200809L | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 80 | #define _POSIX_SEM_NSEMS_MAX        256 | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 81 | #define _POSIX_SEM_VALUE_MAX        32767 | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 82 | #define _POSIX_SHARED_MEMORY_OBJECTS  -1  /* shm_open()/shm_unlink() not implemented */ | 
|  | 83 | #define _POSIX_SHELL                1   /* system() supported */ | 
|  | 84 | #define _POSIX_SIGQUEUE_MAX         32 | 
|  | 85 | #define _POSIX_SPAWN                -1  /* not implemented */ | 
| Elliott Hughes | 06d7f2c | 2017-03-21 11:24:13 -0700 | [diff] [blame] | 86 | #define _POSIX_SPIN_LOCKS __BIONIC_POSIX_FEATURE_SINCE(24) | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 87 | #define _POSIX_SPORADIC_SERVER      -1  /* not implemented */ | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 88 | #define _POSIX_SSIZE_MAX            32767 | 
|  | 89 | #define _POSIX_STREAM_MAX           8 | 
|  | 90 | #define _POSIX_SYMLINK_MAX          255 | 
|  | 91 | #define _POSIX_SYMLOOP_MAX          8 | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 92 | #define _POSIX_SYNCHRONIZED_IO      200809L  /* synchronized i/o supported */ | 
|  | 93 | #define _POSIX_THREADS              200809L  /* we support threads */ | 
|  | 94 | #define _POSIX_THREAD_ATTR_STACKADDR  200809L | 
|  | 95 | #define _POSIX_THREAD_ATTR_STACKSIZE  200809L | 
| Yabin Cui | 7257560 | 2014-12-08 11:54:12 -0800 | [diff] [blame] | 96 | #define _POSIX_THREAD_CPUTIME       0  /* Use sysconf to detect support at runtime. */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 97 | #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 | 
|  | 98 | #define _POSIX_THREAD_KEYS_MAX      128 | 
|  | 99 | #define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L | 
| Elliott Hughes | 7292725 | 2016-07-27 14:05:10 -0700 | [diff] [blame] | 100 | #define _POSIX_THREAD_PRIO_INHERIT -1  /* not implemented */ | 
|  | 101 | #define _POSIX_THREAD_PRIO_PROTECT -1  /* not implemented */ | 
| Elliott Hughes | 468c808 | 2017-05-20 12:47:14 -0700 | [diff] [blame] | 102 | #define _POSIX_THREAD_PROCESS_SHARED  200809L  /* PTHREAD_PROCESS_SHARED supported. */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 103 | #define _POSIX_THREAD_ROBUST_PRIO_INHERIT -1  /* not implemented */ | 
|  | 104 | #define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1  /* not implemented */ | 
|  | 105 | #define _POSIX_THREAD_SAFE_FUNCTIONS 200809L | 
|  | 106 | #define _POSIX_THREAD_SPORADIC_SERVER -1  /* not implemented */ | 
|  | 107 | #define _POSIX_THREAD_THREADS_MAX   64 | 
| Elliott Hughes | 06d7f2c | 2017-03-21 11:24:13 -0700 | [diff] [blame] | 108 | #define _POSIX_TIMEOUTS __BIONIC_POSIX_FEATURE_SINCE(21) /* pthread_mutex_timedlock arrived late. */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 109 | #define _POSIX_TIMERS               200809L  /* Posix timers are supported */ | 
|  | 110 | #define _POSIX_TIMER_MAX            32 | 
|  | 111 | #define _POSIX_TRACE                -1  /* not implemented */ | 
|  | 112 | #define _POSIX_TRACE_EVENT_FILTER   -1  /* not implemented */ | 
|  | 113 | #define _POSIX_TRACE_INHERIT        -1  /* not implemented */ | 
|  | 114 | #define _POSIX_TRACE_LOG            -1  /* not implemented */ | 
|  | 115 | #define _POSIX_TRACE_NAME_MAX       8 | 
|  | 116 | #define _POSIX_TRACE_SYS_MAX        8 | 
|  | 117 | #define _POSIX_TRACE_USER_EVENT_MAX 32 | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 118 | #define _POSIX_TTY_NAME_MAX         9  /* includes trailing NUL */ | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 119 | #define _POSIX_TYPED_MEMORY_OBJECTS -1  /* not implemented */ | 
|  | 120 | #define _POSIX_TZNAME_MAX           6 | 
| Elliott Hughes | a186b2e | 2014-09-22 14:49:07 -0700 | [diff] [blame] | 121 | #define _POSIX_VDISABLE             '\0' | 
|  | 122 |  | 
| Yabin Cui | 1c19194 | 2014-11-19 19:49:14 -0800 | [diff] [blame] | 123 | #if defined(__LP64__) | 
|  | 124 | #define _POSIX_V7_ILP32_OFF32       -1 | 
|  | 125 | #define _POSIX_V7_ILP32_OFFBIG      -1 | 
|  | 126 | #define _POSIX_V7_LP64_OFF64         1 | 
|  | 127 | #define _POSIX_V7_LPBIG_OFFBIG       1 | 
|  | 128 | #else | 
|  | 129 | #define _POSIX_V7_ILP32_OFF32        1 | 
|  | 130 | #define _POSIX_V7_ILP32_OFFBIG      -1 | 
|  | 131 | #define _POSIX_V7_LP64_OFF64        -1 | 
|  | 132 | #define _POSIX_V7_LPBIG_OFFBIG      -1 | 
|  | 133 | #endif | 
|  | 134 |  | 
|  | 135 | #define _POSIX2_BC_BASE_MAX         99 | 
|  | 136 | #define _POSIX2_BC_DIM_MAX          2048 | 
|  | 137 | #define _POSIX2_BC_SCALE_MAX        99 | 
|  | 138 | #define _POSIX2_BC_STRING_MAX       1000 | 
|  | 139 | #define _POSIX2_CHARCLASS_NAME_MAX  14 | 
|  | 140 | #define _POSIX2_CHAR_TERM           -1  /* not implemented */ | 
|  | 141 | #define _POSIX2_COLL_WEIGHTS_MAX    2 | 
|  | 142 | #define _POSIX2_C_BIND              _POSIX_VERSION | 
|  | 143 | #define _POSIX2_C_DEV               -1  /* c dev utilities not implemented */ | 
|  | 144 | #define _POSIX2_EXPR_NEST_MAX       32 | 
|  | 145 | #define _POSIX2_LINE_MAX            2048 | 
|  | 146 | #define _POSIX2_LOCALEDEF           -1  /* localedef utilitiy not implemented */ | 
|  | 147 | #define _POSIX2_RE_DUP_MAX          _POSIX_RE_DUP_MAX | 
|  | 148 | #define _POSIX2_SW_DEV              -1  /* software dev utilities not implemented */ | 
|  | 149 | #define _POSIX2_UPE                 -1  /* user portability utilities not implemented */ | 
|  | 150 |  | 
|  | 151 | #define _XOPEN_ENH_I18N             -1  /* we don't support internationalization in the C library */ | 
|  | 152 | #define _XOPEN_CRYPT                -1  /* don't support X/Open Encryption */ | 
|  | 153 | #define _XOPEN_IOV_MAX              16 | 
|  | 154 | #define _XOPEN_LEGACY               -1  /* not support all */ | 
|  | 155 | #define _XOPEN_REALTIME             -1 /* we don't support all these functions */ | 
|  | 156 | #define _XOPEN_REALTIME_THREADS     -1  /* same here */ | 
|  | 157 | #define _XOPEN_SHM                  -1 | 
|  | 158 | #define _XOPEN_UNIX                 1 | 
|  | 159 |  | 
| Elliott Hughes | 5704c42 | 2016-01-25 18:06:24 -0800 | [diff] [blame] | 160 | #endif |