History log of /bionic/libc/include/sys/cdefs.h
Revision Date Author Comments
b2eb09a9ed9e08d9e49f4245d1959b2ca3fbaaf8 30-Aug-2014 Elliott Hughes <enh@google.com> Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc.

Bug: 16874785

(cherry picked from commit e0c56efddf55ad40cb35b2c22e1dd9b4b50df159)

Change-Id: I9c922ba019f648766fc399d1c4e35e789e25acd4
e6c57fcb05b0dcbfa8129bb6f7d99093f4819370 24-May-2014 Elliott Hughes <enh@google.com> Add C11 <stdatomic.h>.

Bug: 14903517
Change-Id: I631dbfdaa698cf7fea8e3b5e18a32586383e62a5
caa15bfe2d6c065d2caff48583f18351bd96915f 03-Apr-2014 Elliott Hughes <enh@google.com> Define __WORDSIZE like glibc.

Requested by Google Breakpad, but seems to be assumed to be defined
in various places in the AOSP tree already; iputils, wpa_supplicant,
et cetera.

Change-Id: I1f7833c98e0af4c77e49744c08b8239061c9a571
8d60cc63163df81938305632e1b7474aeda17d52 04-Feb-2014 Elliott Hughes <enh@google.com> Use __inline__ for fortify.

libunwind has #define inline /* empty */ which breaks our fortified headers.
glibc uses __inline but our BSD-derived headers often override that. __inline__
is the third alternative understood by GCC that -- as far as I know -- neither
the C library itself nor third-party code tries to mess with.

Bug: 12871594
Change-Id: I6677e70ea531bb7d4c46021b43af760d4ad8ecf7
c13fb75ceabb47f8292be206db80b93889fccf66 18-Dec-2013 Elliott Hughes <enh@google.com> Move bionic over to GCC's 'warning' attribute.

This is a better solution than the old __warn_references because it's
a compile-time rather than link-time warning, it doesn't rely on something
that doesn't appear to be supported by gold (which is why you only used
to see these warnings on mips builds), and the errors refer to the exact
call site(s) rather than just telling you which object file contains a
reference to the bad function.

This is primarily so we can build bionic for aarch64; building libc.so
caused these warnings to fire (because link time is the wrong time) and
warnings are errors.

Change-Id: I5df9281b2a9d98b164a9b11807ea9472c6faa9e3
ab61eb366ac48addf2bca6093a34455193f5c8df 21-Nov-2013 Elliott Hughes <enh@google.com> Switch to upstream sleep(3) and usleep(3).

Also fix the signature of usleep, and the definition of useconds_t which
should be unsigned, as the 'u' in its name implies.

This patch also cleans up the existing FreeBSD hacks by moving the libm
stuff from <sys/cdefs.h> to a libm-private header, and adding comments
about the hacks we use to build FreeBSD source.

Change-Id: Ibe5067a380502df94a0a3a7901969b35411085b6
bd8e6749b78567af62ec126d7cc057386ebee25a 28-Aug-2013 Nick Kralevich <nnk@google.com> cdefs.h: introduce __bos0

Introduce __bos0 as a #define for __builtin_object_size((s), 0).
This macro is intended to be used for places where the standard
__bos macro isn't appropriate.

memcpy, memmove, and memset deliberately use __bos0. This is done
for two reasons:

1) I haven't yet tested to see if __bos is safe to use.
2) glibc uses __bos0 for these methods.

Change-Id: Ifbe02efdb10a72fe3529dbcc47ff647bde6feeca
06040fd75c1edff9e5ffb2b3d3e2a6e66d57c11d 09-Jul-2013 Elliott Hughes <enh@google.com> Add <sys/statvfs.h>.

Bug: 2512019
Change-Id: I6e7fd3fa281977cc4bc270481a95416b5b2dc351
16d1af167f8e36a9aa4a07ae77034ad519b00463 17-Jun-2013 Nick Kralevich <nnk@google.com> libc: add limited FORTIFY_SOURCE support for clang

In 829c089f83ddee37203b52bcb294867a9ae7bdbc, we disabled all
FORTIFY_SOURCE support when compiling under clang. At the time,
we didn't have proper test cases, and couldn't easily create targeted
clang tests.

This change re-enables FORTIFY_SOURCE support under clang for a
limited set of functions, where we have explicit unittests available.
The functions are:

* memcpy
* memmove
* strcpy
* strncpy
* strcat
* strncat
* memset
* strlen (with modifications)
* strchr (with modifications)
* strrchr (with modifications)

It may be possible, in the future, to enable other functions. However,
I need to write unittests first.

For strlen, strchr, and strrchr, clang unconditionally calls the
fortified version of the relevant function. If it doesn't know the
size of the buffer it's dealing with, it passes in ((size_t) -1),
which is the largest possible size_t.

I added two new clang specific unittest files, primarily copied
from fortify?_test.cpp.

I've also rebuild the entire system with these changes, and didn't
observe any obvious problems.

Change-Id: If12a15089bb0ffe93824b485290d05b14355fcaa
b24c0637d06fe0980b9e13a8d0c3e6f4dbda9cd5 18-Jun-2013 Nick Kralevich <nnk@google.com> libc: Introduce __errordecl()

Define __errordecl and replace __attribute__((__error__("foo")))
with __errordecl. Make sure __errordecl is a no-op on clang, as it
generates a compile time warning.

Change-Id: Ifa1a2d3afd6881de9d479fc2adac6737871a2949
d04c18397946f87ac4495351537c31a3d67257da 15-May-2013 Elliott Hughes <enh@google.com> Add more __restricts, clean up __format__ attributes.

Change-Id: I7e2d270cc722d339d221eaea92747eaff3b51403
78d6d9888c24c50f65d694dc8283afdcb58db84c 30-Apr-2013 Nick Kralevich <nnk@google.com> libc: upgrade sprintf to _FORTIFY_SOURCE=2

Upgrade sprintf to fortify_source level 2, to catch
additional security bugs.

Change-Id: Ibc957d65e4cb96152de84b3745a04e00fa22659e
1aae9bd170883805f2e7975cd3dbd2502b083cc1 29-Apr-2013 Nick Kralevich <nnk@google.com> strncpy: implement _FORTIFY_SOURCE=2

Add support for fortify source level 2 to strncpy.
This will enable detection of more areas where strncpy
is used inappropriately. For example, this would have detected
bug 8727221.

Move the fortify_source tests out of string_test.cpp, and
put it into fortify1_test.cpp.

Create a new fortify2_test.cpp file, which copies all
the tests in fortify1_test.cpp, and adds fortify_source level
2 specific tests.

Change-Id: Ica0fba531cc7d0609e4f23b8176739b13f7f7a83
890c8ed6ef773160cd6840a92e0d469fe530871f 22-Mar-2013 Elliott Hughes <enh@google.com> Fix builds where _FORTIFY_SOURCE is off.

Also add a more intention-revealing guard so we don't have loads of
places checking whether our inlining macro is defined.

Change-Id: I168860cedcfc798b07a5145bc48a125700265e47
7582a9c119a4e4d0c306996b2513205889a9fb6c 07-Feb-2013 Elliott Hughes <enh@google.com> Switch x86 syscall stubs over to the ENTER/END style of the ARM stubs.

Also update the x86 asm.h to support this; we need it for libm assembler
anyway.

Also clean up the _FBSDID hack in <sys/cdefs.h>.

Change-Id: Iababd977b8110ec022bf7c93f4d62ece47630e7c
24fad01755d33e6772ea3be56b702570bf257d55 04-Feb-2013 Elliott Hughes <enh@google.com> Document the mallinfo struct, add missing attributes.

Change-Id: Ia97acce1f6a83bd8b3ba8dd20efd962bc96f35a9
a0ee07829a9ba7e99ef68e8c12551301cc797f0f 31-Jan-2013 Elliott Hughes <enh@google.com> Upgrade libm.

This brings us up to date with FreeBSD HEAD, fixes various bugs, unifies
the set of functions we support on ARM, MIPS, and x86, fixes "long double",
adds ISO C99 support, and adds basic unit tests.

It turns out that our "long double" functions have always been broken
for non-normal numbers. This patch fixes that by not using the upstream
implementations and just forwarding to the regular "double" implementation
instead (since "long double" on Android is just "double" anyway, which is
what BSD doesn't support).

All the tests pass on ARM, MIPS, and x86, plus glibc on x86-64.

Bug: 3169850
Bug: 8012787
Bug: https://code.google.com/p/android/issues/detail?id=6697
Change-Id: If0c343030959c24bfc50d4d21c9530052c581837
c1b44ecc5385e68e81667068e03b32c2084a85b1 17-Oct-2012 David 'Digit' Turner <digit@android.com> Revert "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>"

This creates build issues in the internal Android tree.
Will investigate later.

Original patch: https://android-review.googlesource.com/#/c/38875/

Change-Id: I12c5995ebf172890051af42a5d3b31014c9c5117
c124baaf29a948fd8b93e7f1fefc20b659271026 12-Jul-2012 David 'Digit' Turner <digit@android.com> libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>

This patch updates the C library headers to provide ucontext_t
definitions for three architectures.

+ Fix <signal.h> to always define 'struct sigcontext'.

The new declarations are announced with new macros defined in
<sys/cdefs.h> in order to make it easier to adapt client code
that already defines its own, incompatible, versions of the
structures seen here.

http://code.google.com/p/android/issues/detail?id=34784

Change-Id: Ie78c48690a4ce61c50593f6c39639be7fead3596
829c089f83ddee37203b52bcb294867a9ae7bdbc 29-Aug-2012 Nick Kralevich <nnk@google.com> disable _FORTIFY_SOURCE under clang

Clang and _FORTIFY_SOURCE are just plain incompatible with
each other. First of all, clang doesn't understand the
__attribute__((gnu_inline)) header. Second of all,
Clang doesn't have support for __builtin_va_arg_pack()
and __builtin_va_arg_pack_len() (see
http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc)

Until we can resolve these issues, don't even try using
_FORTIFY_SOURCE under clang.

Change-Id: I81c2b8073bb3276fa9a4a6b93c427b641038356a
5fec211f6064adaff361c051a627198157b2c37b 04-Aug-2012 Shih-wei Liao <sliao@google.com> Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute"

This reverts commit 4f1f149c3757c594f9ff987e5ddd919c3e7dba10.
2b7f68c03df9df33708280cf3f5e8f5eba81dda6 04-Aug-2012 Shih-wei Liao <sliao@google.com> Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute"

This reverts commit 4f1f149c3757c594f9ff987e5ddd919c3e7dba10.
4f1f149c3757c594f9ff987e5ddd919c3e7dba10 03-Aug-2012 Shih-wei Liao <sliao@google.com> Fix the clang build: this compiler doesn't support the gnu_inline function attribute

Recent clang compiler doesn't have gnu_inline working. When frameworks/rs
is compiled with clang instead of gcc, it no longer works. Will be fixed
by this patch.

Change-Id: I8b281a1305151909e18958b73914ea27343cb4cd
9b6cc223a36835c4367a036d4cfeff14d25bc742 13-Jul-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: introduce __BIONIC_FORTIFY_UNKNOWN_SIZE macro

Replace all occurances of "(size_t) -1" with a
__BIONIC_FORTIFY_UNKNOWN_SIZE macro.

Change-Id: I0b188f6cf31417d2dbef0e1bd759de3f9782873a
71a18dd435e96564539b5af71b8ea5093a2109a1 07-Jun-2012 Nick Kralevich <nnk@google.com> _FORTIFY_SOURCE: add memset / bzero support

Add _FORTIFY_SOURCE support for the following functions:

* memset
* bzero

Move the __BIONIC_FORTIFY_INLINE definition to cdefs.h so it
can be used from multiple header files.

Change-Id: Iead4d5e35de6ec97786d58ee12573f9b11135bb7
a677907ee8ecca034318fdb97902fa73e7392c4f 21-Mar-2012 Nick Kralevich <nnk@google.com> string.h: add __attribute__ ((pure)) to string functions

cdefs.h: Introduce the __purefunc attribute, which allows us to mark
certain functions as being "pure".

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

Many functions have no effects except the return value and their
return value depends only on the parameters and/or global variables.
Such a function can be subject to common subexpression elimination
and loop optimization just as an arithmetic operator would be.

string.h: Mark many commently used string functions as "pure", to
allow for additional compiler optimizations.

Change-Id: I42961f90f822b6dbcbc3fd72cdbe774a7adc8785
8eda21baa54977e4d164a4174d06b6aa12115fb1 17-Mar-2011 David 'Digit' Turner <digit@android.com> libc: <sys/cdefs.h>: Fix the use of __STDC_VERSION__ from C++

See http://code.google.com/p/android/issues/detail?id=14627 for context.

Change-Id: Idb10b675667d0d6e64dcb1d382be11e45aa6f4c4
23d24394e72715ddf580726655c8ba3fbcf11bfe 06-Dec-2010 David 'Digit' Turner <digit@google.com> libc: Add <android/api-level.h>

Add a new header that defines __ANDROID_API__ as a constant integer
corresponding to the current native API level. This header is included
by <sys/cdefs.h>

Change-Id: Ib4774e247b395991266245815a24292afc919848
NOTE: This header is already provided by the NDK's platform headers.
for levels 3 to 9.
50ace4fec5e8cb5afcbc656a4556fa528adfd760 17-Jun-2010 David 'Digit' Turner <digit@google.com> Remove compiler warnings when building Bionic.

Also add missing declarations to misc. functions.
Fix clearerr() implementation (previous was broken).
Handle feature test macros like _POSIX_C_SOURCE properly.

Change-Id: Icdc973a6b9d550a166fc2545f727ea837fe800c4
3527fd6f0df794207215790321824b7844cc712d 15-Jun-2010 David 'Digit' Turner <digit@google.com> wchar.h: improve wchar_t support in Bionic

Change-Id: Iffd41046fd0933c66542abf7627a1569522dfcb2
1dc9e472e19acfe6dc7f41e429236e7eef7ceda1 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
1767f908af327fa388b1c66883760ad851267013 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution