Home
last modified time | relevance | path

Searched refs:to (Results 1 – 25 of 85) sorted by relevance

1234

/bionic/libc/async_safe/
DREADME.md3 This library provides an async_safe implementation for formatting and writing log messages to logd.
5 Note that the liblog implementation connects a single socket to logd and uses a RWLock to manage
6 it among threads, whereas these functions connect to liblog for each log message. While it's
7 beneficial to have this lock-free and therefore async_safe mechanism to write to logd, connecting
8 a socket for each message does not scale well under load. It was also determined to be too
9 costly to connect a socket for each thread as some processes, such as system_server, have over 100
/bionic/docs/
Dlibc_assembler.md3 This document describes how to verify incoming assembler libc routines.
7 * Update the routine, run the bionic unit tests to verify the routine doesn't
8 have any bugs. See the [Testing](#Testing) section for details about how to
14 the [Unwind Info](#unwind-info) section for details about how to verify this.
16 When benchmarking, it's best to verify on the latest Pixel device supported.
17 Make sure that you benchmark both the big and little cores to verify that
28 Locking to a specific cpu:
33 The bionic benchmarks are used to verify the performance of changes to
39 and pushed on to the device. The commands below show how to do this.
57 command to work, you need to change directory to one of the above
[all …]
Dfdtrack.md5 fdtrack is a file descriptor leak checker added to Android in API level 30.
7 fdtrack consists of two parts: a set of hooks in bionic to register a callback
9 hook to perform and store backtraces for file descriptor creation.
13 Register a callback with `android_fdtrack_compare_exchange_hook` to receive
15 called at any point in order to start capturing events, but be sure to properly
18 not to call callbacks when this is the case).
22 implements a library that uses libunwindstack to unwind and store fd creation backtraces.
26 libfdtrack registers its hook upon being loaded, so to start capturing
28 its output to logcat, either use `fdtrack_dump`, or send the signal
29 `BIONIC_SIGNAL_FDTRACK` (available from `<bionic/reserved_signals.h>`) to the
[all …]
Ddefines.md1 # When to use which `#define`
3 Using `#ifdef` or equivalents is common when writing portable code. Which to use
5 related to Android.
9 If your code is specific to Android's C library, bionic, use `__BIONIC__`. This
13 seen on Android devices, it is possible to use bionic on the host too.
17 If your code is specific to Android devices, use `__ANDROID__`. This isn't
20 of the OS and needs to behave differently on the host than on the device.
22 remember that it is possible -- if unusual -- to use bionic on the host).
27 `__ANDROID_API__` to test which version you're building against. This is
31 One thing to note (if your code may also be built as part of the OS itself) is
[all …]
Dclang_fortify_anatomy.md2 *determined that it'd be good to hold in Bionic's docs, too. Due to the*
3 *ever-changing nature of code, it tries to link to a stable tag of*
11 The intent of this document is to run through the minutiae of how Clang FORTIFY
15 getting up-to-speed on how things function can be quite difficult.
19 FORTIFY is a broad suite of extensions to libc aimed at catching misuses of
22 to function at all.
24 Broadly, FORTIFY implementations try to guard against many misuses of C
28 - Arguments with incorrect values passed to libc functions (e.g.,
30 - Missing arguments to functions (e.g., `open()` with `O_CREAT`, but no mode
33 FORTIFY is traditionally enabled by passing `-D_FORTIFY_SOURCE=N` to your
[all …]
Dnative_allocator.md2 This document describes how to verify the native memory allocator on Android.
3 This procedure should be followed when upgrading or moving to a new allocator.
4 A small minor upgrade might not need to run all of the benchmarks, however,
10 It is important to note that there are two modes for a native allocator
11 to run in on Android. The first is the normal allocator, the second is
12 called the svelte config, which is designed to run on memory constrained
14 add this line to the `BoardConfig.mk` for the given target:
26 a native allocator needs to implement.
29 These are functions that are used to implement a memory leak detector
34 call to an allocation function (malloc/free/etc). When a call
[all …]
DREADME.md13 * [When to use which `#define`](defines.md) - how to choose between
23 If you're trying to make changes to bionic _itself_, start with the
31 * [Validating libc assembler](libc_assembler.md) - how to test changes to
33 * [Validating native allocator changes](native_allocator.md) - how to test
34 changes to the native allocator.
DNOTICE19 "control" means (i) the power, direct or indirect, to cause the
28 including but not limited to software source code, documentation
33 not limited to compiled object code, generated documentation,
34 and conversions to other media types.
38 copyright notice that is included in or attached to the work
46 separable from, or merely link (or bind by name) to the interfaces of,
51 to that Work or Derivative Works thereof, that is intentionally
52 submitted to Licensor for inclusion in the Work by the copyright owner
53 or by an individual or Legal Entity authorized to submit on behalf of
56 to the Licensor or its representatives, including but not limited to
[all …]
DEINTR.md5 If your code is blocked in a system call when a signal needs to be delivered,
6 the kernel needs to interrupt that system call. For something like a read(2)
14 poll(2)? In poll(2)'s case, there's either something to report (in which
17 The kernel's solution to this problem is to return failure (-1) and set
18 errno to `EINTR`: "interrupted system call".
23 disposition is set to ignore, the kernel doesn't even have to deliver the
28 guarantee. If any code has installed a signal handler, you need to cope with
30 host of signal handlers before your code even starts to run. (And, no, you
31 can't ignore them instead, because some of them are critical to how ART works.
33 signals so that the code generated by the JIT doesn't have to insert explicit
[all …]
D32-bit-abi.md6 that use `off_t` to working on files no larger than 2GiB.
8 Android does not require the `_LARGEFILE_SOURCE` macro to be used to make
12 Android also does not require the `_LARGEFILE64_SOURCE` macro to be used
13 to make `off64_t` and corresponding functions such as `ftruncate64` available.
17 There are a couple of exceptions to note. Firstly, `off64_t` and the single
42 If your code stops compiling when you move to NDK r15 or later, removing every
43 definition of `_FILE_OFFSET_BITS=64` will restore the behavior you used to have:
46 aren't aware that `_FILE_OFFSET_BITS` is set. You might also have to
47 remove references to `__USE_FILE_OFFSET64` --- this is the internal
51 to double check:
[all …]
Delf-tls.md25 few instructions. TLS variables belonging to dlopen'ed shared objects, on the other hand, may be
38 According to Drepper, variant 2 was motivated by backwards compatibility, and variant 1 was designed
40 an executable, the linker needs to know where an executable's TLS segment is relative to the TP so
44 Each thread has a "Dynamic Thread Vector" (DTV) with a pointer to each module's TLS block (or NULL
47 expected to point immediately at the DTV pointer, whereas in variant 2, the DTV pointer's offset
50 The DTV's "generation" field is used to lazily update/reallocate the DTV when new modules are loaded
57 When a C/C++ file references a TLS variable, the toolchain generates instructions to find its
70 A GD access can refer to a TLS variable anywhere. To access a variable `tls_var` using the
72 call to a `__tls_get_addr` function provided by libc.
100 `R_TLS_DTPMOD` is a dynamic relocation to the index of the module containing `tls_var`, and
[all …]
Dfdsan.md5 fdsan is a file descriptor sanitizer added to Android in API level 29.
10 *What problem is fdsan trying to solve? Why should I care?*
12to manifest as *use-after-close* and *double-close*. These errors are direct analogues of the memo…
42 … (e.g. suppose thread two was saving user data to disk when a third thread came in and opened a so…
47to detect and/or prevent file descriptor mismanagement by enforcing file descriptor ownership. Lik…
49to set a 64-bit closure tag on a file descriptor. The tag consists of an 8-bit type byte that iden…
59 …- Upon detecting an error, emit a warning to logcat, generate a tombstone, and then continue execu…
67 The likelihood of fdsan catching a file descriptor error is proportional to the percentage of file …
69 ### Using fdsan to fix a bug
72 Let's look at a simple contrived example that uses sleeps to force a particular interleaving of thr…
[all …]
/bionic/
DREADME.md6 This document is a high-level overview of making changes to bionic itself.
7 If you're trying to _use_ bionic, or want more in-depth information about
19 `cos(3)` in a separate library to save space in the days before shared
25 that the dynamic linker replaces with pointers to its own implementation at
30 The C++ ABI support functions. The C++ compiler doesn't know how to implement
38 has a `DT_INTERP` entry that says "use the following program to start me". On
41 into memory and resolving references to symbols (so that when your code tries to
42 jump to `fopen(3)`, say, it lands in the right place).
91 # are in. Those are left to individual kernels' ABIs. In an effort to --
96 # of extra stuff that isn't available to userspace). We import the latest
[all …]
Dandroid-changes-for-ndk-developers.md3 This document details important changes related to native code
22 will be tied to an app's target API level:
27 * At the affected API level and above, we’ll refuse to load the library.
36 toasts help bring some visibility to the issues before it's too late.
39 ## Changes to library dependency resolution
44 had to call `dlopen` or `System.loadLibrary` on all transitive
48 to topologically sort your libraries and load them in reverse order.
50 If you need to support Android devices running OS versions older than
51 API level 23, you might want to consider
52 [ReLinker](https://github.com/KeepSafe/ReLinker) which claims to solve
[all …]
/bionic/libc/arch-riscv64/string/
Dstrcpy.c35 strcpy_gc(char *to, const char *from) in strcpy_gc() argument
37 char *save = to; in strcpy_gc()
39 for (; (*to = *from) != '\0'; ++from, ++to); in strcpy_gc()
/bionic/libc/upstream-openbsd/lib/libc/string/
Dstpcpy.c40 stpcpy(char *to, const char *from) in stpcpy() argument
42 for (; (*to = *from) != '\0'; ++from, ++to); in stpcpy()
43 return(to); in stpcpy()
/bionic/libc/upstream-freebsd/lib/libc/string/
Dwcpcpy.c43 wcpcpy(wchar_t * __restrict to, const wchar_t * __restrict from) in wcpcpy() argument
46 for (; (*to = *from); ++from, ++to); in wcpcpy()
47 return(to); in wcpcpy()
/bionic/apex/
DNOTICE19 "control" means (i) the power, direct or indirect, to cause the
28 including but not limited to software source code, documentation
33 not limited to compiled object code, generated documentation,
34 and conversions to other media types.
38 copyright notice that is included in or attached to the work
46 separable from, or merely link (or bind by name) to the interfaces of,
51 to that Work or Derivative Works thereof, that is intentionally
52 submitted to Licensor for inclusion in the Work by the copyright owner
53 or by an individual or Legal Entity authorized to submit on behalf of
56 to the Licensor or its representatives, including but not limited to
[all …]
/bionic/build/
DNOTICE19 "control" means (i) the power, direct or indirect, to cause the
28 including but not limited to software source code, documentation
33 not limited to compiled object code, generated documentation,
34 and conversions to other media types.
38 copyright notice that is included in or attached to the work
46 separable from, or merely link (or bind by name) to the interfaces of,
51 to that Work or Derivative Works thereof, that is intentionally
52 submitted to Licensor for inclusion in the Work by the copyright owner
53 or by an individual or Legal Entity authorized to submit on behalf of
56 to the Licensor or its representatives, including but not limited to
[all …]
/bionic/libc/malloc_debug/
DREADME_marshmallow_and_earlier.md7 This documentation describes how to enable this feature on API level
10 is not guaranteed to work at all.
15 On these old versions of the OS, you must be able to set system properties
16 using the setprop command from the shell. This requires the ability to
45 When enabled, this value creates a special header to all allocations
52 might cause timeouts when trying to start a device.
56 by a call to get\_malloc\_leak\_info (see README\_api.md for details).
72 When enabled, this value creates a special header to all allocations
83 When the allocation is freed, both of these guards are verified to contain
84 the expected patterns. If not, then an error message is printed to the log.
[all …]
DREADME_api.md3 Malloc debug can be used to get information on all of the live allocations
5 used to gather this data from a process. This tracking can be enabled using
8 The function to gather the data:
12 *info* is set to a buffer allocated by the call that contains all of
14 *overall\_size* is set to the total size of the buffer returned. If this
17 *total\_memory* is set to the sum of all allocation sizes that are live at
20 *backtrace\_size* is set to the maximum number of backtrace entries
23 In order to free the buffer allocated by the function, call:
38 *backtrace\_size* as returned by the original call to
43 incorrectly set to the number of frames in the backtrace.
[all …]
DREADME.md7 This documentation describes how to enable this feature on Android N or later
33 Before, a realloc from one size to a smaller size would not update the
34 backtrace related to the allocation. Starting in P, every single realloc
49 to find memory corruption occuring to a region before the original allocation.
51 When the allocation is freed, the guard is checked to verify it has not been
61 on 64 bit systems to make sure that the allocation returned is aligned
64 This option adds a special header to all allocations that contains the guard
75 to find memory corruption occuring to a region after the original allocation.
77 When the allocation is freed, the guard is checked to verify it has not been
84 This option adds a special header to all allocations that contains
[all …]
/bionic/libc/kernel/
DREADME.md8 unmodified kernel headers in order to get rid of many annoying
33 be used as uapi headers. The tools to process the kernel headers will
35 to be hand-modified.
42 Contains various Python and shell scripts used to get and re-generate
45 The tools to get/parse the headers:
76 version to which they correspond. The format of a tag is
78 android-mainline-5.10 corresponds to linux stable kernel 5.10. To check out
89 Before running the command to import the headers, make sure that you have
91 to determine which directory to use as the destination directory.
93 After running lunch, run this command to import the headers into the Android
[all …]
/bionic/benchmarks/
DREADME.md8 on top of [Google Benchmark](https://github.com/google/benchmark) with some additions to organize
20 `--benchmark_filter=getpid` to run just the benchmarks with "getpid" in their name.
34 the file will be found as relative to the current directory. If the option specifies the full path
35 to an XML file such as `/data/nativetest/suites/example.xml`, it will be used as-is.
37 If no XML file is specified through the command-line option, the default is to use `suites/full.xml…
38 However, for the host bionic benchmarks (`bionic-benchmarks-glibc`), the default is to use
85 The `spawn/` subdirectory has a few benchmarks measuring the time used to start simple programs
96 spent in the spawned process. The real-time is probably more useful, and it is the figure used to
99 Locking the CPU frequency seems to improve the results of these benchmarks significantly, and it
106 Google Benchmark uses two settings to control how many times to run each benchmark, "iterations" and
[all …]
/bionic/linker/
Dld.config.format.md3 This document describes format of /system/etc/ld.config.txt file. This file can be used to customize
9 1. Mappings - maps executable locations to sections
14 This part of the document maps location of an executable to a section. Here is an example
28 # The following line maps section to a dir. Binaries ran from this location will use namespaces
35 # When this flag is set to true linker will set target_sdk_version for this binary to
41 # This property can be used to declare additional namespaces. Note that there is always the default
79 # and links it to default namespace
83 # [Deprecated] This defines what libraries are allowed to be loaded from ns1
85 # This defines what libraries are allowed to be loaded from ns1

1234