blob: f8db0242558258d7a141192baf2b49553297935b [file] [log] [blame]
Elliott Hughesa186b2e2014-09-22 14:49:07 -07001/*
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 Hughes5704c422016-01-25 18:06:24 -080029#ifndef _BITS_POSIX_LIMITS_H_
30#define _BITS_POSIX_LIMITS_H_
Elliott Hughesa186b2e2014-09-22 14:49:07 -070031
Elliott Hughes203e13d2016-07-22 14:56:18 -070032#include <sys/cdefs.h>
Yabin Cui1c191942014-11-19 19:49:14 -080033
Elliott Hughes3a8f75d2017-10-05 10:33:18 -070034#define _POSIX_VERSION 200809L
35#define _POSIX2_VERSION _POSIX_VERSION
36#define _XOPEN_VERSION 700
37
38#define __BIONIC_POSIX_FEATURE_SINCE(level) (((__ANDROID_API__) >= level) ? _POSIX_VERSION : -1)
Elliott Hughes06d7f2c2017-03-21 11:24:13 -070039
Yabin Cui1c191942014-11-19 19:49:14 -080040/* Any constant values here other than -1 or 200809L are explicitly specified by POSIX.1-2008. */
Elliott Hughes73c44a42016-10-19 09:27:02 -070041/* Keep this list sorted by name. */
Elliott Hughes06d7f2c2017-03-21 11:24:13 -070042#define _POSIX_ADVISORY_INFO __BIONIC_POSIX_FEATURE_SINCE(23) /* posix_memadvise arrived late. */
Yabin Cui1c191942014-11-19 19:49:14 -080043#define _POSIX_AIO_LISTIO_MAX 2
44#define _POSIX_AIO_MAX 1
Elliott Hughesa186b2e2014-09-22 14:49:07 -070045#define _POSIX_ARG_MAX 4096
Yabin Cui1c191942014-11-19 19:49:14 -080046#define _POSIX_ASYNCHRONOUS_IO -1 /* not implemented */
Elliott Hughes06d7f2c2017-03-21 11:24:13 -070047#define _POSIX_BARRIERS __BIONIC_POSIX_FEATURE_SINCE(24)
Elliott Hughesa186b2e2014-09-22 14:49:07 -070048#define _POSIX_CHILD_MAX 25
49#define _POSIX_CHOWN_RESTRICTED 1 /* yes, chown requires appropriate privileges */
Elliott Hughes3a8f75d2017-10-05 10:33:18 -070050#define _POSIX_CLOCK_SELECTION __BIONIC_POSIX_FEATURE_SINCE(21) /* clock_nanosleep/pthread_condattr_getclock/pthread_condattr_setclock. */
51#define _POSIX_CPUTIME _POSIX_VERSION /* CLOCK_PROCESS_CPUTIME_ID. */
Yabin Cui1c191942014-11-19 19:49:14 -080052#define _POSIX_DELAYTIMER_MAX 32
Elliott Hughes06d7f2c2017-03-21 11:24:13 -070053#define _POSIX_FSYNC 200809L
Yongqin Liu05897772014-10-29 14:47:47 +080054#define _POSIX_HOST_NAME_MAX 255
Yabin Cui1c191942014-11-19 19:49:14 -080055#define _POSIX_IPV6 200809L
56#define _POSIX_JOB_CONTROL 1 /* job control is a Linux feature */
Elliott Hughesa186b2e2014-09-22 14:49:07 -070057#define _POSIX_LINK_MAX 8
58#define _POSIX_LOGIN_NAME_MAX 9 /* includes trailing NUL */
Yabin Cui1c191942014-11-19 19:49:14 -080059#define _POSIX_MAPPED_FILES 200809L /* mmap-ed files supported */
Elliott Hughesa186b2e2014-09-22 14:49:07 -070060#define _POSIX_MAX_CANON 255
61#define _POSIX_MAX_INPUT 255
Elliott Hughes06d7f2c2017-03-21 11:24:13 -070062#define _POSIX_MEMLOCK __BIONIC_POSIX_FEATURE_SINCE(17) /* mlockall. */
63#define _POSIX_MEMLOCK_RANGE 200809L /* mlock. */
Yabin Cui1c191942014-11-19 19:49:14 -080064#define _POSIX_MEMORY_PROTECTION 200809L
65#define _POSIX_MESSAGE_PASSING -1 /* not implemented */
Elliott Hughes3a8f75d2017-10-05 10:33:18 -070066#define _POSIX_MONOTONIC_CLOCK _POSIX_VERSION /* CLOCK_MONOTONIC. */
Yabin Cui1c191942014-11-19 19:49:14 -080067#define _POSIX_MQ_OPEN_MAX 8
68#define _POSIX_MQ_PRIO_MAX 32
Elliott Hughesa186b2e2014-09-22 14:49:07 -070069#define _POSIX_NAME_MAX 14
Yabin Cui1c191942014-11-19 19:49:14 -080070#define _POSIX_NGROUPS_MAX 8
Elliott Hughesa186b2e2014-09-22 14:49:07 -070071#define _POSIX_NO_TRUNC 1 /* very long pathnames generate an error */
Yabin Cui1c191942014-11-19 19:49:14 -080072#define _POSIX_OPEN_MAX 20
Elliott Hughesa186b2e2014-09-22 14:49:07 -070073#define _POSIX_PATH_MAX 256
74#define _POSIX_PIPE_BUF 512
Yabin Cui1c191942014-11-19 19:49:14 -080075#define _POSIX_PRIORITY_SCHEDULING 200809L /* priority scheduling is a Linux feature */
76#define _POSIX_PRIORITIZED_IO -1 /* not implemented */
77#define _POSIX_RAW_SOCKETS 200809L
78#define _POSIX_READER_WRITER_LOCKS 200809L
Yabin Cui63481602014-12-01 17:41:04 -080079#define _POSIX_REALTIME_SIGNALS 200809L
Yabin Cui1c191942014-11-19 19:49:14 -080080#define _POSIX_REGEXP 1
Elliott Hughesa186b2e2014-09-22 14:49:07 -070081#define _POSIX_RE_DUP_MAX 255
82#define _POSIX_SAVED_IDS 1 /* saved user ids is a Linux feature */
83#define _POSIX_SEMAPHORES 200809L
Yabin Cui1c191942014-11-19 19:49:14 -080084#define _POSIX_SEM_NSEMS_MAX 256
Elliott Hughesa186b2e2014-09-22 14:49:07 -070085#define _POSIX_SEM_VALUE_MAX 32767
Yabin Cui1c191942014-11-19 19:49:14 -080086#define _POSIX_SHARED_MEMORY_OBJECTS -1 /* shm_open()/shm_unlink() not implemented */
87#define _POSIX_SHELL 1 /* system() supported */
88#define _POSIX_SIGQUEUE_MAX 32
89#define _POSIX_SPAWN -1 /* not implemented */
Elliott Hughes06d7f2c2017-03-21 11:24:13 -070090#define _POSIX_SPIN_LOCKS __BIONIC_POSIX_FEATURE_SINCE(24)
Yabin Cui1c191942014-11-19 19:49:14 -080091#define _POSIX_SPORADIC_SERVER -1 /* not implemented */
Elliott Hughesa186b2e2014-09-22 14:49:07 -070092#define _POSIX_SSIZE_MAX 32767
93#define _POSIX_STREAM_MAX 8
94#define _POSIX_SYMLINK_MAX 255
95#define _POSIX_SYMLOOP_MAX 8
Yabin Cui1c191942014-11-19 19:49:14 -080096#define _POSIX_SYNCHRONIZED_IO 200809L /* synchronized i/o supported */
97#define _POSIX_THREADS 200809L /* we support threads */
98#define _POSIX_THREAD_ATTR_STACKADDR 200809L
99#define _POSIX_THREAD_ATTR_STACKSIZE 200809L
Elliott Hughes3a8f75d2017-10-05 10:33:18 -0700100#define _POSIX_THREAD_CPUTIME _POSIX_VERSION /* CLOCK_THREAD_CPUTIME_ID. */
Yabin Cui1c191942014-11-19 19:49:14 -0800101#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
102#define _POSIX_THREAD_KEYS_MAX 128
103#define _POSIX_THREAD_PRIORITY_SCHEDULING 200809L
Elliott Hughes72927252016-07-27 14:05:10 -0700104#define _POSIX_THREAD_PRIO_INHERIT -1 /* not implemented */
105#define _POSIX_THREAD_PRIO_PROTECT -1 /* not implemented */
Elliott Hughes468c8082017-05-20 12:47:14 -0700106#define _POSIX_THREAD_PROCESS_SHARED 200809L /* PTHREAD_PROCESS_SHARED supported. */
Yabin Cui1c191942014-11-19 19:49:14 -0800107#define _POSIX_THREAD_ROBUST_PRIO_INHERIT -1 /* not implemented */
108#define _POSIX_THREAD_ROBUST_PRIO_PROTECT -1 /* not implemented */
109#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L
110#define _POSIX_THREAD_SPORADIC_SERVER -1 /* not implemented */
111#define _POSIX_THREAD_THREADS_MAX 64
Elliott Hughes06d7f2c2017-03-21 11:24:13 -0700112#define _POSIX_TIMEOUTS __BIONIC_POSIX_FEATURE_SINCE(21) /* pthread_mutex_timedlock arrived late. */
Yabin Cui1c191942014-11-19 19:49:14 -0800113#define _POSIX_TIMERS 200809L /* Posix timers are supported */
114#define _POSIX_TIMER_MAX 32
115#define _POSIX_TRACE -1 /* not implemented */
116#define _POSIX_TRACE_EVENT_FILTER -1 /* not implemented */
117#define _POSIX_TRACE_INHERIT -1 /* not implemented */
118#define _POSIX_TRACE_LOG -1 /* not implemented */
119#define _POSIX_TRACE_NAME_MAX 8
120#define _POSIX_TRACE_SYS_MAX 8
121#define _POSIX_TRACE_USER_EVENT_MAX 32
Elliott Hughesa186b2e2014-09-22 14:49:07 -0700122#define _POSIX_TTY_NAME_MAX 9 /* includes trailing NUL */
Yabin Cui1c191942014-11-19 19:49:14 -0800123#define _POSIX_TYPED_MEMORY_OBJECTS -1 /* not implemented */
124#define _POSIX_TZNAME_MAX 6
Elliott Hughesa186b2e2014-09-22 14:49:07 -0700125#define _POSIX_VDISABLE '\0'
126
Yabin Cui1c191942014-11-19 19:49:14 -0800127#if defined(__LP64__)
128#define _POSIX_V7_ILP32_OFF32 -1
129#define _POSIX_V7_ILP32_OFFBIG -1
130#define _POSIX_V7_LP64_OFF64 1
131#define _POSIX_V7_LPBIG_OFFBIG 1
132#else
133#define _POSIX_V7_ILP32_OFF32 1
134#define _POSIX_V7_ILP32_OFFBIG -1
135#define _POSIX_V7_LP64_OFF64 -1
136#define _POSIX_V7_LPBIG_OFFBIG -1
137#endif
138
139#define _POSIX2_BC_BASE_MAX 99
140#define _POSIX2_BC_DIM_MAX 2048
141#define _POSIX2_BC_SCALE_MAX 99
142#define _POSIX2_BC_STRING_MAX 1000
143#define _POSIX2_CHARCLASS_NAME_MAX 14
144#define _POSIX2_CHAR_TERM -1 /* not implemented */
145#define _POSIX2_COLL_WEIGHTS_MAX 2
146#define _POSIX2_C_BIND _POSIX_VERSION
147#define _POSIX2_C_DEV -1 /* c dev utilities not implemented */
148#define _POSIX2_EXPR_NEST_MAX 32
149#define _POSIX2_LINE_MAX 2048
150#define _POSIX2_LOCALEDEF -1 /* localedef utilitiy not implemented */
151#define _POSIX2_RE_DUP_MAX _POSIX_RE_DUP_MAX
152#define _POSIX2_SW_DEV -1 /* software dev utilities not implemented */
153#define _POSIX2_UPE -1 /* user portability utilities not implemented */
154
155#define _XOPEN_ENH_I18N -1 /* we don't support internationalization in the C library */
156#define _XOPEN_CRYPT -1 /* don't support X/Open Encryption */
157#define _XOPEN_IOV_MAX 16
158#define _XOPEN_LEGACY -1 /* not support all */
159#define _XOPEN_REALTIME -1 /* we don't support all these functions */
160#define _XOPEN_REALTIME_THREADS -1 /* same here */
161#define _XOPEN_SHM -1
162#define _XOPEN_UNIX 1
163
Elliott Hughes5704c422016-01-25 18:06:24 -0800164#endif