Commit graph

406 commits

Author SHA1 Message Date
Elliott Hughes
a7a87dda4a <sys/time.h> should include [most of] <sys/select.h>.
Found by trying to build c-ares with bionic.

Change-Id: I38684abcb806ef1e8806c68b4a6dd9200f48849e
2015-07-17 19:10:24 -07:00
Elliott Hughes
2cc41d3e00 Add all the glibc one-line "synonym" header files.
Ported code keeps needing these one by one, so let's just add the whole
set...

Change-Id: I9662b256aeaa1b0ffb22354130e503f0c4aa472b
2015-07-17 13:59:36 -07:00
Bertrand SIMONNET
0875ba3095 Add timespec/timeval conversion helpers.
TIMESPEC_TO_TIMEVAL and TIMEVAL_TO_TIMESPEC are usually provided by
sys/time.h.

BUG: 22532790

Change-Id: I8b9d7298e3250323faa20b1adf9a7514954c6096
2015-07-16 13:10:50 -07:00
Daniel Erat
e55151472b libc: Add sys/fcntl.h for compatibility.
Add a /usr/include/sys/fcntl.h file that includes <fcntl.h>.

Change-Id: Ie34bf7519607c5aae1fbea7c7dca249c9b7801cc
2015-07-08 15:07:17 -06:00
Elliott Hughes
7ea817d39e Add some glibc-like #defines for libchrome.
libchrome uses __USE_XOPEN2K8 to decide whether futimens is
available. That's perhaps not the best idea, but there are other
cases where we defined the same feature macros as glibc to aid
portability.

Change-Id: Ie6e04cb181d88698d618e7dbd26cd347a6bf076c
2015-07-07 09:22:32 -07:00
Dmitriy Ivanov
c2247478d5 Improve personality initialization
1. Personality parameter should be unsigned int (not long)
2. Do not reset bits outside of PER_MASK when setting
   personality value.
3. Set personality for static executables.

Bug: http://b/21900686
Change-Id: I4c7e34079cbd59b818ce221eed325c05b9bb2303
(cherry picked from commit f643eb38c3)
2015-06-30 19:01:24 -07:00
Elliott Hughes
fef58353f4 Fix x86 gdbserver build.
Add the x86-only elf_fpxregset_t to <sys/procfs.h>, and rename
user_fxsr_struct (the kernel's name) to user_fpxregs_struct (the
userspace name).

Bug: http://b/22068064
Change-Id: Id466096bf02baf6bd49b193f49d9036848d33548
2015-06-24 17:31:24 -07:00
Elliott Hughes
895241efbb Fixes for building gdbserver (and gdb) out of the box.
Bug: http://b/21695943
Change-Id: Iadb600b2ae619515d7038a4db9bf464ba31adb36
2015-06-16 16:04:35 -07:00
Elliott Hughes
0577733c2e Avoid name collision with user_fpsimd_state in <asm/ptrace.h>.
We don't want to use <asm/ptrace.h> because (a) it'll drag in a bunch of
namespace pollution and (b) the registers should be "long double" for
userspace, not the kernel's uint128s. So just use a slightly different
name for our struct (which matches the traditional names for these structs
anyway).

Bug: http://b/21695943
Bug: https://code.google.com/p/android/issues/detail?id=86712
Change-Id: I8812ca98cfe6b649dbd31f7d6aea41928ba2acbd
2015-06-15 18:47:39 -07:00
Dan Albert
bf18c61798 Add a sys/procfs.h.
Needed for building gdbserver out of the box.

Bug: http://b/21695943
Bug: https://code.google.com/p/android/issues/detail?id=86712
Change-Id: Ieadda2b595f08bfddfa61fcd68006b8e7c1a438d
2015-06-15 14:33:54 -07:00
Elliott Hughes
be57a40d29 Add process_vm_readv and process_vm_writev.
Bug: http://b/21761353
Change-Id: Ic8ef3f241d62d2a4271fbc783c8af50257bac498
2015-06-10 17:24:20 -07:00
Andres Morales
4e8cda641a remove rootdir build.prop
merge with default.prop

Change-Id: I6cff4527dec2b31bdde42ec26c42ef2782f8deb4
2015-05-08 22:13:15 +00:00
Mark Salyzyn
c3f4c964a3 bionic: fortify comments in _system_properties.h
Change-Id: I2ef8fb7ae5ae03d5d2a50b5a417d585710099760
2015-04-29 13:57:42 -07:00
Mark Salyzyn
bfd65279a5 bionic: add __system_property_area_serial()
Adds a new _internal_ function. Provide a global serial number to
support more efficient private caching algorithms. This allows
to skip re-running the __system_property_find() call on misses until
there is a global change in the properties. This call is a read
barrier, the property data to be read following this call will be
read sequentially and up to date.

Bug: 19544788
Change-Id: I58e6a92baa0f3e8e7b9ec79b10af6d56407dab48
2015-04-27 07:44:03 -07:00
Elliott Hughes
43e020ce93 Remove PROP_PATH_SYSTEM_DEFAULT.
Change-Id: Ib01d9c2f9d890eb5e7ba1e15bd11767195e84967
2015-04-15 17:03:43 -07:00
Elliott Hughes
ba87fe5145 Add the UMOUNT_NOFOLLOW flag to <sys/mount.h>.
Change-Id: I2b81cfc3147d9a0a6ac2a8f064e6d9864fa7e04d
2015-03-11 09:32:25 -07:00
Elliott Hughes
6af62e0d50 Add RLIM_SAVED_CUR and RLIM_SAVED_MAX.
Change-Id: Ia6be76460bfcf852832325c5f36cb272f49a4b87
2015-02-23 13:41:40 -08:00
Elliott Hughes
4c5891d93d valgrind can't find syscall because we didn't put it in <unistd.h>.
Change-Id: I1e47291d4476bd2816138a8cf58f29d4986d39e3
2015-02-19 22:49:44 -08:00
Elliott Hughes
1dbc6bb025 Merge "Implement _FILE_OFFSET_BITS (mostly)." 2015-02-18 18:01:05 +00:00
Elliott Hughes
68dc20d411 Implement _FILE_OFFSET_BITS (mostly).
I still don't think we can make stdio's fseeko and ftello work, but we can
have everything else, and very few programs use fseeko/ftello (and they can
just refrain from using _FILE_OFFSET_BITS and be no worse off than they are
today).

Bug: 11865851
Change-Id: Ic3cb409aae6713f4b345de954bcc4241fcd969ec
2015-02-17 19:54:43 -08:00
Yabin Cui
784de4e50a Revert "Move use of __warnattr to __deprecated."
This reverts commit 4645c4f62d.

Change-Id: I6c1062d54a4e2c4f41ce7a403e4e7840e6339146
2015-02-17 23:54:40 +00:00
Yabin Cui
4645c4f62d Move use of __warnattr to __deprecated.
clang don't support warning attribute. Replacing warning attriubte with
deprecated attribute can achieve the same behavior whether compiled by
gcc or clang.

Bug: 19340053
Change-Id: I064432b81cf55212458edbc749eb72dc15a810fb
2015-02-17 14:14:45 -08:00
Elliott Hughes
92b9c6ff3e POSIX says flock is in <sys/file.h>, not <unistd.h>.
Bug: 19392265
Change-Id: I14d0b56883f0354e13db04a1d140b8f60dae08d7
2015-02-17 09:08:24 -08:00
Yabin Cui
c9d09431b9 Declare getgrent/setgrent/endgrent as missing.
Bug: 19340053
Change-Id: I42bfeda95e6f262e2e74ab47336ea346c2de7e4a
2015-02-13 10:52:35 -08:00
Yabin Cui
2d8f9b5aea Define MAXHOSTNAMELEN explicitly in source files.
Bug: 19093777
Bug: 19092844
Change-Id: I0778507ca2d5c008abb9a6d6315d0909263a8817
2015-02-09 19:56:47 -08:00
Yabin Cui
5e52226f02 Stop including <linux/param.h> in <sys/param.h>.
Bug: 19092844
Change-Id: I1a4a0c84a196a187ea32e58491de744cf3c0f404
2015-02-04 14:59:58 -08:00
Elliott Hughes
09c3382433 Merge "Break two incorrect transitive includes." 2015-01-31 04:18:10 +00:00
Dan Albert
94335cc8e2 Merge "Put back inline definitions if using an old API." 2015-01-30 17:18:49 +00:00
Elliott Hughes
5038b19cef Break two incorrect transitive includes.
Change-Id: I95519caa5258cf5c6b8053f1c7e08ade2a824e49
2015-01-29 20:12:13 -08:00
Dan Albert
466dbe4444 Put back inline definitions if using an old API.
All these inlines were turned in to out of line definitions in L.
This brings us a step closer to being able to just use the current
bionic headers for the NDK, rather than having many old versions of
them.

Change-Id: Ie010bc727d78d3742abc577c70f6578db2e68625
2015-01-29 17:30:40 -08:00
Raghu Gandham
86d2feef9f Modify MIPS64 stat structure to match a generic one in AOSP.
The kernel version of the stat structure is used during the syscalls. After the syscall,
the kernel stat structure is converted to match the generic one. Eventually we would like
the generic stat structure and related syscalls be added to MIPS64 kernel, removing the
thunks added to AOSP.

Change-Id: I7764e80278c1cc8254754c3531ec2dda7544a8ec
2015-01-28 16:12:17 -08:00
Christopher Ferris
419ed122aa Merge "Update kernel headers to v3.18.3." 2015-01-26 21:27:52 +00:00
Christopher Ferris
82d7504cd7 Update kernel headers to v3.18.3.
Bug: 19127803
Change-Id: I67fa0832322ddd0032d909476047578be052bcf2
2015-01-26 10:57:07 -08:00
Elliott Hughes
d309877eee Say "Bad file descriptor" rather than "Bad file number".
This text is actually in POSIX (though it's not mandatory) and it's what glibc
says. Who says "file number" anyway?

Change-Id: Icc91ac24587c2bc692e0b97c19d32ac1bdda4ea7
2015-01-24 13:38:57 -08:00
Andres Morales
9d9ebc5fc9 bionic: libc: Added path to root ramdisk build properties file.
Change-Id: Id850e4e5ef4e91cea7ad53f6858886daf660eeec
2015-01-13 18:07:23 -08:00
Faraz Shahbazker
e247e1c89e [MIPS64] Add correct mcontext_t for 64-bit MIPS
Change-Id: I76d503860d0e1d937b6913bf2c1c6ebb531617da
2015-01-06 07:58:02 -08:00
Elliott Hughes
998f2d5a50 Remove more BSD cruft from the public headers.
Change-Id: I1e3097f745b526db448bf72fbc05fb2ba23929a0
2014-12-19 19:30:11 -08:00
Elliott Hughes
c631bb215e Merge "Fix the types of some of the struct stat fields." 2014-12-18 23:38:26 +00:00
Elliott Hughes
9257c477ae Fix the types of some of the struct stat fields.
Bug: 17062519
Change-Id: I5207867939f3c2876bf6448e565fa4364aa7e4f0
2014-12-18 15:17:42 -08:00
Elliott Hughes
0c92e8c3d1 Remove bogus #include <endian.h> from <sys/stat.h>.
Bug: 17062519
Change-Id: I3dc21ee8b90580f112c73c72aff5d3bec4778026
2014-12-18 15:10:19 -08:00
Elliott Hughes
1c52e6c926 Fix struct stat member types for x86-64.
Bug: 17062519
Change-Id: I93b1e8b1d4b6918ab7c3a985e2f7da277077375e
2014-12-18 15:03:33 -08:00
Yabin Cui
3337435ec8 Merge "Use machine/timespec.h to separate timespec definition." 2014-12-10 19:29:24 +00:00
Yabin Cui
db49903732 Use machine/timespec.h to separate timespec definition.
Bug: 18627763
Change-Id: Ib1c406320f0ecc3705d19183a48f986cdf57c279
2014-12-10 06:36:11 +00:00
Elliott Hughes
824f914cae Move BSD stuff together in <sys/endian.h>.
Change-Id: I8bb511840f3cd98d5008034e405d82e923bd3203
2014-12-09 19:44:42 -08:00
Elliott Hughes
56e017306e Simplify our endian.h implementation.
We can rely on the compiler's builtins. Tested on arm, arm64, mips, x86,
and x86-64.

Change-Id: I0f774ed7e85b3c791a3178d8ef17c6500e6a9ace
2014-12-08 20:35:08 -08:00
Tao Bao
2421406711 Merge "Add cache related sysconf queries" 2014-12-05 18:11:53 +00:00
Tao Bao
1f40be97b1 Add cache related sysconf queries
Several cache related queries are added, such as
_SC_LEVEL1_DCACHE_LINESIZE, _SC_LEVEL1_DCACHE_SIZE and etc. For the
moment, we always return 0 for these queries.

Change-Id: I36f67af8128672d8c1eef49d6f2431cca5a94719
2014-12-04 15:24:28 -08:00
Yabin Cui
5afae64a1b implement posix_madvise
Bug: 18472477
Change-Id: I8183de6c281acf69ed5f7f88351b056b9827b162
2014-12-04 11:01:28 -08:00
Yabin Cui
efbb6fb3f7 change argument type in madvise
Make madvise prototype the same as linux man page.

Bug: 18539500
Change-Id: If3fd0e1d9539b9e10531ab9087bc4040e32b6e9b
2014-12-03 11:11:50 -08:00
David 'Digit' Turner
aad1a39dfb libc: Fix headers to allow direct inclusion.
These headers are missing a few #includes to allow their direct
inclusion from C

http://b.android.com/79841

Change-Id: Ifc712c17f4da70b26adb67d4d49ed659f53c3621
2014-12-01 15:44:24 +01:00