From 2be91915dcecc956d14ff281db0c7d216ca98af2 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 7 Aug 2013 13:09:51 -0700 Subject: [PATCH 001/148] Create optimized __strcpy_chk/__strcat_chk. This change pulls the memcpy code out into a new file so that the __strcpy_chk and __strcat_chk can use it with an include. The new versions of the two chk functions uses assembly versions of strlen and memcpy to implement this check. This allows near parity with the assembly versions of strcpy/strcat. It also means that as memcpy implementations get faster, so do the chk functions. Other included changes: - Change all of the assembly labels to local labels. The other labels confuse gdb and mess up backtracing. - Add .cfi_startproc and .cfi_endproc directives so that gdb is not confused when falling through from one function to another. - Change all functions to use cfi directives since they are more powerful. - Move the memcpy_chk fail code outside of the memcpy function definition so that backtraces work properly. - Preserve lr before the calls to __fortify_chk_fail so that the backtrace actually works. Testing: - Ran the bionic unit tests. Verified all error messages in logs are set correctly. - Ran libc_test, replacing strcpy with __strcpy_chk and replacing strcat with __strcat_chk. - Ran the debugger on nexus10, nexus4, and old nexus7. Verified that the backtrace is correct for all fortify check failures. Also verify that when falling through from __memcpy_chk to memcpy that the backtrace is still correct. Also verified the same for __memset_chk and bzero. Verified the two different paths in the cortex-a9 memset routine that save variables to the stack still show the backtrace properly. Bug: 9293744 Change-Id: Id5aec8c3cb14101d91bd125eaf3770c9c8aa3f57 --- libc/arch-arm/arm.mk | 2 + .../arch-arm/cortex-a15/bionic/__strcat_chk.S | 215 +++++++++++++ .../arch-arm/cortex-a15/bionic/__strcpy_chk.S | 176 ++++++++++ libc/arch-arm/cortex-a15/bionic/memcpy.S | 281 ++-------------- libc/arch-arm/cortex-a15/bionic/memcpy_base.S | 303 ++++++++++++++++++ libc/arch-arm/cortex-a15/bionic/memset.S | 55 ++-- libc/arch-arm/cortex-a15/cortex-a15.mk | 2 + libc/arch-arm/cortex-a9/bionic/__strcat_chk.S | 218 +++++++++++++ libc/arch-arm/cortex-a9/bionic/__strcpy_chk.S | 178 ++++++++++ libc/arch-arm/cortex-a9/bionic/memcpy.S | 199 ++---------- libc/arch-arm/cortex-a9/bionic/memcpy_base.S | 206 ++++++++++++ libc/arch-arm/cortex-a9/bionic/memset.S | 27 +- libc/arch-arm/cortex-a9/cortex-a9.mk | 2 + libc/arch-arm/generic/generic.mk | 2 + libc/arch-arm/krait/bionic/__strcat_chk.S | 215 +++++++++++++ libc/arch-arm/krait/bionic/__strcpy_chk.S | 175 ++++++++++ libc/arch-arm/krait/bionic/memcpy.S | 110 ++----- libc/arch-arm/krait/bionic/memcpy_base.S | 117 +++++++ libc/arch-arm/krait/bionic/memset.S | 18 +- libc/arch-arm/krait/krait.mk | 2 + 20 files changed, 1950 insertions(+), 553 deletions(-) create mode 100644 libc/arch-arm/cortex-a15/bionic/__strcat_chk.S create mode 100644 libc/arch-arm/cortex-a15/bionic/__strcpy_chk.S create mode 100644 libc/arch-arm/cortex-a15/bionic/memcpy_base.S create mode 100644 libc/arch-arm/cortex-a9/bionic/__strcat_chk.S create mode 100644 libc/arch-arm/cortex-a9/bionic/__strcpy_chk.S create mode 100644 libc/arch-arm/cortex-a9/bionic/memcpy_base.S create mode 100644 libc/arch-arm/krait/bionic/__strcat_chk.S create mode 100644 libc/arch-arm/krait/bionic/__strcpy_chk.S create mode 100644 libc/arch-arm/krait/bionic/memcpy_base.S diff --git a/libc/arch-arm/arm.mk b/libc/arch-arm/arm.mk index 1d9863c32..e87ef3803 100644 --- a/libc/arch-arm/arm.mk +++ b/libc/arch-arm/arm.mk @@ -31,6 +31,8 @@ _LIBC_ARCH_DYNAMIC_SRC_FILES := \ _LIBC_FORTIFY_FILES_TO_REMOVE := \ bionic/__memcpy_chk.cpp \ bionic/__memset_chk.cpp \ + bionic/__strcpy_chk.cpp \ + bionic/__strcat_chk.cpp \ libc_common_src_files := \ $(filter-out $(_LIBC_FORTIFY_FILES_TO_REMOVE),$(libc_common_src_files)) diff --git a/libc/arch-arm/cortex-a15/bionic/__strcat_chk.S b/libc/arch-arm/cortex-a15/bionic/__strcat_chk.S new file mode 100644 index 000000000..08dc78a9a --- /dev/null +++ b/libc/arch-arm/cortex-a15/bionic/__strcat_chk.S @@ -0,0 +1,215 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include "libc_events.h" + + .syntax unified + + .thumb + .thumb_func + +// Get the length of src string, then get the source of the dst string. +// Check that the two lengths together don't exceed the threshold, then +// do a memcpy of the data. +ENTRY(__strcat_chk) + .cfi_startproc + pld [r0, #0] + push {r0, lr} + .cfi_def_cfa_offset 8 + .cfi_rel_offset r0, 0 + .cfi_rel_offset lr, 4 + push {r4, r5} + .cfi_adjust_cfa_offset 8 + .cfi_rel_offset r4, 0 + .cfi_rel_offset r5, 0 + + mov lr, r2 + + // Save the dst register to r5 + mov r5, r0 + + // Zero out r4 + eor r4, r4, r4 + + // r1 contains the address of the string to count. +.L_strlen_start: + mov r0, r1 + ands r3, r1, #7 + beq .L_mainloop + + // Align to a double word (64 bits). + rsb r3, r3, #8 + lsls ip, r3, #31 + beq .L_align_to_32 + + ldrb r2, [r1], #1 + cbz r2, .L_update_count_and_finish + +.L_align_to_32: + bcc .L_align_to_64 + ands ip, r3, #2 + beq .L_align_to_64 + + ldrb r2, [r1], #1 + cbz r2, .L_update_count_and_finish + ldrb r2, [r1], #1 + cbz r2, .L_update_count_and_finish + +.L_align_to_64: + tst r3, #4 + beq .L_mainloop + ldr r3, [r1], #4 + + sub ip, r3, #0x01010101 + bic ip, ip, r3 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + + .p2align 2 +.L_mainloop: + ldrd r2, r3, [r1], #8 + + pld [r1, #64] + + sub ip, r2, #0x01010101 + bic ip, ip, r2 + ands ip, ip, #0x80808080 + bne .L_zero_in_first_register + + sub ip, r3, #0x01010101 + bic ip, ip, r3 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + b .L_mainloop + +.L_update_count_and_finish: + sub r3, r1, r0 + sub r3, r3, #1 + b .L_finish + +.L_zero_in_first_register: + sub r3, r1, r0 + lsls r2, ip, #17 + bne .L_sub8_and_finish + bcs .L_sub7_and_finish + lsls ip, ip, #1 + bne .L_sub6_and_finish + + sub r3, r3, #5 + b .L_finish + +.L_sub8_and_finish: + sub r3, r3, #8 + b .L_finish + +.L_sub7_and_finish: + sub r3, r3, #7 + b .L_finish + +.L_sub6_and_finish: + sub r3, r3, #6 + b .L_finish + +.L_zero_in_second_register: + sub r3, r1, r0 + lsls r2, ip, #17 + bne .L_sub4_and_finish + bcs .L_sub3_and_finish + lsls ip, ip, #1 + bne .L_sub2_and_finish + + sub r3, r3, #1 + b .L_finish + +.L_sub4_and_finish: + sub r3, r3, #4 + b .L_finish + +.L_sub3_and_finish: + sub r3, r3, #3 + b .L_finish + +.L_sub2_and_finish: + sub r3, r3, #2 + +.L_finish: + cmp r4, #0 + bne .L_strlen_done + + // Time to get the dst string length. + mov r1, r5 + + // Save the original source address to r5. + mov r5, r0 + + // Save the current length (adding 1 for the terminator). + add r4, r3, #1 + b .L_strlen_start + + // r0 holds the pointer to the dst string. + // r3 holds the dst string length. + // r4 holds the src string length + 1. +.L_strlen_done: + add r2, r3, r4 + cmp r2, lr + bgt .L_fortify_check_failed + + // Set up the registers for the memcpy code. + mov r1, r5 + pld [r1, #64] + mov r2, r4 + add r0, r0, r3 + pop {r4, r5} + .cfi_adjust_cfa_offset -8 + .cfi_restore r4 + .cfi_restore r5 + + #include "memcpy_base.S" + +.L_fortify_check_failed: + .cfi_adjust_cfa_offset 8 + .cfi_rel_offset r4, 0 + .cfi_rel_offset r5, 4 + + ldr r0, error_message + ldr r1, error_code +1: + add r0, pc + bl __fortify_chk_fail +error_code: + .word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW +error_message: + .word error_string-(1b+4) + + .cfi_endproc +END(__strcat_chk) + + .data +error_string: + .string "strcat buffer overflow" diff --git a/libc/arch-arm/cortex-a15/bionic/__strcpy_chk.S b/libc/arch-arm/cortex-a15/bionic/__strcpy_chk.S new file mode 100644 index 000000000..9fde59015 --- /dev/null +++ b/libc/arch-arm/cortex-a15/bionic/__strcpy_chk.S @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include "libc_events.h" + + .syntax unified + + .thumb + .thumb_func + +// Get the length of the source string first, then do a memcpy of the data +// instead of a strcpy. +ENTRY(__strcpy_chk) + .cfi_startproc + pld [r0, #0] + push {r0, lr} + .cfi_def_cfa_offset 8 + .cfi_rel_offset r0, 0 + .cfi_rel_offset lr, 4 + + mov lr, r2 + mov r0, r1 + + ands r3, r1, #7 + beq .L_mainloop + + // Align to a double word (64 bits). + rsb r3, r3, #8 + lsls ip, r3, #31 + beq .L_align_to_32 + + ldrb r2, [r0], #1 + cbz r2, .L_update_count_and_finish + +.L_align_to_32: + bcc .L_align_to_64 + ands ip, r3, #2 + beq .L_align_to_64 + + ldrb r2, [r0], #1 + cbz r2, .L_update_count_and_finish + ldrb r2, [r0], #1 + cbz r2, .L_update_count_and_finish + +.L_align_to_64: + tst r3, #4 + beq .L_mainloop + ldr r3, [r0], #4 + + sub ip, r3, #0x01010101 + bic ip, ip, r3 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + + .p2align 2 +.L_mainloop: + ldrd r2, r3, [r0], #8 + + pld [r0, #64] + + sub ip, r2, #0x01010101 + bic ip, ip, r2 + ands ip, ip, #0x80808080 + bne .L_zero_in_first_register + + sub ip, r3, #0x01010101 + bic ip, ip, r3 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + b .L_mainloop + +.L_update_count_and_finish: + sub r3, r0, r1 + sub r3, r3, #1 + b .L_check_size + +.L_zero_in_first_register: + sub r3, r0, r1 + lsls r2, ip, #17 + bne .L_sub8_and_finish + bcs .L_sub7_and_finish + lsls ip, ip, #1 + bne .L_sub6_and_finish + + sub r3, r3, #5 + b .L_check_size + +.L_sub8_and_finish: + sub r3, r3, #8 + b .L_check_size + +.L_sub7_and_finish: + sub r3, r3, #7 + b .L_check_size + +.L_sub6_and_finish: + sub r3, r3, #6 + b .L_check_size + +.L_zero_in_second_register: + sub r3, r0, r1 + lsls r2, ip, #17 + bne .L_sub4_and_finish + bcs .L_sub3_and_finish + lsls ip, ip, #1 + bne .L_sub2_and_finish + + sub r3, r3, #1 + b .L_check_size + +.L_sub4_and_finish: + sub r3, r3, #4 + b .L_check_size + +.L_sub3_and_finish: + sub r3, r3, #3 + b .L_check_size + +.L_sub2_and_finish: + sub r3, r3, #2 + +.L_check_size: + pld [r1, #0] + pld [r1, #64] + ldr r0, [sp] + cmp r3, lr + bge .L_fortify_check_failed + + // Add 1 for copy length to get the string terminator. + add r2, r3, #1 + + #include "memcpy_base.S" + +.L_fortify_check_failed: + ldr r0, error_message + ldr r1, error_code +1: + add r0, pc + bl __fortify_chk_fail +error_code: + .word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW +error_message: + .word error_string-(1b+4) + + .cfi_endproc +END(__strcpy_chk) + + .data +error_string: + .string "strcpy buffer overflow" diff --git a/libc/arch-arm/cortex-a15/bionic/memcpy.S b/libc/arch-arm/cortex-a15/bionic/memcpy.S index 239402455..8052d62ef 100644 --- a/libc/arch-arm/cortex-a15/bionic/memcpy.S +++ b/libc/arch-arm/cortex-a15/bionic/memcpy.S @@ -53,11 +53,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* Prototype: void *memcpy (void *dst, const void *src, size_t count). */ +// Prototype: void *memcpy (void *dst, const void *src, size_t count). - // This version is tuned for the Cortex-A15 processor. - -#include #include #include "libc_events.h" @@ -65,274 +62,34 @@ .syntax unified .fpu neon -#define CACHE_LINE_SIZE 64 - ENTRY(__memcpy_chk) + .cfi_startproc cmp r2, r3 - bgt fortify_check_failed + bgt __memcpy_chk_fail // Fall through to memcpy... + .cfi_endproc END(__memcpy_chk) ENTRY(memcpy) - // Assumes that n >= 0, and dst, src are valid pointers. - // For any sizes less than 832 use the neon code that doesn't - // care about the src alignment. This avoids any checks - // for src alignment, and offers the best improvement since - // smaller sized copies are dominated by the overhead of - // the pre and post main loop. - // For larger copies, if src and dst cannot both be aligned to - // word boundaries, use the neon code. - // For all other copies, align dst to a double word boundary - // and copy using LDRD/STRD instructions. - - // Save registers (r0 holds the return value): - // optimized push {r0, lr}. - .save {r0, lr} - pld [r1, #(CACHE_LINE_SIZE*16)] + .cfi_startproc + pld [r1, #64] push {r0, lr} + .cfi_def_cfa_offset 8 + .cfi_rel_offset r0, 0 + .cfi_rel_offset lr, 4 - cmp r2, #16 - blo copy_less_than_16_unknown_align + #include "memcpy_base.S" + .cfi_endproc +END(memcpy) - cmp r2, #832 - bge check_alignment + .cfi_startproc +__memcpy_chk_fail: + // Preserve lr for backtrace. + push {lr} + .cfi_def_cfa_offset 4 + .cfi_rel_offset lr, 0 -copy_unknown_alignment: - // Unknown alignment of src and dst. - // Assumes that the first few bytes have already been prefetched. - - // Align destination to 128 bits. The mainloop store instructions - // require this alignment or they will throw an exception. - rsb r3, r0, #0 - ands r3, r3, #0xF - beq 2f - - // Copy up to 15 bytes (count in r3). - sub r2, r2, r3 - movs ip, r3, lsl #31 - - itt mi - ldrbmi lr, [r1], #1 - strbmi lr, [r0], #1 - itttt cs - ldrbcs ip, [r1], #1 - ldrbcs lr, [r1], #1 - strbcs ip, [r0], #1 - strbcs lr, [r0], #1 - - movs ip, r3, lsl #29 - bge 1f - // Copies 4 bytes, dst 32 bits aligned before, at least 64 bits after. - vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! - vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]! -1: bcc 2f - // Copies 8 bytes, dst 64 bits aligned before, at least 128 bits after. - vld1.8 {d0}, [r1]! - vst1.8 {d0}, [r0, :64]! - -2: // Make sure we have at least 64 bytes to copy. - subs r2, r2, #64 - blo 2f - -1: // The main loop copies 64 bytes at a time. - vld1.8 {d0 - d3}, [r1]! - vld1.8 {d4 - d7}, [r1]! - pld [r1, #(CACHE_LINE_SIZE*4)] - subs r2, r2, #64 - vst1.8 {d0 - d3}, [r0, :128]! - vst1.8 {d4 - d7}, [r0, :128]! - bhs 1b - -2: // Fix-up the remaining count and make sure we have >= 32 bytes left. - adds r2, r2, #32 - blo 3f - - // 32 bytes. These cache lines were already preloaded. - vld1.8 {d0 - d3}, [r1]! - sub r2, r2, #32 - vst1.8 {d0 - d3}, [r0, :128]! -3: // Less than 32 left. - add r2, r2, #32 - tst r2, #0x10 - beq copy_less_than_16_unknown_align - // Copies 16 bytes, destination 128 bits aligned. - vld1.8 {d0, d1}, [r1]! - vst1.8 {d0, d1}, [r0, :128]! - -copy_less_than_16_unknown_align: - // Copy up to 15 bytes (count in r2). - movs ip, r2, lsl #29 - bcc 1f - vld1.8 {d0}, [r1]! - vst1.8 {d0}, [r0]! -1: bge 2f - vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! - vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]! - -2: // Copy 0 to 4 bytes. - lsls r2, r2, #31 - itt ne - ldrbne lr, [r1], #1 - strbne lr, [r0], #1 - itttt cs - ldrbcs ip, [r1], #1 - ldrbcs lr, [r1] - strbcs ip, [r0], #1 - strbcs lr, [r0] - - pop {r0, pc} - -check_alignment: - // If src and dst cannot both be aligned to a word boundary, - // use the unaligned copy version. - eor r3, r0, r1 - ands r3, r3, #0x3 - bne copy_unknown_alignment - - // To try and improve performance, stack layout changed, - // i.e., not keeping the stack looking like users expect - // (highest numbered register at highest address). - // TODO: Add debug frame directives. - // We don't need exception unwind directives, because the code below - // does not throw any exceptions and does not call any other functions. - // Generally, newlib functions like this lack debug information for - // assembler source. - .save {r4, r5} - strd r4, r5, [sp, #-8]! - .save {r6, r7} - strd r6, r7, [sp, #-8]! - .save {r8, r9} - strd r8, r9, [sp, #-8]! - - // Optimized for already aligned dst code. - ands ip, r0, #3 - bne dst_not_word_aligned - -word_aligned: - // Align the destination buffer to 8 bytes, to make sure double - // loads and stores don't cross a cache line boundary, - // as they are then more expensive even if the data is in the cache - // (require two load/store issue cycles instead of one). - // If only one of the buffers is not 8 bytes aligned, - // then it's more important to align dst than src, - // because there is more penalty for stores - // than loads that cross a cacheline boundary. - // This check and realignment are only done if there is >= 832 - // bytes to copy. - - // Dst is word aligned, but check if it is already double word aligned. - ands r3, r0, #4 - beq 1f - ldr r3, [r1], #4 - str r3, [r0], #4 - sub r2, #4 - -1: // Can only get here if > 64 bytes to copy, so don't do check r2. - sub r2, #64 - -2: // Every loop iteration copies 64 bytes. - .irp offset, #0, #8, #16, #24, #32 - ldrd r4, r5, [r1, \offset] - strd r4, r5, [r0, \offset] - .endr - - ldrd r4, r5, [r1, #40] - ldrd r6, r7, [r1, #48] - ldrd r8, r9, [r1, #56] - - // Keep the pld as far from the next load as possible. - // The amount to prefetch was determined experimentally using - // large sizes, and verifying the prefetch size does not affect - // the smaller copies too much. - // WARNING: If the ldrd and strd instructions get too far away - // from each other, performance suffers. Three loads - // in a row is the best tradeoff. - pld [r1, #(CACHE_LINE_SIZE*16)] - strd r4, r5, [r0, #40] - strd r6, r7, [r0, #48] - strd r8, r9, [r0, #56] - - add r0, r0, #64 - add r1, r1, #64 - subs r2, r2, #64 - bge 2b - - // Fix-up the remaining count and make sure we have >= 32 bytes left. - adds r2, r2, #32 - blo 4f - - // Copy 32 bytes. These cache lines were already preloaded. - .irp offset, #0, #8, #16, #24 - ldrd r4, r5, [r1, \offset] - strd r4, r5, [r0, \offset] - .endr - add r1, r1, #32 - add r0, r0, #32 - sub r2, r2, #32 -4: // Less than 32 left. - add r2, r2, #32 - tst r2, #0x10 - beq 5f - // Copy 16 bytes. - .irp offset, #0, #8 - ldrd r4, r5, [r1, \offset] - strd r4, r5, [r0, \offset] - .endr - add r1, r1, #16 - add r0, r0, #16 - -5: // Copy up to 15 bytes (count in r2). - movs ip, r2, lsl #29 - bcc 1f - // Copy 8 bytes. - ldrd r4, r5, [r1], #8 - strd r4, r5, [r0], #8 -1: bge 2f - // Copy 4 bytes. - ldr r4, [r1], #4 - str r4, [r0], #4 -2: // Copy 0 to 4 bytes. - lsls r2, r2, #31 - itt ne - ldrbne lr, [r1], #1 - strbne lr, [r0], #1 - itttt cs - ldrbcs ip, [r1], #1 - ldrbcs lr, [r1] - strbcs ip, [r0], #1 - strbcs lr, [r0] - - // Restore registers: optimized pop {r0, pc} - ldrd r8, r9, [sp], #8 - ldrd r6, r7, [sp], #8 - ldrd r4, r5, [sp], #8 - pop {r0, pc} - -dst_not_word_aligned: - // Align dst to word. - rsb ip, ip, #4 - cmp ip, #2 - - itt gt - ldrbgt lr, [r1], #1 - strbgt lr, [r0], #1 - - itt ge - ldrbge lr, [r1], #1 - strbge lr, [r0], #1 - - ldrb lr, [r1], #1 - strb lr, [r0], #1 - - sub r2, r2, ip - - // Src is guaranteed to be at least word aligned by this point. - b word_aligned - - - // Only reached when the __memcpy_chk check fails. -fortify_check_failed: ldr r0, error_message ldr r1, error_code 1: @@ -342,7 +99,7 @@ error_code: .word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW error_message: .word error_string-(1b+8) -END(memcpy) + .cfi_endproc .data error_string: diff --git a/libc/arch-arm/cortex-a15/bionic/memcpy_base.S b/libc/arch-arm/cortex-a15/bionic/memcpy_base.S new file mode 100644 index 000000000..647e0653f --- /dev/null +++ b/libc/arch-arm/cortex-a15/bionic/memcpy_base.S @@ -0,0 +1,303 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * Copyright (c) 2013 ARM Ltd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the company may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + // Assumes that n >= 0, and dst, src are valid pointers. + // For any sizes less than 832 use the neon code that doesn't + // care about the src alignment. This avoids any checks + // for src alignment, and offers the best improvement since + // smaller sized copies are dominated by the overhead of + // the pre and post main loop. + // For larger copies, if src and dst cannot both be aligned to + // word boundaries, use the neon code. + // For all other copies, align dst to a double word boundary + // and copy using LDRD/STRD instructions. + + cmp r2, #16 + blo .L_copy_less_than_16_unknown_align + + cmp r2, #832 + bge .L_check_alignment + +.L_copy_unknown_alignment: + // Unknown alignment of src and dst. + // Assumes that the first few bytes have already been prefetched. + + // Align destination to 128 bits. The mainloop store instructions + // require this alignment or they will throw an exception. + rsb r3, r0, #0 + ands r3, r3, #0xF + beq 2f + + // Copy up to 15 bytes (count in r3). + sub r2, r2, r3 + movs ip, r3, lsl #31 + + itt mi + ldrbmi lr, [r1], #1 + strbmi lr, [r0], #1 + itttt cs + ldrbcs ip, [r1], #1 + ldrbcs lr, [r1], #1 + strbcs ip, [r0], #1 + strbcs lr, [r0], #1 + + movs ip, r3, lsl #29 + bge 1f + // Copies 4 bytes, dst 32 bits aligned before, at least 64 bits after. + vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! + vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]! +1: bcc 2f + // Copies 8 bytes, dst 64 bits aligned before, at least 128 bits after. + vld1.8 {d0}, [r1]! + vst1.8 {d0}, [r0, :64]! + +2: // Make sure we have at least 64 bytes to copy. + subs r2, r2, #64 + blo 2f + +1: // The main loop copies 64 bytes at a time. + vld1.8 {d0 - d3}, [r1]! + vld1.8 {d4 - d7}, [r1]! + pld [r1, #(64*4)] + subs r2, r2, #64 + vst1.8 {d0 - d3}, [r0, :128]! + vst1.8 {d4 - d7}, [r0, :128]! + bhs 1b + +2: // Fix-up the remaining count and make sure we have >= 32 bytes left. + adds r2, r2, #32 + blo 3f + + // 32 bytes. These cache lines were already preloaded. + vld1.8 {d0 - d3}, [r1]! + sub r2, r2, #32 + vst1.8 {d0 - d3}, [r0, :128]! +3: // Less than 32 left. + add r2, r2, #32 + tst r2, #0x10 + beq .L_copy_less_than_16_unknown_align + // Copies 16 bytes, destination 128 bits aligned. + vld1.8 {d0, d1}, [r1]! + vst1.8 {d0, d1}, [r0, :128]! + +.L_copy_less_than_16_unknown_align: + // Copy up to 15 bytes (count in r2). + movs ip, r2, lsl #29 + bcc 1f + vld1.8 {d0}, [r1]! + vst1.8 {d0}, [r0]! +1: bge 2f + vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! + vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]! + +2: // Copy 0 to 4 bytes. + lsls r2, r2, #31 + itt ne + ldrbne lr, [r1], #1 + strbne lr, [r0], #1 + itttt cs + ldrbcs ip, [r1], #1 + ldrbcs lr, [r1] + strbcs ip, [r0], #1 + strbcs lr, [r0] + + pop {r0, pc} + +.L_check_alignment: + // If src and dst cannot both be aligned to a word boundary, + // use the unaligned copy version. + eor r3, r0, r1 + ands r3, r3, #0x3 + bne .L_copy_unknown_alignment + + // To try and improve performance, stack layout changed, + // i.e., not keeping the stack looking like users expect + // (highest numbered register at highest address). + // TODO: Add debug frame directives. + // We don't need exception unwind directives, because the code below + // does not throw any exceptions and does not call any other functions. + // Generally, newlib functions like this lack debug information for + // assembler source. + .save {r4, r5} + strd r4, r5, [sp, #-8]! + .save {r6, r7} + strd r6, r7, [sp, #-8]! + .save {r8, r9} + strd r8, r9, [sp, #-8]! + + // Optimized for already aligned dst code. + ands ip, r0, #3 + bne .L_dst_not_word_aligned + +.L_word_aligned: + // Align the destination buffer to 8 bytes, to make sure double + // loads and stores don't cross a cache line boundary, + // as they are then more expensive even if the data is in the cache + // (require two load/store issue cycles instead of one). + // If only one of the buffers is not 8 bytes aligned, + // then it's more important to align dst than src, + // because there is more penalty for stores + // than loads that cross a cacheline boundary. + // This check and realignment are only done if there is >= 832 + // bytes to copy. + + // Dst is word aligned, but check if it is already double word aligned. + ands r3, r0, #4 + beq 1f + ldr r3, [r1], #4 + str r3, [r0], #4 + sub r2, #4 + +1: // Can only get here if > 64 bytes to copy, so don't do check r2. + sub r2, #64 + +2: // Every loop iteration copies 64 bytes. + .irp offset, #0, #8, #16, #24, #32 + ldrd r4, r5, [r1, \offset] + strd r4, r5, [r0, \offset] + .endr + + ldrd r4, r5, [r1, #40] + ldrd r6, r7, [r1, #48] + ldrd r8, r9, [r1, #56] + + // Keep the pld as far from the next load as possible. + // The amount to prefetch was determined experimentally using + // large sizes, and verifying the prefetch size does not affect + // the smaller copies too much. + // WARNING: If the ldrd and strd instructions get too far away + // from each other, performance suffers. Three loads + // in a row is the best tradeoff. + pld [r1, #(64*16)] + strd r4, r5, [r0, #40] + strd r6, r7, [r0, #48] + strd r8, r9, [r0, #56] + + add r0, r0, #64 + add r1, r1, #64 + subs r2, r2, #64 + bge 2b + + // Fix-up the remaining count and make sure we have >= 32 bytes left. + adds r2, r2, #32 + blo 4f + + // Copy 32 bytes. These cache lines were already preloaded. + .irp offset, #0, #8, #16, #24 + ldrd r4, r5, [r1, \offset] + strd r4, r5, [r0, \offset] + .endr + add r1, r1, #32 + add r0, r0, #32 + sub r2, r2, #32 +4: // Less than 32 left. + add r2, r2, #32 + tst r2, #0x10 + beq 5f + // Copy 16 bytes. + .irp offset, #0, #8 + ldrd r4, r5, [r1, \offset] + strd r4, r5, [r0, \offset] + .endr + add r1, r1, #16 + add r0, r0, #16 + +5: // Copy up to 15 bytes (count in r2). + movs ip, r2, lsl #29 + bcc 1f + // Copy 8 bytes. + ldrd r4, r5, [r1], #8 + strd r4, r5, [r0], #8 +1: bge 2f + // Copy 4 bytes. + ldr r4, [r1], #4 + str r4, [r0], #4 +2: // Copy 0 to 4 bytes. + lsls r2, r2, #31 + itt ne + ldrbne lr, [r1], #1 + strbne lr, [r0], #1 + itttt cs + ldrbcs ip, [r1], #1 + ldrbcs lr, [r1] + strbcs ip, [r0], #1 + strbcs lr, [r0] + + // Restore registers: optimized pop {r0, pc} + ldrd r8, r9, [sp], #8 + ldrd r6, r7, [sp], #8 + ldrd r4, r5, [sp], #8 + pop {r0, pc} + +.L_dst_not_word_aligned: + // Align dst to word. + rsb ip, ip, #4 + cmp ip, #2 + + itt gt + ldrbgt lr, [r1], #1 + strbgt lr, [r0], #1 + + itt ge + ldrbge lr, [r1], #1 + strbge lr, [r0], #1 + + ldrb lr, [r1], #1 + strb lr, [r0], #1 + + sub r2, r2, ip + + // Src is guaranteed to be at least word aligned by this point. + b .L_word_aligned diff --git a/libc/arch-arm/cortex-a15/bionic/memset.S b/libc/arch-arm/cortex-a15/bionic/memset.S index 6c143ad81..5593be689 100644 --- a/libc/arch-arm/cortex-a15/bionic/memset.S +++ b/libc/arch-arm/cortex-a15/bionic/memset.S @@ -40,8 +40,14 @@ .syntax unified ENTRY(__memset_chk) + .cfi_startproc cmp r2, r3 - bls done + bls .L_done + + // Preserve lr for backtrace. + push {lr} + .cfi_def_cfa_offset 4 + .cfi_rel_offset lr, 0 ldr r0, error_message ldr r1, error_code @@ -53,24 +59,28 @@ error_code: error_message: .word error_string-(1b+8) + .cfi_endproc END(__memset_chk) ENTRY(bzero) + .cfi_startproc mov r2, r1 mov r1, #0 - -done: +.L_done: // Fall through to memset... + .cfi_endproc END(bzero) ENTRY(memset) - .save {r0} + .cfi_startproc stmfd sp!, {r0} + .cfi_def_cfa_offset 4 + .cfi_rel_offset r0, 0 // The new algorithm is slower for copies < 16 so use the old // neon code in that case. cmp r2, #16 - blo set_less_than_16_unknown_align + blo .L_set_less_than_16_unknown_align // Use strd which requires an even and odd register so move the // values so that: @@ -84,17 +94,17 @@ ENTRY(memset) orr r1, r1, r1, lsr #8 orr r1, r1, r1, lsr #16 -check_alignment: +.L_check_alignment: // Align destination to a double word to avoid the strd crossing // a cache line boundary. ands ip, r3, #7 - bne do_double_word_align + bne .L_do_double_word_align -double_word_aligned: +.L_double_word_aligned: mov r0, r1 subs r2, #64 - blo set_less_than_64 + blo .L_set_less_than_64 1: // Main loop sets 64 bytes at a time. .irp offset, #0, #8, #16, #24, #32, #40, #48, #56 @@ -105,39 +115,39 @@ double_word_aligned: subs r2, #64 bge 1b -set_less_than_64: +.L_set_less_than_64: // Restore r2 to the count of bytes left to set. add r2, #64 lsls ip, r2, #27 - bcc set_less_than_32 + bcc .L_set_less_than_32 // Set 32 bytes. .irp offset, #0, #8, #16, #24 strd r0, r1, [r3, \offset] .endr add r3, #32 -set_less_than_32: - bpl set_less_than_16 +.L_set_less_than_32: + bpl .L_set_less_than_16 // Set 16 bytes. .irp offset, #0, #8 strd r0, r1, [r3, \offset] .endr add r3, #16 -set_less_than_16: +.L_set_less_than_16: // Less than 16 bytes to set. lsls ip, r2, #29 - bcc set_less_than_8 + bcc .L_set_less_than_8 // Set 8 bytes. strd r0, r1, [r3], #8 -set_less_than_8: - bpl set_less_than_4 +.L_set_less_than_8: + bpl .L_set_less_than_4 // Set 4 bytes str r1, [r3], #4 -set_less_than_4: +.L_set_less_than_4: lsls ip, r2, #31 it ne strbne r1, [r3], #1 @@ -148,7 +158,7 @@ set_less_than_4: ldmfd sp!, {r0} bx lr -do_double_word_align: +.L_do_double_word_align: rsb ip, ip, #8 sub r2, r2, ip movs r0, ip, lsl #31 @@ -160,11 +170,11 @@ do_double_word_align: // Dst is at least word aligned by this point. cmp ip, #4 - blo double_word_aligned + blo .L_double_word_aligned str r1, [r3], #4 - b double_word_aligned + b .L_double_word_aligned -set_less_than_16_unknown_align: +.L_set_less_than_16_unknown_align: // Set up to 15 bytes. vdup.8 d0, r1 movs ip, r2, lsl #29 @@ -180,6 +190,7 @@ set_less_than_16_unknown_align: strbcs r1, [r0], #1 ldmfd sp!, {r0} bx lr + .cfi_endproc END(memset) .data diff --git a/libc/arch-arm/cortex-a15/cortex-a15.mk b/libc/arch-arm/cortex-a15/cortex-a15.mk index 281e424ba..c62e7e72a 100644 --- a/libc/arch-arm/cortex-a15/cortex-a15.mk +++ b/libc/arch-arm/cortex-a15/cortex-a15.mk @@ -4,5 +4,7 @@ $(call libc-add-cpu-variant-src,STRCAT,arch-arm/cortex-a15/bionic/strcat.S) $(call libc-add-cpu-variant-src,STRCMP,arch-arm/cortex-a15/bionic/strcmp.S) $(call libc-add-cpu-variant-src,STRCPY,arch-arm/cortex-a15/bionic/strcpy.S) $(call libc-add-cpu-variant-src,STRLEN,arch-arm/cortex-a15/bionic/strlen.S) +$(call libc-add-cpu-variant-src,__STRCAT_CHK,arch-arm/cortex-a15/bionic/__strcat_chk.S) +$(call libc-add-cpu-variant-src,__STRCPY_CHK,arch-arm/cortex-a15/bionic/__strcpy_chk.S) include bionic/libc/arch-arm/generic/generic.mk diff --git a/libc/arch-arm/cortex-a9/bionic/__strcat_chk.S b/libc/arch-arm/cortex-a9/bionic/__strcat_chk.S new file mode 100644 index 000000000..3f866361d --- /dev/null +++ b/libc/arch-arm/cortex-a9/bionic/__strcat_chk.S @@ -0,0 +1,218 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include "libc_events.h" + + .syntax unified + .fpu neon + .thumb + .thumb_func + +// Get the length of src string, then get the source of the dst string. +// Check that the two lengths together don't exceed the threshold, then +// do a memcpy of the data. +ENTRY(__strcat_chk) + .cfi_startproc + pld [r0, #0] + push {r0, lr} + .cfi_def_cfa_offset 8 + .cfi_rel_offset r0, 0 + .cfi_rel_offset lr, 4 + push {r4, r5} + .cfi_adjust_cfa_offset 8 + .cfi_rel_offset r4, 0 + .cfi_rel_offset r5, 4 + + mov lr, r2 + + // Save the dst register to r5 + mov r5, r0 + + // Zero out r4 + eor r4, r4, r4 + + // r1 contains the address of the string to count. +.L_strlen_start: + mov r0, r1 + + ands r3, r0, #7 + bne .L_align_src + + .p2align 2 +.L_mainloop: + ldmia r1!, {r2, r3} + + pld [r1, #64] + + sub ip, r2, #0x01010101 + bic ip, ip, r2 + ands ip, ip, #0x80808080 + bne .L_zero_in_first_register + + sub ip, r3, #0x01010101 + bic ip, ip, r3 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + b .L_mainloop + +.L_zero_in_first_register: + sub r3, r1, r0 + // Check for zero in byte 0. + lsls r2, ip, #17 + beq .L_check_byte1_reg1 + + sub r3, r3, #8 + b .L_finish + +.L_check_byte1_reg1: + bcc .L_check_byte2_reg1 + + sub r3, r3, #7 + b .L_finish + +.L_check_byte2_reg1: + // Check for zero in byte 2. + tst ip, #0x800000 + it ne + subne r3, r3, #6 + bne .L_finish + sub r3, r3, #5 + b .L_finish + +.L_zero_in_second_register: + sub r3, r1, r0 + // Check for zero in byte 0. + lsls r2, ip, #17 + beq .L_check_byte1_reg2 + + sub r3, r3, #4 + b .L_finish + +.L_check_byte1_reg2: + bcc .L_check_byte2_reg2 + + sub r3, r3, #3 + b .L_finish + +.L_check_byte2_reg2: + // Check for zero in byte 2. + tst ip, #0x800000 + it ne + subne r3, r3, #2 + bne .L_finish + sub r3, r3, #1 + b .L_finish + +.L_align_src: + // Align to a double word (64 bits). + rsb r3, r3, #8 + lsls ip, r3, #31 + beq .L_align_to_32 + + ldrb r2, [r1], #1 + cbz r2, .L_done + +.L_align_to_32: + bcc .L_align_to_64 + + ldrb r2, [r1], #1 + cbz r2, .L_done + ldrb r2, [r1], #1 + cbz r2, .L_done + +.L_align_to_64: + tst r3, #4 + beq .L_mainloop + ldr r2, [r1], #4 + + sub ip, r2, #0x01010101 + bic ip, ip, r2 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + b .L_mainloop + +.L_done: + sub r3, r1, r0 + sub r3, r3, #1 + +.L_finish: + cmp r4, #0 + bne .L_strlen_done + + // Time to get the dst string length. + mov r1, r5 + + // Save the original source address to r5. + mov r5, r0 + + // Save the current length (adding 1 for the terminator). + add r4, r3, #1 + b .L_strlen_start + + // r0 holds the pointer to the dst string. + // r3 holds the dst string length. + // r4 holds the src string length + 1. +.L_strlen_done: + add r2, r3, r4 + cmp r2, lr + bgt .L_fortify_check_failed + + // Set up the registers for the memcpy code. + mov r1, r5 + pld [r1, #64] + mov r2, r4 + add r0, r0, r3 + pop {r4, r5} + .cfi_adjust_cfa_offset -8 + .cfi_restore r4 + .cfi_restore r5 + + #include "memcpy_base.S" + +.L_fortify_check_failed: + .cfi_adjust_cfa_offset 8 + .cfi_rel_offset r4, 0 + .cfi_rel_offset r5, 4 + + ldr r0, error_message + ldr r1, error_code +1: + add r0, pc + bl __fortify_chk_fail +error_code: + .word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW +error_message: + .word error_string-(1b+4) + + .cfi_endproc +END(__strcat_chk) + + .data +error_string: + .string "strcat buffer overflow" diff --git a/libc/arch-arm/cortex-a9/bionic/__strcpy_chk.S b/libc/arch-arm/cortex-a9/bionic/__strcpy_chk.S new file mode 100644 index 000000000..787b0578a --- /dev/null +++ b/libc/arch-arm/cortex-a9/bionic/__strcpy_chk.S @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include "libc_events.h" + + .syntax unified + .fpu neon + .thumb + .thumb_func + +// Get the length of the source string first, then do a memcpy of the data +// instead of a strcpy. +ENTRY(__strcpy_chk) + .cfi_startproc + pld [r0, #0] + push {r0, lr} + .cfi_def_cfa_offset 8 + .cfi_rel_offset r0, 0 + .cfi_rel_offset lr, 4 + + mov lr, r2 + mov r0, r1 + + ands r3, r0, #7 + bne .L_align_src + + .p2align 2 +.L_mainloop: + ldmia r0!, {r2, r3} + + pld [r0, #64] + + sub ip, r2, #0x01010101 + bic ip, ip, r2 + ands ip, ip, #0x80808080 + bne .L_zero_in_first_register + + sub ip, r3, #0x01010101 + bic ip, ip, r3 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + b .L_mainloop + +.L_zero_in_first_register: + sub r3, r0, r1 + // Check for zero in byte 0. + lsls r2, ip, #17 + beq .L_check_byte1_reg1 + + sub r3, r3, #8 + b .L_check_size + +.L_check_byte1_reg1: + bcc .L_check_byte2_reg1 + + sub r3, r3, #7 + b .L_check_size + +.L_check_byte2_reg1: + // Check for zero in byte 2. + tst ip, #0x800000 + it ne + subne r3, r3, #6 + bne .L_check_size + sub r3, r3, #5 + b .L_check_size + +.L_zero_in_second_register: + sub r3, r0, r1 + // Check for zero in byte 0. + lsls r2, ip, #17 + beq .L_check_byte1_reg2 + + sub r3, r3, #4 + b .L_check_size + +.L_check_byte1_reg2: + bcc .L_check_byte2_reg2 + + sub r3, r3, #3 + b .L_check_size + +.L_check_byte2_reg2: + // Check for zero in byte 2. + tst ip, #0x800000 + it ne + subne r3, r3, #2 + bne .L_check_size + sub r3, r3, #1 + b .L_check_size + +.L_align_src: + // Align to a double word (64 bits). + rsb r3, r3, #8 + lsls ip, r3, #31 + beq .L_align_to_32 + + ldrb r2, [r0], #1 + cbz r2, .L_done + +.L_align_to_32: + bcc .L_align_to_64 + + ldrb r2, [r0], #1 + cbz r2, .L_done + ldrb r2, [r0], #1 + cbz r2, .L_done + +.L_align_to_64: + tst r3, #4 + beq .L_mainloop + ldr r2, [r0], #4 + + sub ip, r2, #0x01010101 + bic ip, ip, r2 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + b .L_mainloop + +.L_done: + sub r3, r0, r1 + sub r3, r3, #1 + +.L_check_size: + pld [r1, #0] + pld [r1, #64] + ldr r0, [sp] + cmp r3, lr + bge .L_fortify_check_failed + + // Add 1 for copy length to get the string terminator. + add r2, r3, #1 + + #include "memcpy_base.S" + +.L_fortify_check_failed: + ldr r0, error_message + ldr r1, error_code +1: + add r0, pc + bl __fortify_chk_fail +error_code: + .word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW +error_message: + .word error_string-(1b+4) + + .cfi_endproc +END(__strcpy_chk) + + .data +error_string: + .string "strcpy buffer overflow" diff --git a/libc/arch-arm/cortex-a9/bionic/memcpy.S b/libc/arch-arm/cortex-a9/bionic/memcpy.S index 4e624d43a..e7beb25b3 100644 --- a/libc/arch-arm/cortex-a9/bionic/memcpy.S +++ b/libc/arch-arm/cortex-a9/bionic/memcpy.S @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include #include "libc_events.h" @@ -36,190 +35,40 @@ * cache line. */ - .text + .syntax unified .fpu neon - -#define CACHE_LINE_SIZE 32 + .thumb + .thumb_func ENTRY(__memcpy_chk) + .cfi_startproc cmp r2, r3 - bgt fortify_check_failed + bgt __memcpy_chk_fail // Fall through to memcpy... + .cfi_endproc END(__memcpy_chk) ENTRY(memcpy) - .save {r0, lr} - /* start preloading as early as possible */ - pld [r1, #(CACHE_LINE_SIZE * 0)] - stmfd sp!, {r0, lr} - pld [r1, #(CACHE_LINE_SIZE * 2)] + .cfi_startproc + pld [r1, #0] + stmfd sp!, {r0, lr} + .cfi_def_cfa_offset 8 + .cfi_rel_offset r0, 0 + .cfi_rel_offset lr, 4 + pld [r1, #64] - // Check so divider is at least 16 bytes, needed for alignment code. - cmp r2, #16 - blo 5f + #include "memcpy_base.S" + .cfi_endproc +END(memcpy) + .cfi_startproc +__memcpy_chk_fail: + // Preserve lr for backtrace. + push {lr} + .cfi_def_cfa_offset 4 + .cfi_rel_offset lr, 0 - /* check if buffers are aligned. If so, run arm-only version */ - eor r3, r0, r1 - ands r3, r3, #0x3 - beq 11f - - /* Check the upper size limit for Neon unaligned memory access in memcpy */ - cmp r2, #224 - blo 3f - - /* align destination to 16 bytes for the write-buffer */ - rsb r3, r0, #0 - ands r3, r3, #0xF - beq 3f - - /* copy up to 15-bytes (count in r3) */ - sub r2, r2, r3 - movs ip, r3, lsl #31 - ldrmib lr, [r1], #1 - strmib lr, [r0], #1 - ldrcsb ip, [r1], #1 - ldrcsb lr, [r1], #1 - strcsb ip, [r0], #1 - strcsb lr, [r0], #1 - movs ip, r3, lsl #29 - bge 1f - // copies 4 bytes, destination 32-bits aligned - vld1.32 {d0[0]}, [r1]! - vst1.32 {d0[0]}, [r0, :32]! -1: bcc 2f - // copies 8 bytes, destination 64-bits aligned - vld1.8 {d0}, [r1]! - vst1.8 {d0}, [r0, :64]! -2: - /* preload immediately the next cache line, which we may need */ - pld [r1, #(CACHE_LINE_SIZE * 0)] - pld [r1, #(CACHE_LINE_SIZE * 2)] -3: - /* make sure we have at least 64 bytes to copy */ - subs r2, r2, #64 - blo 2f - - /* preload all the cache lines we need */ - pld [r1, #(CACHE_LINE_SIZE * 4)] - pld [r1, #(CACHE_LINE_SIZE * 6)] - -1: /* The main loop copies 64 bytes at a time */ - vld1.8 {d0 - d3}, [r1]! - vld1.8 {d4 - d7}, [r1]! - pld [r1, #(CACHE_LINE_SIZE * 6)] - subs r2, r2, #64 - vst1.8 {d0 - d3}, [r0]! - vst1.8 {d4 - d7}, [r0]! - bhs 1b - -2: /* fix-up the remaining count and make sure we have >= 32 bytes left */ - add r2, r2, #64 - subs r2, r2, #32 - blo 4f - -3: /* 32 bytes at a time. These cache lines were already preloaded */ - vld1.8 {d0 - d3}, [r1]! - subs r2, r2, #32 - vst1.8 {d0 - d3}, [r0]! - bhs 3b - -4: /* less than 32 left */ - add r2, r2, #32 - tst r2, #0x10 - beq 5f - // copies 16 bytes, 128-bits aligned - vld1.8 {d0, d1}, [r1]! - vst1.8 {d0, d1}, [r0]! -5: /* copy up to 15-bytes (count in r2) */ - movs ip, r2, lsl #29 - bcc 1f - vld1.8 {d0}, [r1]! - vst1.8 {d0}, [r0]! -1: bge 2f - vld1.32 {d0[0]}, [r1]! - vst1.32 {d0[0]}, [r0]! -2: movs ip, r2, lsl #31 - ldrmib r3, [r1], #1 - ldrcsb ip, [r1], #1 - ldrcsb lr, [r1], #1 - strmib r3, [r0], #1 - strcsb ip, [r0], #1 - strcsb lr, [r0], #1 - - ldmfd sp!, {r0, lr} - bx lr -11: - /* Simple arm-only copy loop to handle aligned copy operations */ - stmfd sp!, {r4, r5, r6, r7, r8} - pld [r1, #(CACHE_LINE_SIZE * 4)] - - /* Check alignment */ - rsb r3, r1, #0 - ands r3, #3 - beq 2f - - /* align source to 32 bits. We need to insert 2 instructions between - * a ldr[b|h] and str[b|h] because byte and half-word instructions - * stall 2 cycles. - */ - movs r12, r3, lsl #31 - sub r2, r2, r3 /* we know that r3 <= r2 because r2 >= 4 */ - ldrmib r3, [r1], #1 - ldrcsb r4, [r1], #1 - ldrcsb r5, [r1], #1 - strmib r3, [r0], #1 - strcsb r4, [r0], #1 - strcsb r5, [r0], #1 - -2: - subs r2, r2, #64 - blt 4f - -3: /* Main copy loop, copying 64 bytes at a time */ - pld [r1, #(CACHE_LINE_SIZE * 8)] - ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr} - stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr} - ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr} - stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr} - subs r2, r2, #64 - bge 3b - -4: /* Check if there are > 32 bytes left */ - adds r2, r2, #64 - subs r2, r2, #32 - blt 5f - - /* Copy 32 bytes */ - ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr} - stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr} - subs r2, #32 - -5: /* Handle any remaining bytes */ - adds r2, #32 - beq 6f - - movs r12, r2, lsl #28 - ldmcsia r1!, {r3, r4, r5, r6} /* 16 bytes */ - ldmmiia r1!, {r7, r8} /* 8 bytes */ - stmcsia r0!, {r3, r4, r5, r6} - stmmiia r0!, {r7, r8} - movs r12, r2, lsl #30 - ldrcs r3, [r1], #4 /* 4 bytes */ - ldrmih r4, [r1], #2 /* 2 bytes */ - strcs r3, [r0], #4 - strmih r4, [r0], #2 - tst r2, #0x1 - ldrneb r3, [r1] /* last byte */ - strneb r3, [r0] -6: - ldmfd sp!, {r4, r5, r6, r7, r8} - ldmfd sp!, {r0, pc} - - - // Only reached when the __memcpy_chk check fails. -fortify_check_failed: ldr r0, error_message ldr r1, error_code 1: @@ -228,8 +77,8 @@ fortify_check_failed: error_code: .word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW error_message: - .word error_string-(1b+8) -END(memcpy) + .word error_string-(1b+4) + .cfi_endproc .data error_string: diff --git a/libc/arch-arm/cortex-a9/bionic/memcpy_base.S b/libc/arch-arm/cortex-a9/bionic/memcpy_base.S new file mode 100644 index 000000000..46b5a9361 --- /dev/null +++ b/libc/arch-arm/cortex-a9/bionic/memcpy_base.S @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * This code assumes it is running on a processor that supports all arm v7 + * instructions, that supports neon instructions, and that has a 32 byte + * cache line. + */ + + // Check so divider is at least 16 bytes, needed for alignment code. + cmp r2, #16 + blo 5f + + + /* check if buffers are aligned. If so, run arm-only version */ + eor r3, r0, r1 + ands r3, r3, #0x3 + beq 11f + + /* Check the upper size limit for Neon unaligned memory access in memcpy */ + cmp r2, #224 + blo 3f + + /* align destination to 16 bytes for the write-buffer */ + rsb r3, r0, #0 + ands r3, r3, #0xF + beq 3f + + /* copy up to 15-bytes (count in r3) */ + sub r2, r2, r3 + movs ip, r3, lsl #31 + itt mi + ldrbmi lr, [r1], #1 + strbmi lr, [r0], #1 + itttt cs + ldrbcs ip, [r1], #1 + ldrbcs lr, [r1], #1 + strbcs ip, [r0], #1 + strbcs lr, [r0], #1 + movs ip, r3, lsl #29 + bge 1f + // copies 4 bytes, destination 32-bits aligned + vld1.32 {d0[0]}, [r1]! + vst1.32 {d0[0]}, [r0, :32]! +1: bcc 2f + // copies 8 bytes, destination 64-bits aligned + vld1.8 {d0}, [r1]! + vst1.8 {d0}, [r0, :64]! +2: + /* preload immediately the next cache line, which we may need */ + pld [r1, #0] + pld [r1, #(32 * 2)] +3: + /* make sure we have at least 64 bytes to copy */ + subs r2, r2, #64 + blo 2f + + /* preload all the cache lines we need */ + pld [r1, #(32 * 4)] + pld [r1, #(32 * 6)] + +1: /* The main loop copies 64 bytes at a time */ + vld1.8 {d0 - d3}, [r1]! + vld1.8 {d4 - d7}, [r1]! + pld [r1, #(32 * 6)] + subs r2, r2, #64 + vst1.8 {d0 - d3}, [r0]! + vst1.8 {d4 - d7}, [r0]! + bhs 1b + +2: /* fix-up the remaining count and make sure we have >= 32 bytes left */ + add r2, r2, #64 + subs r2, r2, #32 + blo 4f + +3: /* 32 bytes at a time. These cache lines were already preloaded */ + vld1.8 {d0 - d3}, [r1]! + subs r2, r2, #32 + vst1.8 {d0 - d3}, [r0]! + bhs 3b + +4: /* less than 32 left */ + add r2, r2, #32 + tst r2, #0x10 + beq 5f + // copies 16 bytes, 128-bits aligned + vld1.8 {d0, d1}, [r1]! + vst1.8 {d0, d1}, [r0]! +5: /* copy up to 15-bytes (count in r2) */ + movs ip, r2, lsl #29 + bcc 1f + vld1.8 {d0}, [r1]! + vst1.8 {d0}, [r0]! +1: bge 2f + vld1.32 {d0[0]}, [r1]! + vst1.32 {d0[0]}, [r0]! +2: movs ip, r2, lsl #31 + itt mi + ldrbmi r3, [r1], #1 + strbmi r3, [r0], #1 + itttt cs + ldrbcs ip, [r1], #1 + ldrbcs lr, [r1], #1 + strbcs ip, [r0], #1 + strbcs lr, [r0], #1 + + ldmfd sp!, {r0, lr} + bx lr +11: + /* Simple arm-only copy loop to handle aligned copy operations */ + stmfd sp!, {r4, r5, r6, r7, r8} + pld [r1, #(32 * 4)] + + /* Check alignment */ + rsb r3, r1, #0 + ands r3, #3 + beq 2f + + /* align source to 32 bits. We need to insert 2 instructions between + * a ldr[b|h] and str[b|h] because byte and half-word instructions + * stall 2 cycles. + */ + movs r12, r3, lsl #31 + sub r2, r2, r3 /* we know that r3 <= r2 because r2 >= 4 */ + itt mi + ldrbmi r3, [r1], #1 + strbmi r3, [r0], #1 + itttt cs + ldrbcs r4, [r1], #1 + ldrbcs r5, [r1], #1 + strbcs r4, [r0], #1 + strbcs r5, [r0], #1 + +2: + subs r2, r2, #64 + blt 4f + +3: /* Main copy loop, copying 64 bytes at a time */ + pld [r1, #(32 * 8)] + ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr} + stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr} + ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr} + stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr} + subs r2, r2, #64 + bge 3b + +4: /* Check if there are > 32 bytes left */ + adds r2, r2, #64 + subs r2, r2, #32 + blt 5f + + /* Copy 32 bytes */ + ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr} + stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr} + subs r2, #32 + +5: /* Handle any remaining bytes */ + adds r2, #32 + beq 6f + + movs r12, r2, lsl #28 + itt cs + ldmiacs r1!, {r3, r4, r5, r6} /* 16 bytes */ + stmiacs r0!, {r3, r4, r5, r6} + itt mi + ldmiami r1!, {r7, r8} /* 8 bytes */ + stmiami r0!, {r7, r8} + movs r12, r2, lsl #30 + itt cs + ldrcs r3, [r1], #4 /* 4 bytes */ + strcs r3, [r0], #4 + itt mi + ldrhmi r4, [r1], #2 /* 2 bytes */ + strhmi r4, [r0], #2 + tst r2, #0x1 + itt ne + ldrbne r3, [r1] /* last byte */ + strbne r3, [r0] +6: + ldmfd sp!, {r4, r5, r6, r7, r8} + ldmfd sp!, {r0, pc} diff --git a/libc/arch-arm/cortex-a9/bionic/memset.S b/libc/arch-arm/cortex-a9/bionic/memset.S index d01143039..bc25a3e2e 100644 --- a/libc/arch-arm/cortex-a9/bionic/memset.S +++ b/libc/arch-arm/cortex-a9/bionic/memset.S @@ -38,8 +38,14 @@ .fpu neon ENTRY(__memset_chk) + .cfi_startproc cmp r2, r3 - bls done + bls .L_done + + // Preserve lr for backtrace. + push {lr} + .cfi_def_cfa_offset 4 + .cfi_rel_offset lr, 0 ldr r0, error_message ldr r1, error_code @@ -51,24 +57,29 @@ error_code: error_message: .word error_string-(1b+8) + .cfi_endproc END(__memset_chk) ENTRY(bzero) + .cfi_startproc mov r2, r1 mov r1, #0 -done: +.L_done: // Fall through to memset... + .cfi_endproc END(bzero) /* memset() returns its first argument. */ ENTRY(memset) + .cfi_startproc # The neon memset only wins for less than 132. cmp r2, #132 bhi 11f - .save {r0} stmfd sp!, {r0} + .cfi_def_cfa_offset 4 + .cfi_rel_offset r0, 0 vdup.8 q0, r1 @@ -106,8 +117,15 @@ ENTRY(memset) * offset = (4-(src&3))&3 = -src & 3 */ - .save {r0, r4-r7, lr} stmfd sp!, {r0, r4-r7, lr} + .cfi_def_cfa_offset 24 + .cfi_rel_offset r0, 0 + .cfi_rel_offset r4, 4 + .cfi_rel_offset r5, 8 + .cfi_rel_offset r6, 12 + .cfi_rel_offset r7, 16 + .cfi_rel_offset lr, 20 + rsb r3, r0, #0 ands r3, r3, #3 cmp r3, r2 @@ -169,6 +187,7 @@ ENTRY(memset) strcsb r1, [r0] ldmfd sp!, {r0, r4-r7, lr} bx lr + .cfi_endproc END(memset) .data diff --git a/libc/arch-arm/cortex-a9/cortex-a9.mk b/libc/arch-arm/cortex-a9/cortex-a9.mk index 61a52c2ac..eee1b3646 100644 --- a/libc/arch-arm/cortex-a9/cortex-a9.mk +++ b/libc/arch-arm/cortex-a9/cortex-a9.mk @@ -4,5 +4,7 @@ $(call libc-add-cpu-variant-src,STRCAT,arch-arm/cortex-a9/bionic/strcat.S) $(call libc-add-cpu-variant-src,STRCMP,arch-arm/cortex-a9/bionic/strcmp.S) $(call libc-add-cpu-variant-src,STRCPY,arch-arm/cortex-a9/bionic/strcpy.S) $(call libc-add-cpu-variant-src,STRLEN,arch-arm/cortex-a9/bionic/strlen.S) +$(call libc-add-cpu-variant-src,__STRCAT_CHK,arch-arm/cortex-a9/bionic/__strcat_chk.S) +$(call libc-add-cpu-variant-src,__STRCPY_CHK,arch-arm/cortex-a9/bionic/__strcpy_chk.S) include bionic/libc/arch-arm/generic/generic.mk diff --git a/libc/arch-arm/generic/generic.mk b/libc/arch-arm/generic/generic.mk index c3a5aa53b..e2300039f 100644 --- a/libc/arch-arm/generic/generic.mk +++ b/libc/arch-arm/generic/generic.mk @@ -4,3 +4,5 @@ $(call libc-add-cpu-variant-src,STRCAT,string/strcat.c) $(call libc-add-cpu-variant-src,STRCMP,arch-arm/generic/bionic/strcmp.S) $(call libc-add-cpu-variant-src,STRCPY,arch-arm/generic/bionic/strcpy.S) $(call libc-add-cpu-variant-src,STRLEN,arch-arm/generic/bionic/strlen.c) +$(call libc-add-cpu-variant-src,__STRCAT_CHK,bionic/__strcat_chk.cpp) +$(call libc-add-cpu-variant-src,__STRCPY_CHK,bionic/__strcpy_chk.cpp) diff --git a/libc/arch-arm/krait/bionic/__strcat_chk.S b/libc/arch-arm/krait/bionic/__strcat_chk.S new file mode 100644 index 000000000..4516d3005 --- /dev/null +++ b/libc/arch-arm/krait/bionic/__strcat_chk.S @@ -0,0 +1,215 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include "libc_events.h" + + .syntax unified + + .thumb + .thumb_func + +// Get the length of src string, then get the source of the dst string. +// Check that the two lengths together don't exceed the threshold, then +// do a memcpy of the data. +ENTRY(__strcat_chk) + .cfi_startproc + pld [r0, #0] + push {r0, lr} + .cfi_def_cfa_offset 8 + .cfi_rel_offset r0, 0 + .cfi_rel_offset lr, 4 + push {r4, r5} + .cfi_adjust_cfa_offset 8 + .cfi_rel_offset r4, 0 + .cfi_rel_offset r5, 4 + + mov lr, r2 + + // Save the dst register to r5 + mov r5, r0 + + // Zero out r4 + eor r4, r4, r4 + + // r1 contains the address of the string to count. +.L_strlen_start: + mov r0, r1 + ands r3, r1, #7 + beq .L_mainloop + + // Align to a double word (64 bits). + rsb r3, r3, #8 + lsls ip, r3, #31 + beq .L_align_to_32 + + ldrb r2, [r1], #1 + cbz r2, .L_update_count_and_finish + +.L_align_to_32: + bcc .L_align_to_64 + ands ip, r3, #2 + beq .L_align_to_64 + + ldrb r2, [r1], #1 + cbz r2, .L_update_count_and_finish + ldrb r2, [r1], #1 + cbz r2, .L_update_count_and_finish + +.L_align_to_64: + tst r3, #4 + beq .L_mainloop + ldr r3, [r1], #4 + + sub ip, r3, #0x01010101 + bic ip, ip, r3 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + + .p2align 2 +.L_mainloop: + ldrd r2, r3, [r1], #8 + + pld [r1, #64] + + sub ip, r2, #0x01010101 + bic ip, ip, r2 + ands ip, ip, #0x80808080 + bne .L_zero_in_first_register + + sub ip, r3, #0x01010101 + bic ip, ip, r3 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + b .L_mainloop + +.L_update_count_and_finish: + sub r3, r1, r0 + sub r3, r3, #1 + b .L_finish + +.L_zero_in_first_register: + sub r3, r1, r0 + lsls r2, ip, #17 + bne .L_sub8_and_finish + bcs .L_sub7_and_finish + lsls ip, ip, #1 + bne .L_sub6_and_finish + + sub r3, r3, #5 + b .L_finish + +.L_sub8_and_finish: + sub r3, r3, #8 + b .L_finish + +.L_sub7_and_finish: + sub r3, r3, #7 + b .L_finish + +.L_sub6_and_finish: + sub r3, r3, #6 + b .L_finish + +.L_zero_in_second_register: + sub r3, r1, r0 + lsls r2, ip, #17 + bne .L_sub4_and_finish + bcs .L_sub3_and_finish + lsls ip, ip, #1 + bne .L_sub2_and_finish + + sub r3, r3, #1 + b .L_finish + +.L_sub4_and_finish: + sub r3, r3, #4 + b .L_finish + +.L_sub3_and_finish: + sub r3, r3, #3 + b .L_finish + +.L_sub2_and_finish: + sub r3, r3, #2 + +.L_finish: + cmp r4, #0 + bne .L_strlen_done + + // Time to get the dst string length. + mov r1, r5 + + // Save the original source address to r5. + mov r5, r0 + + // Save the current length (adding 1 for the terminator). + add r4, r3, #1 + b .L_strlen_start + + // r0 holds the pointer to the dst string. + // r3 holds the dst string length. + // r4 holds the src string length + 1. +.L_strlen_done: + add r2, r3, r4 + cmp r2, lr + bgt .L_fortify_check_failed + + // Set up the registers for the memcpy code. + mov r1, r5 + pld [r1, #64] + mov r2, r4 + add r0, r0, r3 + pop {r4, r5} + .cfi_adjust_cfa_offset -8 + .cfi_restore r4 + .cfi_restore r5 + + #include "memcpy_base.S" + +.L_fortify_check_failed: + .cfi_adjust_cfa_offset 8 + .cfi_rel_offset r4, 0 + .cfi_rel_offset r5, 4 + + ldr r0, error_message + ldr r1, error_code +1: + add r0, pc + bl __fortify_chk_fail +error_code: + .word BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW +error_message: + .word error_string-(1b+4) + + .cfi_endproc +END(__strcat_chk) + + .data +error_string: + .string "strcat buffer overflow" diff --git a/libc/arch-arm/krait/bionic/__strcpy_chk.S b/libc/arch-arm/krait/bionic/__strcpy_chk.S new file mode 100644 index 000000000..c57268c46 --- /dev/null +++ b/libc/arch-arm/krait/bionic/__strcpy_chk.S @@ -0,0 +1,175 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include "libc_events.h" + + .syntax unified + + .thumb + .thumb_func + +// Get the length of the source string first, then do a memcpy of the data +// instead of a strcpy. +ENTRY(__strcpy_chk) + .cfi_startproc + pld [r0, #0] + push {r0, lr} + .cfi_def_cfa_offset 8 + .cfi_rel_offset r0, 0 + .cfi_rel_offset lr, 4 + + mov lr, r2 + mov r0, r1 + + ands r3, r1, #7 + beq .L_mainloop + + // Align to a double word (64 bits). + rsb r3, r3, #8 + lsls ip, r3, #31 + beq .L_align_to_32 + + ldrb r2, [r0], #1 + cbz r2, .L_update_count_and_finish + +.L_align_to_32: + bcc .L_align_to_64 + ands ip, r3, #2 + beq .L_align_to_64 + + ldrb r2, [r0], #1 + cbz r2, .L_update_count_and_finish + ldrb r2, [r0], #1 + cbz r2, .L_update_count_and_finish + +.L_align_to_64: + tst r3, #4 + beq .L_mainloop + ldr r3, [r0], #4 + + sub ip, r3, #0x01010101 + bic ip, ip, r3 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + + .p2align 2 +.L_mainloop: + ldrd r2, r3, [r0], #8 + + pld [r0, #64] + + sub ip, r2, #0x01010101 + bic ip, ip, r2 + ands ip, ip, #0x80808080 + bne .L_zero_in_first_register + + sub ip, r3, #0x01010101 + bic ip, ip, r3 + ands ip, ip, #0x80808080 + bne .L_zero_in_second_register + b .L_mainloop + +.L_update_count_and_finish: + sub r3, r0, r1 + sub r3, r3, #1 + b .L_check_size + +.L_zero_in_first_register: + sub r3, r0, r1 + lsls r2, ip, #17 + bne .L_sub8_and_finish + bcs .L_sub7_and_finish + lsls ip, ip, #1 + bne .L_sub6_and_finish + + sub r3, r3, #5 + b .L_check_size + +.L_sub8_and_finish: + sub r3, r3, #8 + b .L_check_size + +.L_sub7_and_finish: + sub r3, r3, #7 + b .L_check_size + +.L_sub6_and_finish: + sub r3, r3, #6 + b .L_check_size + +.L_zero_in_second_register: + sub r3, r0, r1 + lsls r2, ip, #17 + bne .L_sub4_and_finish + bcs .L_sub3_and_finish + lsls ip, ip, #1 + bne .L_sub2_and_finish + + sub r3, r3, #1 + b .L_check_size + +.L_sub4_and_finish: + sub r3, r3, #4 + b .L_check_size + +.L_sub3_and_finish: + sub r3, r3, #3 + b .L_check_size + +.L_sub2_and_finish: + sub r3, r3, #2 + +.L_check_size: + pld [r1, #0] + pld [r1, #64] + ldr r0, [sp] + cmp r3, lr + bge .L_fortify_check_failed + + // Add 1 for copy length to get the string terminator. + add r2, r3, #1 + + #include "memcpy_base.S" + +.L_fortify_check_failed: + ldr r0, error_message + ldr r1, error_code +1: + add r0, pc + bl __fortify_chk_fail +error_code: + .word BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW +error_message: + .word error_string-(1b+4) + .cfi_endproc +END(__strcpy_chk) + + .data +error_string: + .string "strcpy buffer overflow" diff --git a/libc/arch-arm/krait/bionic/memcpy.S b/libc/arch-arm/krait/bionic/memcpy.S index 3afe18ca8..dde231ae9 100644 --- a/libc/arch-arm/krait/bionic/memcpy.S +++ b/libc/arch-arm/krait/bionic/memcpy.S @@ -28,7 +28,6 @@ /* Assumes neon instructions and a cache line size of 32 bytes. */ -#include #include #include "libc_events.h" @@ -38,103 +37,40 @@ * cache line. */ -#define CACHE_LINE_SIZE 32 - .text + .syntax unified .fpu neon + .thumb + .thumb_func ENTRY(__memcpy_chk) + .cfi_startproc cmp r2, r3 - bgt fortify_check_failed + bgt __memcpy_chk_fail // Fall through to memcpy... + .cfi_endproc END(__memcpy_chk) ENTRY(memcpy) - .save {r0, lr} - /* start preloading as early as possible */ - pld [r1, #(CACHE_LINE_SIZE*4)] - stmfd sp!, {r0, lr} + .cfi_startproc + pld [r1, #64] + stmfd sp!, {r0, lr} + .cfi_def_cfa_offset 8 + .cfi_rel_offset r0, 0 + .cfi_rel_offset lr, 4 - /* do we have at least 16-bytes to copy (needed for alignment below) */ - cmp r2, #16 - blo 5f + #include "memcpy_base.S" + .cfi_endproc +END(memcpy) - /* align destination to cache-line for the write-buffer */ - rsb r3, r0, #0 - ands r3, r3, #0xF - beq 2f + .cfi_startproc +__memcpy_chk_fail: + // Preserve lr for backtrace. + push {lr} + .cfi_def_cfa_offset 4 + .cfi_rel_offset lr, 0 - /* copy up to 15-bytes (count in r3) */ - sub r2, r2, r3 - movs ip, r3, lsl #31 - ldrmib lr, [r1], #1 - strmib lr, [r0], #1 - ldrcsb ip, [r1], #1 - ldrcsb lr, [r1], #1 - strcsb ip, [r0], #1 - strcsb lr, [r0], #1 - movs ip, r3, lsl #29 - bge 1f - // copies 4 bytes, destination 32-bits aligned - vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! - vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]! -1: bcc 2f - // copies 8 bytes, destination 64-bits aligned - vld1.8 {d0}, [r1]! - vst1.8 {d0}, [r0, :64]! - -2: /* make sure we have at least 64 bytes to copy */ - subs r2, r2, #64 - blo 2f - -1: /* The main loop copies 64 bytes at a time */ - vld1.8 {d0 - d3}, [r1]! - vld1.8 {d4 - d7}, [r1]! - pld [r1, #(CACHE_LINE_SIZE*2)] - subs r2, r2, #64 - vst1.8 {d0 - d3}, [r0, :128]! - vst1.8 {d4 - d7}, [r0, :128]! - bhs 1b - -2: /* fix-up the remaining count and make sure we have >= 32 bytes left */ - adds r2, r2, #32 - blo 4f - - /* Copy 32 bytes. These cache lines were already preloaded */ - vld1.8 {d0 - d3}, [r1]! - sub r2, r2, #32 - vst1.8 {d0 - d3}, [r0, :128]! - -4: /* less than 32 left */ - add r2, r2, #32 - tst r2, #0x10 - beq 5f - // copies 16 bytes, 128-bits aligned - vld1.8 {d0, d1}, [r1]! - vst1.8 {d0, d1}, [r0, :128]! - -5: /* copy up to 15-bytes (count in r2) */ - movs ip, r2, lsl #29 - bcc 1f - vld1.8 {d0}, [r1]! - vst1.8 {d0}, [r0]! -1: bge 2f - vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! - vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]! -2: movs ip, r2, lsl #31 - ldrmib r3, [r1], #1 - ldrcsb ip, [r1], #1 - ldrcsb lr, [r1], #1 - strmib r3, [r0], #1 - strcsb ip, [r0], #1 - strcsb lr, [r0], #1 - - ldmfd sp!, {r0, lr} - bx lr - - // Only reached when the __memcpy_chk check fails. -fortify_check_failed: ldr r0, error_message ldr r1, error_code 1: @@ -143,8 +79,8 @@ fortify_check_failed: error_code: .word BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW error_message: - .word error_string-(1b+8) -END(memcpy) + .word error_string-(1b+4) + .cfi_endproc .data error_string: diff --git a/libc/arch-arm/krait/bionic/memcpy_base.S b/libc/arch-arm/krait/bionic/memcpy_base.S new file mode 100644 index 000000000..48ce477f0 --- /dev/null +++ b/libc/arch-arm/krait/bionic/memcpy_base.S @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +/* + * This code assumes it is running on a processor that supports all arm v7 + * instructions, that supports neon instructions, and that has a 32 byte + * cache line. + */ + +// Assumes neon instructions and a cache line size of 32 bytes. + + /* do we have at least 16-bytes to copy (needed for alignment below) */ + cmp r2, #16 + blo 5f + + /* align destination to cache-line for the write-buffer */ + rsb r3, r0, #0 + ands r3, r3, #0xF + beq 2f + + /* copy up to 15-bytes (count in r3) */ + sub r2, r2, r3 + movs ip, r3, lsl #31 + itt mi + ldrbmi lr, [r1], #1 + strbmi lr, [r0], #1 + itttt cs + ldrbcs ip, [r1], #1 + ldrbcs lr, [r1], #1 + strbcs ip, [r0], #1 + strbcs lr, [r0], #1 + movs ip, r3, lsl #29 + bge 1f + // copies 4 bytes, destination 32-bits aligned + vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! + vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0, :32]! +1: bcc 2f + // copies 8 bytes, destination 64-bits aligned + vld1.8 {d0}, [r1]! + vst1.8 {d0}, [r0, :64]! + +2: /* make sure we have at least 64 bytes to copy */ + subs r2, r2, #64 + blo 2f + +1: /* The main loop copies 64 bytes at a time */ + vld1.8 {d0 - d3}, [r1]! + vld1.8 {d4 - d7}, [r1]! + pld [r1, #(32*2)] + subs r2, r2, #64 + vst1.8 {d0 - d3}, [r0, :128]! + vst1.8 {d4 - d7}, [r0, :128]! + bhs 1b + +2: /* fix-up the remaining count and make sure we have >= 32 bytes left */ + adds r2, r2, #32 + blo 4f + + /* Copy 32 bytes. These cache lines were already preloaded */ + vld1.8 {d0 - d3}, [r1]! + sub r2, r2, #32 + vst1.8 {d0 - d3}, [r0, :128]! + +4: /* less than 32 left */ + add r2, r2, #32 + tst r2, #0x10 + beq 5f + // copies 16 bytes, 128-bits aligned + vld1.8 {d0, d1}, [r1]! + vst1.8 {d0, d1}, [r0, :128]! + +5: /* copy up to 15-bytes (count in r2) */ + movs ip, r2, lsl #29 + bcc 1f + vld1.8 {d0}, [r1]! + vst1.8 {d0}, [r0]! +1: bge 2f + vld4.8 {d0[0], d1[0], d2[0], d3[0]}, [r1]! + vst4.8 {d0[0], d1[0], d2[0], d3[0]}, [r0]! +2: movs ip, r2, lsl #31 + itt mi + ldrbmi r3, [r1], #1 + strbmi r3, [r0], #1 + itttt cs + ldrbcs ip, [r1], #1 + ldrbcs lr, [r1], #1 + strbcs ip, [r0], #1 + strbcs lr, [r0], #1 + + ldmfd sp!, {r0, lr} + bx lr diff --git a/libc/arch-arm/krait/bionic/memset.S b/libc/arch-arm/krait/bionic/memset.S index 4e4788b7b..15661320b 100644 --- a/libc/arch-arm/krait/bionic/memset.S +++ b/libc/arch-arm/krait/bionic/memset.S @@ -39,8 +39,14 @@ .fpu neon ENTRY(__memset_chk) + .cfi_startproc cmp r2, r3 - bls done + bls .L_done + + // Preserve lr for backtrace. + push {lr} + .cfi_def_cfa_offset 4 + .cfi_rel_offset lr, 0 ldr r0, error_message ldr r1, error_code @@ -52,20 +58,25 @@ error_code: error_message: .word error_string-(1b+8) + .cfi_endproc END(__memset_chk) ENTRY(bzero) + .cfi_startproc mov r2, r1 mov r1, #0 -done: +.L_done: // Fall through to memset... + .cfi_endproc END(bzero) /* memset() returns its first argument. */ ENTRY(memset) - .save {r0} + .cfi_startproc stmfd sp!, {r0} + .cfi_def_cfa_offset 4 + .cfi_rel_offset r0, 0 vdup.8 q0, r1 @@ -98,6 +109,7 @@ ENTRY(memset) strcsb r1, [r0], #1 ldmfd sp!, {r0} bx lr + .cfi_endproc END(memset) .data diff --git a/libc/arch-arm/krait/krait.mk b/libc/arch-arm/krait/krait.mk index 1ff18e9bb..29ab743c6 100644 --- a/libc/arch-arm/krait/krait.mk +++ b/libc/arch-arm/krait/krait.mk @@ -1,6 +1,8 @@ $(call libc-add-cpu-variant-src,MEMCPY,arch-arm/krait/bionic/memcpy.S) $(call libc-add-cpu-variant-src,MEMSET,arch-arm/krait/bionic/memset.S) $(call libc-add-cpu-variant-src,STRCMP,arch-arm/krait/bionic/strcmp.S) +$(call libc-add-cpu-variant-src,__STRCAT_CHK,arch-arm/krait/bionic/__strcat_chk.S) +$(call libc-add-cpu-variant-src,__STRCPY_CHK,arch-arm/krait/bionic/__strcpy_chk.S) # Use cortex-a15 versions of strcat/strcpy/strlen. $(call libc-add-cpu-variant-src,STRCAT,arch-arm/cortex-a15/bionic/strcat.S) $(call libc-add-cpu-variant-src,STRCPY,arch-arm/cortex-a15/bionic/strcpy.S) From cb491bc66dc0abc145930b09086eb9189a30f6c2 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Mon, 19 Aug 2013 17:45:09 -0700 Subject: [PATCH 002/148] Add the dl_iterate_phdr function to libdl for arm. Bug: 8410085 Change-Id: I94ed51bc5d4c626df7552c0e85c31ccee2d6568f --- libc/arch-arm/arm.mk | 5 +++-- libc/include/link.h | 4 ++-- libdl/libdl.c | 6 +----- linker/dlfcn.cpp | 20 +++++++++++--------- linker/linker.cpp | 4 +--- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/libc/arch-arm/arm.mk b/libc/arch-arm/arm.mk index e87ef3803..5f2443f9a 100644 --- a/libc/arch-arm/arm.mk +++ b/libc/arch-arm/arm.mk @@ -21,10 +21,11 @@ _LIBC_ARCH_COMMON_SRC_FILES := \ # These are used by the static and dynamic versions of the libc # respectively. _LIBC_ARCH_STATIC_SRC_FILES := \ - arch-arm/bionic/exidx_static.c + arch-arm/bionic/exidx_static.c \ + bionic/dl_iterate_phdr_static.c \ _LIBC_ARCH_DYNAMIC_SRC_FILES := \ - arch-arm/bionic/exidx_dynamic.c + arch-arm/bionic/exidx_dynamic.c \ # Remove the C++ fortify function implementations for which there is an # arm assembler version. diff --git a/libc/include/link.h b/libc/include/link.h index 842b4483d..0edf5df9a 100644 --- a/libc/include/link.h +++ b/libc/include/link.h @@ -43,11 +43,11 @@ struct dl_phdr_info { ElfW(Half) dlpi_phnum; }; +int dl_iterate_phdr(int (*cb)(struct dl_phdr_info*, size_t, void*), void*); + #ifdef __arm__ typedef long unsigned int* _Unwind_Ptr; _Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc, int* pcount); -#else -int dl_iterate_phdr(int (*cb)(struct dl_phdr_info*, size_t, void*), void*); #endif __END_DECLS diff --git a/libdl/libdl.c b/libdl/libdl.c index 378f521b6..548364cba 100644 --- a/libdl/libdl.c +++ b/libdl/libdl.c @@ -30,12 +30,8 @@ void android_update_LD_LIBRARY_PATH(const char* ld_library_path) { } void *dl_unwind_find_exidx(void *pc, int *pcount) { return 0; } -#elif defined(__i386__) || defined(__mips__) +#endif /* we munge the cb definition so we don't have to include any headers here. * It won't affect anything since these are just symbols anyway */ int dl_iterate_phdr(int (*cb)(void *info, void *size, void *data), void *data) { return 0; } - -#else -#error Unsupported architecture. Only mips, arm and x86 are supported. -#endif diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp index 638164d68..946f79eb7 100644 --- a/linker/dlfcn.cpp +++ b/linker/dlfcn.cpp @@ -146,11 +146,10 @@ int dlclose(void* handle) { } #if defined(ANDROID_ARM_LINKER) -// 0000000 00011111 111112 22222222 2333333 3333444444444455555555556666666 6667 -// 0123456 78901234 567890 12345678 9012345 6789012345678901234567890123456 7890 +// 0000000 00011111 111112 22222222 2333333 3333444444444455555555556666666 6667777777777888 8888888 +// 0123456 78901234 567890 12345678 9012345 6789012345678901234567890123456 7890123456789012 3456789 #define ANDROID_LIBDL_STRTAB \ - "dlopen\0dlclose\0dlsym\0dlerror\0dladdr\0android_update_LD_LIBRARY_PATH\0dl_unwind_find_exidx\0" - + "dlopen\0dlclose\0dlsym\0dlerror\0dladdr\0android_update_LD_LIBRARY_PATH\0dl_iterate_phdr\0dl_unwind_find_exidx\0" #elif defined(ANDROID_X86_LINKER) || defined(ANDROID_MIPS_LINKER) // 0000000 00011111 111112 22222222 2333333 3333444444444455555555556666666 6667 // 0123456 78901234 567890 12345678 9012345 6789012345678901234567890123456 7890 @@ -181,10 +180,9 @@ static Elf32_Sym gLibDlSymtab[] = { ELF32_SYM_INITIALIZER(21, &dlerror, 1), ELF32_SYM_INITIALIZER(29, &dladdr, 1), ELF32_SYM_INITIALIZER(36, &android_update_LD_LIBRARY_PATH, 1), -#if defined(ANDROID_ARM_LINKER) - ELF32_SYM_INITIALIZER(67, &dl_unwind_find_exidx, 1), -#elif defined(ANDROID_X86_LINKER) || defined(ANDROID_MIPS_LINKER) ELF32_SYM_INITIALIZER(67, &dl_iterate_phdr, 1), +#if defined(ANDROID_ARM_LINKER) + ELF32_SYM_INITIALIZER(83, &dl_unwind_find_exidx, 1), #endif }; @@ -207,7 +205,11 @@ static Elf32_Sym gLibDlSymtab[] = { // Note that adding any new symbols here requires // stubbing them out in libdl. static unsigned gLibDlBuckets[1] = { 1 }; +#if defined(ANDROID_ARM_LINKER) +static unsigned gLibDlChains[9] = { 0, 2, 3, 4, 5, 6, 7, 8, 0 }; +#else static unsigned gLibDlChains[8] = { 0, 2, 3, 4, 5, 6, 7, 0 }; +#endif // This is used by the dynamic linker. Every process gets these symbols for free. soinfo libdl_info = { @@ -223,8 +225,8 @@ soinfo libdl_info = { strtab: ANDROID_LIBDL_STRTAB, symtab: gLibDlSymtab, - nbucket: 1, - nchain: 8, + nbucket: sizeof(gLibDlBuckets)/sizeof(unsigned), + nchain: sizeof(gLibDlChains)/sizeof(unsigned), bucket: gLibDlBuckets, chain: gLibDlChains, diff --git a/linker/linker.cpp b/linker/linker.cpp index 623be29f3..0f201815f 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -414,7 +414,7 @@ _Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc, int *pcount) return NULL; } -#elif defined(ANDROID_X86_LINKER) || defined(ANDROID_MIPS_LINKER) +#endif /* Here, we only have to provide a callback to iterate across all the * loaded libraries. gcc_eh does the rest. */ @@ -437,8 +437,6 @@ dl_iterate_phdr(int (*cb)(dl_phdr_info *info, size_t size, void *data), return rv; } -#endif - static Elf32_Sym* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name) { Elf32_Sym* symtab = si->symtab; const char* strtab = si->strtab; From f14d71fcf74e755ece4f8ca2ca2b7483424aa432 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 27 Sep 2013 14:18:36 -0700 Subject: [PATCH 003/148] Fix line that got removed by merge. Change-Id: I8c1f3624b52161893d1e04f0a156df613f90e39d --- tests/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Android.mk b/tests/Android.mk index 20262f42c..f1e67f87d 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -150,6 +150,7 @@ LOCAL_C_INCLUDES += \ LOCAL_WHOLE_STATIC_LIBRARIES := \ $(test_fortify_static_libraries) \ bionic-unit-tests-unwind-test-impl \ + include $(BUILD_STATIC_LIBRARY) # ----------------------------------------------------------------------------- From d2642fa70cfbd77286514e1123fcd280d7f7047f Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 2 Oct 2013 17:03:44 -0700 Subject: [PATCH 004/148] Remove the __ARM_FEATURE_DSP check. The check for __ARM_FEATURE_DSP being defined is pointless since it is always defined. Bug: 10971279 Change-Id: Id3f709cf9fd0e5a001be1a7dab5f249bcc16fe4c --- libc/arch-arm/cortex-a15/bionic/strcmp.S | 11 ----------- libc/arch-arm/cortex-a9/bionic/strcmp.S | 11 ----------- libc/arch-arm/krait/bionic/strcmp.S | 11 ----------- 3 files changed, 33 deletions(-) diff --git a/libc/arch-arm/cortex-a15/bionic/strcmp.S b/libc/arch-arm/cortex-a15/bionic/strcmp.S index 13b329f4f..422be863d 100644 --- a/libc/arch-arm/cortex-a15/bionic/strcmp.S +++ b/libc/arch-arm/cortex-a15/bionic/strcmp.S @@ -145,19 +145,8 @@ ENTRY(strcmp) .macro magic_find_zero_bytes w1 /* Macro to find all-zero bytes in w1, result is in ip. */ -#if (defined (__ARM_FEATURE_DSP)) uadd8 ip, \w1, r6 sel ip, r7, r6 -#else /* not defined (__ARM_FEATURE_DSP) */ - /* __ARM_FEATURE_DSP is not defined for some Cortex-M processors. - Coincidently, these processors only have Thumb-2 mode, where we can use the - the (large) magic constant available directly as an immediate in instructions. - Note that we cannot use the magic constant in ARM mode, where we need - to create the constant in a register. */ - sub ip, \w1, #0x01010101 - bic ip, ip, \w1 - and ip, ip, #0x80808080 -#endif /* not defined (__ARM_FEATURE_DSP) */ .endm /* magic_find_zero_bytes */ .macro setup_return w1 w2 diff --git a/libc/arch-arm/cortex-a9/bionic/strcmp.S b/libc/arch-arm/cortex-a9/bionic/strcmp.S index 232df75b6..24a4157bd 100644 --- a/libc/arch-arm/cortex-a9/bionic/strcmp.S +++ b/libc/arch-arm/cortex-a9/bionic/strcmp.S @@ -145,19 +145,8 @@ ENTRY(strcmp) .macro magic_find_zero_bytes w1 /* Macro to find all-zero bytes in w1, result is in ip. */ -#if (defined (__ARM_FEATURE_DSP)) uadd8 ip, \w1, r6 sel ip, r7, r6 -#else /* not defined (__ARM_FEATURE_DSP) */ - /* __ARM_FEATURE_DSP is not defined for some Cortex-M processors. - Coincidently, these processors only have Thumb-2 mode, where we can use the - the (large) magic constant available directly as an immediate in instructions. - Note that we cannot use the magic constant in ARM mode, where we need - to create the constant in a register. */ - sub ip, \w1, #0x01010101 - bic ip, ip, \w1 - and ip, ip, #0x80808080 -#endif /* not defined (__ARM_FEATURE_DSP) */ .endm /* magic_find_zero_bytes */ .macro setup_return w1 w2 diff --git a/libc/arch-arm/krait/bionic/strcmp.S b/libc/arch-arm/krait/bionic/strcmp.S index d4cf3f42e..e78bc9cfd 100644 --- a/libc/arch-arm/krait/bionic/strcmp.S +++ b/libc/arch-arm/krait/bionic/strcmp.S @@ -145,19 +145,8 @@ ENTRY(strcmp) .macro magic_find_zero_bytes w1 /* Macro to find all-zero bytes in w1, result is in ip. */ -#if (defined (__ARM_FEATURE_DSP)) uadd8 ip, \w1, r6 sel ip, r7, r6 -#else /* not defined (__ARM_FEATURE_DSP) */ - /* __ARM_FEATURE_DSP is not defined for some Cortex-M processors. - Coincidently, these processors only have Thumb-2 mode, where we can use the - the (large) magic constant available directly as an immediate in instructions. - Note that we cannot use the magic constant in ARM mode, where we need - to create the constant in a register. */ - sub ip, \w1, #0x01010101 - bic ip, ip, \w1 - and ip, ip, #0x80808080 -#endif /* not defined (__ARM_FEATURE_DSP) */ .endm /* magic_find_zero_bytes */ .macro setup_return w1 w2 From 48fc3e8b9fe7241ecf8ad61248247986742f05b6 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 3 Oct 2013 11:15:09 -0700 Subject: [PATCH 005/148] Remove dead files. memcpy.a15.S/strcmp.a15.S files were submitted by ARM for use as the basis for the memcpy/strcmp implementations in cortex-a15. memset.S was moved in to the generic directory. NOTE: memcpy.a9.S was submitted by Linaro to be the basis for the memcpy for cortex-a9/cortex-a15 but has not been incorporated yet. Bug: 10971279 Change-Id: Id8d97c888b4b9951cf49e1d94902501960720d56 --- libc/arch-arm/bionic/memcpy.a15.S | 406 --------------- libc/arch-arm/bionic/memset.S | 200 -------- libc/arch-arm/bionic/strcmp.a15.S | 787 ------------------------------ 3 files changed, 1393 deletions(-) delete mode 100644 libc/arch-arm/bionic/memcpy.a15.S delete mode 100644 libc/arch-arm/bionic/memset.S delete mode 100644 libc/arch-arm/bionic/strcmp.a15.S diff --git a/libc/arch-arm/bionic/memcpy.a15.S b/libc/arch-arm/bionic/memcpy.a15.S deleted file mode 100644 index 516e20c62..000000000 --- a/libc/arch-arm/bionic/memcpy.a15.S +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Copyright (c) 2013 ARM Ltd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the company may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - /* Prototype: void *memcpy (void *dst, const void *src, size_t count). */ - - /* Use the version of memcpy implemented using LDRD and STRD. - This version is tuned for Cortex-A15. - This might not be the best for other ARMv7-A CPUs, - but there is no predefine to distinguish between - different CPUs in the same architecture, - and this version is better than the plain memcpy provided in newlib. - - Therefore, we use this version for all ARMv7-A CPUS. */ - - /* To make the same code compile for both ARM and Thumb instruction - sets, switch to unified syntax at the beginning of this function. - However, by using the same code, we may be missing optimization - opportunities. For instance, in LDRD/STRD instructions, the first - destination register must be even and the second consecutive in - ARM state, but not in Thumb state. */ - -#include -#include - - .syntax unified - -ENTRY(memcpy) - - /* Assumes that n >= 0, and dst, src are valid pointers. - If there is at least 8 bytes to copy, use LDRD/STRD. - If src and dst are misaligned with different offsets, - first copy byte by byte until dst is aligned, - and then copy using LDRD/STRD and shift if needed. - When less than 8 left, copy a word and then byte by byte. */ - - /* Save registers (r0 holds the return value): - optimized push {r0, r4, r5, r6, r7, lr}. - To try and improve performance, stack layout changed, - i.e., not keeping the stack looking like users expect - (highest numbered register at highest address). */ - .save {r0, lr} - push {r0, lr} - .save {r4, r5} - strd r4, r5, [sp, #-8]! - .save {r6, r7} - strd r6, r7, [sp, #-8]! - - /* TODO: Add debug frame directives. - We don't need exception unwind directives, because the code below - does not throw any exceptions and does not call any other functions. - Generally, newlib functions like this lack debug information for - assembler source. */ - - /* Get copying of tiny blocks out of the way first. */ - /* Is there at least 4 bytes to copy? */ - subs r2, r2, #4 - blt copy_less_than_4 /* If n < 4. */ - - /* Check word alignment. */ - ands ip, r0, #3 /* ip = last 2 bits of dst. */ - bne dst_not_word_aligned /* If dst is not word-aligned. */ - - /* Get here if dst is word-aligned. */ - ands ip, r1, #3 /* ip = last 2 bits of src. */ - bne src_not_word_aligned /* If src is not word-aligned. */ -word_aligned: - /* Get here if source and dst both are word-aligned. - The number of bytes remaining to copy is r2+4. */ - - /* Is there is at least 64 bytes to copy? */ - subs r2, r2, #60 - blt copy_less_than_64 /* If r2 + 4 < 64. */ - - /* First, align the destination buffer to 8-bytes, - to make sure double loads and stores don't cross cache line boundary, - as they are then more expensive even if the data is in the cache - (require two load/store issue cycles instead of one). - If only one of the buffers is not 8-bytes aligned, - then it's more important to align dst than src, - because there is more penalty for stores - than loads that cross cacheline boundary. - This check and realignment are only worth doing - if there is a lot to copy. */ - - /* Get here if dst is word aligned, - i.e., the 2 least significant bits are 0. - If dst is not 2w aligned (i.e., the 3rd bit is not set in dst), - then copy 1 word (4 bytes). */ - ands r3, r0, #4 - beq 11f /* If dst already two-word aligned. */ - ldr r3, [r1], #4 - str r3, [r0], #4 - subs r2, r2, #4 - blt copy_less_than_64 - -11: - /* TODO: Align to cacheline (useful for PLD optimization). */ - - /* Every loop iteration copies 64 bytes. */ -1: - .irp offset, #0, #8, #16, #24, #32, #40, #48, #56 - ldrd r4, r5, [r1, \offset] - strd r4, r5, [r0, \offset] - .endr - - add r0, r0, #64 - add r1, r1, #64 - subs r2, r2, #64 - bge 1b /* If there is more to copy. */ - -copy_less_than_64: - - /* Get here if less than 64 bytes to copy, -64 <= r2 < 0. - Restore the count if there is more than 7 bytes to copy. */ - adds r2, r2, #56 - blt copy_less_than_8 - - /* Copy 8 bytes at a time. */ -2: - ldrd r4, r5, [r1], #8 - strd r4, r5, [r0], #8 - subs r2, r2, #8 - bge 2b /* If there is more to copy. */ - -copy_less_than_8: - - /* Get here if less than 8 bytes to copy, -8 <= r2 < 0. - Check if there is more to copy. */ - cmn r2, #8 - beq return /* If r2 + 8 == 0. */ - - /* Restore the count if there is more than 3 bytes to copy. */ - adds r2, r2, #4 - blt copy_less_than_4 - - /* Copy 4 bytes. */ - ldr r3, [r1], #4 - str r3, [r0], #4 - -copy_less_than_4: - /* Get here if less than 4 bytes to copy, -4 <= r2 < 0. */ - - /* Restore the count, check if there is more to copy. */ - adds r2, r2, #4 - beq return /* If r2 == 0. */ - - /* Get here with r2 is in {1,2,3}={01,10,11}. */ - /* Logical shift left r2, insert 0s, update flags. */ - lsls r2, r2, #31 - - /* Copy byte by byte. - Condition ne means the last bit of r2 is 0. - Condition cs means the second to last bit of r2 is set, - i.e., r2 is 1 or 3. */ - itt ne - ldrbne r3, [r1], #1 - strbne r3, [r0], #1 - - itttt cs - ldrbcs r4, [r1], #1 - ldrbcs r5, [r1] - strbcs r4, [r0], #1 - strbcs r5, [r0] - -return: - /* Restore registers: optimized pop {r0, r4, r5, r6, r7, pc} */ - /* This is the only return point of memcpy. */ - ldrd r6, r7, [sp], #8 - ldrd r4, r5, [sp], #8 - pop {r0, pc} - -#ifndef __ARM_FEATURE_UNALIGNED - - /* The following assembly macro implements misaligned copy in software. - Assumes that dst is word aligned, src is at offset "pull" bits from - word, push = 32 - pull, and the number of bytes that remain to copy - is r2 + 4, r2 >= 0. */ - - /* In the code below, r2 is the number of bytes that remain to be - written. The number of bytes read is always larger, because we have - partial words in the shift queue. */ - - .macro miscopy pull push shiftleft shiftright - - /* Align src to the previous word boundary. */ - bic r1, r1, #3 - - /* Initialize the shift queue. */ - ldr r5, [r1], #4 /* Load a word from source. */ - - subs r2, r2, #4 - blt 6f /* Go to misaligned copy of less than 8 bytes. */ - - /* Get here if there is more than 8 bytes to copy. - The number of bytes to copy is r2+8, r2 >= 0. */ - - subs r2, r2, #56 - blt 4f /* Go to misaligned copy of less than 64 bytes. */ - -3: - /* Get here if there is more than 64 bytes to copy. - The number of bytes to copy is r2+64, r2 >= 0. */ - - /* Copy 64 bytes in every iteration. - Use a partial word from the shift queue. */ - .irp offset, #0, #8, #16, #24, #32, #40, #48, #56 - mov r6, r5, \shiftleft #\pull - ldrd r4, r5, [r1, \offset] - orr r6, r6, r4, \shiftright #\push - mov r7, r4, \shiftleft #\pull - orr r7, r7, r5, \shiftright #\push - strd r6, r7, [r0, \offset] - .endr - - add r1, r1, #64 - add r0, r0, #64 - subs r2, r2, #64 - bge 3b - -4: - /* Get here if there is less than 64 bytes to copy (-64 <= r2 < 0) - and they are misaligned. */ - - /* Restore the count if there is more than 7 bytes to copy. */ - adds r2, r2, #56 - - blt 6f /* Go to misaligned copy of less than 8 bytes. */ - -5: - /* Copy 8 bytes at a time. - Use a partial word from the shift queue. */ - mov r6, r5, \shiftleft #\pull - ldrd r4, r5, [r1], #8 - orr r6, r6, r4, \shiftright #\push - mov r7, r4, \shiftleft #\pull - orr r7, r7, r5, \shiftright #\push - strd r6, r7, [r0], #8 - - subs r2, r2, #8 - bge 5b /* If there is more to copy. */ - -6: - /* Get here if there less than 8 bytes to copy (-8 <= r2 < 0) - and they are misaligned. */ - - /* Check if there is more to copy. */ - cmn r2, #8 - beq return - - /* Check if there is less than 4 bytes to copy. */ - cmn r2, #4 - - itt lt - /* Restore src offset from word-align. */ - sublt r1, r1, #(\push / 8) - blt copy_less_than_4 - - /* Use a partial word from the shift queue. */ - mov r3, r5, \shiftleft #\pull - /* Load a word from src, but without writeback - (this word is not fully written to dst). */ - ldr r5, [r1] - - /* Restore src offset from word-align. */ - add r1, r1, #(\pull / 8) - - /* Shift bytes to create one dst word and store it. */ - orr r3, r3, r5, \shiftright #\push - str r3, [r0], #4 - - /* Use single byte copying of the remaining bytes. */ - b copy_less_than_4 - - .endm - -#endif /* not __ARM_FEATURE_UNALIGNED */ - -dst_not_word_aligned: - - /* Get here when dst is not aligned and ip has the last 2 bits of dst, - i.e., ip is the offset of dst from word. - The number of bytes that remains to copy is r2 + 4, - i.e., there are at least 4 bytes to copy. - Write a partial word (0 to 3 bytes), such that dst becomes - word-aligned. */ - - /* If dst is at ip bytes offset from a word (with 0 < ip < 4), - then there are (4 - ip) bytes to fill up to align dst to the next - word. */ - rsb ip, ip, #4 /* ip = #4 - ip. */ - cmp ip, #2 - - /* Copy byte by byte with conditionals. */ - itt gt - ldrbgt r3, [r1], #1 - strbgt r3, [r0], #1 - - itt ge - ldrbge r4, [r1], #1 - strbge r4, [r0], #1 - - ldrb lr, [r1], #1 - strb lr, [r0], #1 - - /* Update the count. - ip holds the number of bytes we have just copied. */ - subs r2, r2, ip /* r2 = r2 - ip. */ - blt copy_less_than_4 /* If r2 < ip. */ - - /* Get here if there are more than 4 bytes to copy. - Check if src is aligned. If beforehand src and dst were not word - aligned but congruent (same offset), then now they are both - word-aligned, and we can copy the rest efficiently (without - shifting). */ - ands ip, r1, #3 /* ip = last 2 bits of src. */ - beq word_aligned /* If r1 is word-aligned. */ - -src_not_word_aligned: - /* Get here when src is not word-aligned, but dst is word-aligned. - The number of bytes that remains to copy is r2+4. */ - -#ifdef __ARM_FEATURE_UNALIGNED - /* Copy word by word using LDR when alignment can be done in hardware, - i.e., SCTLR.A is set, supporting unaligned access in LDR and STR. */ - subs r2, r2, #60 - blt 8f - -7: - /* Copy 64 bytes in every loop iteration. */ - .irp offset, #0, #4, #8, #12, #16, #20, #24, #28, #32, #36, #40, #44, #48, #52, #56, #60 - ldr r3, [r1, \offset] - str r3, [r0, \offset] - .endr - - add r0, r0, #64 - add r1, r1, #64 - subs r2, r2, #64 - bge 7b - -8: - /* Get here if less than 64 bytes to copy, -64 <= r2 < 0. - Check if there is more than 3 bytes to copy. */ - adds r2, r2, #60 - blt copy_less_than_4 - -9: - /* Get here if there is less than 64 but at least 4 bytes to copy, - where the number of bytes to copy is r2+4. */ - ldr r3, [r1], #4 - str r3, [r0], #4 - subs r2, r2, #4 - bge 9b - - b copy_less_than_4 - -#else /* not __ARM_FEATURE_UNALIGNED */ - - /* ip has last 2 bits of src, - i.e., ip is the offset of src from word, and ip > 0. - Compute shifts needed to copy from src to dst. */ - cmp ip, #2 - beq miscopy_16_16 /* If ip == 2. */ - bge miscopy_24_8 /* If ip == 3. */ - - /* Get here if ip == 1. */ - - /* Endian independent macros for shifting bytes within registers. */ - -#ifndef __ARMEB__ -miscopy_8_24: miscopy pull=8 push=24 shiftleft=lsr shiftright=lsl -miscopy_16_16: miscopy pull=16 push=16 shiftleft=lsr shiftright=lsl -miscopy_24_8: miscopy pull=24 push=8 shiftleft=lsr shiftright=lsl -#else /* not __ARMEB__ */ -miscopy_8_24: miscopy pull=8 push=24 shiftleft=lsl shiftright=lsr -miscopy_16_16: miscopy pull=16 push=16 shiftleft=lsl shiftright=lsr -miscopy_24_8: miscopy pull=24 push=8 shiftleft=lsl shiftright=lsr -#endif /* not __ARMEB__ */ - -#endif /* not __ARM_FEATURE_UNALIGNED */ - -END(memcpy) diff --git a/libc/arch-arm/bionic/memset.S b/libc/arch-arm/bionic/memset.S deleted file mode 100644 index 102d54128..000000000 --- a/libc/arch-arm/bionic/memset.S +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include - - /* - * Optimized memset() for ARM. - * - * memset() returns its first argument. - */ - -#if defined(__ARM_NEON__) - .fpu neon -#endif - -ENTRY(bzero) - mov r2, r1 - mov r1, #0 - // Fall through to memset... -END(bzero) - -ENTRY(memset) -#if defined(__ARM_NEON__) - -#ifdef NEON_MEMSET_DIVIDER - cmp r2, #NEON_MEMSET_DIVIDER - bhi 11f -#endif - .save {r0} - stmfd sp!, {r0} - - vdup.8 q0, r1 - -#ifndef NEON_UNALIGNED_ACCESS - /* do we have at least 16-bytes to write (needed for alignment below) */ - cmp r2, #16 - blo 3f - - /* align destination to 16 bytes for the write-buffer */ - rsb r3, r0, #0 - ands r3, r3, #0xF - beq 2f - - /* write up to 15-bytes (count in r3) */ - sub r2, r2, r3 - movs ip, r3, lsl #31 - strmib r1, [r0], #1 - strcsb r1, [r0], #1 - strcsb r1, [r0], #1 - movs ip, r3, lsl #29 - bge 1f - - // writes 4 bytes, 32-bits aligned - vst1.32 {d0[0]}, [r0, :32]! -1: bcc 2f - - // writes 8 bytes, 64-bits aligned - vst1.8 {d0}, [r0, :64]! -2: -#endif - /* make sure we have at least 32 bytes to write */ - subs r2, r2, #32 - blo 2f - vmov q1, q0 - -1: /* The main loop writes 32 bytes at a time */ - subs r2, r2, #32 -#ifndef NEON_UNALIGNED_ACCESS - vst1.8 {d0 - d3}, [r0, :128]! -#else - vst1.8 {d0 - d3}, [r0]! -#endif - bhs 1b - -2: /* less than 32 left */ - add r2, r2, #32 - tst r2, #0x10 - beq 3f - - // writes 16 bytes, 128-bits aligned -#ifndef NEON_UNALIGNED_ACCESS - vst1.8 {d0, d1}, [r0, :128]! -#else - vst1.8 {d0, d1}, [r0]! -#endif -3: /* write up to 15-bytes (count in r2) */ - movs ip, r2, lsl #29 - bcc 1f - vst1.8 {d0}, [r0]! -1: bge 2f - vst1.32 {d0[0]}, [r0]! -2: movs ip, r2, lsl #31 - strmib r1, [r0], #1 - strcsb r1, [r0], #1 - strcsb r1, [r0], #1 - ldmfd sp!, {r0} - bx lr -11: -#endif - - /* - * Optimized memset() for ARM. - * - * memset() returns its first argument. - */ - - /* compute the offset to align the destination - * offset = (4-(src&3))&3 = -src & 3 - */ - - .save {r0, r4-r7, lr} - stmfd sp!, {r0, r4-r7, lr} - rsb r3, r0, #0 - ands r3, r3, #3 - cmp r3, r2 - movhi r3, r2 - - /* splat r1 */ - mov r1, r1, lsl #24 - orr r1, r1, r1, lsr #8 - orr r1, r1, r1, lsr #16 - - movs r12, r3, lsl #31 - strcsb r1, [r0], #1 /* can't use strh (alignment unknown) */ - strcsb r1, [r0], #1 - strmib r1, [r0], #1 - subs r2, r2, r3 - ldmlsfd sp!, {r0, r4-r7, lr} /* return */ - bxls lr - - /* align the destination to a cache-line */ - mov r12, r1 - mov lr, r1 - mov r4, r1 - mov r5, r1 - mov r6, r1 - mov r7, r1 - - rsb r3, r0, #0 - ands r3, r3, #0x1C - beq 3f - cmp r3, r2 - andhi r3, r2, #0x1C - sub r2, r2, r3 - - /* conditionally writes 0 to 7 words (length in r3) */ - movs r3, r3, lsl #28 - stmcsia r0!, {r1, lr} - stmcsia r0!, {r1, lr} - stmmiia r0!, {r1, lr} - movs r3, r3, lsl #2 - strcs r1, [r0], #4 - -3: - subs r2, r2, #32 - mov r3, r1 - bmi 2f -1: subs r2, r2, #32 - stmia r0!, {r1,r3,r4,r5,r6,r7,r12,lr} - bhs 1b -2: add r2, r2, #32 - - /* conditionally stores 0 to 31 bytes */ - movs r2, r2, lsl #28 - stmcsia r0!, {r1,r3,r12,lr} - stmmiia r0!, {r1, lr} - movs r2, r2, lsl #2 - strcs r1, [r0], #4 - strmih r1, [r0], #2 - movs r2, r2, lsl #2 - strcsb r1, [r0] - ldmfd sp!, {r0, r4-r7, lr} - bx lr -END(memset) diff --git a/libc/arch-arm/bionic/strcmp.a15.S b/libc/arch-arm/bionic/strcmp.a15.S deleted file mode 100644 index b726a6e25..000000000 --- a/libc/arch-arm/bionic/strcmp.a15.S +++ /dev/null @@ -1,787 +0,0 @@ -/* - * Copyright (c) 2013 ARM Ltd - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the company may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "arm_asm.h" - -#ifdef __ARMEB__ -#define S2LOMEM lsl -#define S2LOMEMEQ lsleq -#define S2HIMEM lsr -#define MSB 0x000000ff -#define LSB 0xff000000 -#define BYTE0_OFFSET 24 -#define BYTE1_OFFSET 16 -#define BYTE2_OFFSET 8 -#define BYTE3_OFFSET 0 -#else /* not __ARMEB__ */ -#define S2LOMEM lsr -#define S2LOMEMEQ lsreq -#define S2HIMEM lsl -#define BYTE0_OFFSET 0 -#define BYTE1_OFFSET 8 -#define BYTE2_OFFSET 16 -#define BYTE3_OFFSET 24 -#define MSB 0xff000000 -#define LSB 0x000000ff -#endif /* not __ARMEB__ */ - -.syntax unified - -#if defined (__thumb__) - .thumb - .thumb_func -#endif - .global strcmp - .type strcmp, %function -strcmp: - -#if (defined (__thumb__) && !defined (__thumb2__)) -1: - ldrb r2, [r0] - ldrb r3, [r1] - adds r0, r0, #1 - adds r1, r1, #1 - cmp r2, #0 - beq 2f - cmp r2, r3 - beq 1b -2: - subs r0, r2, r3 - bx lr -#elif (defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED)) -1: - ldrb r2, [r0], #1 - ldrb r3, [r1], #1 - cmp r2, #1 - it cs - cmpcs r2, r3 - beq 1b - subs r0, r2, r3 - RETURN - - -#elif (defined (_ISA_THUMB_2) || defined (_ISA_ARM_6)) - /* Use LDRD whenever possible. */ - -/* The main thing to look out for when comparing large blocks is that - the loads do not cross a page boundary when loading past the index - of the byte with the first difference or the first string-terminator. - - For example, if the strings are identical and the string-terminator - is at index k, byte by byte comparison will not load beyond address - s1+k and s2+k; word by word comparison may load up to 3 bytes beyond - k; double word - up to 7 bytes. If the load of these bytes crosses - a page boundary, it might cause a memory fault (if the page is not mapped) - that would not have happened in byte by byte comparison. - - If an address is (double) word aligned, then a load of a (double) word - from that address will not cross a page boundary. - Therefore, the algorithm below considers word and double-word alignment - of strings separately. */ - -/* High-level description of the algorithm. - - * The fast path: if both strings are double-word aligned, - use LDRD to load two words from each string in every loop iteration. - * If the strings have the same offset from a word boundary, - use LDRB to load and compare byte by byte until - the first string is aligned to a word boundary (at most 3 bytes). - This is optimized for quick return on short unaligned strings. - * If the strings have the same offset from a double-word boundary, - use LDRD to load two words from each string in every loop iteration, as in the fast path. - * If the strings do not have the same offset from a double-word boundary, - load a word from the second string before the loop to initialize the queue. - Use LDRD to load two words from every string in every loop iteration. - Inside the loop, load the second word from the second string only after comparing - the first word, using the queued value, to guarantee safety across page boundaries. - * If the strings do not have the same offset from a word boundary, - use LDR and a shift queue. Order of loads and comparisons matters, - similarly to the previous case. - - * Use UADD8 and SEL to compare words, and use REV and CLZ to compute the return value. - * The only difference between ARM and Thumb modes is the use of CBZ instruction. - * The only difference between big and little endian is the use of REV in little endian - to compute the return value, instead of MOV. - * No preload. [TODO.] -*/ - - .macro m_cbz reg label -#ifdef __thumb2__ - cbz \reg, \label -#else /* not defined __thumb2__ */ - cmp \reg, #0 - beq \label -#endif /* not defined __thumb2__ */ - .endm /* m_cbz */ - - .macro m_cbnz reg label -#ifdef __thumb2__ - cbnz \reg, \label -#else /* not defined __thumb2__ */ - cmp \reg, #0 - bne \label -#endif /* not defined __thumb2__ */ - .endm /* m_cbnz */ - - .macro init - /* Macro to save temporary registers and prepare magic values. */ - subs sp, sp, #16 - strd r4, r5, [sp, #8] - strd r6, r7, [sp] - mvn r6, #0 /* all F */ - mov r7, #0 /* all 0 */ - .endm /* init */ - - .macro magic_compare_and_branch w1 w2 label - /* Macro to compare registers w1 and w2 and conditionally branch to label. */ - cmp \w1, \w2 /* Are w1 and w2 the same? */ - magic_find_zero_bytes \w1 - it eq - cmpeq ip, #0 /* Is there a zero byte in w1? */ - bne \label - .endm /* magic_compare_and_branch */ - - .macro magic_find_zero_bytes w1 - /* Macro to find all-zero bytes in w1, result is in ip. */ -#if (defined (__ARM_FEATURE_DSP)) - uadd8 ip, \w1, r6 - sel ip, r7, r6 -#else /* not defined (__ARM_FEATURE_DSP) */ - /* __ARM_FEATURE_DSP is not defined for some Cortex-M processors. - Coincidently, these processors only have Thumb-2 mode, where we can use the - the (large) magic constant available directly as an immediate in instructions. - Note that we cannot use the magic constant in ARM mode, where we need - to create the constant in a register. */ - sub ip, \w1, #0x01010101 - bic ip, ip, \w1 - and ip, ip, #0x80808080 -#endif /* not defined (__ARM_FEATURE_DSP) */ - .endm /* magic_find_zero_bytes */ - - .macro setup_return w1 w2 -#ifdef __ARMEB__ - mov r1, \w1 - mov r2, \w2 -#else /* not __ARMEB__ */ - rev r1, \w1 - rev r2, \w2 -#endif /* not __ARMEB__ */ - .endm /* setup_return */ - - /* - optpld r0, #0 - optpld r1, #0 - */ - - /* Are both strings double-word aligned? */ - orr ip, r0, r1 - tst ip, #7 - bne do_align - - /* Fast path. */ - init - -doubleword_aligned: - - /* Get here when the strings to compare are double-word aligned. */ - /* Compare two words in every iteration. */ - .p2align 2 -2: - /* - optpld r0, #16 - optpld r1, #16 - */ - - /* Load the next double-word from each string. */ - ldrd r2, r3, [r0], #8 - ldrd r4, r5, [r1], #8 - - magic_compare_and_branch w1=r2, w2=r4, label=return_24 - magic_compare_and_branch w1=r3, w2=r5, label=return_35 - b 2b - -do_align: - /* Is the first string word-aligned? */ - ands ip, r0, #3 - beq word_aligned_r0 - - /* Fast compare byte by byte until the first string is word-aligned. */ - /* The offset of r0 from a word boundary is in ip. Thus, the number of bytes - to read until the next word boudnary is 4-ip. */ - bic r0, r0, #3 - ldr r2, [r0], #4 - lsls ip, ip, #31 - beq byte2 - bcs byte3 - -byte1: - ldrb ip, [r1], #1 - uxtb r3, r2, ror #BYTE1_OFFSET - subs ip, r3, ip - bne fast_return - m_cbz reg=r3, label=fast_return - -byte2: - ldrb ip, [r1], #1 - uxtb r3, r2, ror #BYTE2_OFFSET - subs ip, r3, ip - bne fast_return - m_cbz reg=r3, label=fast_return - -byte3: - ldrb ip, [r1], #1 - uxtb r3, r2, ror #BYTE3_OFFSET - subs ip, r3, ip - bne fast_return - m_cbnz reg=r3, label=word_aligned_r0 - -fast_return: - mov r0, ip - bx lr - -word_aligned_r0: - init - /* The first string is word-aligned. */ - /* Is the second string word-aligned? */ - ands ip, r1, #3 - bne strcmp_unaligned - -word_aligned: - /* The strings are word-aligned. */ - /* Is the first string double-word aligned? */ - tst r0, #4 - beq doubleword_aligned_r0 - - /* If r0 is not double-word aligned yet, align it by loading - and comparing the next word from each string. */ - ldr r2, [r0], #4 - ldr r4, [r1], #4 - magic_compare_and_branch w1=r2 w2=r4 label=return_24 - -doubleword_aligned_r0: - /* Get here when r0 is double-word aligned. */ - /* Is r1 doubleword_aligned? */ - tst r1, #4 - beq doubleword_aligned - - /* Get here when the strings to compare are word-aligned, - r0 is double-word aligned, but r1 is not double-word aligned. */ - - /* Initialize the queue. */ - ldr r5, [r1], #4 - - /* Compare two words in every iteration. */ - .p2align 2 -3: - /* - optpld r0, #16 - optpld r1, #16 - */ - - /* Load the next double-word from each string and compare. */ - ldrd r2, r3, [r0], #8 - magic_compare_and_branch w1=r2 w2=r5 label=return_25 - ldrd r4, r5, [r1], #8 - magic_compare_and_branch w1=r3 w2=r4 label=return_34 - b 3b - - .macro miscmp_word offsetlo offsethi - /* Macro to compare misaligned strings. */ - /* r0, r1 are word-aligned, and at least one of the strings - is not double-word aligned. */ - /* Compare one word in every loop iteration. */ - /* OFFSETLO is the original bit-offset of r1 from a word-boundary, - OFFSETHI is 32 - OFFSETLO (i.e., offset from the next word). */ - - /* Initialize the shift queue. */ - ldr r5, [r1], #4 - - /* Compare one word from each string in every loop iteration. */ - .p2align 2 -7: - ldr r3, [r0], #4 - S2LOMEM r5, r5, #\offsetlo - magic_find_zero_bytes w1=r3 - cmp r7, ip, S2HIMEM #\offsetlo - and r2, r3, r6, S2LOMEM #\offsetlo - it eq - cmpeq r2, r5 - bne return_25 - ldr r5, [r1], #4 - cmp ip, #0 - eor r3, r2, r3 - S2HIMEM r2, r5, #\offsethi - it eq - cmpeq r3, r2 - bne return_32 - b 7b - .endm /* miscmp_word */ - -strcmp_unaligned: - /* r0 is word-aligned, r1 is at offset ip from a word. */ - /* Align r1 to the (previous) word-boundary. */ - bic r1, r1, #3 - - /* Unaligned comparison word by word using LDRs. */ - cmp ip, #2 - beq miscmp_word_16 /* If ip == 2. */ - bge miscmp_word_24 /* If ip == 3. */ - miscmp_word offsetlo=8 offsethi=24 /* If ip == 1. */ -miscmp_word_16: miscmp_word offsetlo=16 offsethi=16 -miscmp_word_24: miscmp_word offsetlo=24 offsethi=8 - - -return_32: - setup_return w1=r3, w2=r2 - b do_return -return_34: - setup_return w1=r3, w2=r4 - b do_return -return_25: - setup_return w1=r2, w2=r5 - b do_return -return_35: - setup_return w1=r3, w2=r5 - b do_return -return_24: - setup_return w1=r2, w2=r4 - -do_return: - -#ifdef __ARMEB__ - mov r0, ip -#else /* not __ARMEB__ */ - rev r0, ip -#endif /* not __ARMEB__ */ - - /* Restore temporaries early, before computing the return value. */ - ldrd r6, r7, [sp] - ldrd r4, r5, [sp, #8] - adds sp, sp, #16 - - /* There is a zero or a different byte between r1 and r2. */ - /* r0 contains a mask of all-zero bytes in r1. */ - /* Using r0 and not ip here because cbz requires low register. */ - m_cbz reg=r0, label=compute_return_value - clz r0, r0 - /* r0 contains the number of bits on the left of the first all-zero byte in r1. */ - rsb r0, r0, #24 - /* Here, r0 contains the number of bits on the right of the first all-zero byte in r1. */ - lsr r1, r1, r0 - lsr r2, r2, r0 - -compute_return_value: - movs r0, #1 - cmp r1, r2 - /* The return value is computed as follows. - If r1>r2 then (C==1 and Z==0) and LS doesn't hold and r0 is #1 at return. - If r1> -#else -#define RSHIFT >> -#define LSHIFT << -#endif - -#define body(shift) \ - mask = 0xffffffffU RSHIFT shift; \ - w1 = *wp1++; \ - w2 = *wp2++; \ - do \ - { \ - t1 = w1 & mask; \ - if (__builtin_expect(t1 != w2 RSHIFT shift, 0)) \ - { \ - w2 RSHIFT= shift; \ - break; \ - } \ - if (__builtin_expect(((w1 - b1) & ~w1) & (b1 << 7), 0)) \ - { \ - /* See comment in assembler below re syndrome on big-endian */\ - if ((((w1 - b1) & ~w1) & (b1 << 7)) & mask) \ - w2 RSHIFT= shift; \ - else \ - { \ - w2 = *wp2; \ - t1 = w1 RSHIFT (32 - shift); \ - w2 = (w2 LSHIFT (32 - shift)) RSHIFT (32 - shift); \ - } \ - break; \ - } \ - w2 = *wp2++; \ - t1 ^= w1; \ - if (__builtin_expect(t1 != w2 LSHIFT (32 - shift), 0)) \ - { \ - t1 = w1 >> (32 - shift); \ - w2 = (w2 << (32 - shift)) RSHIFT (32 - shift); \ - break; \ - } \ - w1 = *wp1++; \ - } while (1) - - const unsigned* wp1; - const unsigned* wp2; - unsigned w1, w2; - unsigned mask; - unsigned shift; - unsigned b1 = 0x01010101; - char c1, c2; - unsigned t1; - - while (((unsigned) s1) & 3) - { - c1 = *s1++; - c2 = *s2++; - if (c1 == 0 || c1 != c2) - return c1 - (int)c2; - } - wp1 = (unsigned*) (((unsigned)s1) & ~3); - wp2 = (unsigned*) (((unsigned)s2) & ~3); - t1 = ((unsigned) s2) & 3; - if (t1 == 1) - { - body(8); - } - else if (t1 == 2) - { - body(16); - } - else - { - body (24); - } - - do - { -#ifdef __ARMEB__ - c1 = (char) t1 >> 24; - c2 = (char) w2 >> 24; -#else /* not __ARMEB__ */ - c1 = (char) t1; - c2 = (char) w2; -#endif /* not __ARMEB__ */ - t1 RSHIFT= 8; - w2 RSHIFT= 8; - } while (c1 != 0 && c1 == c2); - return c1 - c2; -#endif /* 0 */ - - - wp1 .req r0 - wp2 .req r1 - b1 .req r2 - w1 .req r4 - w2 .req r5 - t1 .req ip - @ r3 is scratch - - /* First of all, compare bytes until wp1(sp1) is word-aligned. */ -1: - tst wp1, #3 - beq 2f - ldrb r2, [wp1], #1 - ldrb r3, [wp2], #1 - cmp r2, #1 - it cs - cmpcs r2, r3 - beq 1b - sub r0, r2, r3 - RETURN - -2: - str r5, [sp, #-4]! - str r4, [sp, #-4]! - //stmfd sp!, {r4, r5} - mov b1, #1 - orr b1, b1, b1, lsl #8 - orr b1, b1, b1, lsl #16 - - and t1, wp2, #3 - bic wp2, wp2, #3 - ldr w1, [wp1], #4 - ldr w2, [wp2], #4 - cmp t1, #2 - beq 2f - bhi 3f - - /* Critical inner Loop: Block with 3 bytes initial overlap */ - .p2align 2 -1: - bic t1, w1, MSB - cmp t1, w2, S2LOMEM #8 - sub r3, w1, b1 - bic r3, r3, w1 - bne 4f - ands r3, r3, b1, lsl #7 - it eq - ldreq w2, [wp2], #4 - bne 5f - eor t1, t1, w1 - cmp t1, w2, S2HIMEM #24 - bne 6f - ldr w1, [wp1], #4 - b 1b -4: - S2LOMEM w2, w2, #8 - b 8f - -5: -#ifdef __ARMEB__ - /* The syndrome value may contain false ones if the string ends - with the bytes 0x01 0x00 */ - tst w1, #0xff000000 - itt ne - tstne w1, #0x00ff0000 - tstne w1, #0x0000ff00 - beq 7f -#else - bics r3, r3, #0xff000000 - bne 7f -#endif - ldrb w2, [wp2] - S2LOMEM t1, w1, #24 -#ifdef __ARMEB__ - lsl w2, w2, #24 -#endif - b 8f - -6: - S2LOMEM t1, w1, #24 - and w2, w2, LSB - b 8f - - /* Critical inner Loop: Block with 2 bytes initial overlap */ - .p2align 2 -2: - S2HIMEM t1, w1, #16 - sub r3, w1, b1 - S2LOMEM t1, t1, #16 - bic r3, r3, w1 - cmp t1, w2, S2LOMEM #16 - bne 4f - ands r3, r3, b1, lsl #7 - it eq - ldreq w2, [wp2], #4 - bne 5f - eor t1, t1, w1 - cmp t1, w2, S2HIMEM #16 - bne 6f - ldr w1, [wp1], #4 - b 2b - -5: -#ifdef __ARMEB__ - /* The syndrome value may contain false ones if the string ends - with the bytes 0x01 0x00 */ - tst w1, #0xff000000 - it ne - tstne w1, #0x00ff0000 - beq 7f -#else - lsls r3, r3, #16 - bne 7f -#endif - ldrh w2, [wp2] - S2LOMEM t1, w1, #16 -#ifdef __ARMEB__ - lsl w2, w2, #16 -#endif - b 8f - -6: - S2HIMEM w2, w2, #16 - S2LOMEM t1, w1, #16 -4: - S2LOMEM w2, w2, #16 - b 8f - - /* Critical inner Loop: Block with 1 byte initial overlap */ - .p2align 2 -3: - and t1, w1, LSB - cmp t1, w2, S2LOMEM #24 - sub r3, w1, b1 - bic r3, r3, w1 - bne 4f - ands r3, r3, b1, lsl #7 - it eq - ldreq w2, [wp2], #4 - bne 5f - eor t1, t1, w1 - cmp t1, w2, S2HIMEM #8 - bne 6f - ldr w1, [wp1], #4 - b 3b -4: - S2LOMEM w2, w2, #24 - b 8f -5: - /* The syndrome value may contain false ones if the string ends - with the bytes 0x01 0x00 */ - tst w1, LSB - beq 7f - ldr w2, [wp2], #4 -6: - S2LOMEM t1, w1, #8 - bic w2, w2, MSB - b 8f -7: - mov r0, #0 - //ldmfd sp!, {r4, r5} - ldr r4, [sp], #4 - ldr r5, [sp], #4 - RETURN -8: - and r2, t1, LSB - and r0, w2, LSB - cmp r0, #1 - it cs - cmpcs r0, r2 - itt eq - S2LOMEMEQ t1, t1, #8 - S2LOMEMEQ w2, w2, #8 - beq 8b - sub r0, r2, r0 - //ldmfd sp!, {r4, r5} - ldr r4, [sp], #4 - ldr r5, [sp], #4 - RETURN - -#endif /* !(defined (_ISA_THUMB_2) || defined (_ISA_ARM_6) - defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || - (defined (__thumb__) && !defined (__thumb2__))) */ From f389284e86bbcbdb257d7388a17fde007113b0d6 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 3 Oct 2013 13:26:22 -0700 Subject: [PATCH 006/148] Add dependencies on included makefiles. Bug: 11050594 Change-Id: I5e6e1965f9c0c493921cf59c974b3bcbaea40c22 --- libc/Android.mk | 34 ++++++++++++++++++++++------------ libc/arch-arm/arm.mk | 4 +++- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/libc/Android.mk b/libc/Android.mk index e710afb20..fca9a3fa1 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -2,6 +2,11 @@ LOCAL_PATH:= $(call my-dir) include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/syscalls.mk +# Make everything depend on any changes to included makefiles. +libc_common_additional_dependencies := \ + $(LOCAL_PATH)/arch-$(TARGET_ARCH)/syscalls.mk \ + $(LOCAL_PATH)/Android.mk \ + # Define the common source files for all the libc instances # ========================================================= libc_common_src_files := \ @@ -538,12 +543,17 @@ _LIBC_ARCH_COMMON_SRC_FILES := _LIBC_ARCH_CPU_VARIANT_SRC_FILES := _LIBC_ARCH_STATIC_SRC_FILES := _LIBC_ARCH_DYNAMIC_SRC_FILES := -include bionic/libc/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk +_LIBC_ARCH_ADDITIONAL_DEPENDENCIES := + +libc_common_additional_dependencies += \ + $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk +include $(LOCAL_PATH)/arch-$(TARGET_ARCH)/$(TARGET_ARCH).mk libc_common_src_files += $(_LIBC_ARCH_COMMON_SRC_FILES) libc_common_src_files += $(_LIBC_ARCH_CPU_VARIANT_SRC_FILES) libc_arch_static_src_files := $(_LIBC_ARCH_STATIC_SRC_FILES) libc_arch_dynamic_src_files := $(_LIBC_ARCH_DYNAMIC_SRC_FILES) +libc_common_additional_dependencies += $(_LIBC_ARCH_ADDITIONAL_DEPENDENCIES) # Define some common cflags # ======================================================== @@ -770,7 +780,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libbionic_ssp -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SYSTEM_SHARED_LIBRARIES := include $(BUILD_STATIC_LIBRARY) @@ -793,7 +803,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_tzcode -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SYSTEM_SHARED_LIBRARIES := include $(BUILD_STATIC_LIBRARY) @@ -818,7 +828,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_freebsd -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SYSTEM_SHARED_LIBRARIES := include $(BUILD_STATIC_LIBRARY) @@ -843,7 +853,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_netbsd -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SYSTEM_SHARED_LIBRARIES := include $(BUILD_STATIC_LIBRARY) @@ -861,7 +871,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_bionic -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SYSTEM_SHARED_LIBRARIES := include $(BUILD_STATIC_LIBRARY) @@ -880,7 +890,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_common -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_WHOLE_STATIC_LIBRARIES := \ libbionic_ssp \ libc_bionic \ @@ -919,7 +929,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_MODULE := libc_nomalloc -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_WHOLE_STATIC_LIBRARIES := libc_common LOCAL_SYSTEM_SHARED_LIBRARIES := @@ -944,7 +954,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_WHOLE_STATIC_LIBRARIES := libc_common LOCAL_SYSTEM_SHARED_LIBRARIES := @@ -987,7 +997,7 @@ ifeq ($(TARGET_ARCH),arm) endif LOCAL_MODULE:= libc -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_REQUIRED_MODULES := tzdata # WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries, @@ -1033,7 +1043,7 @@ LOCAL_SRC_FILES := \ bionic/malloc_debug_check.cpp \ LOCAL_MODULE:= libc_malloc_debug_leak -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SHARED_LIBRARIES := libc libdl LOCAL_WHOLE_STATIC_LIBRARIES := libc_common @@ -1063,7 +1073,7 @@ LOCAL_SRC_FILES := \ bionic/malloc_debug_qemu.cpp LOCAL_MODULE:= libc_malloc_debug_qemu -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SHARED_LIBRARIES := libc libdl LOCAL_WHOLE_STATIC_LIBRARIES := libc_common diff --git a/libc/arch-arm/arm.mk b/libc/arch-arm/arm.mk index 5f2443f9a..da54cb829 100644 --- a/libc/arch-arm/arm.mk +++ b/libc/arch-arm/arm.mk @@ -42,4 +42,6 @@ ifeq ($(strip $(wildcard bionic/libc/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU $(error "TARGET_CPU_VARIANT not set or set to an unknown value. Possible values are cortex-a7, cortex-a8, cortex-a9, cortex-a15, krait. Use generic for devices that do not have a CPU similar to any of the supported cpu variants.") endif -include bionic/libc/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk +_LIBC_ARCH_ADDITIONAL_DEPENDENCIES := \ + $(LOCAL_PATH)/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk +include $(LOCAL_PATH)/arch-arm/$(TARGET_CPU_VARIANT)/$(TARGET_CPU_VARIANT).mk From ea699f0cf4c9ae7fac24683674c93427993a7190 Mon Sep 17 00:00:00 2001 From: Rom Lemarchand Date: Mon, 21 Oct 2013 15:18:40 -0700 Subject: [PATCH 007/148] Refresh libc/kernel/common/linux/ion.h Change-Id: Ibd2bf99224b31bbad7b3a9b0d82bfef19162db7b --- libc/kernel/common/linux/ion.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/libc/kernel/common/linux/ion.h b/libc/kernel/common/linux/ion.h index f18939d11..59045d2f3 100644 --- a/libc/kernel/common/linux/ion.h +++ b/libc/kernel/common/linux/ion.h @@ -19,39 +19,44 @@ #ifndef _LINUX_ION_H #define _LINUX_ION_H #include -struct ion_handle; +typedef int ion_user_handle_t; /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ enum ion_heap_type { ION_HEAP_TYPE_SYSTEM, ION_HEAP_TYPE_SYSTEM_CONTIG, ION_HEAP_TYPE_CARVEOUT, /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ + ION_HEAP_TYPE_CHUNK, + ION_HEAP_TYPE_DMA, ION_HEAP_TYPE_CUSTOM, ION_NUM_HEAPS = 16, +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ }; #define ION_HEAP_SYSTEM_MASK (1 << ION_HEAP_TYPE_SYSTEM) -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define ION_HEAP_SYSTEM_CONTIG_MASK (1 << ION_HEAP_TYPE_SYSTEM_CONTIG) #define ION_HEAP_CARVEOUT_MASK (1 << ION_HEAP_TYPE_CARVEOUT) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ION_HEAP_TYPE_DMA_MASK (1 << ION_HEAP_TYPE_DMA) +#define ION_NUM_HEAP_IDS sizeof(unsigned int) * 8 #define ION_FLAG_CACHED 1 #define ION_FLAG_CACHED_NEEDS_SYNC 2 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ struct ion_allocation_data { size_t len; size_t align; - unsigned int heap_mask; + unsigned int heap_id_mask; /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ unsigned int flags; - struct ion_handle *handle; + ion_user_handle_t handle; }; struct ion_fd_data { /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ - struct ion_handle *handle; + ion_user_handle_t handle; int fd; }; struct ion_handle_data { /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ - struct ion_handle *handle; + ion_user_handle_t handle; }; struct ion_custom_data { unsigned int cmd; From 356a4e4a3243ddb40c41a9bbaf7e86f821aaa912 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 25 Nov 2013 14:08:33 -0800 Subject: [PATCH 008/148] Regenerate the bionic headers to match external/kernel-headers. (This undoes the AOSP-only ion.h hack.) Bug: 11859767 Change-Id: Id863c70d63b2716ae22cafd7ddb1163bbc7a3d11 --- libc/kernel/uapi/linux/ion.h | 41 +++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/libc/kernel/uapi/linux/ion.h b/libc/kernel/uapi/linux/ion.h index f18939d11..5af39d04f 100644 --- a/libc/kernel/uapi/linux/ion.h +++ b/libc/kernel/uapi/linux/ion.h @@ -16,56 +16,63 @@ *** **************************************************************************** ****************************************************************************/ -#ifndef _LINUX_ION_H -#define _LINUX_ION_H +#ifndef _UAPI_LINUX_ION_H +#define _UAPI_LINUX_ION_H +#include #include -struct ion_handle; /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +typedef int ion_user_handle_t; enum ion_heap_type { ION_HEAP_TYPE_SYSTEM, ION_HEAP_TYPE_SYSTEM_CONTIG, - ION_HEAP_TYPE_CARVEOUT, /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ + ION_HEAP_TYPE_CARVEOUT, + ION_HEAP_TYPE_CHUNK, + ION_HEAP_TYPE_DMA, ION_HEAP_TYPE_CUSTOM, +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ ION_NUM_HEAPS = 16, }; #define ION_HEAP_SYSTEM_MASK (1 << ION_HEAP_TYPE_SYSTEM) -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define ION_HEAP_SYSTEM_CONTIG_MASK (1 << ION_HEAP_TYPE_SYSTEM_CONTIG) -#define ION_HEAP_CARVEOUT_MASK (1 << ION_HEAP_TYPE_CARVEOUT) -#define ION_FLAG_CACHED 1 -#define ION_FLAG_CACHED_NEEDS_SYNC 2 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ION_HEAP_CARVEOUT_MASK (1 << ION_HEAP_TYPE_CARVEOUT) +#define ION_HEAP_TYPE_DMA_MASK (1 << ION_HEAP_TYPE_DMA) +#define ION_NUM_HEAP_IDS sizeof(unsigned int) * 8 +#define ION_FLAG_CACHED 1 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ION_FLAG_CACHED_NEEDS_SYNC 2 struct ion_allocation_data { size_t len; size_t align; - unsigned int heap_mask; /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ + unsigned int heap_id_mask; unsigned int flags; - struct ion_handle *handle; + ion_user_handle_t handle; }; -struct ion_fd_data { /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ - struct ion_handle *handle; +struct ion_fd_data { + ion_user_handle_t handle; int fd; }; -struct ion_handle_data { /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ - struct ion_handle *handle; +struct ion_handle_data { + ion_user_handle_t handle; }; struct ion_custom_data { - unsigned int cmd; /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ + unsigned int cmd; unsigned long arg; }; #define ION_IOC_MAGIC 'I' -#define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_allocation_data) /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_allocation_data) #define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data) #define ION_IOC_MAP _IOWR(ION_IOC_MAGIC, 2, struct ion_fd_data) #define ION_IOC_SHARE _IOWR(ION_IOC_MAGIC, 4, struct ion_fd_data) -#define ION_IOC_IMPORT _IOWR(ION_IOC_MAGIC, 5, struct ion_fd_data) /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ION_IOC_IMPORT _IOWR(ION_IOC_MAGIC, 5, struct ion_fd_data) #define ION_IOC_SYNC _IOWR(ION_IOC_MAGIC, 7, struct ion_fd_data) #define ION_IOC_CUSTOM _IOWR(ION_IOC_MAGIC, 6, struct ion_custom_data) #endif +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ From 0695aa725513e096b5633817eea3db1499e58f7e Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Thu, 23 Jan 2014 15:15:28 -0800 Subject: [PATCH 009/148] Use arch-specific variable to set up the x86 ld flags. Bug: 11654773 Change-Id: I9e9075bac1303cfa39b0f717dd74625ce1dd5fa5 --- libdl/Android.mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libdl/Android.mk b/libdl/Android.mk index 49cfb0c8a..3d60474f0 100644 --- a/libdl/Android.mk +++ b/libdl/Android.mk @@ -18,9 +18,8 @@ include $(CLEAR_VARS) LOCAL_LDFLAGS := -Wl,--exclude-libs=libgcc.a # for x86, exclude libgcc_eh.a for the same reasons as above -ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64)) -LOCAL_LDFLAGS += -Wl,--exclude-libs=libgcc_eh.a -endif +LOCAL_LDFLAGS_x86 := -Wl,--exclude-libs=libgcc_eh.a +LOCAL_LDFLAGS_x86_64 := $(LOCAL_LDFLAGS_x86) LOCAL_SRC_FILES:= libdl.c LOCAL_CFLAGS := -Wall -Wextra -Werror From 2677d133dd7196cc3c7a4e5293f208c00b00b3af Mon Sep 17 00:00:00 2001 From: Sreeram Ramachandran Date: Tue, 13 May 2014 16:59:38 -0700 Subject: [PATCH 010/148] Fix build. (cherry picked from commit 06e8796ee95793435c194b0a55e26d7b568c7409) Change-Id: I33293d8bc62cbb22e23a704c4242e7e9d3fce7c5 --- libc/Android.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libc/Android.mk b/libc/Android.mk index 4bae7648c..47c0d90b7 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -142,7 +142,6 @@ libc_bionic_src_files := \ bionic/mkfifo.cpp \ bionic/mknod.cpp \ bionic/mntent.cpp \ - bionic/NetdClient.cpp \ bionic/open.cpp \ bionic/pause.cpp \ bionic/pipe.cpp \ @@ -848,6 +847,7 @@ LOCAL_SRC_FILES := \ bionic/dlmalloc.c \ bionic/malloc_debug_common.cpp \ bionic/libc_init_static.cpp \ + bionic/NetdClient.cpp \ LOCAL_CFLAGS := $(libc_common_cflags) \ -DLIBC_STATIC @@ -883,6 +883,7 @@ LOCAL_SRC_FILES := \ bionic/debug_stacktrace.cpp \ bionic/pthread_debug.cpp \ bionic/libc_init_dynamic.cpp \ + bionic/NetdClient.cpp \ LOCAL_MODULE := libc LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) From 47b93faa48170661583aecea0ad79b7d1aad8008 Mon Sep 17 00:00:00 2001 From: Sreeram Ramachandran Date: Tue, 13 May 2014 17:48:52 -0700 Subject: [PATCH 011/148] Fix build (take two). Make sure __netdClientDispatch is defined in the same set of libraries that refer to it (e.g.: with connect.cpp). (cherry picked from commit 8205a61248973ac13716ae80e712c80e126b0541) Change-Id: I86d7bf2df5bde09f75a35b204eac0e1361747e22 --- libc/Android.mk | 2 +- libc/bionic/NetdClient.cpp | 22 ++++------------------ libc/bionic/NetdClientDispatch.cpp | 29 +++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 libc/bionic/NetdClientDispatch.cpp diff --git a/libc/Android.mk b/libc/Android.mk index 47c0d90b7..9eacb542f 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -142,6 +142,7 @@ libc_bionic_src_files := \ bionic/mkfifo.cpp \ bionic/mknod.cpp \ bionic/mntent.cpp \ + bionic/NetdClientDispatch.cpp \ bionic/open.cpp \ bionic/pause.cpp \ bionic/pipe.cpp \ @@ -847,7 +848,6 @@ LOCAL_SRC_FILES := \ bionic/dlmalloc.c \ bionic/malloc_debug_common.cpp \ bionic/libc_init_static.cpp \ - bionic/NetdClient.cpp \ LOCAL_CFLAGS := $(libc_common_cflags) \ -DLIBC_STATIC diff --git a/libc/bionic/NetdClient.cpp b/libc/bionic/NetdClient.cpp index 56d82445b..6826ee8ee 100644 --- a/libc/bionic/NetdClient.cpp +++ b/libc/bionic/NetdClient.cpp @@ -14,24 +14,14 @@ * limitations under the License. */ +#ifdef LIBC_STATIC +#error NetdClient.cpp should NOT be included in static libc builds. +#endif + #include #include #include -#ifdef __i386__ -#define __socketcall __attribute__((__cdecl__)) -#else -#define __socketcall -#endif - -extern "C" __socketcall int __connect(int, const sockaddr*, socklen_t); - -NetdClientDispatch __netdClientDispatch __attribute__((aligned(32))) = { - __connect -}; - -#ifndef LIBC_STATIC - #include template @@ -56,13 +46,9 @@ static void netdClientInitImpl() { static pthread_once_t netdClientInitOnce = PTHREAD_ONCE_INIT; -#endif // LIBC_STATIC - extern "C" __LIBC_HIDDEN__ void netdClientInit() { -#ifndef LIBC_STATIC if (pthread_once(&netdClientInitOnce, netdClientInitImpl)) { __libc_format_log(ANDROID_LOG_ERROR, "netdClient", "Unable to initialize netd_client component."); } -#endif // LIBC_STATIC } diff --git a/libc/bionic/NetdClientDispatch.cpp b/libc/bionic/NetdClientDispatch.cpp new file mode 100644 index 000000000..31728d2fe --- /dev/null +++ b/libc/bionic/NetdClientDispatch.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#ifdef __i386__ +#define __socketcall __attribute__((__cdecl__)) +#else +#define __socketcall +#endif + +extern "C" __socketcall int __connect(int, const sockaddr*, socklen_t); + +NetdClientDispatch __netdClientDispatch __attribute__((aligned(32))) = { + __connect +}; From 41d9a503716ed6f3291f4cae097dca08d459429c Mon Sep 17 00:00:00 2001 From: Paul Jensen Date: Tue, 8 Apr 2014 15:43:41 -0400 Subject: [PATCH 012/148] Add support for deleting per-network DNS resolver caches. This is required when the possible range of NetIds is large to prevent netd consuming excessive amounts of memory. This required replacing the per-cache locks in favor of a single global lock to prevent accesses to deleted caches. Change-Id: I99d058bafea5de743e56075dbed74031da4df63f --- libc/dns/include/resolv_cache.h | 11 +-- libc/dns/include/resolv_netid.h | 3 + libc/dns/resolv/res_cache.c | 128 ++++++++++++++++++++------------ libc/dns/resolv/res_send.c | 31 ++++---- 4 files changed, 100 insertions(+), 73 deletions(-) diff --git a/libc/dns/include/resolv_cache.h b/libc/dns/include/resolv_cache.h index 16f3e43a1..e049d951f 100644 --- a/libc/dns/include/resolv_cache.h +++ b/libc/dns/include/resolv_cache.h @@ -32,11 +32,6 @@ #include struct __res_state; -struct resolv_cache; /* forward */ - -/* Gets the cache for a network. Returned cache might be NULL. */ -__LIBC_HIDDEN__ -extern struct resolv_cache* __get_res_cache(unsigned netid); /* sets the name server addresses to the provided res_state structure. The * name servers are retrieved from the cache which is associated @@ -53,7 +48,7 @@ typedef enum { __LIBC_HIDDEN__ extern ResolvCacheStatus -_resolv_cache_lookup( struct resolv_cache* cache, +_resolv_cache_lookup( unsigned netid, const void* query, int querylen, void* answer, @@ -65,7 +60,7 @@ _resolv_cache_lookup( struct resolv_cache* cache, */ __LIBC_HIDDEN__ extern void -_resolv_cache_add( struct resolv_cache* cache, +_resolv_cache_add( unsigned netid, const void* query, int querylen, const void* answer, @@ -74,7 +69,7 @@ _resolv_cache_add( struct resolv_cache* cache, /* Notify the cache a request failed */ __LIBC_HIDDEN__ extern void -_resolv_cache_query_failed( struct resolv_cache* cache, +_resolv_cache_query_failed( unsigned netid, const void* query, int querylen); diff --git a/libc/dns/include/resolv_netid.h b/libc/dns/include/resolv_netid.h index 991a0bf13..006a6c237 100644 --- a/libc/dns/include/resolv_netid.h +++ b/libc/dns/include/resolv_netid.h @@ -65,6 +65,9 @@ extern void _resolv_set_nameservers_for_net(unsigned netid, /* flush the cache associated with a certain network */ extern void _resolv_flush_cache_for_net(unsigned netid); +/* delete the cache associated with a certain network */ +extern void _resolv_delete_cache_for_net(unsigned netid); + __END_DECLS #endif /* _RESOLV_NETID_H */ diff --git a/libc/dns/resolv/res_cache.c b/libc/dns/resolv/res_cache.c index 9df97cdfc..70e8340c3 100644 --- a/libc/dns/resolv/res_cache.c +++ b/libc/dns/resolv/res_cache.c @@ -1218,7 +1218,6 @@ typedef struct resolv_cache { int max_entries; int num_entries; Entry mru_list; - pthread_mutex_t lock; int last_id; Entry* entries; PendingReqInfo pending_requests; @@ -1236,6 +1235,15 @@ struct resolv_cache_info { #define HTABLE_VALID(x) ((x) != NULL && (x) != HTABLE_DELETED) +static pthread_once_t _res_cache_once = PTHREAD_ONCE_INIT; +static void _res_cache_init(void); + +// lock protecting everything in the _resolve_cache_info structs (next ptr, etc) +static pthread_mutex_t _res_cache_list_lock; + +/* gets cache associated with a network, or NULL if none exists */ +static struct resolv_cache* _find_named_cache_locked(unsigned netid); + static void _cache_flush_pending_requests_locked( struct resolv_cache* cache ) { @@ -1256,18 +1264,18 @@ _cache_flush_pending_requests_locked( struct resolv_cache* cache ) } } -/* return 0 if no pending request is found matching the key - * if a matching request is found the calling thread will wait - * and return 1 when released */ +/* Return 0 if no pending request is found matching the key. + * If a matching request is found the calling thread will wait until + * the matching request completes, then update *cache and return 1. */ static int -_cache_check_pending_request_locked( struct resolv_cache* cache, Entry* key ) +_cache_check_pending_request_locked( struct resolv_cache** cache, Entry* key, unsigned netid ) { struct pending_req_info *ri, *prev; int exist = 0; - if (cache && key) { - ri = cache->pending_requests.next; - prev = &cache->pending_requests; + if (*cache && key) { + ri = (*cache)->pending_requests.next; + prev = &(*cache)->pending_requests; while (ri) { if (ri->hash == key->hash) { exist = 1; @@ -1288,7 +1296,9 @@ _cache_check_pending_request_locked( struct resolv_cache* cache, Entry* key ) struct timespec ts = {0,0}; XLOG("Waiting for previous request"); ts.tv_sec = _time_now() + PENDING_REQUEST_TIMEOUT; - pthread_cond_timedwait(&ri->cond, &cache->lock, &ts); + pthread_cond_timedwait(&ri->cond, &_res_cache_list_lock, &ts); + /* Must update *cache as it could have been deleted. */ + *cache = _find_named_cache_locked(netid); } } @@ -1325,17 +1335,25 @@ _cache_notify_waiting_tid_locked( struct resolv_cache* cache, Entry* key ) /* notify the cache that the query failed */ void -_resolv_cache_query_failed( struct resolv_cache* cache, +_resolv_cache_query_failed( unsigned netid, const void* query, int querylen) { Entry key[1]; + Cache* cache; - if (cache && entry_init_key(key, query, querylen)) { - pthread_mutex_lock(&cache->lock); + if (!entry_init_key(key, query, querylen)) + return; + + pthread_mutex_lock(&_res_cache_list_lock); + + cache = _find_named_cache_locked(netid); + + if (cache) { _cache_notify_waiting_tid_locked(cache, key); - pthread_mutex_unlock(&cache->lock); } + + pthread_mutex_unlock(&_res_cache_list_lock); } static void @@ -1391,7 +1409,6 @@ _resolv_cache_create( void ) cache->max_entries = _res_cache_get_max_entries(); cache->entries = calloc(sizeof(*cache->entries), cache->max_entries); if (cache->entries) { - pthread_mutex_init( &cache->lock, NULL ); cache->mru_list.mru_prev = cache->mru_list.mru_next = &cache->mru_list; XLOG("%s: cache created\n", __FUNCTION__); } else { @@ -1586,7 +1603,7 @@ static void _cache_remove_expired(Cache* cache) { } ResolvCacheStatus -_resolv_cache_lookup( struct resolv_cache* cache, +_resolv_cache_lookup( unsigned netid, const void* query, int querylen, void* answer, @@ -1597,6 +1614,7 @@ _resolv_cache_lookup( struct resolv_cache* cache, Entry** lookup; Entry* e; time_t now; + Cache* cache; ResolvCacheStatus result = RESOLV_CACHE_NOTFOUND; @@ -1609,7 +1627,14 @@ _resolv_cache_lookup( struct resolv_cache* cache, return RESOLV_CACHE_UNSUPPORTED; } /* lookup cache */ - pthread_mutex_lock( &cache->lock ); + pthread_once(&_res_cache_once, _res_cache_init); + pthread_mutex_lock(&_res_cache_list_lock); + + cache = _find_named_cache_locked(netid); + if (cache == NULL) { + result = RESOLV_CACHE_UNSUPPORTED; + goto Exit; + } /* see the description of _lookup_p to understand this. * the function always return a non-NULL pointer. @@ -1621,7 +1646,7 @@ _resolv_cache_lookup( struct resolv_cache* cache, XLOG( "NOT IN CACHE"); // calling thread will wait if an outstanding request is found // that matching this query - if (!_cache_check_pending_request_locked(cache, key)) { + if (!_cache_check_pending_request_locked(&cache, key, netid) || cache == NULL) { goto Exit; } else { lookup = _cache_lookup_p(cache, key); @@ -1662,13 +1687,13 @@ _resolv_cache_lookup( struct resolv_cache* cache, result = RESOLV_CACHE_FOUND; Exit: - pthread_mutex_unlock( &cache->lock ); + pthread_mutex_unlock(&_res_cache_list_lock); return result; } void -_resolv_cache_add( struct resolv_cache* cache, +_resolv_cache_add( unsigned netid, const void* query, int querylen, const void* answer, @@ -1678,6 +1703,7 @@ _resolv_cache_add( struct resolv_cache* cache, Entry* e; Entry** lookup; u_long ttl; + Cache* cache = NULL; /* don't assume that the query has already been cached */ @@ -1686,7 +1712,12 @@ _resolv_cache_add( struct resolv_cache* cache, return; } - pthread_mutex_lock( &cache->lock ); + pthread_mutex_lock(&_res_cache_list_lock); + + cache = _find_named_cache_locked(netid); + if (cache == NULL) { + goto Exit; + } XLOG( "%s: query:", __FUNCTION__ ); XLOG_QUERY(query,querylen); @@ -1732,8 +1763,10 @@ _resolv_cache_add( struct resolv_cache* cache, _cache_dump_mru(cache); #endif Exit: - _cache_notify_waiting_tid_locked(cache, key); - pthread_mutex_unlock( &cache->lock ); + if (cache != NULL) { + _cache_notify_waiting_tid_locked(cache, key); + } + pthread_mutex_unlock(&_res_cache_list_lock); } /****************************************************************************/ @@ -1744,20 +1777,13 @@ Exit: /****************************************************************************/ /****************************************************************************/ -static pthread_once_t _res_cache_once = PTHREAD_ONCE_INIT; - // Head of the list of caches. Protected by _res_cache_list_lock. static struct resolv_cache_info _res_cache_list; -// lock protecting everything in the _resolve_cache_info structs (next ptr, etc) -static pthread_mutex_t _res_cache_list_lock; - /* insert resolv_cache_info into the list of resolv_cache_infos */ static void _insert_cache_info_locked(struct resolv_cache_info* cache_info); /* creates a resolv_cache_info */ static struct resolv_cache_info* _create_cache_info( void ); -/* gets cache associated with a network, or NULL if none exists */ -static struct resolv_cache* _find_named_cache_locked(unsigned netid); /* gets a resolv_cache_info associated with a network, or NULL if not found */ static struct resolv_cache_info* _find_cache_info_locked(unsigned netid); /* look up the named cache, and creates one if needed */ @@ -1785,22 +1811,6 @@ _res_cache_init(void) pthread_mutex_init(&_res_cache_list_lock, NULL); } -struct resolv_cache* -__get_res_cache(unsigned netid) -{ - struct resolv_cache *cache; - - pthread_once(&_res_cache_once, _res_cache_init); - pthread_mutex_lock(&_res_cache_list_lock); - - /* Does NOT create a cache if it does not exist. */ - cache = _find_named_cache_locked(netid); - - pthread_mutex_unlock(&_res_cache_list_lock); - XLOG("%s: netid=%u, cache=%p\n", __FUNCTION__, netid, cache); - return cache; -} - static struct resolv_cache* _get_res_cache_for_net_locked(unsigned netid) { @@ -1837,12 +1847,36 @@ _flush_cache_for_net_locked(unsigned netid) { struct resolv_cache* cache = _find_named_cache_locked(netid); if (cache) { - pthread_mutex_lock(&cache->lock); _cache_flush_locked(cache); - pthread_mutex_unlock(&cache->lock); } } +void _resolv_delete_cache_for_net(unsigned netid) +{ + pthread_once(&_res_cache_once, _res_cache_init); + pthread_mutex_lock(&_res_cache_list_lock); + + struct resolv_cache_info* prev_cache_info = &_res_cache_list; + + while (prev_cache_info->next) { + struct resolv_cache_info* cache_info = prev_cache_info->next; + + if (cache_info->netid == netid) { + prev_cache_info->next = cache_info->next; + _cache_flush_locked(cache_info->cache); + free(cache_info->cache->entries); + free(cache_info->cache); + _free_nameservers_locked(cache_info); + free(cache_info); + break; + } + + prev_cache_info = prev_cache_info->next; + } + + pthread_mutex_unlock(&_res_cache_list_lock); +} + static struct resolv_cache_info* _create_cache_info(void) { diff --git a/libc/dns/resolv/res_send.c b/libc/dns/resolv/res_send.c index 9b36f5575..972e143a9 100644 --- a/libc/dns/resolv/res_send.c +++ b/libc/dns/resolv/res_send.c @@ -367,7 +367,6 @@ res_nsend(res_state statp, int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; char abuf[NI_MAXHOST]; #if USE_RESOLV_CACHE - struct resolv_cache* cache; ResolvCacheStatus cache_status = RESOLV_CACHE_UNSUPPORTED; #endif @@ -389,21 +388,17 @@ res_nsend(res_state statp, terrno = ETIMEDOUT; #if USE_RESOLV_CACHE - // get the cache associated with the network - cache = __get_res_cache(statp->netid); - if (cache != NULL) { - int anslen = 0; - cache_status = _resolv_cache_lookup( - cache, buf, buflen, - ans, anssiz, &anslen); + int anslen = 0; + cache_status = _resolv_cache_lookup( + statp->netid, buf, buflen, + ans, anssiz, &anslen); - if (cache_status == RESOLV_CACHE_FOUND) { - return anslen; - } else { - // had a cache miss for a known network, so populate the thread private - // data so the normal resolve path can do its thing - _resolv_populate_res_for_net(statp); - } + if (cache_status == RESOLV_CACHE_FOUND) { + return anslen; + } else if (cache_status != RESOLV_CACHE_UNSUPPORTED) { + // had a cache miss for a known network, so populate the thread private + // data so the normal resolve path can do its thing + _resolv_populate_res_for_net(statp); } if (statp->nscount == 0) { @@ -602,7 +597,7 @@ res_nsend(res_state statp, #if USE_RESOLV_CACHE if (cache_status == RESOLV_CACHE_NOTFOUND) { - _resolv_cache_add(cache, buf, buflen, + _resolv_cache_add(statp->netid, buf, buflen, ans, resplen); } #endif @@ -658,13 +653,13 @@ res_nsend(res_state statp, errno = terrno; #if USE_RESOLV_CACHE - _resolv_cache_query_failed(cache, buf, buflen); + _resolv_cache_query_failed(statp->netid, buf, buflen); #endif return (-1); fail: #if USE_RESOLV_CACHE - _resolv_cache_query_failed(cache, buf, buflen); + _resolv_cache_query_failed(statp->netid, buf, buflen); #endif res_nclose(statp); return (-1); From dedf2922d5c67e8c1e457b542bd71bc53d460b53 Mon Sep 17 00:00:00 2001 From: Sreeram Ramachandran Date: Tue, 13 May 2014 15:40:26 -0700 Subject: [PATCH 013/148] Mark sockets on accept(). Conflicts: libc/SYSCALLS.TXT Change-Id: I5d09be413cf720fbed905f96313b007997ada76c --- libc/Android.mk | 1 + libc/SYSCALLS.TXT | 4 ++-- .../syscalls/{accept.S => __accept.S} | 4 ++-- .../syscalls/{accept.S => __accept.S} | 5 +++-- .../syscalls/{accept.S => __accept.S} | 4 ++-- .../syscalls/{accept.S => __accept.S} | 5 +++-- .../syscalls/{accept.S => __accept.S} | 4 ++-- .../syscalls/{accept.S => __accept.S} | 5 +++-- libc/bionic/NetdClient.cpp | 1 + libc/bionic/NetdClientDispatch.cpp | 4 +++- libc/bionic/accept.cpp | 22 +++++++++++++++++++ libc/private/NetdClient.h | 1 + 12 files changed, 45 insertions(+), 15 deletions(-) rename libc/arch-arm/syscalls/{accept.S => __accept.S} (89%) rename libc/arch-arm64/syscalls/{accept.S => __accept.S} (88%) rename libc/arch-mips/syscalls/{accept.S => __accept.S} (89%) rename libc/arch-mips64/syscalls/{accept.S => __accept.S} (87%) rename libc/arch-x86/syscalls/{accept.S => __accept.S} (94%) rename libc/arch-x86_64/syscalls/{accept.S => __accept.S} (85%) create mode 100644 libc/bionic/accept.cpp diff --git a/libc/Android.mk b/libc/Android.mk index ed7d055e7..817c76767 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -98,6 +98,7 @@ libc_common_src_files += \ libc_bionic_src_files := \ bionic/abort.cpp \ + bionic/accept.cpp \ bionic/access.cpp \ bionic/assert.cpp \ bionic/atof.cpp \ diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index e9fb57522..83feb65c7 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -236,7 +236,7 @@ int socketpair(int, int, int, int*) arm,arm64,mips,mips64,x86_64 int bind(int, struct sockaddr*, int) arm,arm64,mips,mips64,x86_64 int __connect:connect(int, struct sockaddr*, socklen_t) arm,arm64,mips,mips64,x86_64 int listen(int, int) arm,arm64,mips,mips64,x86_64 -int accept(int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64 +int __accept:accept(int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64 int accept4(int, struct sockaddr*, socklen_t*, int) arm,arm64,mips,mips64,x86_64 int getsockname(int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64 int getpeername(int, struct sockaddr*, socklen_t*) arm,arm64,mips,mips64,x86_64 @@ -255,7 +255,7 @@ int socket:socketcall:1(int, int, int) x86 int bind:socketcall:2(int, struct sockaddr*, int) x86 int __connect:socketcall:3(int, struct sockaddr*, socklen_t) x86 int listen:socketcall:4(int, int) x86 -int accept:socketcall:5(int, struct sockaddr*, socklen_t*) x86 +int __accept:socketcall:5(int, struct sockaddr*, socklen_t*) x86 int getsockname:socketcall:6(int, struct sockaddr*, socklen_t*) x86 int getpeername:socketcall:7(int, struct sockaddr*, socklen_t*) x86 int socketpair:socketcall:8(int, int, int, int*) x86 diff --git a/libc/arch-arm/syscalls/accept.S b/libc/arch-arm/syscalls/__accept.S similarity index 89% rename from libc/arch-arm/syscalls/accept.S rename to libc/arch-arm/syscalls/__accept.S index e2a51f5db..bae11bcb7 100644 --- a/libc/arch-arm/syscalls/accept.S +++ b/libc/arch-arm/syscalls/__accept.S @@ -2,7 +2,7 @@ #include -ENTRY(accept) +ENTRY(__accept) mov ip, r7 ldr r7, =__NR_accept swi #0 @@ -11,4 +11,4 @@ ENTRY(accept) bxls lr neg r0, r0 b __set_errno -END(accept) +END(__accept) diff --git a/libc/arch-arm64/syscalls/accept.S b/libc/arch-arm64/syscalls/__accept.S similarity index 88% rename from libc/arch-arm64/syscalls/accept.S rename to libc/arch-arm64/syscalls/__accept.S index dae6121f2..21b68bc6b 100644 --- a/libc/arch-arm64/syscalls/accept.S +++ b/libc/arch-arm64/syscalls/__accept.S @@ -2,7 +2,7 @@ #include -ENTRY(accept) +ENTRY(__accept) stp x29, x30, [sp, #-16]! mov x29, sp str x8, [sp, #-16]! @@ -18,4 +18,5 @@ ENTRY(accept) b.hi __set_errno ret -END(accept) +END(__accept) +.hidden __accept diff --git a/libc/arch-mips/syscalls/accept.S b/libc/arch-mips/syscalls/__accept.S similarity index 89% rename from libc/arch-mips/syscalls/accept.S rename to libc/arch-mips/syscalls/__accept.S index 09496abdc..d8141feee 100644 --- a/libc/arch-mips/syscalls/accept.S +++ b/libc/arch-mips/syscalls/__accept.S @@ -2,7 +2,7 @@ #include -ENTRY(accept) +ENTRY(__accept) .set noreorder .cpload t9 li v0, __NR_accept @@ -16,4 +16,4 @@ ENTRY(accept) j t9 nop .set reorder -END(accept) +END(__accept) diff --git a/libc/arch-mips64/syscalls/accept.S b/libc/arch-mips64/syscalls/__accept.S similarity index 87% rename from libc/arch-mips64/syscalls/accept.S rename to libc/arch-mips64/syscalls/__accept.S index 6c3855698..4404a6862 100644 --- a/libc/arch-mips64/syscalls/accept.S +++ b/libc/arch-mips64/syscalls/__accept.S @@ -2,7 +2,7 @@ #include -ENTRY(accept) +ENTRY(__accept) .set push .set noreorder li v0, __NR_accept @@ -22,4 +22,5 @@ ENTRY(accept) j t9 move ra, t0 .set pop -END(accept) +END(__accept) +.hidden __accept diff --git a/libc/arch-x86/syscalls/accept.S b/libc/arch-x86/syscalls/__accept.S similarity index 94% rename from libc/arch-x86/syscalls/accept.S rename to libc/arch-x86/syscalls/__accept.S index f7e8a58eb..31cb35001 100644 --- a/libc/arch-x86/syscalls/accept.S +++ b/libc/arch-x86/syscalls/__accept.S @@ -2,7 +2,7 @@ #include -ENTRY(accept) +ENTRY(__accept) pushl %ebx pushl %ecx .cfi_def_cfa_offset 8 @@ -24,4 +24,4 @@ ENTRY(accept) popl %ecx popl %ebx ret -END(accept) +END(__accept) diff --git a/libc/arch-x86_64/syscalls/accept.S b/libc/arch-x86_64/syscalls/__accept.S similarity index 85% rename from libc/arch-x86_64/syscalls/accept.S rename to libc/arch-x86_64/syscalls/__accept.S index 588fb8231..ff0f5e765 100644 --- a/libc/arch-x86_64/syscalls/accept.S +++ b/libc/arch-x86_64/syscalls/__accept.S @@ -2,7 +2,7 @@ #include -ENTRY(accept) +ENTRY(__accept) movl $__NR_accept, %eax syscall cmpq $-MAX_ERRNO, %rax @@ -13,4 +13,5 @@ ENTRY(accept) orq $-1, %rax 1: ret -END(accept) +END(__accept) +.hidden __accept diff --git a/libc/bionic/NetdClient.cpp b/libc/bionic/NetdClient.cpp index 6826ee8ee..72d90b7bb 100644 --- a/libc/bionic/NetdClient.cpp +++ b/libc/bionic/NetdClient.cpp @@ -40,6 +40,7 @@ static void netdClientInitImpl() { // default implementations of functions that it would've overridden. return; } + netdClientInitFunction(netdClientHandle, "netdClientInitAccept", &__netdClientDispatch.accept); netdClientInitFunction(netdClientHandle, "netdClientInitConnect", &__netdClientDispatch.connect); } diff --git a/libc/bionic/NetdClientDispatch.cpp b/libc/bionic/NetdClientDispatch.cpp index 31728d2fe..adfe16d7f 100644 --- a/libc/bionic/NetdClientDispatch.cpp +++ b/libc/bionic/NetdClientDispatch.cpp @@ -22,8 +22,10 @@ #define __socketcall #endif +extern "C" __socketcall int __accept(int, sockaddr*, socklen_t*); extern "C" __socketcall int __connect(int, const sockaddr*, socklen_t); NetdClientDispatch __netdClientDispatch __attribute__((aligned(32))) = { - __connect + __accept, + __connect, }; diff --git a/libc/bionic/accept.cpp b/libc/bionic/accept.cpp new file mode 100644 index 000000000..46b4efc65 --- /dev/null +++ b/libc/bionic/accept.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +int accept(int sockfd, sockaddr* addr, socklen_t* addrlen) { + return __netdClientDispatch.accept(sockfd, addr, addrlen); +} diff --git a/libc/private/NetdClient.h b/libc/private/NetdClient.h index 48c05cb9d..b2ce7a664 100644 --- a/libc/private/NetdClient.h +++ b/libc/private/NetdClient.h @@ -20,6 +20,7 @@ #include struct NetdClientDispatch { + int (*accept)(int, sockaddr*, socklen_t*); int (*connect)(int, const sockaddr*, socklen_t); }; From 559c7842cc6862568d9b5799fc0bcf74d58b596b Mon Sep 17 00:00:00 2001 From: Paul Jensen Date: Thu, 15 May 2014 14:43:07 -0400 Subject: [PATCH 014/148] Query libnetd_client for the appropriate netId for host resolution. If libnetd_client can't be found, operate as before and use the default netId potentially overriden by a more specific netId passed in to android_get*fornet(). Change-Id: I42ef3293172651870fb46d2de22464c4f03e8e0b --- libc/bionic/NetdClient.cpp | 2 ++ libc/bionic/NetdClientDispatch.cpp | 5 +++++ libc/dns/gethnamaddr.c | 5 +++++ libc/dns/net/getaddrinfo.c | 3 +++ libc/private/NetdClient.h | 12 +++++++++--- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/libc/bionic/NetdClient.cpp b/libc/bionic/NetdClient.cpp index 72d90b7bb..23f7c433d 100644 --- a/libc/bionic/NetdClient.cpp +++ b/libc/bionic/NetdClient.cpp @@ -43,6 +43,8 @@ static void netdClientInitImpl() { netdClientInitFunction(netdClientHandle, "netdClientInitAccept", &__netdClientDispatch.accept); netdClientInitFunction(netdClientHandle, "netdClientInitConnect", &__netdClientDispatch.connect); + netdClientInitFunction(netdClientHandle, "netdClientInitNetIdForResolv", + &__netdClientDispatch.netIdForResolv); } static pthread_once_t netdClientInitOnce = PTHREAD_ONCE_INIT; diff --git a/libc/bionic/NetdClientDispatch.cpp b/libc/bionic/NetdClientDispatch.cpp index adfe16d7f..62130a1f3 100644 --- a/libc/bionic/NetdClientDispatch.cpp +++ b/libc/bionic/NetdClientDispatch.cpp @@ -25,7 +25,12 @@ extern "C" __socketcall int __accept(int, sockaddr*, socklen_t*); extern "C" __socketcall int __connect(int, const sockaddr*, socklen_t); +static unsigned fallBackNetIdForResolv(unsigned netId) { + return netId; +} + NetdClientDispatch __netdClientDispatch __attribute__((aligned(32))) = { __accept, __connect, + fallBackNetIdForResolv, }; diff --git a/libc/dns/gethnamaddr.c b/libc/dns/gethnamaddr.c index 4da99b2fe..41a876a23 100644 --- a/libc/dns/gethnamaddr.c +++ b/libc/dns/gethnamaddr.c @@ -60,6 +60,7 @@ #include #include #include +#include "NetdClient.h" #include "resolv_netid.h" #include "resolv_private.h" #include "resolv_cache.h" @@ -760,6 +761,8 @@ gethostbyname_internal(const char *name, int af, res_state res, unsigned netid, proxy = android_open_proxy(); if (proxy == NULL) goto exit; + netid = __netdClientDispatch.netIdForResolv(netid); + /* This is writing to system/netd/DnsProxyListener.cpp and changes * here need to be matched there */ if (fprintf(proxy, "gethostbyname %u %s %d", @@ -796,6 +799,8 @@ android_gethostbyaddrfornet_proxy(const void *addr, const char * addrStr = inet_ntop(af, addr, buf, sizeof(buf)); if (addrStr == NULL) goto exit; + netid = __netdClientDispatch.netIdForResolv(netid); + if (fprintf(proxy, "gethostbyaddr %s %d %d %u", addrStr, len, af, netid) < 0) { goto exit; diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c index 4c120d907..bdf3ba756 100644 --- a/libc/dns/net/getaddrinfo.c +++ b/libc/dns/net/getaddrinfo.c @@ -92,6 +92,7 @@ #include #include #include +#include "NetdClient.h" #include "resolv_cache.h" #include "resolv_netid.h" #include "resolv_private.h" @@ -449,6 +450,8 @@ android_getaddrinfo_proxy( return EAI_NODATA; } + netid = __netdClientDispatch.netIdForResolv(netid); + // Send the request. proxy = fdopen(sock, "r+"); if (fprintf(proxy, "getaddrinfo %s %s %d %d %d %d %u", diff --git a/libc/private/NetdClient.h b/libc/private/NetdClient.h index b2ce7a664..664c54fb4 100644 --- a/libc/private/NetdClient.h +++ b/libc/private/NetdClient.h @@ -17,13 +17,19 @@ #ifndef PRIVATE_NETD_CLIENT_H #define PRIVATE_NETD_CLIENT_H +#include #include +__BEGIN_DECLS + struct NetdClientDispatch { - int (*accept)(int, sockaddr*, socklen_t*); - int (*connect)(int, const sockaddr*, socklen_t); + int (*accept)(int, struct sockaddr*, socklen_t*); + int (*connect)(int, const struct sockaddr*, socklen_t); + unsigned (*netIdForResolv)(unsigned); }; -extern NetdClientDispatch __netdClientDispatch; +extern struct NetdClientDispatch __netdClientDispatch; + +__END_DECLS #endif // PRIVATE_NETD_CLIENT_H From 57a26275754730c0b1c8ec313b99cbefc10564c9 Mon Sep 17 00:00:00 2001 From: Sreeram Ramachandran Date: Mon, 19 May 2014 10:21:39 -0700 Subject: [PATCH 015/148] Fix build breakage. Change-Id: I1835198c64c28021b81f0c790f108685a3f456c7 --- libc/dns/gethnamaddr.c | 2 +- libc/dns/net/getaddrinfo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/dns/gethnamaddr.c b/libc/dns/gethnamaddr.c index 41a876a23..1afad6d4d 100644 --- a/libc/dns/gethnamaddr.c +++ b/libc/dns/gethnamaddr.c @@ -60,7 +60,7 @@ #include #include #include -#include "NetdClient.h" +#include "NetdClientDispatch.h" #include "resolv_netid.h" #include "resolv_private.h" #include "resolv_cache.h" diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c index bdf3ba756..be692e39a 100644 --- a/libc/dns/net/getaddrinfo.c +++ b/libc/dns/net/getaddrinfo.c @@ -92,7 +92,7 @@ #include #include #include -#include "NetdClient.h" +#include "NetdClientDispatch.h" #include "resolv_cache.h" #include "resolv_netid.h" #include "resolv_private.h" From ddc7f830ce56197e5915276d597bc8a017104532 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 20 May 2014 15:06:37 -0700 Subject: [PATCH 016/148] HACK: linker: check for handle==0xffffffff on LP64 bionic RTLD_NEXT was changed from 0xffffffff to -1L, which breaks existing binaries compiled. Temporarily look either until we can get recompiled binaries. Bug: 15113039 Change-Id: I1568fa0e4a832c5e6df21da74a33b22bde7f16f6 --- linker/dlfcn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp index 8ef121294..7e3b3f41d 100644 --- a/linker/dlfcn.cpp +++ b/linker/dlfcn.cpp @@ -102,7 +102,7 @@ void* dlsym(void* handle, const char* symbol) { ElfW(Sym)* sym = NULL; if (handle == RTLD_DEFAULT) { sym = dlsym_linear_lookup(symbol, &found, NULL); - } else if (handle == RTLD_NEXT) { + } else if (handle == RTLD_NEXT || handle == (void*)0xffffffffL) { void* caller_addr = __builtin_return_address(0); soinfo* si = find_containing_library(caller_addr); From a856c6f543c71f6778cdb9b39f6049ae8b2c4e53 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 29 May 2014 21:03:15 -0700 Subject: [PATCH 017/148] DO NOT MERGE Fix lmp-preview-dev after bionic merge. Other projects in lmp-preview-dev are out of date, and it's easier to patch bionic than to fix all of them. Change-Id: Id55c3da7259ba0bb5e62462d5eca721d3716c07f --- libc/include/stdio.h | 2 ++ libc/include/sys/atomics.h | 72 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 libc/include/sys/atomics.h diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 90f595c9e..c6b2d3226 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -253,6 +253,8 @@ int vprintf(const char * __restrict, __va_list) int dprintf(int, const char * __restrict, ...) __printflike(2, 3); int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0); +int fdprintf(int, const char * __restrict, ...) __printflike(2, 3); /* Note: this is only in the preview release. */ + #ifndef __AUDIT__ char* gets(char*) __warnattr("gets is very unsafe; consider using fgets"); int sprintf(char* __restrict, const char* __restrict, ...) diff --git a/libc/include/sys/atomics.h b/libc/include/sys/atomics.h new file mode 100644 index 000000000..3366f0ee3 --- /dev/null +++ b/libc/include/sys/atomics.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_ATOMICS_H +#define _SYS_ATOMICS_H + +#include +#include + +/* Note: this is only in the preview release. */ + +__BEGIN_DECLS + +#define __ATOMIC_INLINE__ static __inline__ __attribute__((always_inline)) + +__ATOMIC_INLINE__ int +__atomic_cmpxchg(int old_value, int new_value, volatile int* ptr) +{ + /* We must return 0 on success */ + return __sync_val_compare_and_swap(ptr, old_value, new_value) != old_value; +} + +__ATOMIC_INLINE__ int +__atomic_swap(int new_value, volatile int *ptr) +{ + int old_value; + do { + old_value = *ptr; + } while (__sync_val_compare_and_swap(ptr, old_value, new_value) != old_value); + return old_value; +} + +__ATOMIC_INLINE__ int +__atomic_dec(volatile int *ptr) +{ + return __sync_fetch_and_sub (ptr, 1); +} + +__ATOMIC_INLINE__ int +__atomic_inc(volatile int *ptr) +{ + return __sync_fetch_and_add (ptr, 1); +} + + +__END_DECLS + +#endif /* _SYS_ATOMICS_H */ From 31ad03761d35ce5bff48cc1cb3764816727ac1f0 Mon Sep 17 00:00:00 2001 From: Paul Jensen Date: Thu, 29 May 2014 16:28:30 -0400 Subject: [PATCH 018/148] Make host resolver call __connect() rather than connect() so mark isn't cleared. Calling connect() will erase the mark set by the host resolver code because the explicitlySelected bit of the Fwmark isn't set. It's by design that the explicitlySelected bit isn't set as this facilitates falling through to other routing rules if the selected network doesn't provide a route to the DNS server as may be the case with VPNs. Change-Id: I60ba7c754194ead97df3ac6a6c5b3db1f446dac8 --- libc/dns/include/resolv_private.h | 10 ++++++++++ libc/dns/net/getaddrinfo.c | 4 ++-- libc/dns/resolv/res_send.c | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libc/dns/include/resolv_private.h b/libc/dns/include/resolv_private.h index 8914fae0e..bea16d418 100644 --- a/libc/dns/include/resolv_private.h +++ b/libc/dns/include/resolv_private.h @@ -494,6 +494,16 @@ void res_setnetid(res_state, unsigned); void res_setmark(res_state, unsigned); u_int res_randomid(void); +#ifdef __i386__ +# define __socketcall extern __attribute__((__cdecl__)) +#else +# define __socketcall extern +#endif + +__socketcall int __connect(int, const struct sockaddr*, socklen_t); + +#undef __socketcall + __END_DECLS #endif /* !_RESOLV_PRIVATE_H_ */ diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c index be692e39a..32d946cb2 100644 --- a/libc/dns/net/getaddrinfo.c +++ b/libc/dns/net/getaddrinfo.c @@ -369,7 +369,7 @@ _test_connect(int pf, struct sockaddr *addr, size_t addrlen, unsigned mark) { return 0; int ret; do { - ret = connect(s, addr, addrlen); + ret = __connect(s, addr, addrlen); } while (ret < 0 && errno == EINTR); int success = (ret == 0); do { @@ -1803,7 +1803,7 @@ _find_src_addr(const struct sockaddr *addr, struct sockaddr *src_addr, unsigned if (mark != MARK_UNSET && setsockopt(sock, SOL_SOCKET, SO_MARK, &mark, sizeof(mark)) < 0) return 0; do { - ret = connect(sock, addr, len); + ret = __connect(sock, addr, len); } while (ret == -1 && errno == EINTR); if (ret == -1) { diff --git a/libc/dns/resolv/res_send.c b/libc/dns/resolv/res_send.c index 972e143a9..e64ccde4d 100644 --- a/libc/dns/resolv/res_send.c +++ b/libc/dns/resolv/res_send.c @@ -946,7 +946,7 @@ connect_with_timeout(int sock, const struct sockaddr *nsap, socklen_t salen, int origflags = fcntl(sock, F_GETFL, 0); fcntl(sock, F_SETFL, origflags | O_NONBLOCK); - res = connect(sock, nsap, salen); + res = __connect(sock, nsap, salen); if (res < 0 && errno != EINPROGRESS) { res = -1; goto done; @@ -1103,7 +1103,7 @@ send_dg(res_state statp, res_nclose(statp); return (0); } - if (connect(EXT(statp).nssocks[ns], nsap, (socklen_t)nsaplen) < 0) { + if (__connect(EXT(statp).nssocks[ns], nsap, (socklen_t)nsaplen) < 0) { Aerror(statp, stderr, "connect(dg)", errno, nsap, nsaplen); res_nclose(statp); From 4832a0961dc891ef69177c9cf0c3e3ba5dd7b69d Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 29 May 2014 21:03:15 -0700 Subject: [PATCH 019/148] DO NOT MERGE Fix lmp-preview-dev after bionic merge. Other projects in lmp-preview-dev are out of date, and it's easier to patch bionic than to fix all of them. (cherry picked from commit a856c6f543c71f6778cdb9b39f6049ae8b2c4e53) Change-Id: Id8fbdf35eb55150579f85b7bdddb5d68d3012218 --- libc/include/stdio.h | 2 ++ libc/include/sys/atomics.h | 72 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 libc/include/sys/atomics.h diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 90f595c9e..c6b2d3226 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -253,6 +253,8 @@ int vprintf(const char * __restrict, __va_list) int dprintf(int, const char * __restrict, ...) __printflike(2, 3); int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0); +int fdprintf(int, const char * __restrict, ...) __printflike(2, 3); /* Note: this is only in the preview release. */ + #ifndef __AUDIT__ char* gets(char*) __warnattr("gets is very unsafe; consider using fgets"); int sprintf(char* __restrict, const char* __restrict, ...) diff --git a/libc/include/sys/atomics.h b/libc/include/sys/atomics.h new file mode 100644 index 000000000..3366f0ee3 --- /dev/null +++ b/libc/include/sys/atomics.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _SYS_ATOMICS_H +#define _SYS_ATOMICS_H + +#include +#include + +/* Note: this is only in the preview release. */ + +__BEGIN_DECLS + +#define __ATOMIC_INLINE__ static __inline__ __attribute__((always_inline)) + +__ATOMIC_INLINE__ int +__atomic_cmpxchg(int old_value, int new_value, volatile int* ptr) +{ + /* We must return 0 on success */ + return __sync_val_compare_and_swap(ptr, old_value, new_value) != old_value; +} + +__ATOMIC_INLINE__ int +__atomic_swap(int new_value, volatile int *ptr) +{ + int old_value; + do { + old_value = *ptr; + } while (__sync_val_compare_and_swap(ptr, old_value, new_value) != old_value); + return old_value; +} + +__ATOMIC_INLINE__ int +__atomic_dec(volatile int *ptr) +{ + return __sync_fetch_and_sub (ptr, 1); +} + +__ATOMIC_INLINE__ int +__atomic_inc(volatile int *ptr) +{ + return __sync_fetch_and_add (ptr, 1); +} + + +__END_DECLS + +#endif /* _SYS_ATOMICS_H */ From 430cf1a6c32471ada4dad028acbfcc032da01fd3 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 3 Jun 2014 14:45:17 -0700 Subject: [PATCH 020/148] DO NOT MERGE fdprintf backward compatibility shim. Fixes LP64 build. Change-Id: Ic76005cd1f5a55344ea8ee3d070d25631d011037 --- libc/bionic/ndk_cruft.cpp | 9 --------- libc/include/stdio.h | 9 ++++++++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index 1284b9a4e..f680fe0d0 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -186,15 +186,6 @@ extern "C" intmax_t strntoimax(const char* nptr, char** endptr, int base, size_t return (intmax_t) strntoumax(nptr, endptr, base, n); } -// POSIX calls this dprintf, but LP32 Android had fdprintf instead. -extern "C" int fdprintf(int fd, const char* fmt, ...) { - va_list ap; - va_start(ap, fmt); - int rc = vdprintf(fd, fmt, ap); - va_end(ap); - return rc; -} - // POSIX calls this vdprintf, but LP32 Android had fdprintf instead. extern "C" int vfdprintf(int fd, const char* fmt, va_list ap) { return vdprintf(fd, fmt, ap); diff --git a/libc/include/stdio.h b/libc/include/stdio.h index c6b2d3226..8f3c525d7 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -253,7 +253,14 @@ int vprintf(const char * __restrict, __va_list) int dprintf(int, const char * __restrict, ...) __printflike(2, 3); int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0); -int fdprintf(int, const char * __restrict, ...) __printflike(2, 3); /* Note: this is only in the preview release. */ +static inline int fdprintf(int fd, const char* fmt, ...) { + /* Note: this backward compatibility shim is only in the preview release. */ + va_list ap; + va_start(ap, fmt); + int rc = vdprintf(fd, fmt, ap); + va_end(ap); + return rc; +} #ifndef __AUDIT__ char* gets(char*) __warnattr("gets is very unsafe; consider using fgets"); From bd7a892c300a2c257bd7422f56325c575765b09a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 5 Jun 2014 12:28:14 -0700 Subject: [PATCH 021/148] Fix unwinding through x86-64 __bionic_clone. x86-64 needs these CFI directives to stop unwinding here. I've also cleaned up the assembler a little, and made x86 and x86-64 a little more alike. Bug: 15195760 (cherry picked from commit aeb3016f8132689d1b49d30056005b667e3d2d0e) Change-Id: I511fe238b1ef1a1c16aef735f93bbee9accb0689 --- libc/arch-x86/bionic/__bionic_clone.S | 6 +++--- libc/arch-x86_64/bionic/__bionic_clone.S | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/libc/arch-x86/bionic/__bionic_clone.S b/libc/arch-x86/bionic/__bionic_clone.S index 7c972de54..672512c52 100644 --- a/libc/arch-x86/bionic/__bionic_clone.S +++ b/libc/arch-x86/bionic/__bionic_clone.S @@ -25,8 +25,8 @@ ENTRY(__bionic_clone) int $0x80 # Check result. - cmpl $0, %eax - je .L_bc_child + testl %eax, %eax + jz .L_bc_child jg .L_bc_parent # An error occurred, so set errno and return -1. @@ -44,7 +44,7 @@ ENTRY(__bionic_clone) hlt .L_bc_parent: - # we're the parent; nothing to do. + # We're the parent; nothing to do. .L_bc_return: popl %edi popl %esi diff --git a/libc/arch-x86_64/bionic/__bionic_clone.S b/libc/arch-x86_64/bionic/__bionic_clone.S index db7d05c28..7fe44a233 100644 --- a/libc/arch-x86_64/bionic/__bionic_clone.S +++ b/libc/arch-x86_64/bionic/__bionic_clone.S @@ -45,17 +45,23 @@ ENTRY(__bionic_clone) # Make the system call. movl $__NR_clone, %eax syscall - testl %eax, %eax - jns 1f + + # Check result. + testq %rax, %rax + jz .L_bc_child + jg .L_bc_parent # An error occurred, set errno and return -1. negl %eax movl %eax, %edi call __set_errno orl $-1, %eax - jmp 2f -1: - jnz 2f + ret + +.L_bc_child: + # We don't want anyone to unwind past this point. + .cfi_undefined %rip + .cfi_undefined %rbp # We're in the child now, so call __bionic_clone_entry # with the arguments from the child stack moved into @@ -64,7 +70,9 @@ ENTRY(__bionic_clone) popq %rsi # arg call __bionic_clone_entry hlt -2: + +.L_bc_parent: + # We're the parent; nothing to do. ret END(__bionic_clone) .hidden __bionic_clone From acc2f79ed7881178c203b1f7cea31596d42ca6cd Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 30 May 2014 16:00:53 -0700 Subject: [PATCH 022/148] Use __libc_fatal() for failed malloc in new This way we can print a useful message to the log isntead of just dying mysteriously. (cherry picked from commit 989725940e765f0065b2bc06b881cde864b62595) Bug: 13564922 Change-Id: I704e1263ec1e7556808348b821a20bacc934eb4a --- libc/bionic/new.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libc/bionic/new.cpp b/libc/bionic/new.cpp index cb19dfae2..fcfd1bdf5 100644 --- a/libc/bionic/new.cpp +++ b/libc/bionic/new.cpp @@ -14,15 +14,18 @@ * limitations under the License. */ +#include #include #include +#include "private/libc_logging.h" + const std::nothrow_t std::nothrow = {}; void* operator new(std::size_t size) { void* p = malloc(size); if (p == NULL) { - abort(); + __libc_fatal("new failed to allocate %zu bytes", size); } return p; } @@ -30,7 +33,7 @@ void* operator new(std::size_t size) { void* operator new[](std::size_t size) { void* p = malloc(size); if (p == NULL) { - abort(); + __libc_fatal("new[] failed to allocate %zu bytes", size); } return p; } From 3b9da0f99a6629d5283844922327711c985c78eb Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 5 Jun 2014 20:10:09 -0700 Subject: [PATCH 023/148] Fix the printf family for non-ASCII. The bug here turned out to be that we hadn't increased the constant corresponding to the maximum number of bytes in a character to match our new implementation, so any character requiring more than a byte in UTF-8 would break our printf family. Bug: 15439554 (cherry picked from commit 69f05d291d848de654c72e5278de8ca06fbf5d2f) Change-Id: Ia5467e22ccb022e8d118de82291916050656147e --- libc/include/limits.h | 2 +- libc/include/stdlib.h | 2 +- tests/stdio_test.cpp | 19 +++++++++++++++++++ tests/wchar_test.cpp | 29 +++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/libc/include/limits.h b/libc/include/limits.h index dc4590299..fb09657a2 100644 --- a/libc/include/limits.h +++ b/libc/include/limits.h @@ -112,7 +112,7 @@ #define SSIZE_MAX LONG_MAX -#define MB_LEN_MAX 6 +#define MB_LEN_MAX 4 /* New code should use sysconf(_SC_PAGE_SIZE) instead. */ #ifndef PAGE_SIZE diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index 834dcda51..483aaf027 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -167,7 +167,7 @@ extern int mbtowc(wchar_t *, const char *, size_t); extern int wctomb(char *, wchar_t); extern size_t wcstombs(char *, const wchar_t *, size_t); -#define MB_CUR_MAX 1 +#define MB_CUR_MAX 4U #if 0 /* MISSING FROM BIONIC */ extern int on_exit(void (*)(int, void *), void *); diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp index 0ff85bf00..e291f52fe 100644 --- a/tests/stdio_test.cpp +++ b/tests/stdio_test.cpp @@ -426,7 +426,26 @@ TEST(stdio, snprintf_negative_zero_5084292) { EXPECT_STREQ("-0.000000", buf); } +TEST(stdio, snprintf_utf8_15439554) { + // http://b/15439554 + char buf[BUFSIZ]; + + // 1-byte character. + snprintf(buf, sizeof(buf), "%dx%d", 1, 2); + EXPECT_STREQ("1x2", buf); + // 2-byte character. + snprintf(buf, sizeof(buf), "%d\xc2\xa2%d", 1, 2); + EXPECT_STREQ("1¢2", buf); + // 3-byte character. + snprintf(buf, sizeof(buf), "%d\xe2\x82\xac%d", 1, 2); + EXPECT_STREQ("1€2", buf); + // 4-byte character. + snprintf(buf, sizeof(buf), "%d\xf0\xa4\xad\xa2%d", 1, 2); + EXPECT_STREQ("1𤭢2", buf); +} + TEST(stdio, fprintf_failures_7229520) { + // http://b/7229520 FILE* fp; // Unbuffered case where the fprintf(3) itself fails. diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp index 5a250a24f..964bb0946 100644 --- a/tests/wchar_test.cpp +++ b/tests/wchar_test.cpp @@ -453,3 +453,32 @@ TEST(wchar, wmemmove) { wmemmove(wstr+5, wstr, sizeof(const_wstr)/sizeof(wchar_t) - 6); EXPECT_STREQ(L"This This is a test of something or other", wstr); } + +TEST(wchar, mbrtowc_15439554) { + // http://b/15439554 + ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8")); + uselocale(LC_GLOBAL_LOCALE); + + ASSERT_GE(static_cast(MB_LEN_MAX), MB_CUR_MAX); + ASSERT_GE(MB_CUR_MAX, 4U); + + wchar_t wc; + size_t n; + + // 1-byte character. + n = mbrtowc(&wc, "x", MB_CUR_MAX, NULL); + EXPECT_EQ(1U, n); + EXPECT_EQ(L'x', wc); + // 2-byte character. + n = mbrtowc(&wc, "\xc2\xa2", MB_CUR_MAX, NULL); + EXPECT_EQ(2U, n); + EXPECT_EQ(L'¢', wc); + // 3-byte character. + n = mbrtowc(&wc, "\xe2\x82\xac", MB_CUR_MAX, NULL); + EXPECT_EQ(3U, n); + EXPECT_EQ(L'€', wc); + // 4-byte character. + n = mbrtowc(&wc, "\xf0\xa4\xad\xa2", MB_CUR_MAX, NULL); + EXPECT_EQ(4U, n); + EXPECT_EQ(L'𤭢', wc); +} From fe6e646cb79fe15d7815fdb9c92cc66be56ab1d4 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 16 Jun 2014 10:24:37 -0700 Subject: [PATCH 024/148] Update NOTICE files. Change-Id: I459caf48ba861372a4d0bc75f98a9cb4acc20fd5 --- libc/NOTICE | 202 +++++++++++++++++++++++++++++++++++++++++++++-- libstdc++/NOTICE | 4 - linker/NOTICE | 32 ++++++++ 3 files changed, 229 insertions(+), 9 deletions(-) diff --git a/libc/NOTICE b/libc/NOTICE index 4334275fa..ca542d1cf 100644 --- a/libc/NOTICE +++ b/libc/NOTICE @@ -103,6 +103,22 @@ PERFORMANCE OF THIS SOFTWARE. ------------------------------------------------------------------- +Copyright (C) 2006 The Android Open Source Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +------------------------------------------------------------------- + Copyright (C) 2006 The Android Open Source Project All rights reserved. @@ -131,6 +147,22 @@ SUCH DAMAGE. ------------------------------------------------------------------- +Copyright (C) 2008 The Android Open Source Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +------------------------------------------------------------------- + Copyright (C) 2008 The Android Open Source Project All rights reserved. @@ -451,6 +483,35 @@ SUCH DAMAGE. ------------------------------------------------------------------- +Copyright (C) 2013 The Android Open Source Project +All rights reserved. +Copyright (c) 2013-2014 NVIDIA Corporation. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +------------------------------------------------------------------- + Copyright (C) 2013 The Android Open Source Project Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. All rights reserved. @@ -799,11 +860,7 @@ are met: 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. -4. Neither the name of the University nor the names of its contributors +3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -819,6 +876,24 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Portions Copyright (c) 1993 by Digital Equipment Corporation. + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies, and that +the name of Digital Equipment Corporation not be used in advertising or +publicity pertaining to distribution of the document or software without +specific, written prior permission. + +THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT +CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + ------------------------------------------------------------------- Copyright (c) 1983, 1993 @@ -4065,6 +4140,37 @@ SUCH DAMAGE. Copyright (c) 2009 David Schultz All rights reserved. +Copyright (c) 2011 The FreeBSD Foundation +All rights reserved. +Portions of this software were developed by David Chisnall +under sponsorship from the FreeBSD Foundation. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +------------------------------------------------------------------- + +Copyright (c) 2009 David Schultz +All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -4249,6 +4355,33 @@ SUCH DAMAGE. ------------------------------------------------------------------- +Copyright (c) 2011 Ed Schouten + David Chisnall +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +------------------------------------------------------------------- + Copyright (c) 2011 Intel Corporation All rights reserved. @@ -4559,6 +4692,65 @@ Copyright (c) 2013, Linaro Limited ------------------------------------------------------------------- +Copyright (c) 2014, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------- + +Copyright (c) 2014, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------- + Copyright (c) 2014, Linaro Limited All rights reserved. diff --git a/libstdc++/NOTICE b/libstdc++/NOTICE index 6c263d127..59d610681 100644 --- a/libstdc++/NOTICE +++ b/libstdc++/NOTICE @@ -79,7 +79,3 @@ purpose. It is provided "as is" without express or implied warranty. ------------------------------------------------------------------- -Copyright 2006 The Android Open Source Project - -------------------------------------------------------------------- - diff --git a/linker/NOTICE b/linker/NOTICE index c3d6cf6ee..db4ec7b4f 100644 --- a/linker/NOTICE +++ b/linker/NOTICE @@ -154,6 +154,22 @@ SUCH DAMAGE. ------------------------------------------------------------------- +Copyright (C) 2013 The Android Open Source Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +------------------------------------------------------------------- + Copyright (C) 2013 The Android Open Source Project All rights reserved. @@ -182,3 +198,19 @@ SUCH DAMAGE. ------------------------------------------------------------------- +Copyright (C) 2014 The Android Open Source Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +------------------------------------------------------------------- + From 40bc7cd4ed9fb848a7b3d934f69669f64ceed707 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 18 Jun 2014 12:18:25 -0700 Subject: [PATCH 025/148] DO NOT MERGE Re-add .save directive for arm assembler code. Restored the .save directives so that the libcorkscrew unwinder continues to function. Bug: 15701117 Change-Id: I853695a299548b84c78ae8147b9757dbeacdb1ec --- libc/arch-arm/bionic/__bionic_clone.S | 1 + libc/arch-arm/bionic/abort_arm.S | 1 + libc/arch-arm/bionic/memcmp.S | 1 + libc/arch-arm/bionic/memcmp16.S | 1 + libc/arch-arm/bionic/syscall.S | 1 + libc/arch-arm/syscalls/__epoll_pwait.S | 1 + libc/arch-arm/syscalls/__llseek.S | 1 + libc/arch-arm/syscalls/__mmap2.S | 1 + libc/arch-arm/syscalls/__ppoll.S | 1 + libc/arch-arm/syscalls/__pselect6.S | 1 + libc/arch-arm/syscalls/__waitid.S | 1 + libc/arch-arm/syscalls/fchownat.S | 1 + libc/arch-arm/syscalls/fsetxattr.S | 1 + libc/arch-arm/syscalls/futex.S | 1 + libc/arch-arm/syscalls/getsockopt.S | 1 + libc/arch-arm/syscalls/linkat.S | 1 + libc/arch-arm/syscalls/lsetxattr.S | 1 + libc/arch-arm/syscalls/mount.S | 1 + libc/arch-arm/syscalls/perf_event_open.S | 1 + libc/arch-arm/syscalls/prctl.S | 1 + libc/arch-arm/syscalls/pread64.S | 1 + libc/arch-arm/syscalls/pwrite64.S | 1 + libc/arch-arm/syscalls/readahead.S | 1 + libc/arch-arm/syscalls/recvfrom.S | 1 + libc/arch-arm/syscalls/sendto.S | 1 + libc/arch-arm/syscalls/setsockopt.S | 1 + libc/arch-arm/syscalls/setxattr.S | 1 + libc/tools/gensyscalls.py | 1 + 28 files changed, 28 insertions(+) diff --git a/libc/arch-arm/bionic/__bionic_clone.S b/libc/arch-arm/bionic/__bionic_clone.S index 7b76f5e9f..72f48920a 100644 --- a/libc/arch-arm/bionic/__bionic_clone.S +++ b/libc/arch-arm/bionic/__bionic_clone.S @@ -31,6 +31,7 @@ // pid_t __bionic_clone(int flags, void* child_stack, pid_t* parent_tid, void* tls, pid_t* child_tid, int (*fn)(void*), void* arg); ENTRY(__bionic_clone) mov ip, sp + .save {r4, r5, r6, r7} # save registers to parent stack stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 diff --git a/libc/arch-arm/bionic/abort_arm.S b/libc/arch-arm/bionic/abort_arm.S index 1aaf21ad8..2fc29134c 100644 --- a/libc/arch-arm/bionic/abort_arm.S +++ b/libc/arch-arm/bionic/abort_arm.S @@ -36,6 +36,7 @@ * sequence when the crash happens. */ ENTRY(abort) + .save {r3, r14} stmfd sp!, {r3, r14} .cfi_def_cfa_offset 8 .cfi_rel_offset r3, 0 diff --git a/libc/arch-arm/bionic/memcmp.S b/libc/arch-arm/bionic/memcmp.S index 0dc3af0ca..921f8efb6 100644 --- a/libc/arch-arm/bionic/memcmp.S +++ b/libc/arch-arm/bionic/memcmp.S @@ -108,6 +108,7 @@ ENTRY(memcmp) #endif /* save registers */ + .save {r4, lr} stmfd sp!, {r4, lr} .cfi_def_cfa_offset 8 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/bionic/memcmp16.S b/libc/arch-arm/bionic/memcmp16.S index afbb1b047..26a1bf364 100644 --- a/libc/arch-arm/bionic/memcmp16.S +++ b/libc/arch-arm/bionic/memcmp16.S @@ -75,6 +75,7 @@ ENTRY(__memcmp16) /* save registers */ + .save {r4, lr} 0: stmfd sp!, {r4, lr} .cfi_def_cfa_offset 8 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/bionic/syscall.S b/libc/arch-arm/bionic/syscall.S index 864771841..5a6627bb0 100644 --- a/libc/arch-arm/bionic/syscall.S +++ b/libc/arch-arm/bionic/syscall.S @@ -30,6 +30,7 @@ ENTRY(syscall) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/__epoll_pwait.S b/libc/arch-arm/syscalls/__epoll_pwait.S index b2d8d48f0..a90254a6c 100644 --- a/libc/arch-arm/syscalls/__epoll_pwait.S +++ b/libc/arch-arm/syscalls/__epoll_pwait.S @@ -4,6 +4,7 @@ ENTRY(__epoll_pwait) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/__llseek.S b/libc/arch-arm/syscalls/__llseek.S index ec307d291..1a3e4c77d 100644 --- a/libc/arch-arm/syscalls/__llseek.S +++ b/libc/arch-arm/syscalls/__llseek.S @@ -4,6 +4,7 @@ ENTRY(__llseek) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/__mmap2.S b/libc/arch-arm/syscalls/__mmap2.S index 8a179977d..7d989e936 100644 --- a/libc/arch-arm/syscalls/__mmap2.S +++ b/libc/arch-arm/syscalls/__mmap2.S @@ -4,6 +4,7 @@ ENTRY(__mmap2) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/__ppoll.S b/libc/arch-arm/syscalls/__ppoll.S index d9fb3d9fb..7cdbe517c 100644 --- a/libc/arch-arm/syscalls/__ppoll.S +++ b/libc/arch-arm/syscalls/__ppoll.S @@ -4,6 +4,7 @@ ENTRY(__ppoll) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/__pselect6.S b/libc/arch-arm/syscalls/__pselect6.S index 05fea543e..4c5b51329 100644 --- a/libc/arch-arm/syscalls/__pselect6.S +++ b/libc/arch-arm/syscalls/__pselect6.S @@ -4,6 +4,7 @@ ENTRY(__pselect6) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/__waitid.S b/libc/arch-arm/syscalls/__waitid.S index e5e1f54dc..ad9ad167e 100644 --- a/libc/arch-arm/syscalls/__waitid.S +++ b/libc/arch-arm/syscalls/__waitid.S @@ -4,6 +4,7 @@ ENTRY(__waitid) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/fchownat.S b/libc/arch-arm/syscalls/fchownat.S index ea8193f43..4397a2234 100644 --- a/libc/arch-arm/syscalls/fchownat.S +++ b/libc/arch-arm/syscalls/fchownat.S @@ -4,6 +4,7 @@ ENTRY(fchownat) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/fsetxattr.S b/libc/arch-arm/syscalls/fsetxattr.S index 64b8d031e..39b97f99c 100644 --- a/libc/arch-arm/syscalls/fsetxattr.S +++ b/libc/arch-arm/syscalls/fsetxattr.S @@ -4,6 +4,7 @@ ENTRY(fsetxattr) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/futex.S b/libc/arch-arm/syscalls/futex.S index 1646ca207..45e6fa6e2 100644 --- a/libc/arch-arm/syscalls/futex.S +++ b/libc/arch-arm/syscalls/futex.S @@ -4,6 +4,7 @@ ENTRY(futex) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/getsockopt.S b/libc/arch-arm/syscalls/getsockopt.S index 2ded34fd3..735efbb60 100644 --- a/libc/arch-arm/syscalls/getsockopt.S +++ b/libc/arch-arm/syscalls/getsockopt.S @@ -4,6 +4,7 @@ ENTRY(getsockopt) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/linkat.S b/libc/arch-arm/syscalls/linkat.S index 27f1e0098..c612d0276 100644 --- a/libc/arch-arm/syscalls/linkat.S +++ b/libc/arch-arm/syscalls/linkat.S @@ -4,6 +4,7 @@ ENTRY(linkat) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/lsetxattr.S b/libc/arch-arm/syscalls/lsetxattr.S index fb3f75fdc..67639f649 100644 --- a/libc/arch-arm/syscalls/lsetxattr.S +++ b/libc/arch-arm/syscalls/lsetxattr.S @@ -4,6 +4,7 @@ ENTRY(lsetxattr) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/mount.S b/libc/arch-arm/syscalls/mount.S index d56682c63..b18411416 100644 --- a/libc/arch-arm/syscalls/mount.S +++ b/libc/arch-arm/syscalls/mount.S @@ -4,6 +4,7 @@ ENTRY(mount) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/perf_event_open.S b/libc/arch-arm/syscalls/perf_event_open.S index 2821ac5d9..e0cf91eec 100644 --- a/libc/arch-arm/syscalls/perf_event_open.S +++ b/libc/arch-arm/syscalls/perf_event_open.S @@ -4,6 +4,7 @@ ENTRY(perf_event_open) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/prctl.S b/libc/arch-arm/syscalls/prctl.S index 615a2fa2e..40acb611c 100644 --- a/libc/arch-arm/syscalls/prctl.S +++ b/libc/arch-arm/syscalls/prctl.S @@ -4,6 +4,7 @@ ENTRY(prctl) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/pread64.S b/libc/arch-arm/syscalls/pread64.S index 0bfb6d051..a33018c70 100644 --- a/libc/arch-arm/syscalls/pread64.S +++ b/libc/arch-arm/syscalls/pread64.S @@ -4,6 +4,7 @@ ENTRY(pread64) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/pwrite64.S b/libc/arch-arm/syscalls/pwrite64.S index 03247b100..5ae992199 100644 --- a/libc/arch-arm/syscalls/pwrite64.S +++ b/libc/arch-arm/syscalls/pwrite64.S @@ -4,6 +4,7 @@ ENTRY(pwrite64) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/readahead.S b/libc/arch-arm/syscalls/readahead.S index 83d84424f..326ed6f21 100644 --- a/libc/arch-arm/syscalls/readahead.S +++ b/libc/arch-arm/syscalls/readahead.S @@ -4,6 +4,7 @@ ENTRY(readahead) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/recvfrom.S b/libc/arch-arm/syscalls/recvfrom.S index cb89f7230..367790bac 100644 --- a/libc/arch-arm/syscalls/recvfrom.S +++ b/libc/arch-arm/syscalls/recvfrom.S @@ -4,6 +4,7 @@ ENTRY(recvfrom) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/sendto.S b/libc/arch-arm/syscalls/sendto.S index bd0ec1d4c..533d95e6b 100644 --- a/libc/arch-arm/syscalls/sendto.S +++ b/libc/arch-arm/syscalls/sendto.S @@ -4,6 +4,7 @@ ENTRY(sendto) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/setsockopt.S b/libc/arch-arm/syscalls/setsockopt.S index b2d759790..c4f7a01c5 100644 --- a/libc/arch-arm/syscalls/setsockopt.S +++ b/libc/arch-arm/syscalls/setsockopt.S @@ -4,6 +4,7 @@ ENTRY(setsockopt) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/arch-arm/syscalls/setxattr.S b/libc/arch-arm/syscalls/setxattr.S index 022195d01..6987215c8 100644 --- a/libc/arch-arm/syscalls/setxattr.S +++ b/libc/arch-arm/syscalls/setxattr.S @@ -4,6 +4,7 @@ ENTRY(setxattr) mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py index cea350848..97dc628da 100755 --- a/libc/tools/gensyscalls.py +++ b/libc/tools/gensyscalls.py @@ -71,6 +71,7 @@ END(%(func)s) arm_eabi_call_long = syscall_stub_header + """\ mov ip, sp + .save {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7} .cfi_def_cfa_offset 16 .cfi_rel_offset r4, 0 From f6968e3c0822b27e9aa584c3490573f34b1725c1 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 11 Jul 2014 21:10:15 -0700 Subject: [PATCH 026/148] Define SIOCKILLADDR which isn't in the common kernel uapi headers. (cherry picked from commit 2ba2888cac2f04daff7bbaf032d0df7a095b00c3) Change-Id: I3845871bb44dae94d9a0428af0f562ddfb8bd660 --- libc/include/sys/socket.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h index ae2f2381e..3b11d202d 100644 --- a/libc/include/sys/socket.h +++ b/libc/include/sys/socket.h @@ -40,6 +40,13 @@ #include #include +/* This is an Android extension that won't be in the uapi headers for the common kernel. */ +#if !defined(SIOCKILLADDR) +#define SIOCKILLADDR 0x8939 +#else +#error SIOCKILLADDR defined twice +#endif + __BEGIN_DECLS #define sockaddr_storage __kernel_sockaddr_storage From 38778e3b6c89689bbdd01f4a52ac88f02bf59783 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Fri, 11 Jul 2014 12:59:16 -0700 Subject: [PATCH 027/148] Upstream atexit Change-Id: Ia454a2181b5058ed9783dc02b6b1805d0e4d2715 (cherry picked from commit 53c3c271dc9927dd280981fc23409af60f460007) --- libc/Android.mk | 5 +- libc/bionic/abort.cpp | 1 - libc/bionic/libc_init_common.cpp | 1 - libc/bionic/libc_init_dynamic.cpp | 2 +- libc/bionic/libc_init_static.cpp | 3 +- libc/private/thread_private.h | 8 +- .../android/include/openbsd-compat.h | 2 + .../android/include/thread_private.h | 26 --- .../lib/libc}/stdlib/atexit.c | 150 ++++++------------ .../lib/libc}/stdlib/atexit.h | 12 +- 10 files changed, 68 insertions(+), 142 deletions(-) delete mode 100644 libc/upstream-openbsd/android/include/thread_private.h rename libc/{ => upstream-openbsd/lib/libc}/stdlib/atexit.c (51%) rename libc/{ => upstream-openbsd/lib/libc}/stdlib/atexit.h (88%) diff --git a/libc/Android.mk b/libc/Android.mk index 765f4d2a0..59cc3b847 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -67,7 +67,6 @@ libc_common_src_files := \ bionic/unlockpt.c \ stdio/snprintf.c\ stdio/sprintf.c \ - stdlib/atexit.c \ unistd/syslog.c \ # Fortify implementations of libc functions. @@ -463,6 +462,7 @@ libc_upstream_openbsd_src_files := \ upstream-openbsd/lib/libc/stdio/wprintf.c \ upstream-openbsd/lib/libc/stdio/wscanf.c \ upstream-openbsd/lib/libc/stdio/wsetup.c \ + upstream-openbsd/lib/libc/stdlib/atexit.c \ upstream-openbsd/lib/libc/stdlib/atoi.c \ upstream-openbsd/lib/libc/stdlib/atol.c \ upstream-openbsd/lib/libc/stdlib/atoll.c \ @@ -549,7 +549,6 @@ libc_common_cppflags := \ # Define some common includes # ======================================================== libc_common_c_includes += \ - $(LOCAL_PATH)/stdlib \ $(LOCAL_PATH)/stdio \ # ======================================================== @@ -735,6 +734,7 @@ LOCAL_SRC_FILES := $(libc_upstream_openbsd_src_files) LOCAL_CFLAGS := \ $(libc_common_cflags) \ -Wno-sign-compare -Wno-uninitialized -Wno-unused-parameter \ + -I$(LOCAL_PATH)/private \ -I$(LOCAL_PATH)/upstream-openbsd/android/include \ -I$(LOCAL_PATH)/upstream-openbsd/lib/libc/include \ -I$(LOCAL_PATH)/upstream-openbsd/lib/libc/gdtoa/ \ @@ -767,6 +767,7 @@ LOCAL_CFLAGS := \ $(libc_common_cflags) \ -Wno-sign-compare -Wno-uninitialized \ -fvisibility=hidden \ + -I$(LOCAL_PATH)/private \ -I$(LOCAL_PATH)/upstream-openbsd/android/include \ -I$(LOCAL_PATH)/upstream-openbsd/lib/libc/include \ -include openbsd-compat.h \ diff --git a/libc/bionic/abort.cpp b/libc/bionic/abort.cpp index 69ac0e503..75413c608 100644 --- a/libc/bionic/abort.cpp +++ b/libc/bionic/abort.cpp @@ -30,7 +30,6 @@ #include #include #include -#include "atexit.h" #ifdef __arm__ extern "C" __LIBC_HIDDEN__ void __libc_android_abort() diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp index fa61c3c10..aa76650cf 100644 --- a/libc/bionic/libc_init_common.cpp +++ b/libc/bionic/libc_init_common.cpp @@ -39,7 +39,6 @@ #include #include -#include "atexit.h" #include "private/bionic_auxv.h" #include "private/bionic_ssp.h" #include "private/bionic_tls.h" diff --git a/libc/bionic/libc_init_dynamic.cpp b/libc/bionic/libc_init_dynamic.cpp index 7c463643b..78125f968 100644 --- a/libc/bionic/libc_init_dynamic.cpp +++ b/libc/bionic/libc_init_dynamic.cpp @@ -48,7 +48,6 @@ #include #include #include -#include "atexit.h" #include "libc_init_common.h" #include "private/bionic_tls.h" @@ -58,6 +57,7 @@ extern "C" { extern void malloc_debug_init(void); extern void malloc_debug_fini(void); extern void netdClientInit(void); + extern int __cxa_atexit(void (*)(void *), void *, void *); }; // We flag the __libc_preinit function as a constructor to ensure diff --git a/libc/bionic/libc_init_static.cpp b/libc/bionic/libc_init_static.cpp index ab0b3a69f..bc11f3d93 100644 --- a/libc/bionic/libc_init_static.cpp +++ b/libc/bionic/libc_init_static.cpp @@ -46,7 +46,6 @@ #include #include -#include "atexit.h" #include "libc_init_common.h" #include "pthread_internal.h" @@ -60,6 +59,8 @@ // itself at the start of a page. #define PAGE_END(x) PAGE_START((x) + (PAGE_SIZE-1)) +extern "C" int __cxa_atexit(void (*)(void *), void *, void *); + static void call_array(void(**list)()) { // First element is -1, list is null-terminated while (*++list) { diff --git a/libc/private/thread_private.h b/libc/private/thread_private.h index 724808a69..b8b1a815e 100644 --- a/libc/private/thread_private.h +++ b/libc/private/thread_private.h @@ -33,8 +33,12 @@ struct __thread_private_tag_t { #define _THREAD_PRIVATE_MUTEX_UNLOCK(name) \ pthread_mutex_unlock( &__THREAD_NAME(name)._private_lock ) -__LIBC_HIDDEN__ void _thread_atexit_lock(void); -__LIBC_HIDDEN__ void _thread_atexit_unlock(void); +/* Note that these aren't compatible with the usual OpenBSD ones which lazy-initialize! */ +#define _MUTEX_LOCK(l) pthread_mutex_lock((pthread_mutex_t*) l) +#define _MUTEX_UNLOCK(l) pthread_mutex_unlock((pthread_mutex_t*) l) + +__LIBC_HIDDEN__ void _thread_atexit_lock(void); +__LIBC_HIDDEN__ void _thread_atexit_unlock(void); #define _ATEXIT_LOCK() _thread_atexit_lock() #define _ATEXIT_UNLOCK() _thread_atexit_unlock() diff --git a/libc/upstream-openbsd/android/include/openbsd-compat.h b/libc/upstream-openbsd/android/include/openbsd-compat.h index f00d91ab2..cf63907cb 100644 --- a/libc/upstream-openbsd/android/include/openbsd-compat.h +++ b/libc/upstream-openbsd/android/include/openbsd-compat.h @@ -40,4 +40,6 @@ __LIBC64_HIDDEN__ extern const short *_tolower_tab_; __LIBC64_HIDDEN__ extern const short *_toupper_tab_; +__LIBC_HIDDEN__ extern struct atexit *__atexit; + #endif diff --git a/libc/upstream-openbsd/android/include/thread_private.h b/libc/upstream-openbsd/android/include/thread_private.h deleted file mode 100644 index 10421e2c1..000000000 --- a/libc/upstream-openbsd/android/include/thread_private.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _THREAD_PRIVATE_H_ -#define _THREAD_PRIVATE_H_ - -#include - -/* Note that these aren't compatible with the usual OpenBSD ones which lazy-initialize! */ -#define _MUTEX_LOCK(l) pthread_mutex_lock((pthread_mutex_t*) l) -#define _MUTEX_UNLOCK(l) pthread_mutex_unlock((pthread_mutex_t*) l) - -#endif /* _THREAD_PRIVATE_H_ */ diff --git a/libc/stdlib/atexit.c b/libc/upstream-openbsd/lib/libc/stdlib/atexit.c similarity index 51% rename from libc/stdlib/atexit.c rename to libc/upstream-openbsd/lib/libc/stdlib/atexit.c index e10238b31..6532b382e 100644 --- a/libc/stdlib/atexit.c +++ b/libc/upstream-openbsd/lib/libc/stdlib/atexit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atexit.c,v 1.14 2007/09/05 20:47:47 chl Exp $ */ +/* $OpenBSD: atexit.c,v 1.20 2014/07/11 09:51:37 kettenis Exp $ */ /* * Copyright (c) 2002 Daniel Hartmeier * All rights reserved. @@ -35,57 +35,16 @@ #include #include #include "atexit.h" -#include "private/thread_private.h" +#include "thread_private.h" struct atexit *__atexit; - -/* - * TODO: Read this before upstreaming: - * - * As of Apr 2014 there is a bug regaring function type detection logic in - * Free/Open/NetBSD implementations of __cxa_finalize(). - * - * What it is about: - * First of all there are two kind of atexit handlers: - * 1) void handler(void) - this is the regular type - * available for to user via atexit(.) function call. - * - * 2) void internal_handler(void*) - this is the type - * __cxa_atexit() function expects. This handler is used - * by C++ compiler to register static destructor calls. - * Note that calling this function as the handler of type (1) - * results in incorrect this pointer in static d-tors. - * - * What is wrong with BSD implementations: - * - * They use dso argument to identify the handler type. The problem - * with it is dso is also used to identify the handlers associated - * with particular dynamic library and allow __cxa_finalize to call correct - * set of functions on dlclose(). And it cannot identify both. - * - * What is correct way to identify function type? - * - * Consider this: - * 1. __cxa_finalize and __cxa_atexit are part of libc and do not have access to hidden - * &__dso_handle. - * 2. __cxa_atexit has only 3 arguments: function pointer, function argument, dso. - * none of them can be reliably used to pass information about handler type. - * 3. following http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor (3.3.5.3 - B) - * translation of user atexit -> __cxa_atexit(f, NULL, NULL) results in crashes - * on exit() after dlclose() of a library with an atexit() call. - * - * One way to resolve this is to always call second form of handler, which will - * result in storing unused argument in register/stack depending on architecture - * and should not present any problems. - * - * Another way is to make them dso-local in one way or the other. - */ +static int restartloop; /* * Function pointers are stored in a linked list of pages. The list * is initially empty, and pages are allocated on demand. The first * function pointer in the first allocated page (the last one in - * the linked list) was reserved for the cleanup function. + * the linked list) is reserved for the cleanup function. * * Outside the following functions, all pages are mprotect()'ed * to prevent unintentional/malicious corruption. @@ -103,7 +62,7 @@ __cxa_atexit(void (*func)(void *), void *arg, void *dso) { struct atexit *p = __atexit; struct atexit_fn *fnp; - size_t pgsize = getpagesize(); + int pgsize = getpagesize(); int ret = -1; if (pgsize < sizeof(*p)) @@ -132,11 +91,12 @@ __cxa_atexit(void (*func)(void *), void *arg, void *dso) __atexit = p; } fnp = &p->fns[p->ind++]; - fnp->cxa_func = func; + fnp->fn_ptr = func; fnp->fn_arg = arg; fnp->fn_dso = dso; if (mprotect(p, pgsize, PROT_READ)) goto unlock; + restartloop = 1; ret = 0; unlock: _ATEXIT_UNLOCK(); @@ -151,50 +111,41 @@ unlock: void __cxa_finalize(void *dso) { - struct atexit *p, *q, *original_atexit; + struct atexit *p, *q; struct atexit_fn fn; - int n, pgsize = getpagesize(), original_ind; + int n, pgsize = getpagesize(); static int call_depth; _ATEXIT_LOCK(); call_depth++; - p = original_atexit = __atexit; - n = original_ind = p != NULL ? p->ind : 0; - while (p != NULL) { - if (p->fns[n].cxa_func != NULL /* not called */ - && (dso == NULL || dso == p->fns[n].fn_dso)) { /* correct DSO */ +restart: + restartloop = 0; + for (p = __atexit; p != NULL; p = p->next) { + for (n = p->ind; --n >= 0;) { + if (p->fns[n].fn_ptr == NULL) + continue; /* already called */ + if (dso != NULL && dso != p->fns[n].fn_dso) + continue; /* wrong DSO */ + /* * Mark handler as having been already called to avoid * dupes and loops, then call the appropriate function. */ fn = p->fns[n]; if (mprotect(p, pgsize, PROT_READ | PROT_WRITE) == 0) { - p->fns[n].cxa_func = NULL; + p->fns[n].fn_ptr = NULL; mprotect(p, pgsize, PROT_READ); } - _ATEXIT_UNLOCK(); - (*fn.cxa_func)(fn.fn_arg); + (*fn.fn_ptr)(fn.fn_arg); _ATEXIT_LOCK(); - // check for new atexit handlers - if ((__atexit->ind != original_ind) || (__atexit != original_atexit)) { - // need to restart now to preserve correct - // call order - LIFO - p = original_atexit = __atexit; - n = original_ind = p->ind; - continue; - } - } - if (n == 0) { - p = p->next; - n = p != NULL ? p->ind : 0; - } else { - --n; + if (restartloop) + goto restart; } } - --call_depth; + call_depth--; /* * If called via exit(), unmap the pages since we have now run @@ -218,33 +169,34 @@ __cxa_finalize(void *dso) void __atexit_register_cleanup(void (*func)(void)) { - struct atexit *p; - size_t pgsize = getpagesize(); + struct atexit *p; + int pgsize = getpagesize(); - if (pgsize < sizeof(*p)) - return; - _ATEXIT_LOCK(); - p = __atexit; - while (p != NULL && p->next != NULL) - p = p->next; - if (p == NULL) { - p = mmap(NULL, pgsize, PROT_READ | PROT_WRITE, - MAP_ANON | MAP_PRIVATE, -1, 0); - if (p == MAP_FAILED) - goto unlock; - p->ind = 1; - p->max = (pgsize - ((char *)&p->fns[0] - (char *)p)) / - sizeof(p->fns[0]); - p->next = NULL; - __atexit = p; - } else { - if (mprotect(p, pgsize, PROT_READ | PROT_WRITE)) - goto unlock; - } - p->fns[0].cxa_func = (void (*)(void*))func; - p->fns[0].fn_arg = NULL; - p->fns[0].fn_dso = NULL; - mprotect(p, pgsize, PROT_READ); + if (pgsize < sizeof(*p)) + return; + _ATEXIT_LOCK(); + p = __atexit; + while (p != NULL && p->next != NULL) + p = p->next; + if (p == NULL) { + p = mmap(NULL, pgsize, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, 0); + if (p == MAP_FAILED) + goto unlock; + p->ind = 1; + p->max = (pgsize - ((char *)&p->fns[0] - (char *)p)) / + sizeof(p->fns[0]); + p->next = NULL; + __atexit = p; + } else { + if (mprotect(p, pgsize, PROT_READ | PROT_WRITE)) + goto unlock; + } + p->fns[0].fn_ptr = (void (*)(void *))func; + p->fns[0].fn_arg = NULL; + p->fns[0].fn_dso = NULL; + mprotect(p, pgsize, PROT_READ); + restartloop = 1; unlock: - _ATEXIT_UNLOCK(); + _ATEXIT_UNLOCK(); } diff --git a/libc/stdlib/atexit.h b/libc/upstream-openbsd/lib/libc/stdlib/atexit.h similarity index 88% rename from libc/stdlib/atexit.h rename to libc/upstream-openbsd/lib/libc/stdlib/atexit.h index b530ade5c..3de2aa3bf 100644 --- a/libc/stdlib/atexit.h +++ b/libc/upstream-openbsd/lib/libc/stdlib/atexit.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atexit.h,v 1.7 2007/09/03 14:40:16 millert Exp $ */ +/* $OpenBSD: atexit.h,v 1.9 2014/06/18 19:01:10 kettenis Exp $ */ /* * Copyright (c) 2002 Daniel Hartmeier @@ -30,24 +30,18 @@ * */ -#include - struct atexit { struct atexit *next; /* next in list */ int ind; /* next index in this table */ int max; /* max entries >= ATEXIT_SIZE */ struct atexit_fn { - void (*cxa_func)(void *); + void (*fn_ptr)(void *); void *fn_arg; /* argument for CXA callback */ void *fn_dso; /* shared module handle */ } fns[1]; /* the table itself */ }; -__BEGIN_DECLS - -__LIBC_HIDDEN__ extern struct atexit *__atexit; /* points to head of LIFO stack */ +extern struct atexit *__atexit; /* points to head of LIFO stack */ int __cxa_atexit(void (*)(void *), void *, void *); void __cxa_finalize(void *); - -__END_DECLS From caaf71ebb358f811fe7602bbadb90b897e93eaf7 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 14 Jul 2014 11:22:59 -0700 Subject: [PATCH 028/148] Sync upstream-openbsd. (cherry picked from commit 4f0b67a8dbf0e1d8b1dae42358553fb8d14456d4) Change-Id: I8753959853312ab978bc4eb1bbbcdc7d1b007b95 --- libc/Android.mk | 1 - .../lib/libc/thread-stub/__isthreaded.c | 37 ------------------- libc/upstream-openbsd/lib/libc/stdlib/exit.c | 10 +++++ .../upstream-openbsd/lib/libc/string/stpcpy.c | 4 +- .../upstream-openbsd/lib/libc/string/strcat.c | 6 +-- .../upstream-openbsd/lib/libc/string/strcmp.c | 6 +-- .../upstream-openbsd/lib/libc/string/strcpy.c | 6 +-- .../upstream-openbsd/lib/libc/string/strlen.c | 6 +-- .../lib/libc/string/strncmp.c | 6 +-- .../lib/libc/string/strncpy.c | 6 +-- 10 files changed, 18 insertions(+), 70 deletions(-) delete mode 100644 libc/upstream-netbsd/lib/libc/thread-stub/__isthreaded.c diff --git a/libc/Android.mk b/libc/Android.mk index 59cc3b847..1345159a3 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -305,7 +305,6 @@ libc_upstream_netbsd_src_files := \ upstream-netbsd/lib/libc/string/strcasestr.c \ upstream-netbsd/lib/libc/string/strcoll.c \ upstream-netbsd/lib/libc/string/strxfrm.c \ - upstream-netbsd/lib/libc/thread-stub/__isthreaded.c \ upstream-netbsd/lib/libc/unistd/killpg.c \ libc_upstream_openbsd_gdtoa_src_files := \ diff --git a/libc/upstream-netbsd/lib/libc/thread-stub/__isthreaded.c b/libc/upstream-netbsd/lib/libc/thread-stub/__isthreaded.c deleted file mode 100644 index 50c1b6f4e..000000000 --- a/libc/upstream-netbsd/lib/libc/thread-stub/__isthreaded.c +++ /dev/null @@ -1,37 +0,0 @@ -/* $NetBSD: __isthreaded.c,v 1.3 2009/12/01 01:33:25 explorer Exp $ */ - -/*- - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Michael Graff. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: __isthreaded.c,v 1.3 2009/12/01 01:33:25 explorer Exp $"); -#endif /* LIBC_SCCS and not lint */ - -int __isthreaded = 0; diff --git a/libc/upstream-openbsd/lib/libc/stdlib/exit.c b/libc/upstream-openbsd/lib/libc/stdlib/exit.c index ef8b335c8..83fe3d2de 100644 --- a/libc/upstream-openbsd/lib/libc/stdlib/exit.c +++ b/libc/upstream-openbsd/lib/libc/stdlib/exit.c @@ -33,6 +33,16 @@ #include #include #include "atexit.h" +#include "thread_private.h" + +/* + * This variable is zero until a process has created a thread. + * It is used to avoid calling locking functions in libc when they + * are not required. By default, libc is intended to be(come) + * thread-safe, but without a (significant) penalty to non-threaded + * processes. + */ +int __isthreaded = 0; /* * Exit, flushing stdio buffers if necessary. diff --git a/libc/upstream-openbsd/lib/libc/string/stpcpy.c b/libc/upstream-openbsd/lib/libc/string/stpcpy.c index d3d61e0f1..d88afac34 100644 --- a/libc/upstream-openbsd/lib/libc/string/stpcpy.c +++ b/libc/upstream-openbsd/lib/libc/string/stpcpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stpcpy.c,v 1.1 2012/01/17 02:48:01 guenther Exp $ */ +/* $OpenBSD: stpcpy.c,v 1.2 2014/07/09 17:08:21 naddy Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -33,7 +33,7 @@ #if defined(APIWARN) __warn_references(stpcpy, - "warning: stpcpy() is dangerous GNU crap; don't use it"); + "warning: stpcpy() is dangerous; do not use it"); #endif char * diff --git a/libc/upstream-openbsd/lib/libc/string/strcat.c b/libc/upstream-openbsd/lib/libc/string/strcat.c index 7cea5229f..646c9c209 100644 --- a/libc/upstream-openbsd/lib/libc/string/strcat.c +++ b/libc/upstream-openbsd/lib/libc/string/strcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strcat.c,v 1.8 2005/08/08 08:05:37 espie Exp $ */ +/* $OpenBSD: strcat.c,v 1.9 2014/06/10 04:17:37 deraadt Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -29,11 +29,7 @@ * SUCH DAMAGE. */ -#if !defined(_KERNEL) && !defined(_STANDALONE) #include -#else -#include -#endif #if defined(APIWARN) __warn_references(strcat, diff --git a/libc/upstream-openbsd/lib/libc/string/strcmp.c b/libc/upstream-openbsd/lib/libc/string/strcmp.c index 816fd111a..d1b6c50d7 100644 --- a/libc/upstream-openbsd/lib/libc/string/strcmp.c +++ b/libc/upstream-openbsd/lib/libc/string/strcmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strcmp.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */ +/* $OpenBSD: strcmp.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -32,11 +32,7 @@ * SUCH DAMAGE. */ -#if !defined(_KERNEL) && !defined(_STANDALONE) #include -#else -#include -#endif /* * Compare strings. diff --git a/libc/upstream-openbsd/lib/libc/string/strcpy.c b/libc/upstream-openbsd/lib/libc/string/strcpy.c index 71d90d410..5a9001e43 100644 --- a/libc/upstream-openbsd/lib/libc/string/strcpy.c +++ b/libc/upstream-openbsd/lib/libc/string/strcpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strcpy.c,v 1.8 2005/08/08 08:05:37 espie Exp $ */ +/* $OpenBSD: strcpy.c,v 1.9 2014/06/10 04:17:37 deraadt Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -29,11 +29,7 @@ * SUCH DAMAGE. */ -#if !defined(_KERNEL) && !defined(_STANDALONE) #include -#else -#include -#endif #if defined(APIWARN) __warn_references(strcpy, diff --git a/libc/upstream-openbsd/lib/libc/string/strlen.c b/libc/upstream-openbsd/lib/libc/string/strlen.c index 12d9ec4da..7e0e27b1d 100644 --- a/libc/upstream-openbsd/lib/libc/string/strlen.c +++ b/libc/upstream-openbsd/lib/libc/string/strlen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strlen.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */ +/* $OpenBSD: strlen.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -29,11 +29,7 @@ * SUCH DAMAGE. */ -#if !defined(_KERNEL) && !defined(_STANDALONE) #include -#else -#include -#endif size_t strlen(const char *str) diff --git a/libc/upstream-openbsd/lib/libc/string/strncmp.c b/libc/upstream-openbsd/lib/libc/string/strncmp.c index 0aea80d7d..0a4ddc1d9 100644 --- a/libc/upstream-openbsd/lib/libc/string/strncmp.c +++ b/libc/upstream-openbsd/lib/libc/string/strncmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strncmp.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */ +/* $OpenBSD: strncmp.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -29,11 +29,7 @@ * SUCH DAMAGE. */ -#if !defined(_KERNEL) && !defined(_STANDALONE) #include -#else -#include -#endif int strncmp(const char *s1, const char *s2, size_t n) diff --git a/libc/upstream-openbsd/lib/libc/string/strncpy.c b/libc/upstream-openbsd/lib/libc/string/strncpy.c index 4426cbe2e..5003a199a 100644 --- a/libc/upstream-openbsd/lib/libc/string/strncpy.c +++ b/libc/upstream-openbsd/lib/libc/string/strncpy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strncpy.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */ +/* $OpenBSD: strncpy.c,v 1.7 2014/06/10 04:17:37 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -32,11 +32,7 @@ * SUCH DAMAGE. */ -#if !defined(_KERNEL) && !defined(_STANDALONE) #include -#else -#include -#endif /* * Copy src to dst, truncating or null-padding to always copy n bytes. From 99ae0983c0fd22e34e4d2aa61942b04e347447ee Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 14 Jul 2014 11:57:03 -0700 Subject: [PATCH 029/148] Implement rand/srand in terms of random/srandom. Code developed for glibc or older versions of bionic might expect more randomness than the BSD implementation provides. Bug: 15829381 (cherry picked from commit 76c241b091b4d9d9a9237d40e814e52ce2917f47) Change-Id: If721b3f16efdb21cb67df5ec5034c0ba905bd029 --- libc/Android.mk | 2 +- libc/bionic/rand.cpp | 29 +++++++++++ libc/upstream-netbsd/lib/libc/stdlib/rand.c | 57 --------------------- tests/stdlib_test.cpp | 7 --- 4 files changed, 30 insertions(+), 65 deletions(-) create mode 100644 libc/bionic/rand.cpp delete mode 100644 libc/upstream-netbsd/lib/libc/stdlib/rand.c diff --git a/libc/Android.mk b/libc/Android.mk index 1345159a3..51002e5a8 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -177,6 +177,7 @@ libc_bionic_src_files := \ bionic/pthread_sigmask.cpp \ bionic/ptrace.cpp \ bionic/raise.cpp \ + bionic/rand.cpp \ bionic/readlink.cpp \ bionic/reboot.cpp \ bionic/recv.cpp \ @@ -294,7 +295,6 @@ libc_upstream_netbsd_src_files := \ upstream-netbsd/lib/libc/stdlib/mrand48.c \ upstream-netbsd/lib/libc/stdlib/nrand48.c \ upstream-netbsd/lib/libc/stdlib/_rand48.c \ - upstream-netbsd/lib/libc/stdlib/rand.c \ upstream-netbsd/lib/libc/stdlib/rand_r.c \ upstream-netbsd/lib/libc/stdlib/seed48.c \ upstream-netbsd/lib/libc/stdlib/srand48.c \ diff --git a/libc/bionic/rand.cpp b/libc/bionic/rand.cpp new file mode 100644 index 000000000..0074f2d24 --- /dev/null +++ b/libc/bionic/rand.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +// The BSD rand/srand is very weak. glibc just uses random/srandom instead. +// Since we're likely to run code intended for glibc, and POSIX doesn't seem +// to disallow this, we go that route too. + +int rand() { + return random(); +} + +void srand(unsigned int seed) { + return srandom(seed); +} diff --git a/libc/upstream-netbsd/lib/libc/stdlib/rand.c b/libc/upstream-netbsd/lib/libc/stdlib/rand.c deleted file mode 100644 index 4909d1434..000000000 --- a/libc/upstream-netbsd/lib/libc/stdlib/rand.c +++ /dev/null @@ -1,57 +0,0 @@ -/* $NetBSD: rand.c,v 1.12 2012/06/25 22:32:45 abs Exp $ */ - -/*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#if defined(LIBC_SCCS) && !defined(lint) -#if 0 -static char sccsid[] = "@(#)rand.c 8.1 (Berkeley) 6/14/93"; -#else -__RCSID("$NetBSD: rand.c,v 1.12 2012/06/25 22:32:45 abs Exp $"); -#endif -#endif /* LIBC_SCCS and not lint */ - -#include -#include - -static u_long next = 1; - -int -rand(void) -{ - /* LINTED integer overflow */ - return (int)((next = next * 1103515245 + 12345) % ((u_long)RAND_MAX + 1)); -} - -void -srand(u_int seed) -{ - next = seed; -} diff --git a/tests/stdlib_test.cpp b/tests/stdlib_test.cpp index 7c86d76ba..6d29421d0 100644 --- a/tests/stdlib_test.cpp +++ b/tests/stdlib_test.cpp @@ -53,17 +53,10 @@ TEST(stdlib, random) { TEST(stdlib, rand) { srand(0x01020304); -#if defined(__BIONIC__) - EXPECT_EQ(1675538669, rand()); - EXPECT_EQ(1678228258, rand()); - EXPECT_EQ(1352350131, rand()); - EXPECT_EQ(824068976, rand()); -#else EXPECT_EQ(55436735, rand()); EXPECT_EQ(1399865117, rand()); EXPECT_EQ(2032643283, rand()); EXPECT_EQ(571329216, rand()); -#endif } TEST(stdlib, mrand48) { From ca276c40dfdb80ef553c6646da7f984ef7b694ce Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 14 Jul 2014 14:41:47 -0700 Subject: [PATCH 030/148] Fix visibility for a bunch more symbols. Bug: 11156955 Bug: 15291317 (cherry picked from commit a167eef5482d4a89d4277ec74f57adbe38052813) Change-Id: Ib038ad34ef59631f7b4ed6dff2b7956001b8b159 --- libc/private/bionic_name_mem.h | 2 +- libc/stdio/local.h | 9 +-------- libc/upstream-freebsd/android/include/namespace.h | 2 -- libc/upstream-netbsd/android/include/namespace.h | 3 +++ .../android/include/openbsd-compat.h | 14 +++++++++++--- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/libc/private/bionic_name_mem.h b/libc/private/bionic_name_mem.h index 98716f41e..1c7664efb 100644 --- a/libc/private/bionic_name_mem.h +++ b/libc/private/bionic_name_mem.h @@ -34,7 +34,7 @@ __BEGIN_DECLS -int __bionic_name_mem(void* addr, size_t len, const char* name); +__LIBC_HIDDEN__ int __bionic_name_mem(void* addr, size_t len, const char* name); __END_DECLS diff --git a/libc/stdio/local.h b/libc/stdio/local.h index 151e00957..4511a71da 100644 --- a/libc/stdio/local.h +++ b/libc/stdio/local.h @@ -49,14 +49,7 @@ */ __LIBC_HIDDEN__ int __srget(FILE*); __LIBC_HIDDEN__ int __swbuf(int, FILE*); - -/* - * The NDK apparently includes an android_support.a library that - * refers to __srefill in its copy of the vsnprintf implementation. - */ -/* TODO(LP64): __LIBC_HIDDEN__ int __srefill(FILE*);*/ -/* http://b/15291317: the LP64 NDK needs to be fixed to remove that cruft. */ -__LIBC_ABI_PUBLIC__ int __srefill(FILE*); +__LIBC_HIDDEN__ int __srefill(FILE*); #else __LIBC_ABI_PUBLIC__ int __srget(FILE*); __LIBC_ABI_PUBLIC__ int __swbuf(int, FILE*); diff --git a/libc/upstream-freebsd/android/include/namespace.h b/libc/upstream-freebsd/android/include/namespace.h index a980b574c..a3f850ef6 100644 --- a/libc/upstream-freebsd/android/include/namespace.h +++ b/libc/upstream-freebsd/android/include/namespace.h @@ -17,6 +17,4 @@ #ifndef _BIONIC_FREEBSD_NAMESPACE_H_included #define _BIONIC_FREEBSD_NAMESPACE_H_included -__attribute__((visibility("hidden"))) char* _mktemp(char*); - #endif diff --git a/libc/upstream-netbsd/android/include/namespace.h b/libc/upstream-netbsd/android/include/namespace.h index a4d415101..5df543cfc 100644 --- a/libc/upstream-netbsd/android/include/namespace.h +++ b/libc/upstream-netbsd/android/include/namespace.h @@ -22,4 +22,7 @@ #undef __weak_alias #endif +__LIBC_HIDDEN__ int __res_enable_mt(void); +__LIBC_HIDDEN__ int __res_disable_mt(void); + #endif diff --git a/libc/upstream-openbsd/android/include/openbsd-compat.h b/libc/upstream-openbsd/android/include/openbsd-compat.h index cf63907cb..5827a82dd 100644 --- a/libc/upstream-openbsd/android/include/openbsd-compat.h +++ b/libc/upstream-openbsd/android/include/openbsd-compat.h @@ -37,9 +37,17 @@ #define issetugid() 0 /* LP32 NDK ctype.h contained references to these. */ -__LIBC64_HIDDEN__ extern const short *_tolower_tab_; -__LIBC64_HIDDEN__ extern const short *_toupper_tab_; +__LIBC64_HIDDEN__ extern const short* _tolower_tab_; +__LIBC64_HIDDEN__ extern const short* _toupper_tab_; -__LIBC_HIDDEN__ extern struct atexit *__atexit; +__LIBC_HIDDEN__ extern struct atexit* __atexit; +__LIBC_HIDDEN__ extern const char _C_ctype_[]; +__LIBC_HIDDEN__ extern const short _C_toupper_[]; +__LIBC_HIDDEN__ extern const short _C_tolower_[]; +__LIBC_HIDDEN__ extern char* __findenv(const char*, int, int*); +__LIBC_HIDDEN__ extern char* _mktemp(char*); + +/* TODO: hide this when android_support.a is fixed (http://b/16298580).*/ +/*__LIBC_HIDDEN__*/ extern int __isthreaded; #endif From 73c963e4c5bf111df3abe9ad7eac98a918b88bb3 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Mon, 14 Jul 2014 18:47:23 -0700 Subject: [PATCH 031/148] Fix BIONIC_ROUND_UP_POWER_OF_2 for 64 bit. There were two bugs here: - For 64 bit values, this did not properly round up. - The macro rounded to the power of 2 less than value, not to the power of 2 greater than value. (cherry picked from commit 27047faf283cb9d3d025a984cd9934fd2c404407) Change-Id: Idf1ec67854e1eb423704e599ae1c6b674d36618d --- libc/private/bionic_macros.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libc/private/bionic_macros.h b/libc/private/bionic_macros.h index a3a69853d..61794bd54 100644 --- a/libc/private/bionic_macros.h +++ b/libc/private/bionic_macros.h @@ -37,6 +37,8 @@ (((value) + (alignment) - 1) & ~((alignment) - 1)) #define BIONIC_ROUND_UP_POWER_OF_2(value) \ - (1UL << (sizeof(value) * 8 - 1 - __builtin_clz(value))) + (sizeof(value) == 8) \ + ? (1UL << (64 - __builtin_clzl(static_cast(value)))) \ + : (1UL << (32 - __builtin_clz(static_cast(value)))) #endif // _BIONIC_MACROS_H_ From da8accfefece3a436de68f1b750791fbf0974076 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Mon, 14 Jul 2014 15:48:02 -0700 Subject: [PATCH 032/148] Remove isascii_l(3). Had intended to remove this one before submitting the locale changes, but forgot. It isn't a standard ctype function, so we don't need it. Change-Id: Ie9c09fa6c61b1101b5992fa06da30e373a0c6bf7 --- libc/bionic/ctype.cpp | 4 ---- libc/include/ctype.h | 1 - 2 files changed, 5 deletions(-) diff --git a/libc/bionic/ctype.cpp b/libc/bionic/ctype.cpp index 3960d9d4c..2b31d5268 100644 --- a/libc/bionic/ctype.cpp +++ b/libc/bionic/ctype.cpp @@ -36,10 +36,6 @@ int isalpha_l(int c, locale_t) { return isalpha(c); } -int isascii_l(int c, locale_t) { - return isascii(c); -} - int isblank_l(int c, locale_t) { return isblank(c); } diff --git a/libc/include/ctype.h b/libc/include/ctype.h index 19b1adfe3..d05a95297 100644 --- a/libc/include/ctype.h +++ b/libc/include/ctype.h @@ -75,7 +75,6 @@ int toupper(int); int isalnum_l(int, locale_t); int isalpha_l(int, locale_t); -int isascii_l(int, locale_t); int isblank_l(int, locale_t); int iscntrl_l(int, locale_t); int isdigit_l(int, locale_t); From 97ba2a5cc4cf098938bb0a2c19ff01eb57c5536c Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 15 Jul 2014 18:39:27 -0700 Subject: [PATCH 033/148] Regenerate the syscalls list after the uapi update. (cherry picked from commit 3fa60e10bcbfb8c7d94aeefc427640371683c920) Change-Id: Id545a5b0b0953967effd819177f0dadb134f2011 --- libc/include/sys/glibc-syscalls.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libc/include/sys/glibc-syscalls.h b/libc/include/sys/glibc-syscalls.h index 3131b6b3f..459ee78f8 100644 --- a/libc/include/sys/glibc-syscalls.h +++ b/libc/include/sys/glibc-syscalls.h @@ -217,10 +217,12 @@ #define SYS_sched_get_priority_max __NR_sched_get_priority_max #define SYS_sched_get_priority_min __NR_sched_get_priority_min #define SYS_sched_getaffinity __NR_sched_getaffinity +#define SYS_sched_getattr __NR_sched_getattr #define SYS_sched_getparam __NR_sched_getparam #define SYS_sched_getscheduler __NR_sched_getscheduler #define SYS_sched_rr_get_interval __NR_sched_rr_get_interval #define SYS_sched_setaffinity __NR_sched_setaffinity +#define SYS_sched_setattr __NR_sched_setattr #define SYS_sched_setparam __NR_sched_setparam #define SYS_sched_setscheduler __NR_sched_setscheduler #define SYS_sched_yield __NR_sched_yield @@ -545,10 +547,12 @@ #define SYS_sched_get_priority_max __NR_sched_get_priority_max #define SYS_sched_get_priority_min __NR_sched_get_priority_min #define SYS_sched_getaffinity __NR_sched_getaffinity +#define SYS_sched_getattr __NR_sched_getattr #define SYS_sched_getparam __NR_sched_getparam #define SYS_sched_getscheduler __NR_sched_getscheduler #define SYS_sched_rr_get_interval __NR_sched_rr_get_interval #define SYS_sched_setaffinity __NR_sched_setaffinity +#define SYS_sched_setattr __NR_sched_setattr #define SYS_sched_setparam __NR_sched_setparam #define SYS_sched_setscheduler __NR_sched_setscheduler #define SYS_sched_yield __NR_sched_yield @@ -902,10 +906,12 @@ #define SYS_sched_get_priority_max __NR_sched_get_priority_max #define SYS_sched_get_priority_min __NR_sched_get_priority_min #define SYS_sched_getaffinity __NR_sched_getaffinity +#define SYS_sched_getattr __NR_sched_getattr #define SYS_sched_getparam __NR_sched_getparam #define SYS_sched_getscheduler __NR_sched_getscheduler #define SYS_sched_rr_get_interval __NR_sched_rr_get_interval #define SYS_sched_setaffinity __NR_sched_setaffinity +#define SYS_sched_setattr __NR_sched_setattr #define SYS_sched_setparam __NR_sched_setparam #define SYS_sched_setscheduler __NR_sched_setscheduler #define SYS_sched_yield __NR_sched_yield @@ -1258,10 +1264,12 @@ #define SYS_sched_get_priority_max __NR_sched_get_priority_max #define SYS_sched_get_priority_min __NR_sched_get_priority_min #define SYS_sched_getaffinity __NR_sched_getaffinity +#define SYS_sched_getattr __NR_sched_getattr #define SYS_sched_getparam __NR_sched_getparam #define SYS_sched_getscheduler __NR_sched_getscheduler #define SYS_sched_rr_get_interval __NR_sched_rr_get_interval #define SYS_sched_setaffinity __NR_sched_setaffinity +#define SYS_sched_setattr __NR_sched_setattr #define SYS_sched_setparam __NR_sched_setparam #define SYS_sched_setscheduler __NR_sched_setscheduler #define SYS_sched_yield __NR_sched_yield @@ -1586,10 +1594,12 @@ #define SYS_sched_get_priority_max __NR_sched_get_priority_max #define SYS_sched_get_priority_min __NR_sched_get_priority_min #define SYS_sched_getaffinity __NR_sched_getaffinity +#define SYS_sched_getattr __NR_sched_getattr #define SYS_sched_getparam __NR_sched_getparam #define SYS_sched_getscheduler __NR_sched_getscheduler #define SYS_sched_rr_get_interval __NR_sched_rr_get_interval #define SYS_sched_setaffinity __NR_sched_setaffinity +#define SYS_sched_setattr __NR_sched_setattr #define SYS_sched_setparam __NR_sched_setparam #define SYS_sched_setscheduler __NR_sched_setscheduler #define SYS_sched_yield __NR_sched_yield From 3002131da33401cf1b45abbdbec58b7c751fc43a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 15 Jul 2014 16:53:13 -0700 Subject: [PATCH 034/148] Use VDSO for clock_gettime(2) and gettimeofday(2). Bug: 15387103 (cherry picked from commit 625993dfbb085a3cde7492eda8ec1cdc1ee39a78) Change-Id: I0e156d7049ba1495902259071a96936592e74025 --- benchmarks/Android.mk | 2 +- benchmarks/time_benchmark.cpp | 50 ++++++- libc/Android.mk | 1 + libc/SYSCALLS.TXT | 8 +- .../{clock_gettime.S => __clock_gettime.S} | 5 +- .../{gettimeofday.S => __gettimeofday.S} | 5 +- .../{clock_gettime.S => __clock_gettime.S} | 5 +- .../{gettimeofday.S => __gettimeofday.S} | 5 +- libc/bionic/dl_iterate_phdr_static.cpp | 11 +- libc/bionic/libc_init_common.cpp | 4 + libc/bionic/vdso.cpp | 129 ++++++++++++++++++ linker/linker_phdr.cpp | 5 +- tests/sys_time_test.cpp | 21 +++ tests/time_test.cpp | 21 +++ 14 files changed, 250 insertions(+), 22 deletions(-) rename libc/arch-arm64/syscalls/{clock_gettime.S => __clock_gettime.S} (76%) rename libc/arch-arm64/syscalls/{gettimeofday.S => __gettimeofday.S} (77%) rename libc/arch-x86_64/syscalls/{clock_gettime.S => __clock_gettime.S} (78%) rename libc/arch-x86_64/syscalls/{gettimeofday.S => __gettimeofday.S} (79%) create mode 100644 libc/bionic/vdso.cpp diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk index f9722ae86..4d7ad962a 100644 --- a/benchmarks/Android.mk +++ b/benchmarks/Android.mk @@ -54,7 +54,7 @@ LOCAL_SHARED_LIBRARIES += libstlport LOCAL_SRC_FILES := $(benchmark_src_files) include $(BUILD_EXECUTABLE) -ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86) +ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64)) ifeq ($(TARGET_ARCH),x86) LINKER = linker NATIVE_SUFFIX=32 diff --git a/benchmarks/time_benchmark.cpp b/benchmarks/time_benchmark.cpp index 3bf8c07f6..0a146aef7 100644 --- a/benchmarks/time_benchmark.cpp +++ b/benchmarks/time_benchmark.cpp @@ -16,6 +16,7 @@ #include "benchmark.h" +#include #include #if defined(__BIONIC__) @@ -41,7 +42,7 @@ BENCHMARK(BM_time_localtime_tz); static void BM_time_clock_gettime(int iters) { StartBenchmarkTiming(); - struct timespec t; + timespec t; for (int i = 0; i < iters; ++i) { clock_gettime(CLOCK_MONOTONIC, &t); } @@ -49,3 +50,50 @@ static void BM_time_clock_gettime(int iters) { StopBenchmarkTiming(); } BENCHMARK(BM_time_clock_gettime); + +static void BM_time_clock_gettime_syscall(int iters) { + StartBenchmarkTiming(); + + timespec t; + for (int i = 0; i < iters; ++i) { + syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &t); + } + + StopBenchmarkTiming(); +} +BENCHMARK(BM_time_clock_gettime_syscall); + +static void BM_time_gettimeofday(int iters) { + StartBenchmarkTiming(); + + timeval tv; + for (int i = 0; i < iters; ++i) { + gettimeofday(&tv, NULL); + } + + StopBenchmarkTiming(); +} +BENCHMARK(BM_time_gettimeofday); + +static void BM_time_gettimeofday_syscall(int iters) { + StartBenchmarkTiming(); + + timeval tv; + for (int i = 0; i < iters; ++i) { + syscall(__NR_gettimeofday, &tv, NULL); + } + + StopBenchmarkTiming(); +} +BENCHMARK(BM_time_gettimeofday_syscall); + +static void BM_time_time(int iters) { + StartBenchmarkTiming(); + + for (int i = 0; i < iters; ++i) { + time(NULL); + } + + StopBenchmarkTiming(); +} +BENCHMARK(BM_time_time); diff --git a/libc/Android.mk b/libc/Android.mk index 51002e5a8..0485d72b8 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -229,6 +229,7 @@ libc_bionic_src_files := \ bionic/umount.cpp \ bionic/unlink.cpp \ bionic/utimes.cpp \ + bionic/vdso.cpp \ bionic/vfork.cpp \ bionic/wait.cpp \ bionic/wchar.cpp \ diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index b4c81341d..7ae054e78 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -194,11 +194,9 @@ int swapon(const char*, int) all int swapoff(const char*) all # time -int gettimeofday(struct timeval*, struct timezone*) all int settimeofday(const struct timeval*, const struct timezone*) all clock_t times(struct tms*) all int nanosleep(const struct timespec*, struct timespec*) all -int clock_gettime(clockid_t clk_id, struct timespec* tp) all int clock_settime(clockid_t clk_id, const struct timespec* tp) all int clock_getres(clockid_t clk_id, struct timespec* res) all int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec* req, struct timespec* rem) all @@ -320,3 +318,9 @@ int __set_tls:set_thread_area(void*) mips,mips64 # x86-specific int __set_thread_area:set_thread_area(void*) x86 + +# vdso stuff. +int clock_gettime(clockid_t, timespec*) arm,mips,mips64,x86 +int __clock_gettime:clock_gettime(clockid_t, timespec*) arm64,x86_64 +int gettimeofday(timeval*, timezone*) arm,mips,mips64,x86 +int __gettimeofday:gettimeofday(timeval*, timezone*) arm64,x86_64 diff --git a/libc/arch-arm64/syscalls/clock_gettime.S b/libc/arch-arm64/syscalls/__clock_gettime.S similarity index 76% rename from libc/arch-arm64/syscalls/clock_gettime.S rename to libc/arch-arm64/syscalls/__clock_gettime.S index ffdde5790..f3466488a 100644 --- a/libc/arch-arm64/syscalls/clock_gettime.S +++ b/libc/arch-arm64/syscalls/__clock_gettime.S @@ -2,7 +2,7 @@ #include -ENTRY(clock_gettime) +ENTRY(__clock_gettime) mov x8, __NR_clock_gettime svc #0 @@ -11,4 +11,5 @@ ENTRY(clock_gettime) b.hi __set_errno ret -END(clock_gettime) +END(__clock_gettime) +.hidden __clock_gettime diff --git a/libc/arch-arm64/syscalls/gettimeofday.S b/libc/arch-arm64/syscalls/__gettimeofday.S similarity index 77% rename from libc/arch-arm64/syscalls/gettimeofday.S rename to libc/arch-arm64/syscalls/__gettimeofday.S index 3b6104b42..6582c49a2 100644 --- a/libc/arch-arm64/syscalls/gettimeofday.S +++ b/libc/arch-arm64/syscalls/__gettimeofday.S @@ -2,7 +2,7 @@ #include -ENTRY(gettimeofday) +ENTRY(__gettimeofday) mov x8, __NR_gettimeofday svc #0 @@ -11,4 +11,5 @@ ENTRY(gettimeofday) b.hi __set_errno ret -END(gettimeofday) +END(__gettimeofday) +.hidden __gettimeofday diff --git a/libc/arch-x86_64/syscalls/clock_gettime.S b/libc/arch-x86_64/syscalls/__clock_gettime.S similarity index 78% rename from libc/arch-x86_64/syscalls/clock_gettime.S rename to libc/arch-x86_64/syscalls/__clock_gettime.S index 20850c852..7e553b80a 100644 --- a/libc/arch-x86_64/syscalls/clock_gettime.S +++ b/libc/arch-x86_64/syscalls/__clock_gettime.S @@ -2,7 +2,7 @@ #include -ENTRY(clock_gettime) +ENTRY(__clock_gettime) movl $__NR_clock_gettime, %eax syscall cmpq $-MAX_ERRNO, %rax @@ -12,4 +12,5 @@ ENTRY(clock_gettime) call __set_errno 1: ret -END(clock_gettime) +END(__clock_gettime) +.hidden __clock_gettime diff --git a/libc/arch-x86_64/syscalls/gettimeofday.S b/libc/arch-x86_64/syscalls/__gettimeofday.S similarity index 79% rename from libc/arch-x86_64/syscalls/gettimeofday.S rename to libc/arch-x86_64/syscalls/__gettimeofday.S index 4867c3072..a38eb64c7 100644 --- a/libc/arch-x86_64/syscalls/gettimeofday.S +++ b/libc/arch-x86_64/syscalls/__gettimeofday.S @@ -2,7 +2,7 @@ #include -ENTRY(gettimeofday) +ENTRY(__gettimeofday) movl $__NR_gettimeofday, %eax syscall cmpq $-MAX_ERRNO, %rax @@ -12,4 +12,5 @@ ENTRY(gettimeofday) call __set_errno 1: ret -END(gettimeofday) +END(__gettimeofday) +.hidden __gettimeofday diff --git a/libc/bionic/dl_iterate_phdr_static.cpp b/libc/bionic/dl_iterate_phdr_static.cpp index 7e9eeddb2..155a7a00a 100644 --- a/libc/bionic/dl_iterate_phdr_static.cpp +++ b/libc/bionic/dl_iterate_phdr_static.cpp @@ -27,6 +27,7 @@ */ #include +#include #include #include #include @@ -37,11 +38,9 @@ extern "C" void* __executable_start; int dl_iterate_phdr(int (*cb)(struct dl_phdr_info* info, size_t size, void* data), void* data) { ElfW(Ehdr)* ehdr = reinterpret_cast(&__executable_start); - // TODO: again, copied from linker.c. Find a better home for this later. - if (ehdr->e_ident[EI_MAG0] != ELFMAG0) return -1; - if (ehdr->e_ident[EI_MAG1] != ELFMAG1) return -1; - if (ehdr->e_ident[EI_MAG2] != ELFMAG2) return -1; - if (ehdr->e_ident[EI_MAG3] != ELFMAG3) return -1; + if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) != 0) { + return -1; + } // Dynamic binaries get their dl_iterate_phdr from the dynamic linker, but // static binaries get this. We don't have a list of shared objects to @@ -54,7 +53,7 @@ int dl_iterate_phdr(int (*cb)(struct dl_phdr_info* info, size_t size, void* data exe_info.dlpi_phdr = reinterpret_cast(reinterpret_cast(ehdr) + ehdr->e_phoff); exe_info.dlpi_phnum = ehdr->e_phnum; -#ifdef AT_SYSINFO_EHDR +#if defined(AT_SYSINFO_EHDR) // Try the executable first. int rc = cb(&exe_info, sizeof(exe_info), data); if (rc != 0) { diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp index aa76650cf..9e4eecde4 100644 --- a/libc/bionic/libc_init_common.cpp +++ b/libc/bionic/libc_init_common.cpp @@ -51,6 +51,8 @@ extern "C" int __system_properties_init(void); extern "C" int __set_tls(void* ptr); extern "C" int __set_tid_address(int* tid_address); +void __libc_init_vdso(); + // Not public, but well-known in the BSDs. const char* __progname; @@ -129,6 +131,8 @@ void __libc_init_common(KernelArgumentBlock& args) { _pthread_internal_add(main_thread); __system_properties_init(); // Requires 'environ'. + + __libc_init_vdso(); } /* This function will be called during normal program termination diff --git a/libc/bionic/vdso.cpp b/libc/bionic/vdso.cpp new file mode 100644 index 000000000..0875ee633 --- /dev/null +++ b/libc/bionic/vdso.cpp @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +// x86 has a vdso, but there's nothing useful to us in it. +#if defined(__aarch64__) || defined(__x86_64__) + +#if defined(__aarch64__) +#define VDSO_CLOCK_GETTIME_SYMBOL "__kernel_clock_gettime" +#define VDSO_GETTIMEOFDAY_SYMBOL "__kernel_gettimeofday" +#elif defined(__x86_64__) +#define VDSO_CLOCK_GETTIME_SYMBOL "__vdso_clock_gettime" +#define VDSO_GETTIMEOFDAY_SYMBOL "__vdso_gettimeofday" +#endif + +#include + +extern "C" int __clock_gettime(int, timespec*); +extern "C" int __gettimeofday(timeval*, struct timezone*); + +struct vdso_entry { + const char* name; + void* fn; +}; + +enum { + VDSO_CLOCK_GETTIME = 0, + VDSO_GETTIMEOFDAY, + VDSO_END +}; + +static vdso_entry vdso_entries[] = { + [VDSO_CLOCK_GETTIME] = { VDSO_CLOCK_GETTIME_SYMBOL, reinterpret_cast(__clock_gettime) }, + [VDSO_GETTIMEOFDAY] = { VDSO_GETTIMEOFDAY_SYMBOL, reinterpret_cast(__gettimeofday) }, +}; + +int clock_gettime(int clock_id, timespec* tp) { + static int (*vdso_clock_gettime)(int, timespec*) = + (int (*)(int, timespec*)) vdso_entries[VDSO_CLOCK_GETTIME].fn; + return vdso_clock_gettime(clock_id, tp); +} + +int gettimeofday(timeval* tv, struct timezone* tz) { + static int (*vdso_gettimeofday)(timeval*, struct timezone*) = + (int (*)(timeval*, struct timezone*)) vdso_entries[VDSO_GETTIMEOFDAY].fn; + return vdso_gettimeofday(tv, tz); +} + +void __libc_init_vdso() { + // Do we have a vdso? + uintptr_t vdso_ehdr_addr = getauxval(AT_SYSINFO_EHDR); + ElfW(Ehdr)* vdso_ehdr = reinterpret_cast(vdso_ehdr_addr); + if (vdso_ehdr == NULL) { + return; + } + + // How many symbols does it have? + size_t symbol_count = 0; + ElfW(Shdr)* vdso_shdr = reinterpret_cast(vdso_ehdr_addr + vdso_ehdr->e_shoff); + for (size_t i = 0; i < vdso_ehdr->e_shnum; ++i) { + if (vdso_shdr[i].sh_type == SHT_DYNSYM) { + symbol_count = vdso_shdr[i].sh_size / sizeof(ElfW(Sym)); + } + } + if (symbol_count == 0) { + return; + } + + // Where's the dynamic table? + ElfW(Addr) vdso_addr = 0; + ElfW(Dyn)* vdso_dyn = NULL; + ElfW(Phdr)* vdso_phdr = reinterpret_cast(vdso_ehdr_addr + vdso_ehdr->e_phoff); + for (size_t i = 0; i < vdso_ehdr->e_phnum; ++i) { + if (vdso_phdr[i].p_type == PT_DYNAMIC) { + vdso_dyn = reinterpret_cast(vdso_ehdr_addr + vdso_phdr[i].p_offset); + } else if (vdso_phdr[i].p_type == PT_LOAD) { + vdso_addr = vdso_ehdr_addr + vdso_phdr[i].p_offset - vdso_phdr[i].p_vaddr; + } + } + if (vdso_addr == 0 || vdso_dyn == NULL) { + return; + } + + // Where are the string and symbol tables? + const char* strtab = NULL; + ElfW(Sym)* symtab = NULL; + for (ElfW(Dyn)* d = vdso_dyn; d->d_tag != DT_NULL; ++d) { + if (d->d_tag == DT_STRTAB) { + strtab = reinterpret_cast(vdso_addr + d->d_un.d_ptr); + } else if (d->d_tag == DT_SYMTAB) { + symtab = reinterpret_cast(vdso_addr + d->d_un.d_ptr); + } + } + if (strtab == NULL || symtab == NULL) { + return; + } + + // Are there any symbols we want? + for (size_t i = 0; i < symbol_count; ++i) { + for (size_t j = 0; j < VDSO_END; ++j) { + if (strcmp(vdso_entries[j].name, strtab + symtab[i].st_name) == 0) { + vdso_entries[j].fn = reinterpret_cast(vdso_addr + symtab[i].st_value); + } + } + } +} + +#else + +void __libc_init_vdso() { +} + +#endif diff --git a/linker/linker_phdr.cpp b/linker/linker_phdr.cpp index 11585afe7..0b99d2065 100644 --- a/linker/linker_phdr.cpp +++ b/linker/linker_phdr.cpp @@ -156,10 +156,7 @@ bool ElfReader::ReadElfHeader() { } bool ElfReader::VerifyElfHeader() { - if (header_.e_ident[EI_MAG0] != ELFMAG0 || - header_.e_ident[EI_MAG1] != ELFMAG1 || - header_.e_ident[EI_MAG2] != ELFMAG2 || - header_.e_ident[EI_MAG3] != ELFMAG3) { + if (memcmp(header_.e_ident, ELFMAG, SELFMAG) != 0) { DL_ERR("\"%s\" has bad ELF magic", name_); return false; } diff --git a/tests/sys_time_test.cpp b/tests/sys_time_test.cpp index 730992fca..bb142bc5f 100644 --- a/tests/sys_time_test.cpp +++ b/tests/sys_time_test.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include "TemporaryFile.h" @@ -46,3 +47,23 @@ TEST(sys_time, utimes_NULL) { TemporaryFile tf; ASSERT_EQ(0, utimes(tf.filename, NULL)); } + +TEST(sys_time, gettimeofday) { + // Try to ensure that our vdso gettimeofday is working. + timeval tv1; + ASSERT_EQ(0, gettimeofday(&tv1, NULL)); + timeval tv2; + ASSERT_EQ(0, syscall(__NR_gettimeofday, &tv2, NULL)); + + // What's the difference between the two? + tv2.tv_sec -= tv1.tv_sec; + tv2.tv_usec -= tv1.tv_usec; + if (tv2.tv_usec < 0) { + --tv2.tv_sec; + tv2.tv_usec += 1000000; + } + + // Should be less than (a very generous, to try to avoid flakiness) 1000us. + ASSERT_EQ(0, tv2.tv_sec); + ASSERT_LT(tv2.tv_usec, 1000); +} diff --git a/tests/time_test.cpp b/tests/time_test.cpp index 58cb374cf..12b1ea75e 100644 --- a/tests/time_test.cpp +++ b/tests/time_test.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -419,3 +420,23 @@ TEST(time, timer_delete_from_timer_thread) { ASSERT_EQ(ESRCH, pthread_detach(tdd.thread_id)); #endif } + +TEST(time, clock_gettime) { + // Try to ensure that our vdso clock_gettime is working. + timespec ts1; + ASSERT_EQ(0, clock_gettime(CLOCK_MONOTONIC, &ts1)); + timespec ts2; + ASSERT_EQ(0, syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts2)); + + // What's the difference between the two? + ts2.tv_sec -= ts1.tv_sec; + ts2.tv_nsec -= ts1.tv_nsec; + if (ts2.tv_nsec < 0) { + --ts2.tv_sec; + ts2.tv_nsec += 1000000000; + } + + // Should be less than (a very generous, to try to avoid flakiness) 1000000ns. + ASSERT_EQ(0, ts2.tv_sec); + ASSERT_LT(ts2.tv_nsec, 1000000); +} From 9a7fdb2dae8f0ae0f9c5b0596bb2710f782925aa Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 16 Jul 2014 15:18:54 -0700 Subject: [PATCH 035/148] ptrace(3) should be varargs. Bug: 16352070 (cherry picked from commit 98b088dce70a2625d5cfa1872e427af5f06bfd99) Change-Id: I6193ef44df9a5668020916eaca90b47fc4c8ab77 --- libc/bionic/ptrace.cpp | 40 ++++++++++++++++++++------------------- libc/include/sys/ptrace.h | 8 ++++---- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/libc/bionic/ptrace.cpp b/libc/bionic/ptrace.cpp index 5715b0934..5156ec24c 100644 --- a/libc/bionic/ptrace.cpp +++ b/libc/bionic/ptrace.cpp @@ -26,28 +26,30 @@ * SUCH DAMAGE. */ -#include +#include #include -extern "C" long __ptrace(int request, pid_t pid, void* addr, void* data); +extern "C" long __ptrace(int req, pid_t pid, void* addr, void* data); -long ptrace(int request, pid_t pid, void* addr, void* data) { - switch (request) { - case PTRACE_PEEKUSR: - case PTRACE_PEEKTEXT: - case PTRACE_PEEKDATA: - { - long word; - long ret = __ptrace(request, pid, addr, &word); - if (ret == 0) { - return word; - } else { - // __ptrace already set errno for us. - return -1; - } - } +long ptrace(int req, ...) { + bool is_peek = (req == PTRACE_PEEKUSR || req == PTRACE_PEEKTEXT || req == PTRACE_PEEKDATA); + long peek_result; - default: - return __ptrace(request, pid, addr, data); + va_list args; + va_start(args, req); + pid_t pid = va_arg(args, pid_t); + void* addr = va_arg(args, void*); + void* data; + if (is_peek) { + data = &peek_result; + } else { + data = va_arg(args, void*); } + va_end(args); + + long result = __ptrace(req, pid, addr, data); + if (is_peek && result == 0) { + return peek_result; + } + return result; } diff --git a/libc/include/sys/ptrace.h b/libc/include/sys/ptrace.h index 848416b64..8bba9fe43 100644 --- a/libc/include/sys/ptrace.h +++ b/libc/include/sys/ptrace.h @@ -30,15 +30,15 @@ #include #include -/* For all of the defines */ #include __BEGIN_DECLS -#define PTRACE_POKEUSER PTRACE_POKEUSR -#define PTRACE_PEEKUSER PTRACE_PEEKUSR +/* glibc uses different names from the kernel for these two... */ +#define PTRACE_POKEUSER PTRACE_POKEUSR +#define PTRACE_PEEKUSER PTRACE_PEEKUSR -extern long ptrace(int request, pid_t pid, void *addr, void *data); +extern long ptrace(int, ...); __END_DECLS From 013c9b8035aaa3352aee76451b853c0c29c01223 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Tue, 15 Jul 2014 19:02:33 -0700 Subject: [PATCH 036/148] Add gen syscalls step to instructions. Also, fix incorrect path to some tools. (cherry picked from commit ea271fdf2671707ed29bc6b564f544d2489115ff) Change-Id: Ie93cbc84b9a46d622b0b462a33bed0ee129992cb --- libc/kernel/README.TXT | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libc/kernel/README.TXT b/libc/kernel/README.TXT index 0edbcc654..e7312ef21 100644 --- a/libc/kernel/README.TXT +++ b/libc/kernel/README.TXT @@ -55,11 +55,15 @@ IMPORTANT IMPORTANT: Grab the latest headers from the android kernel by running this command: - bionic/kernel/tools/generate_uapi_headers.sh --download-kernel + bionic/libc/kernel/tools/generate_uapi_headers.sh --download-kernel Next, run this command to copy the parsed files to bionic/libc/kernel/uapi: - bionic/kernel/tools/update_all.py + bionic/libc/kernel/tools/update_all.py + +Finally, run this command to regenerate the syscalls list: + + bionic/libc/tools/gensyscalls.py After this, you will need to build/test the tree to make sure that these changes do not introduce any errors. From d648f557f116513263aa2f86bba552d2f72660f1 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 17 Jul 2014 14:26:33 -0700 Subject: [PATCH 037/148] Remove non-standard prctl constants from . Also remove __bionic_name_mem which has exactly one caller, and is only ever expected to be used in this one place. (cherry picked from commit d7453860a6b06e7d4a960c20792ce6f0b6cc5f3a) Change-Id: I26b7638609e9d4eaf4f21ae29721ea27d4176702 --- libc/Android.mk | 1 - libc/bionic/__bionic_name_mem.cpp | 50 ------------------------------- libc/bionic/dlmalloc.c | 9 ++++-- libc/include/sys/prctl.h | 13 -------- libc/private/bionic_name_mem.h | 41 ------------------------- 5 files changed, 7 insertions(+), 107 deletions(-) delete mode 100644 libc/bionic/__bionic_name_mem.cpp delete mode 100644 libc/private/bionic_name_mem.h diff --git a/libc/Android.mk b/libc/Android.mk index 0485d72b8..0adaff7d5 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -96,7 +96,6 @@ libc_bionic_src_files := \ bionic/access.cpp \ bionic/assert.cpp \ bionic/atof.cpp \ - bionic/__bionic_name_mem.cpp \ bionic/bionic_time_conversions.cpp \ bionic/brk.cpp \ bionic/c16rtomb.cpp \ diff --git a/libc/bionic/__bionic_name_mem.cpp b/libc/bionic/__bionic_name_mem.cpp deleted file mode 100644 index 72a1d1eab..000000000 --- a/libc/bionic/__bionic_name_mem.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "private/bionic_name_mem.h" - -#include - -// Local definitions of custom prctl arguments to set a vma name in some kernels. -#define BIONIC_PR_SET_VMA 0x53564d41 -#define BIONIC_PR_SET_VMA_ANON_NAME 0 - -// Names a region of memory. The name is expected to show up in /proc/pid/maps -// and /proc/pid/smaps. There is no guarantee that it will work, and if it -// does work it is likely to only work on memory that was allocated with -// mmap(MAP_ANONYMOUS), and only on regions that are page aligned. name should -// be a pointer to a string that is valid for as long as the memory is mapped, -// preferably a compile-time constant string. -// -// Returns -1 on error and sets errno. If it returns an error naming page -// aligned anonymous memory the kernel doesn't support naming, and an alternate -// method of naming memory should be used (like ashmem). - -int __bionic_name_mem(void* addr, size_t len, const char* name) { - return prctl(BIONIC_PR_SET_VMA, BIONIC_PR_SET_VMA_ANON_NAME, addr, len, name); -} diff --git a/libc/bionic/dlmalloc.c b/libc/bionic/dlmalloc.c index 2d67392c0..7ecca1d3e 100644 --- a/libc/bionic/dlmalloc.c +++ b/libc/bionic/dlmalloc.c @@ -26,11 +26,16 @@ static void __bionic_heap_usage_error(const char* function, void* address); #define CORRUPTION_ERROR_ACTION(m) __bionic_heap_corruption_error(__FUNCTION__) #define USAGE_ERROR_ACTION(m,p) __bionic_heap_usage_error(__FUNCTION__, p) -/* Bionic named anonymous memory declarations */ +// Bionic named anonymous memory declarations. static void* named_anonymous_mmap(size_t length); #define MMAP(s) named_anonymous_mmap(s) #define DIRECT_MMAP(s) named_anonymous_mmap(s) +// Local definitions of custom prctl arguments to set a vma name in Android kernels. +#include +#define PR_SET_VMA 0x53564d41 +#define PR_SET_VMA_ANON_NAME 0 + // Ugly inclusion of C file so that bionic specific #defines configure dlmalloc. #include "../upstream-dlmalloc/malloc.c" @@ -51,6 +56,6 @@ static void* named_anonymous_mmap(size_t length) { if (map == MAP_FAILED) { return map; } - __bionic_name_mem(map, length, "libc_malloc"); + prctl(BIONIC_PR_SET_VMA, BIONIC_PR_SET_VMA_ANON_NAME, map, length, "libc_malloc"); return map; } diff --git a/libc/include/sys/prctl.h b/libc/include/sys/prctl.h index 391c22a77..f66f6f544 100644 --- a/libc/include/sys/prctl.h +++ b/libc/include/sys/prctl.h @@ -38,18 +38,6 @@ #error PR_SET_TIMERSLACK_PID defined twice #endif -#if !defined(PR_SET_VMA) -#define PR_SET_VMA 0x53564d41 -#else -#error PR_SET_VMA defined twice -#endif - -#if !defined(PR_SET_VMA_ANON_NAME) -#define PR_SET_VMA_ANON_NAME 0 -#else -#error PR_SET_VMA_ANON_NAME defined twice -#endif - __BEGIN_DECLS /* IMPORTANT NOTE: This function is declared as taking a variable number @@ -63,4 +51,3 @@ extern int prctl(int option, ...); __END_DECLS #endif /* _SYS_PRCTL_H */ - diff --git a/libc/private/bionic_name_mem.h b/libc/private/bionic_name_mem.h deleted file mode 100644 index 1c7664efb..000000000 --- a/libc/private/bionic_name_mem.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _BIONIC_NAME_MEM_H -#define _BIONIC_NAME_MEM_H - -#include -#include - -__BEGIN_DECLS - -__LIBC_HIDDEN__ int __bionic_name_mem(void* addr, size_t len, const char* name); - -__END_DECLS - -#endif From b46696858b9018ff8a1069d429366e05d4814c52 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 17 Jul 2014 15:09:17 -0700 Subject: [PATCH 038/148] Fix private/bionic_name_mem.h build breakage. (cherry picked from commit 2f9c6e38b8f59ea6e53e95e062e04dc987ac67f3) Change-Id: Ia8e96da98802d312011df866ac1baaa48f97811c --- libc/bionic/dlmalloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libc/bionic/dlmalloc.c b/libc/bionic/dlmalloc.c index 7ecca1d3e..d582071a7 100644 --- a/libc/bionic/dlmalloc.c +++ b/libc/bionic/dlmalloc.c @@ -16,7 +16,6 @@ #include "dlmalloc.h" -#include "private/bionic_name_mem.h" #include "private/libc_logging.h" // Send dlmalloc errors to the log. @@ -56,6 +55,6 @@ static void* named_anonymous_mmap(size_t length) { if (map == MAP_FAILED) { return map; } - prctl(BIONIC_PR_SET_VMA, BIONIC_PR_SET_VMA_ANON_NAME, map, length, "libc_malloc"); + prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, map, length, "libc_malloc"); return map; } From de24f1ac00924b9a523d06784867bc8c9312335d Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 18 Jul 2014 15:55:41 -0700 Subject: [PATCH 039/148] Clean up some misinformation around prctl. prctl shouldn't be in . (cherry picked from commit 9c07aee83b4ebbf2dba8e23d6896683187b9724e) Change-Id: I70cda886fbf4d58d82dc70adaa981506ebff9949 --- libc/SYSCALLS.TXT | 4 +--- libc/include/sys/prctl.h | 10 +++------- libc/include/unistd.h | 3 --- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index 7ae054e78..014d55444 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -80,9 +80,7 @@ int setpgid(pid_t, pid_t) all int setregid:setregid32(gid_t, gid_t) arm,x86 int setregid:setregid(gid_t, gid_t) arm64,mips,mips64,x86_64 int chroot(const char*) all -# IMPORTANT: Even though declares prctl(int, ...), the syscall stub must take 6 arguments -# to match the kernel implementation. -int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) all +int prctl(int, unsigned long, unsigned long, unsigned long, unsigned long) all long __arch_prctl:arch_prctl(int, unsigned long) x86_64 int capget(cap_user_header_t header, cap_user_data_t data) all int capset(cap_user_header_t header, const cap_user_data_t data) all diff --git a/libc/include/sys/prctl.h b/libc/include/sys/prctl.h index 8c6167744..d96b8b6e5 100644 --- a/libc/include/sys/prctl.h +++ b/libc/include/sys/prctl.h @@ -25,20 +25,16 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + #ifndef _SYS_PRCTL_H #define _SYS_PRCTL_H -#include #include +#include + __BEGIN_DECLS -/* IMPORTANT NOTE: This function is declared as taking a variable number - * of arguments to match the GLibc definition. However - * its declaration inside SYSCALLS.TXT *must* make it - * take 6 arguments to ensure consistency with the kernel - * implementation. - */ extern int prctl(int option, ...); __END_DECLS diff --git a/libc/include/unistd.h b/libc/include/unistd.h index afe5f1a3f..12e625743 100644 --- a/libc/include/unistd.h +++ b/libc/include/unistd.h @@ -71,9 +71,6 @@ extern int execl(const char *, const char *, ...); extern int execlp(const char *, const char *, ...); extern int execle(const char *, const char *, ...); -/* IMPORTANT: See comment under about this declaration */ -extern int prctl(int option, ...); - extern int nice(int); extern int setuid(uid_t); From e8bc581333d1fe19d28211330d1e06d471365d54 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 18 Jul 2014 12:26:45 -0700 Subject: [PATCH 040/148] Use the mmap/munmap for allocation routines. To avoid any issues calling malloc related routines, use mmap/munmap. Specifically, this avoids any problems when this is compiled into a malloc debug shared library. (cherry picked from commit 6425327c3278137d153b8a7505f97d2f5f058d49) Change-Id: If43d12b2c588c9abcbfbbd2c53702cdac7695a73 --- libc/bionic/debug_mapinfo.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libc/bionic/debug_mapinfo.cpp b/libc/bionic/debug_mapinfo.cpp index e81ea5415..17276ce40 100644 --- a/libc/bionic/debug_mapinfo.cpp +++ b/libc/bionic/debug_mapinfo.cpp @@ -29,14 +29,8 @@ #include #include #include +#include -#ifdef USE_JEMALLOC -#include "jemalloc.h" -#define Malloc(function) je_ ## function -#else -#include "dlmalloc.h" -#define Malloc(function) dl ## function -#endif #include "debug_mapinfo.h" // 6f000000-6f01e000 rwxp 00000000 00:0c 16389419 /system/lib/libcomposer.so @@ -52,8 +46,9 @@ static mapinfo_t* parse_maps_line(char* line) { if (len < 50) return 0; if (line[20] != 'x') return 0; - mapinfo_t* mi = static_cast(Malloc(malloc)(sizeof(mapinfo_t) + (len - 47))); - if (mi == 0) return 0; + mapinfo_t* mi = static_cast( + mmap(NULL, sizeof(mapinfo_t) + (len - 47), PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0)); + if (mi == MAP_FAILED) return 0; mi->start = strtoul(line, 0, 16); mi->end = strtoul(line + 9, 0, 16); @@ -85,7 +80,7 @@ __LIBC_HIDDEN__ void mapinfo_destroy(mapinfo_t* mi) { while (mi != NULL) { mapinfo_t* del = mi; mi = mi->next; - Malloc(free)(del); + munmap(del, sizeof(mapinfo_t) + strlen(del->name) + 2); } } From b5bef263b37b1f0def2a6c4e8e714ab871452b72 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 17 Jul 2014 17:12:35 -0700 Subject: [PATCH 041/148] Remove PR_SET_TIMERSLACK_PID from . (cherry picked from commit 9f165d24f00c3bd4337ef719105bfb36bfa00a8b) Change-Id: I009d3742cefbf36115f09824f267a0265ae215bf --- libc/include/sys/prctl.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libc/include/sys/prctl.h b/libc/include/sys/prctl.h index f66f6f544..8c6167744 100644 --- a/libc/include/sys/prctl.h +++ b/libc/include/sys/prctl.h @@ -31,13 +31,6 @@ #include #include -/* These should appear in the uapi headers at some point, but they're not there right now. */ -#if !defined(PR_SET_TIMERSLACK_PID) -#define PR_SET_TIMERSLACK_PID 41 -#else -#error PR_SET_TIMERSLACK_PID defined twice -#endif - __BEGIN_DECLS /* IMPORTANT NOTE: This function is declared as taking a variable number From 291da8d3533b3ee47f8d742c72d789d3149d15da Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 17 Jul 2014 17:10:02 -0700 Subject: [PATCH 042/148] Remove SIOCKILLADDR from . (cherry picked from commit 8a3d1ca183e19d849728318fe8b0d36856fa000f) Change-Id: Idb5cc4cff3ece7fa8740db12a19438d1a1c9a6a8 --- libc/include/sys/socket.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h index 3b11d202d..ae2f2381e 100644 --- a/libc/include/sys/socket.h +++ b/libc/include/sys/socket.h @@ -40,13 +40,6 @@ #include #include -/* This is an Android extension that won't be in the uapi headers for the common kernel. */ -#if !defined(SIOCKILLADDR) -#define SIOCKILLADDR 0x8939 -#else -#error SIOCKILLADDR defined twice -#endif - __BEGIN_DECLS #define sockaddr_storage __kernel_sockaddr_storage From b0815aeacb86e20cbbd4fa27dd90ad43b9c200fe Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Tue, 15 Jul 2014 19:09:07 -0700 Subject: [PATCH 043/148] Make sure not to construct illegal property names. (cherry picked from commit 53531ccebbaf103d80516ff74874482ca3ee31fc) Change-Id: I7e988c335ef32b61b2ac34f34509274623dbed69 --- benchmarks/property_benchmark.cpp | 34 +++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/benchmarks/property_benchmark.cpp b/benchmarks/property_benchmark.cpp index f330d7e9a..0802b4c30 100644 --- a/benchmarks/property_benchmark.cpp +++ b/benchmarks/property_benchmark.cpp @@ -28,12 +28,14 @@ extern void *__system_property_area__; +// Do not exceed 512, that is about the largest number of properties +// that can be created with the current property area size. #define TEST_NUM_PROPS \ - Arg(1)->Arg(4)->Arg(16)->Arg(64)->Arg(128)->Arg(256)->Arg(512)->Arg(1024) + Arg(1)->Arg(4)->Arg(16)->Arg(64)->Arg(128)->Arg(256)->Arg(512) struct LocalPropertyTestState { LocalPropertyTestState(int nprops) : nprops(nprops), valid(false) { - static const char prop_name_chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_"; + static const char prop_name_chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_."; const char* android_data = getenv("ANDROID_DATA"); if (android_data == NULL) { @@ -66,18 +68,38 @@ struct LocalPropertyTestState { srandom(nprops); for (int i = 0; i < nprops; i++) { - name_lens[i] = random() % PROP_NAME_MAX; + // Make sure the name has at least 10 characters to make + // it very unlikely to generate the same random name. + name_lens[i] = (random() % (PROP_NAME_MAX - 10)) + 10; names[i] = new char[PROP_NAME_MAX + 1]; + size_t prop_name_len = sizeof(prop_name_chars) - 1; for (int j = 0; j < name_lens[i]; j++) { - names[i][j] = prop_name_chars[random() % (sizeof(prop_name_chars) - 1)]; + if (j == 0 || names[i][j-1] == '.' || j == name_lens[i] - 1) { + // Certain values are not allowed: + // - Don't start name with '.' + // - Don't allow '.' to appear twice in a row + // - Don't allow the name to end with '.' + // This assumes that '.' is the last character in the + // array so that decrementing the length by one removes + // the value from the possible values. + prop_name_len--; + } + names[i][j] = prop_name_chars[random() % prop_name_len]; } names[i][name_lens[i]] = 0; - value_lens[i] = random() % PROP_VALUE_MAX; + + // Make sure the value contains at least 1 character. + value_lens[i] = (random() % (PROP_VALUE_MAX - 1)) + 1; values[i] = new char[PROP_VALUE_MAX]; for (int j = 0; j < value_lens[i]; j++) { values[i][j] = prop_name_chars[random() % (sizeof(prop_name_chars) - 1)]; } - __system_property_add(names[i], name_lens[i], values[i], value_lens[i]); + + if (__system_property_add(names[i], name_lens[i], values[i], value_lens[i]) < 0) { + printf("Failed to add a property, terminating...\n"); + printf("%s = %.*s\n", names[i], value_lens[i], values[i]); + exit(1); + } } valid = true; From ed68221a8225a6696d2b0b1607ef0b2de1c1b3aa Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Wed, 16 Jul 2014 11:33:48 -0700 Subject: [PATCH 044/148] Define atomic_charN_t only if charN_t is supported. Some platform code is apparently compiled with switches that do not support char16_t and char32_t. This caused stdatomic.h to fail to compile. This CL makes stdatomic.h usable in those environments. (cherry picked from commit 8b002362d996859ebfc8588d6859a9a79203dc27) Change-Id: Ie5a17f20b8b545c97128d00605b4eabd2a6bfe3e --- libc/include/stdatomic.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libc/include/stdatomic.h b/libc/include/stdatomic.h index 43ec7534b..669cefd66 100644 --- a/libc/include/stdatomic.h +++ b/libc/include/stdatomic.h @@ -205,8 +205,10 @@ typedef _Atomic(long) atomic_long; typedef _Atomic(unsigned long) atomic_ulong; typedef _Atomic(long long) atomic_llong; typedef _Atomic(unsigned long long) atomic_ullong; -typedef _Atomic(char16_t) atomic_char16_t; -typedef _Atomic(char32_t) atomic_char32_t; +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L + typedef _Atomic(char16_t) atomic_char16_t; + typedef _Atomic(char32_t) atomic_char32_t; +#endif typedef _Atomic(wchar_t) atomic_wchar_t; typedef _Atomic(int_least8_t) atomic_int_least8_t; typedef _Atomic(uint_least8_t) atomic_uint_least8_t; From 841c633fa13ba8d48563fbda247e75bab3bd6f49 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sat, 19 Jul 2014 20:15:42 -0700 Subject: [PATCH 045/148] resolved conflicts for merge of b5bef263 to lmp-dev-plus-aosp . Change-Id: Ieef30b3a308ca3cad4a59f17566d4cede0ae2b16 From b76613627d045acd3bdb7294f424f14c21584872 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 21 Jul 2014 16:35:24 -0700 Subject: [PATCH 046/148] Rewrite syslog(3) to use Android logging. Since we don't have syslogd on Android and you can't run one on a non-rooted device, it's more useful if syslog output just goes to the regular Android logging system. Bug: 14292866 (cherry picked from commit 3ad8ecb64e9dd5614169232b84a93eb3b8aa32d7) Change-Id: I3038855ca4f22532bf6d2c45d3f8028b866975f9 --- HACKING.txt | 11 +- libc/Android.mk | 2 +- libc/bionic/libc_logging.cpp | 3 + libc/bionic/syslog.cpp | 75 +++++++ libc/include/syslog.h | 24 +-- libc/unistd/syslog.c | 392 ----------------------------------- tests/libc_logging_test.cpp | 11 + 7 files changed, 105 insertions(+), 413 deletions(-) create mode 100644 libc/bionic/syslog.cpp delete mode 100644 libc/unistd/syslog.c diff --git a/HACKING.txt b/HACKING.txt index fb93b5a10..27e136827 100644 --- a/HACKING.txt +++ b/HACKING.txt @@ -81,13 +81,6 @@ libc/ private/ # These are private header files meant for use within bionic itself. - stdio/ - stdlib/ - unistd/ - # These are legacy files of unknown provenance. In the past, bionic was a - # mess of random versions of random files from all three of FreeBSD, NetBSD, - # and OpenBSD! We've been working to clean that up, but these directories - # are basically where all the stuff we haven't got to yet lives. dns/ # Contains the DNS resolver (originates from NetBSD code). @@ -114,6 +107,10 @@ libc/ # current upstream source in one of the upstream directories or by # switching the file to C++ and cleaning it up. + stdio/ + # These are legacy files of dubious provenance. We're working to clean + # this mess up, and this directory should disappear. + tools/ # Various tools used to maintain bionic. diff --git a/libc/Android.mk b/libc/Android.mk index 0adaff7d5..fd3da965a 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -67,7 +67,6 @@ libc_common_src_files := \ bionic/unlockpt.c \ stdio/snprintf.c\ stdio/sprintf.c \ - unistd/syslog.c \ # Fortify implementations of libc functions. libc_common_src_files += \ @@ -218,6 +217,7 @@ libc_bionic_src_files := \ bionic/stubs.cpp \ bionic/symlink.cpp \ bionic/sysconf.cpp \ + bionic/syslog.cpp \ bionic/sys_siglist.c \ bionic/sys_signame.c \ bionic/system_properties.cpp \ diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp index e656a1255..88d979091 100644 --- a/libc/bionic/libc_logging.cpp +++ b/libc/bionic/libc_logging.cpp @@ -378,6 +378,9 @@ static void out_vformat(Out& o, const char* format, va_list args) { } else if (c == '%') { buffer[0] = '%'; buffer[1] = '\0'; + } else if (c == 'm') { + // syslog-like %m for strerror(errno). + str = strerror(errno); } else { __assert(__FILE__, __LINE__, "conversion specifier unsupported"); } diff --git a/libc/bionic/syslog.cpp b/libc/bionic/syslog.cpp new file mode 100644 index 000000000..7e153eb16 --- /dev/null +++ b/libc/bionic/syslog.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include "private/libc_logging.h" + +static const char* syslog_log_tag = NULL; +static int syslog_priority_mask = 0xff; + +void closelog() { +} + +void openlog(const char* log_tag, int /*options*/, int /*facility*/) { + syslog_log_tag = log_tag; +} + +int setlogmask(int new_mask) { + int old_mask = syslog_priority_mask; + // 0 is used to query the current mask. + if (new_mask != 0) { + syslog_priority_mask = new_mask; + } + return old_mask; +} + +void syslog(int priority, const char* fmt, ...) { + va_list args; + va_start(args, fmt); + vsyslog(priority, fmt, args); + va_end(args); +} + +void vsyslog(int priority, const char* fmt, va_list args) { + // Check whether we're supposed to be logging messages of this priority. + if ((syslog_priority_mask & LOG_MASK(LOG_PRI(priority))) == 0) { + return; + } + + // What's our log tag? + const char* log_tag = syslog_log_tag; + if (log_tag == NULL) { + log_tag = getprogname(); + } + + // What's our Android log priority? + priority &= LOG_PRIMASK; + int android_log_priority; + if (priority < LOG_ERR) { + android_log_priority = ANDROID_LOG_ERROR; + } else if (priority == LOG_WARNING) { + android_log_priority = ANDROID_LOG_WARN; + } else if (priority <= LOG_INFO) { + android_log_priority = ANDROID_LOG_INFO; + } else { + android_log_priority = ANDROID_LOG_DEBUG; + } + + __libc_format_log_va_list(android_log_priority, log_tag, fmt, args); +} diff --git a/libc/include/syslog.h b/libc/include/syslog.h index a52e81154..f396feca7 100644 --- a/libc/include/syslog.h +++ b/libc/include/syslog.h @@ -74,20 +74,18 @@ __BEGIN_DECLS #define LOG_MASK(pri) (1 << (pri)) #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) -#define LOG_PID 0x01 /* include pid with message */ -#define LOG_CONS 0x02 /* write to console on logger error */ -#define LOG_ODELAY 0x04 /* delay connection until syslog() */ -#define LOG_NDELAY 0x08 /* open connection immediately */ -#define LOG_NOWAIT 0x10 /* wait for child processes (unused on linux) */ -#define LOG_PERROR 0x20 /* additional logging to stderr */ +#define LOG_PID 0x01 +#define LOG_CONS 0x02 +#define LOG_ODELAY 0x04 +#define LOG_NDELAY 0x08 +#define LOG_NOWAIT 0x10 +#define LOG_PERROR 0x20 -#define _PATH_LOG "/dev/syslog" - -extern void closelog(void); -extern void openlog(const char *, int, int); -extern int setlogmask(int); -extern void syslog(int, const char *, ...) __printflike(2, 3); -extern void vsyslog(int, const char *, va_list) __printflike(2, 0); +extern void closelog(void); +extern void openlog(const char*, int, int); +extern int setlogmask(int); +extern void syslog(int, const char*, ...) __printflike(2, 3); +extern void vsyslog(int, const char*, va_list) __printflike(2, 0); __END_DECLS diff --git a/libc/unistd/syslog.c b/libc/unistd/syslog.c deleted file mode 100644 index 339df680a..000000000 --- a/libc/unistd/syslog.c +++ /dev/null @@ -1,392 +0,0 @@ -/* $OpenBSD: syslog.c,v 1.28 2005/08/08 08:05:34 espie Exp $ */ -/* - * Copyright (c) 1983, 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -struct syslog_data { - int log_file; - int connected; - int opened; - int log_stat; - const char* log_tag; - int log_fac; - int log_mask; -}; - -#define SYSLOG_DATA_INIT {-1, 0, 0, 0, (const char *)0, LOG_USER, 0xff} - -static struct syslog_data sdata = SYSLOG_DATA_INIT; - -extern const char *__progname; /* Program name, from crt0. */ - -static void disconnectlog_r(struct syslog_data *); /* disconnect from syslogd */ -static void connectlog_r(struct syslog_data *); /* (re)connect to syslogd */ - -#if defined(__LP64__) -#define SYSLOG_R_VISIBILITY static -#else -#define SYSLOG_R_VISIBILITY extern -#endif - -SYSLOG_R_VISIBILITY void closelog_r(struct syslog_data*); -SYSLOG_R_VISIBILITY void openlog_r(const char*, int, int, struct syslog_data*); -SYSLOG_R_VISIBILITY int setlogmask_r(int, struct syslog_data*); -SYSLOG_R_VISIBILITY void syslog_r(int, struct syslog_data*, const char*, ...) __printflike(3, 4); -SYSLOG_R_VISIBILITY void vsyslog_r(int, struct syslog_data*, const char*, va_list) __printflike(3, 0); - -/* - * syslog, vsyslog -- - * print message on log file; output is intended for syslogd(8). - */ -void -syslog(int pri, const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vsyslog(pri, fmt, ap); - va_end(ap); -} - -void -vsyslog(int pri, const char *fmt, va_list ap) -{ - vsyslog_r(pri, &sdata, fmt, ap); -} - -void -openlog(const char *ident, int logstat, int logfac) -{ - openlog_r(ident, logstat, logfac, &sdata); -} - -void -closelog(void) -{ - closelog_r(&sdata); -} - -/* setlogmask -- set the log mask level */ -int -setlogmask(int pmask) -{ - return setlogmask_r(pmask, &sdata); -} - -/* Reentrant version of syslog, i.e. syslog_r() */ - -void -syslog_r(int pri, struct syslog_data *data, const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vsyslog_r(pri, data, fmt, ap); - va_end(ap); -} - -void -vsyslog_r(int pri, struct syslog_data *data, const char *fmt, va_list ap) -{ - int cnt; - char ch, *p, *t; - time_t now; - int fd, saved_errno, error; -#define TBUF_LEN 2048 -#define FMT_LEN 1024 - char *stdp = NULL, tbuf[TBUF_LEN], fmt_cpy[FMT_LEN]; - int tbuf_left, fmt_left, prlen; - -#define INTERNALLOG LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID - /* Check for invalid bits. */ - if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) { - if (data == &sdata) { - syslog(INTERNALLOG, - "syslog: unknown facility/priority: %x", pri); - } else { - syslog_r(INTERNALLOG, data, - "syslog_r: unknown facility/priority: %x", pri); - } - pri &= LOG_PRIMASK|LOG_FACMASK; - } - - /* Check priority against setlogmask values. */ - if (!(LOG_MASK(LOG_PRI(pri)) & data->log_mask)) - return; - - saved_errno = errno; - - /* Set default facility if none specified. */ - if ((pri & LOG_FACMASK) == 0) - pri |= data->log_fac; - - /* If we have been called through syslog(), no need for reentrancy. */ - if (data == &sdata) - (void)time(&now); - - p = tbuf; - tbuf_left = TBUF_LEN; - -#define DEC() \ - do { \ - if (prlen < 0) \ - prlen = 0; \ - if (prlen >= tbuf_left) \ - prlen = tbuf_left - 1; \ - p += prlen; \ - tbuf_left -= prlen; \ - } while (0) - - prlen = snprintf(p, tbuf_left, "<%d>", pri); - DEC(); - - /* - * syslogd will expand time automagically for reentrant case, and - * for normal case, just do like before - */ - if (data == &sdata) { - prlen = strftime(p, tbuf_left, "%h %e %T ", localtime(&now)); - DEC(); - } - - if (data->log_stat & LOG_PERROR) - stdp = p; - if (data->log_tag == NULL) - data->log_tag = __progname; - if (data->log_tag != NULL) { - prlen = snprintf(p, tbuf_left, "%s", data->log_tag); - DEC(); - } - if (data->log_stat & LOG_PID) { - prlen = snprintf(p, tbuf_left, "[%ld]", (long)getpid()); - DEC(); - } - if (data->log_tag != NULL) { - if (tbuf_left > 1) { - *p++ = ':'; - tbuf_left--; - } - if (tbuf_left > 1) { - *p++ = ' '; - tbuf_left--; - } - } - - /* strerror() is not reentrant */ - - for (t = fmt_cpy, fmt_left = FMT_LEN; (ch = *fmt); ++fmt) { - if (ch == '%' && fmt[1] == 'm') { - ++fmt; - if (data == &sdata) { - prlen = snprintf(t, fmt_left, "%s", - strerror(saved_errno)); - } else { - prlen = snprintf(t, fmt_left, "Error %d", - saved_errno); - } - if (prlen < 0) - prlen = 0; - if (prlen >= fmt_left) - prlen = fmt_left - 1; - t += prlen; - fmt_left -= prlen; - } else if (ch == '%' && fmt[1] == '%' && fmt_left > 2) { - *t++ = '%'; - *t++ = '%'; - fmt++; - fmt_left -= 2; - } else { - if (fmt_left > 1) { - *t++ = ch; - fmt_left--; - } - } - } - *t = '\0'; - - prlen = vsnprintf(p, tbuf_left, fmt_cpy, ap); - DEC(); - cnt = p - tbuf; - - /* Output to stderr if requested. */ - if (data->log_stat & LOG_PERROR) { - struct iovec iov[2]; - - iov[0].iov_base = stdp; - iov[0].iov_len = cnt - (stdp - tbuf); - iov[1].iov_base = "\n"; - iov[1].iov_len = 1; - (void)writev(STDERR_FILENO, iov, 2); - } - - /* Get connected, output the message to the local logger. */ - if (!data->opened) - openlog_r(data->log_tag, data->log_stat, 0, data); - connectlog_r(data); - - /* - * If the send() failed, there are two likely scenarios: - * 1) syslogd was restarted - * 2) /dev/log is out of socket buffer space - * We attempt to reconnect to /dev/log to take care of - * case #1 and keep send()ing data to cover case #2 - * to give syslogd a chance to empty its socket buffer. - */ - if ((error = send(data->log_file, tbuf, cnt, 0)) < 0) { - if (errno != ENOBUFS) { - disconnectlog_r(data); - connectlog_r(data); - } - do { - usleep(1); - if ((error = send(data->log_file, tbuf, cnt, 0)) >= 0) - break; - } while (errno == ENOBUFS); - } - - /* - * Output the message to the console; try not to block - * as a blocking console should not stop other processes. - * Make sure the error reported is the one from the syslogd failure. - */ - if (error == -1 && (data->log_stat & LOG_CONS) && - (fd = open(_PATH_CONSOLE, O_WRONLY|O_NONBLOCK, 0)) >= 0) { - struct iovec iov[2]; - - p = strchr(tbuf, '>') + 1; - iov[0].iov_base = p; - iov[0].iov_len = cnt - (p - tbuf); - iov[1].iov_base = "\r\n"; - iov[1].iov_len = 2; - (void)writev(fd, iov, 2); - (void)close(fd); - } - - if (data != &sdata) - closelog_r(data); -} - -static void -disconnectlog_r(struct syslog_data *data) -{ - /* - * If the user closed the FD and opened another in the same slot, - * that's their problem. They should close it before calling on - * system services. - */ - if (data->log_file != -1) { - close(data->log_file); - data->log_file = -1; - } - data->connected = 0; /* retry connect */ -} - -static void -connectlog_r(struct syslog_data *data) -{ - union { - struct sockaddr syslogAddr; - struct sockaddr_un syslogAddrUn; - } u; - -#define SyslogAddr u.syslogAddrUn - - if (data->log_file == -1) { - if ((data->log_file = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) - return; - (void)fcntl(data->log_file, F_SETFD, 1); - } - if (data->log_file != -1 && !data->connected) { - memset(&SyslogAddr, '\0', sizeof(SyslogAddr)); -#if 0 - /* BIONIC: no sun_len field to fill on Linux */ - SyslogAddr.sun_len = sizeof(SyslogAddr); -#endif - SyslogAddr.sun_family = AF_UNIX; - strlcpy(SyslogAddr.sun_path, _PATH_LOG, - sizeof(SyslogAddr.sun_path)); - if (connect(data->log_file, &u.syslogAddr, - sizeof(SyslogAddr)) == -1) { - (void)close(data->log_file); - data->log_file = -1; - } else - data->connected = 1; - } -} - -void -openlog_r(const char *ident, int logstat, int logfac, struct syslog_data *data) -{ - if (ident != NULL) - data->log_tag = ident; - data->log_stat = logstat; - if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0) - data->log_fac = logfac; - - if (data->log_stat & LOG_NDELAY) /* open immediately */ - connectlog_r(data); - - data->opened = 1; /* ident and facility has been set */ -} - -void -closelog_r(struct syslog_data *data) -{ - (void)close(data->log_file); - data->log_file = -1; - data->connected = 0; - data->log_tag = NULL; -} - -/* setlogmask -- set the log mask level */ -int -setlogmask_r(int pmask, struct syslog_data *data) -{ - int omask; - - omask = data->log_mask; - if (pmask != 0) - data->log_mask = pmask; - return (omask); -} diff --git a/tests/libc_logging_test.cpp b/tests/libc_logging_test.cpp index 950161e78..ef39d1c03 100644 --- a/tests/libc_logging_test.cpp +++ b/tests/libc_logging_test.cpp @@ -176,3 +176,14 @@ TEST(libc_logging, lld_LLONG_MIN) { GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif // __BIONIC__ } + +TEST(libc_logging, m) { +#if defined(__BIONIC__) + char buf[BUFSIZ]; + errno = EBADF; + __libc_format_buffer(buf, sizeof(buf), "<%m>"); + EXPECT_STREQ("", buf); +#else // __BIONIC__ + GTEST_LOG_(INFO) << "This test does nothing.\n"; +#endif // __BIONIC__ +} From 6209c81d40e2b4e129a28bda3259150d79d507e8 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 18 Jul 2014 15:57:41 -0700 Subject: [PATCH 047/148] Use upstream OpenBSD's arc4random. The getentropy_linux.c is lightly modified to build on Android, but we're now completely in sync with upstream OpenBSD's arc4random implementation. (cherry picked from commit 2b67d7dee09852789d9ac7d8972ed6cdb2c18430) Change-Id: Icc939b5fa2fcac3e15ff93735d2d34f67e9bb149 --- libc/Android.mk | 4 +- libc/bionic/arc4random.c | 288 --------- libc/bionic/getentropy_linux.c | 565 ++++++++++++++++++ libc/private/thread_private.h | 5 +- .../android/include/arc4random.h | 87 +++ .../android/include/openbsd-compat.h | 6 + .../lib/libc/crypt/arc4random.c | 195 ++++++ .../lib/libc/crypt/arc4random_uniform.c | 56 ++ 8 files changed, 915 insertions(+), 291 deletions(-) delete mode 100644 libc/bionic/arc4random.c create mode 100644 libc/bionic/getentropy_linux.c create mode 100644 libc/upstream-openbsd/android/include/arc4random.h create mode 100644 libc/upstream-openbsd/lib/libc/crypt/arc4random.c create mode 100644 libc/upstream-openbsd/lib/libc/crypt/arc4random_uniform.c diff --git a/libc/Android.mk b/libc/Android.mk index fd3da965a..0bdf1a552 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -37,7 +37,6 @@ endif # Define the common source files for all the libc instances # ========================================================= libc_common_src_files := \ - bionic/arc4random.c \ bionic/bindresvport.c \ bionic/daemon.c \ bionic/err.c \ @@ -124,6 +123,7 @@ libc_bionic_src_files := \ bionic/futimens.cpp \ bionic/getauxval.cpp \ bionic/getcwd.cpp \ + bionic/getentropy_linux.c \ bionic/getpgrp.cpp \ bionic/getpid.cpp \ bionic/gettid.cpp \ @@ -335,6 +335,8 @@ libc_upstream_openbsd_gdtoa_src_files_64 := \ upstream-openbsd/lib/libc/gdtoa/strtorQ.c \ libc_upstream_openbsd_src_files := \ + upstream-openbsd/lib/libc/crypt/arc4random.c \ + upstream-openbsd/lib/libc/crypt/arc4random_uniform.c \ upstream-openbsd/lib/libc/gen/alarm.c \ upstream-openbsd/lib/libc/gen/ctype_.c \ upstream-openbsd/lib/libc/gen/exec.c \ diff --git a/libc/bionic/arc4random.c b/libc/bionic/arc4random.c deleted file mode 100644 index 9bdf3417e..000000000 --- a/libc/bionic/arc4random.c +++ /dev/null @@ -1,288 +0,0 @@ -/* $OpenBSD: arc4random.c,v 1.33 2014/06/13 18:58:58 deraadt Exp $ */ - -/* - * Copyright (c) 1996, David Mazieres - * Copyright (c) 2008, Damien Miller - * Copyright (c) 2013, Markus Friedl - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * ChaCha based random number generator for OpenBSD. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(__ANDROID__) -#include -#include -#include "private/libc_logging.h" -#include "private/thread_private.h" - -#define explicit_bzero(p, s) memset(p, 0, s) - -#undef MAP_ANON -#define MAP_ANON (MAP_PRIVATE | MAP_ANONYMOUS) - -/* - * XXX Should be replaced with a proper entropy measure. - */ -static int -gotdata(u_char *buf, size_t len) -{ - char any_set = 0; - size_t i; - - for (i = 0; i < len; ++i) - any_set |= buf[i]; - if (any_set == 0) - return -1; - return 0; -} - -static int -getentropy/*_urandom*/(u_char *buf, size_t len) -{ - int save_errno = errno; - - int fd = TEMP_FAILURE_RETRY(open("/dev/urandom", O_RDONLY|O_CLOEXEC|O_NOFOLLOW, 0)); - if (fd == -1) { - __libc_fatal("getentropy_urandom failed to open \"/dev/urandom\": %s", - strerror(errno)); - } - - /* Lightly verify that the device node looks sane */ - struct stat st; - if (fstat(fd, &st) == -1 || !S_ISCHR(st.st_mode)) { - __libc_fatal("getentropy_urandom failed to fstat \"/dev/urandom\": %s", - strerror(errno)); - } - int cnt; - if (ioctl(fd, RNDGETENTCNT, &cnt) == -1) { - __libc_fatal("getentropy_urandom failed to ioctl \"/dev/urandom\": %s", - strerror(errno)); - } - for (size_t i = 0; i < len; ) { - size_t wanted = len - i; - ssize_t ret = TEMP_FAILURE_RETRY(read(fd, buf + i, wanted)); - - if (ret == -1) { - __libc_fatal("getentropy_urandom failed to read \"/dev/urandom\": %s", - strerror(errno)); - } - i += ret; - } - close(fd); - if (gotdata(buf, len) == -1) { - __libc_fatal("getentropy_urandom failed to get enough entropy: %s", - strerror(errno)); - } - - errno = save_errno; - return 0; -} -#endif /* __ANDROID__ */ - -#define KEYSTREAM_ONLY -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#include "../upstream-openbsd/lib/libc/crypt/chacha_private.h" -#pragma GCC diagnostic pop - -#ifdef __GNUC__ -#define inline __inline -#else /* !__GNUC__ */ -#define inline -#endif /* !__GNUC__ */ - -#define KEYSZ 32 -#define IVSZ 8 -#define BLOCKSZ 64 -#define RSBUFSZ (16*BLOCKSZ) -static int rs_initialized; -static pid_t rs_stir_pid; -static chacha_ctx *rs; /* chacha context for random keystream */ -static u_char *rs_buf; /* keystream blocks */ -static size_t rs_have; /* valid bytes at end of rs_buf */ -static size_t rs_count; /* bytes till reseed */ - -static inline void _rs_rekey(u_char *dat, size_t datlen); - -static inline void -_rs_init(u_char *buf, size_t n) -{ - if (n < KEYSZ + IVSZ) - return; - - if (rs == NULL && (rs = mmap(NULL, sizeof(*rs), PROT_READ|PROT_WRITE, - MAP_ANON, -1, 0)) == MAP_FAILED) - abort(); - if (rs_buf == NULL && (rs_buf = mmap(NULL, RSBUFSZ, PROT_READ|PROT_WRITE, - MAP_ANON, -1, 0)) == MAP_FAILED) - abort(); - - chacha_keysetup(rs, buf, KEYSZ * 8, 0); - chacha_ivsetup(rs, buf + KEYSZ); -} - -static void -_rs_stir(void) -{ - u_char rnd[KEYSZ + IVSZ]; - - /* XXX */ - (void) getentropy(rnd, sizeof rnd); - - if (!rs_initialized) { - rs_initialized = 1; - _rs_init(rnd, sizeof(rnd)); - } else - _rs_rekey(rnd, sizeof(rnd)); - explicit_bzero(rnd, sizeof(rnd)); - - /* invalidate rs_buf */ - rs_have = 0; - memset(rs_buf, 0, RSBUFSZ); - - rs_count = 1600000; -} - -static inline void -_rs_stir_if_needed(size_t len) -{ - pid_t pid = getpid(); - - if (rs_count <= len || !rs_initialized || rs_stir_pid != pid) { - rs_stir_pid = pid; - _rs_stir(); - } else - rs_count -= len; -} - -static inline void -_rs_rekey(u_char *dat, size_t datlen) -{ -#ifndef KEYSTREAM_ONLY - memset(rs_buf, 0,RSBUFSZ); -#endif - /* fill rs_buf with the keystream */ - chacha_encrypt_bytes(rs, rs_buf, rs_buf, RSBUFSZ); - /* mix in optional user provided data */ - if (dat) { - size_t i, m; - - m = MIN(datlen, KEYSZ + IVSZ); - for (i = 0; i < m; i++) - rs_buf[i] ^= dat[i]; - } - /* immediately reinit for backtracking resistance */ - _rs_init(rs_buf, KEYSZ + IVSZ); - memset(rs_buf, 0, KEYSZ + IVSZ); - rs_have = RSBUFSZ - KEYSZ - IVSZ; -} - -static inline void -_rs_random_buf(void *_buf, size_t n) -{ - u_char *buf = (u_char *)_buf; - size_t m; - - _rs_stir_if_needed(n); - while (n > 0) { - if (rs_have > 0) { - m = MIN(n, rs_have); - memcpy(buf, rs_buf + RSBUFSZ - rs_have, m); - memset(rs_buf + RSBUFSZ - rs_have, 0, m); - buf += m; - n -= m; - rs_have -= m; - } - if (rs_have == 0) - _rs_rekey(NULL, 0); - } -} - -static inline void -_rs_random_u32(u_int32_t *val) -{ - _rs_stir_if_needed(sizeof(*val)); - if (rs_have < sizeof(*val)) - _rs_rekey(NULL, 0); - memcpy(val, rs_buf + RSBUFSZ - rs_have, sizeof(*val)); - memset(rs_buf + RSBUFSZ - rs_have, 0, sizeof(*val)); - rs_have -= sizeof(*val); -} - -u_int32_t -arc4random(void) -{ - u_int32_t val; - - _ARC4_LOCK(); - _rs_random_u32(&val); - _ARC4_UNLOCK(); - return val; -} - -void -arc4random_buf(void *buf, size_t n) -{ - _ARC4_LOCK(); - _rs_random_buf(buf, n); - _ARC4_UNLOCK(); -} - -/* - * Calculate a uniformly distributed random number less than upper_bound - * avoiding "modulo bias". - * - * Uniformity is achieved by generating new random numbers until the one - * returned is outside the range [0, 2**32 % upper_bound). This - * guarantees the selected random number will be inside - * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound) - * after reduction modulo upper_bound. - */ -u_int32_t -arc4random_uniform(u_int32_t upper_bound) -{ - u_int32_t r, min; - - if (upper_bound < 2) - return 0; - - /* 2**32 % x == (2**32 - x) % x */ - min = -upper_bound % upper_bound; - - /* - * This could theoretically loop forever but each retry has - * p > 0.5 (worst case, usually far better) of selecting a - * number inside the range we need, so it should rarely need - * to re-roll. - */ - for (;;) { - r = arc4random(); - if (r >= min) - break; - } - - return r % upper_bound; -} diff --git a/libc/bionic/getentropy_linux.c b/libc/bionic/getentropy_linux.c new file mode 100644 index 000000000..409bd7d96 --- /dev/null +++ b/libc/bionic/getentropy_linux.c @@ -0,0 +1,565 @@ +/* $OpenBSD: getentropy_linux.c,v 1.28 2014/07/20 03:24:10 deraadt Exp $ */ + +/* + * Copyright (c) 2014 Theo de Raadt + * Copyright (c) 2014 Bob Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Emulation of getentropy(2) as documented at: + * http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2 + */ + +#define _POSIX_C_SOURCE 199309L +#define _GNU_SOURCE 1 +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_SYSCTL_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_OPENSSL +#include +#endif + +#include +#include +#ifdef HAVE_GETAUXVAL +#include +#endif +#include + +#define REPEAT 5 +#define min(a, b) (((a) < (b)) ? (a) : (b)) + +#define HX(a, b) \ + do { \ + if ((a)) \ + HD(errno); \ + else \ + HD(b); \ + } while (0) + +#define HR(x, l) (SHA512_Update(&ctx, (char *)(x), (l))) +#define HD(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (x))) +#define HF(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (void*))) + +int getentropy(void *buf, size_t len); + +static int gotdata(char *buf, size_t len); +#ifdef SYS__getrandom +static int getentropy_getrandom(void *buf, size_t len); +#endif +static int getentropy_urandom(void *buf, size_t len); +#ifdef SYS__sysctl +static int getentropy_sysctl(void *buf, size_t len); +#endif +#ifdef HAVE_OPENSSL +static int getentropy_fallback(void *buf, size_t len); +static int getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data); +#endif + +int +getentropy(void *buf, size_t len) +{ + int ret = -1; + + if (len > 256) { + errno = EIO; + return -1; + } + +#ifdef SYS__getrandom + /* + * Try descriptor-less getrandom() + */ + ret = getentropy_getrandom(buf, len); + if (ret != -1) + return (ret); +#endif + + /* + * Try to get entropy with /dev/urandom + * + * This can fail if the process is inside a chroot or if file + * descriptors are exhausted. + */ + ret = getentropy_urandom(buf, len); + if (ret != -1) + return (ret); + +#ifdef SYS__sysctl + /* + * Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID. + * sysctl is a failsafe API, so it guarantees a result. This + * should work inside a chroot, or when file descriptors are + * exhuasted. + * + * However this can fail if the Linux kernel removes support + * for sysctl. Starting in 2007, there have been efforts to + * deprecate the sysctl API/ABI, and push callers towards use + * of the chroot-unavailable fd-using /proc mechanism -- + * essentially the same problems as /dev/urandom. + * + * Numerous setbacks have been encountered in their deprecation + * schedule, so as of June 2014 the kernel ABI still exists on + * most Linux architectures. The sysctl() stub in libc is missing + * on some systems. There are also reports that some kernels + * spew messages to the console. + */ + ret = getentropy_sysctl(buf, len); + if (ret != -1) + return (ret); +#endif /* SYS__sysctl */ + + /* + * Entropy collection via /dev/urandom and sysctl have failed. + * + * No other API exists for collecting entropy. See the large + * comment block above. + * + * We have very few options: + * - Even syslog_r is unsafe to call at this low level, so + * there is no way to alert the user or program. + * - Cannot call abort() because some systems have unsafe + * corefiles. + * - Could raise(SIGKILL) resulting in silent program termination. + * - Return EIO, to hint that arc4random's stir function + * should raise(SIGKILL) + * - Do the best under the circumstances.... + * + * This code path exists to bring light to the issue that Linux + * does not provide a failsafe API for entropy collection. + * + * We hope this demonstrates that Linux should either retain their + * sysctl ABI, or consider providing a new failsafe API which + * works in a chroot or when file descriptors are exhausted. + */ +#undef FAIL_INSTEAD_OF_TRYING_FALLBACK +#ifdef FAIL_INSTEAD_OF_TRYING_FALLBACK + raise(SIGKILL); +#endif +#ifdef HAVE_OPENSSL + ret = getentropy_fallback(buf, len); + if (ret != -1) + return (ret); +#endif + + errno = EIO; + return (ret); +} + +/* + * Basic sanity checking; wish we could do better. + */ +static int +gotdata(char *buf, size_t len) +{ + char any_set = 0; + size_t i; + + for (i = 0; i < len; ++i) + any_set |= buf[i]; + if (any_set == 0) + return -1; + return 0; +} + +#ifdef SYS__getrandom +static int +getentropy_getrandom(void *buf, size_t len) +{ +#if 0 + +/* Hand-definitions until the API becomes commonplace */ +#ifndef SYS__getrandom +#ifdef __LP64__ +#define SYS__getrandom 317 +#else +#define SYS__getrandom 354 +#endif +#endif + struct __getrandom_args args = { + .buf = buf; + .len = len; + .flags = 0; + }; + + if (len > 256) + return (-1); + ret = syscall(SYS__getrandom, &args); + if (ret == len) + return (0); +#endif + return -1; +} +#endif + +static int +getentropy_urandom(void *buf, size_t len) +{ + struct stat st; + size_t i; + int fd, cnt, flags; + int save_errno = errno; + +start: + + flags = O_RDONLY; +#ifdef O_NOFOLLOW + flags |= O_NOFOLLOW; +#endif +#ifdef O_CLOEXEC + flags |= O_CLOEXEC; +#endif + fd = open("/dev/urandom", flags, 0); + if (fd == -1) { + if (errno == EINTR) + goto start; + goto nodevrandom; + } +#ifndef O_CLOEXEC + fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC); +#endif + + /* Lightly verify that the device node looks sane */ + if (fstat(fd, &st) == -1 || !S_ISCHR(st.st_mode)) { + close(fd); + goto nodevrandom; + } + if (ioctl(fd, RNDGETENTCNT, &cnt) == -1) { + close(fd); + goto nodevrandom; + } + for (i = 0; i < len; ) { + size_t wanted = len - i; + ssize_t ret = read(fd, (char *)buf + i, wanted); + + if (ret == -1) { + if (errno == EAGAIN || errno == EINTR) + continue; + close(fd); + goto nodevrandom; + } + i += ret; + } + close(fd); + if (gotdata(buf, len) == 0) { + errno = save_errno; + return 0; /* satisfied */ + } +nodevrandom: + errno = EIO; + return -1; +} + +#ifdef SYS__sysctl +static int +getentropy_sysctl(void *buf, size_t len) +{ + static int mib[] = { CTL_KERN, KERN_RANDOM, RANDOM_UUID }; + size_t i; + int save_errno = errno; + + for (i = 0; i < len; ) { + size_t chunk = min(len - i, 16); + + /* SYS__sysctl because some systems already removed sysctl() */ + struct __sysctl_args args = { + .name = mib, + .nlen = 3, + .oldval = (char*) buf + i, + .oldlenp = &chunk, + }; + if (syscall(SYS__sysctl, &args) != 0) + goto sysctlfailed; + i += chunk; + } + if (gotdata(buf, len) == 0) { + errno = save_errno; + return (0); /* satisfied */ + } +sysctlfailed: + errno = EIO; + return -1; +} +#endif /* SYS__sysctl */ + +#ifdef HAVE_OPENSSL + +static int cl[] = { + CLOCK_REALTIME, +#ifdef CLOCK_MONOTONIC + CLOCK_MONOTONIC, +#endif +#ifdef CLOCK_MONOTONIC_RAW + CLOCK_MONOTONIC_RAW, +#endif +#ifdef CLOCK_TAI + CLOCK_TAI, +#endif +#ifdef CLOCK_VIRTUAL + CLOCK_VIRTUAL, +#endif +#ifdef CLOCK_UPTIME + CLOCK_UPTIME, +#endif +#ifdef CLOCK_PROCESS_CPUTIME_ID + CLOCK_PROCESS_CPUTIME_ID, +#endif +#ifdef CLOCK_THREAD_CPUTIME_ID + CLOCK_THREAD_CPUTIME_ID, +#endif +}; + +static int +getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data) +{ + SHA512_CTX *ctx = data; + + SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr)); + return 0; +} + +static int +getentropy_fallback(void *buf, size_t len) +{ + uint8_t results[SHA512_DIGEST_LENGTH]; + int save_errno = errno, e, pgs = getpagesize(), faster = 0, repeat; + static int cnt; + struct timespec ts; + struct timeval tv; + struct rusage ru; + sigset_t sigset; + struct stat st; + SHA512_CTX ctx; + static pid_t lastpid; + pid_t pid; + size_t i, ii, m; + char *p; + + pid = getpid(); + if (lastpid == pid) { + faster = 1; + repeat = 2; + } else { + faster = 0; + lastpid = pid; + repeat = REPEAT; + } + for (i = 0; i < len; ) { + int j; + SHA512_Init(&ctx); + for (j = 0; j < repeat; j++) { + HX((e = gettimeofday(&tv, NULL)) == -1, tv); + if (e != -1) { + cnt += (int)tv.tv_sec; + cnt += (int)tv.tv_usec; + } + + dl_iterate_phdr(getentropy_phdr, &ctx); + + for (ii = 0; ii < sizeof(cl)/sizeof(cl[0]); ii++) + HX(clock_gettime(cl[ii], &ts) == -1, ts); + + HX((pid = getpid()) == -1, pid); + HX((pid = getsid(pid)) == -1, pid); + HX((pid = getppid()) == -1, pid); + HX((pid = getpgid(0)) == -1, pid); + HX((e = getpriority(0, 0)) == -1, e); + + if (!faster) { + ts.tv_sec = 0; + ts.tv_nsec = 1; + (void) nanosleep(&ts, NULL); + } + + HX(sigpending(&sigset) == -1, sigset); + HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1, + sigset); + + HF(getentropy); /* an addr in this library */ + HF(printf); /* an addr in libc */ + p = (char *)&p; + HD(p); /* an addr on stack */ + p = (char *)&errno; + HD(p); /* the addr of errno */ + + if (i == 0) { + struct sockaddr_storage ss; + struct statvfs stvfs; + struct termios tios; + struct statfs stfs; + socklen_t ssl; + off_t off; + + /* + * Prime-sized mappings encourage fragmentation; + * thus exposing some address entropy. + */ + struct mm { + size_t npg; + void *p; + } mm[] = { + { 17, MAP_FAILED }, { 3, MAP_FAILED }, + { 11, MAP_FAILED }, { 2, MAP_FAILED }, + { 5, MAP_FAILED }, { 3, MAP_FAILED }, + { 7, MAP_FAILED }, { 1, MAP_FAILED }, + { 57, MAP_FAILED }, { 3, MAP_FAILED }, + { 131, MAP_FAILED }, { 1, MAP_FAILED }, + }; + + for (m = 0; m < sizeof mm/sizeof(mm[0]); m++) { + HX(mm[m].p = mmap(NULL, + mm[m].npg * pgs, + PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANON, -1, + (off_t)0), mm[m].p); + if (mm[m].p != MAP_FAILED) { + size_t mo; + + /* Touch some memory... */ + p = mm[m].p; + mo = cnt % + (mm[m].npg * pgs - 1); + p[mo] = 1; + cnt += (int)((long)(mm[m].p) + / pgs); + } + + /* Check cnts and times... */ + for (ii = 0; ii < sizeof(cl)/sizeof(cl[0]); + ii++) { + HX((e = clock_gettime(cl[ii], + &ts)) == -1, ts); + if (e != -1) + cnt += (int)ts.tv_nsec; + } + + HX((e = getrusage(RUSAGE_SELF, + &ru)) == -1, ru); + if (e != -1) { + cnt += (int)ru.ru_utime.tv_sec; + cnt += (int)ru.ru_utime.tv_usec; + } + } + + for (m = 0; m < sizeof mm/sizeof(mm[0]); m++) { + if (mm[m].p != MAP_FAILED) + munmap(mm[m].p, mm[m].npg * pgs); + mm[m].p = MAP_FAILED; + } + + HX(stat(".", &st) == -1, st); + HX(statvfs(".", &stvfs) == -1, stvfs); + HX(statfs(".", &stfs) == -1, stfs); + + HX(stat("/", &st) == -1, st); + HX(statvfs("/", &stvfs) == -1, stvfs); + HX(statfs("/", &stfs) == -1, stfs); + + HX((e = fstat(0, &st)) == -1, st); + if (e == -1) { + if (S_ISREG(st.st_mode) || + S_ISFIFO(st.st_mode) || + S_ISSOCK(st.st_mode)) { + HX(fstatvfs(0, &stvfs) == -1, + stvfs); + HX(fstatfs(0, &stfs) == -1, + stfs); + HX((off = lseek(0, (off_t)0, + SEEK_CUR)) < 0, off); + } + if (S_ISCHR(st.st_mode)) { + HX(tcgetattr(0, &tios) == -1, + tios); + } else if (S_ISSOCK(st.st_mode)) { + memset(&ss, 0, sizeof ss); + ssl = sizeof(ss); + HX(getpeername(0, + (void *)&ss, &ssl) == -1, + ss); + } + } + + HX((e = getrusage(RUSAGE_CHILDREN, + &ru)) == -1, ru); + if (e != -1) { + cnt += (int)ru.ru_utime.tv_sec; + cnt += (int)ru.ru_utime.tv_usec; + } + } else { + /* Subsequent hashes absorb previous result */ + HD(results); + } + + HX((e = gettimeofday(&tv, NULL)) == -1, tv); + if (e != -1) { + cnt += (int)tv.tv_sec; + cnt += (int)tv.tv_usec; + } + + HD(cnt); + } +#ifdef HAVE_GETAUXVAL +#ifdef AT_RANDOM + /* Not as random as you think but we take what we are given */ + p = (char *) getauxval(AT_RANDOM); + if (p) + HR(p, 16); +#endif +#ifdef AT_SYSINFO_EHDR + p = (char *) getauxval(AT_SYSINFO_EHDR); + if (p) + HR(p, pgs); +#endif +#ifdef AT_BASE + p = (char *) getauxval(AT_BASE); + if (p) + HD(p); +#endif +#endif + + SHA512_Final(results, &ctx); + memcpy((char *)buf + i, results, min(sizeof(results), len - i)); + i += min(sizeof(results), len - i); + } + memset(results, 0, sizeof results); + if (gotdata(buf, len) == 0) { + errno = save_errno; + return 0; /* satisfied */ + } + errno = EIO; + return -1; +} + +#endif /* HAVE_OPENSSL */ diff --git a/libc/private/thread_private.h b/libc/private/thread_private.h index b8b1a815e..2e3ac3d97 100644 --- a/libc/private/thread_private.h +++ b/libc/private/thread_private.h @@ -46,8 +46,9 @@ __LIBC_HIDDEN__ void _thread_atexit_unlock(void); __LIBC_HIDDEN__ void _thread_arc4_lock(void); __LIBC_HIDDEN__ void _thread_arc4_unlock(void); -#define _ARC4_LOCK() _thread_arc4_lock() -#define _ARC4_UNLOCK() _thread_arc4_unlock() +#define _ARC4_LOCK() _thread_arc4_lock() +#define _ARC4_UNLOCK() _thread_arc4_unlock() +#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) __END_DECLS diff --git a/libc/upstream-openbsd/android/include/arc4random.h b/libc/upstream-openbsd/android/include/arc4random.h new file mode 100644 index 000000000..c07257d24 --- /dev/null +++ b/libc/upstream-openbsd/android/include/arc4random.h @@ -0,0 +1,87 @@ +/* $OpenBSD: arc4random_linux.h,v 1.7 2014/07/20 20:51:13 bcook Exp $ */ + +/* + * Copyright (c) 1996, David Mazieres + * Copyright (c) 2008, Damien Miller + * Copyright (c) 2013, Markus Friedl + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * Stub functions for portability. + */ + +#include + +#include +#include + +// Android gets these from "thread_private.h". +#include "thread_private.h" +//static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; +//#define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) +//#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) + +#ifdef __GLIBC__ +extern void *__dso_handle; +extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void *); +#define _ARC4_ATFORK(f) __register_atfork(NULL, NULL, (f), __dso_handle) +#else +#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) +#endif + +static inline void +_getentropy_fail(void) +{ + raise(SIGKILL); +} + +static volatile sig_atomic_t _rs_forked; + +static inline void +_rs_forkhandler(void) +{ + _rs_forked = 1; +} + +static inline void +_rs_forkdetect(void) +{ + static pid_t _rs_pid = 0; + pid_t pid = getpid(); + + if (_rs_pid == 0 || _rs_pid != pid || _rs_forked) { + _rs_pid = pid; + _rs_forked = 0; + if (rs) + memset(rs, 0, sizeof(*rs)); + } +} + +static inline int +_rs_allocate(struct _rs **rsp, struct _rsx **rsxp) +{ + if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE, + MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) + return (-1); + + if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE, + MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) { + munmap(*rsxp, sizeof(**rsxp)); + return (-1); + } + + _ARC4_ATFORK(_rs_forkhandler); + return (0); +} diff --git a/libc/upstream-openbsd/android/include/openbsd-compat.h b/libc/upstream-openbsd/android/include/openbsd-compat.h index 5827a82dd..34ad2c5c8 100644 --- a/libc/upstream-openbsd/android/include/openbsd-compat.h +++ b/libc/upstream-openbsd/android/include/openbsd-compat.h @@ -18,6 +18,7 @@ #define _BIONIC_OPENBSD_COMPAT_H_included #include +#include // For size_t. #define __USE_BSD @@ -36,6 +37,11 @@ /* OpenBSD has this, but we can't really implement it correctly on Linux. */ #define issetugid() 0 +#define explicit_bzero(p, s) memset(p, 0, s) + +/* We have OpenBSD's getentropy_linux.c, but we don't mention getentropy in any header. */ +__LIBC_HIDDEN__ extern int getentropy(void*, size_t); + /* LP32 NDK ctype.h contained references to these. */ __LIBC64_HIDDEN__ extern const short* _tolower_tab_; __LIBC64_HIDDEN__ extern const short* _toupper_tab_; diff --git a/libc/upstream-openbsd/lib/libc/crypt/arc4random.c b/libc/upstream-openbsd/lib/libc/crypt/arc4random.c new file mode 100644 index 000000000..64248b6ac --- /dev/null +++ b/libc/upstream-openbsd/lib/libc/crypt/arc4random.c @@ -0,0 +1,195 @@ +/* $OpenBSD: arc4random.c,v 1.50 2014/07/21 18:13:12 deraadt Exp $ */ + +/* + * Copyright (c) 1996, David Mazieres + * Copyright (c) 2008, Damien Miller + * Copyright (c) 2013, Markus Friedl + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * ChaCha based random number generator for OpenBSD. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define KEYSTREAM_ONLY +#include "chacha_private.h" + +#define min(a, b) ((a) < (b) ? (a) : (b)) +#ifdef __GNUC__ +#define inline __inline +#else /* !__GNUC__ */ +#define inline +#endif /* !__GNUC__ */ + +#define KEYSZ 32 +#define IVSZ 8 +#define BLOCKSZ 64 +#define RSBUFSZ (16*BLOCKSZ) + +/* Marked MAP_INHERIT_ZERO, so zero'd out in fork children. */ +static struct _rs { + size_t rs_have; /* valid bytes at end of rs_buf */ + size_t rs_count; /* bytes till reseed */ +} *rs; + +/* Maybe be preserved in fork children, if _rs_allocate() decides. */ +static struct _rsx { + chacha_ctx rs_chacha; /* chacha context for random keystream */ + u_char rs_buf[RSBUFSZ]; /* keystream blocks */ +} *rsx; + +static inline int _rs_allocate(struct _rs **, struct _rsx **); +static inline void _rs_forkdetect(void); +#include "arc4random.h" + +static inline void _rs_rekey(u_char *dat, size_t datlen); + +static inline void +_rs_init(u_char *buf, size_t n) +{ + if (n < KEYSZ + IVSZ) + return; + + if (rs == NULL) { + if (_rs_allocate(&rs, &rsx) == -1) + abort(); + } + + chacha_keysetup(&rsx->rs_chacha, buf, KEYSZ * 8, 0); + chacha_ivsetup(&rsx->rs_chacha, buf + KEYSZ); +} + +static void +_rs_stir(void) +{ + u_char rnd[KEYSZ + IVSZ]; + + if (getentropy(rnd, sizeof rnd) == -1) + _getentropy_fail(); + + if (!rs) + _rs_init(rnd, sizeof(rnd)); + else + _rs_rekey(rnd, sizeof(rnd)); + explicit_bzero(rnd, sizeof(rnd)); /* discard source seed */ + + /* invalidate rs_buf */ + rs->rs_have = 0; + memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf)); + + rs->rs_count = 1600000; +} + +static inline void +_rs_stir_if_needed(size_t len) +{ + _rs_forkdetect(); + if (!rs || rs->rs_count <= len) + _rs_stir(); + if (rs->rs_count <= len) + rs->rs_count = 0; + else + rs->rs_count -= len; +} + +static inline void +_rs_rekey(u_char *dat, size_t datlen) +{ +#ifndef KEYSTREAM_ONLY + memset(rsx->rs_buf, 0, sizeof(rsx->rs_buf)); +#endif + /* fill rs_buf with the keystream */ + chacha_encrypt_bytes(&rsx->rs_chacha, rsx->rs_buf, + rsx->rs_buf, sizeof(rsx->rs_buf)); + /* mix in optional user provided data */ + if (dat) { + size_t i, m; + + m = min(datlen, KEYSZ + IVSZ); + for (i = 0; i < m; i++) + rsx->rs_buf[i] ^= dat[i]; + } + /* immediately reinit for backtracking resistance */ + _rs_init(rsx->rs_buf, KEYSZ + IVSZ); + memset(rsx->rs_buf, 0, KEYSZ + IVSZ); + rs->rs_have = sizeof(rsx->rs_buf) - KEYSZ - IVSZ; +} + +static inline void +_rs_random_buf(void *_buf, size_t n) +{ + u_char *buf = (u_char *)_buf; + u_char *keystream; + size_t m; + + _rs_stir_if_needed(n); + while (n > 0) { + if (rs->rs_have > 0) { + m = min(n, rs->rs_have); + keystream = rsx->rs_buf + sizeof(rsx->rs_buf) + - rs->rs_have; + memcpy(buf, keystream, m); + memset(keystream, 0, m); + buf += m; + n -= m; + rs->rs_have -= m; + } + if (rs->rs_have == 0) + _rs_rekey(NULL, 0); + } +} + +static inline void +_rs_random_u32(uint32_t *val) +{ + u_char *keystream; + + _rs_stir_if_needed(sizeof(*val)); + if (rs->rs_have < sizeof(*val)) + _rs_rekey(NULL, 0); + keystream = rsx->rs_buf + sizeof(rsx->rs_buf) - rs->rs_have; + memcpy(val, keystream, sizeof(*val)); + memset(keystream, 0, sizeof(*val)); + rs->rs_have -= sizeof(*val); +} + +uint32_t +arc4random(void) +{ + uint32_t val; + + _ARC4_LOCK(); + _rs_random_u32(&val); + _ARC4_UNLOCK(); + return val; +} + +void +arc4random_buf(void *buf, size_t n) +{ + _ARC4_LOCK(); + _rs_random_buf(buf, n); + _ARC4_UNLOCK(); +} diff --git a/libc/upstream-openbsd/lib/libc/crypt/arc4random_uniform.c b/libc/upstream-openbsd/lib/libc/crypt/arc4random_uniform.c new file mode 100644 index 000000000..1aa9a622f --- /dev/null +++ b/libc/upstream-openbsd/lib/libc/crypt/arc4random_uniform.c @@ -0,0 +1,56 @@ +/* $OpenBSD: arc4random_uniform.c,v 1.1 2014/07/12 13:24:54 deraadt Exp $ */ + +/* + * Copyright (c) 2008, Damien Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +/* + * Calculate a uniformly distributed random number less than upper_bound + * avoiding "modulo bias". + * + * Uniformity is achieved by generating new random numbers until the one + * returned is outside the range [0, 2**32 % upper_bound). This + * guarantees the selected random number will be inside + * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound) + * after reduction modulo upper_bound. + */ +uint32_t +arc4random_uniform(uint32_t upper_bound) +{ + uint32_t r, min; + + if (upper_bound < 2) + return 0; + + /* 2**32 % x == (2**32 - x) % x */ + min = -upper_bound % upper_bound; + + /* + * This could theoretically loop forever but each retry has + * p > 0.5 (worst case, usually far better) of selecting a + * number inside the range we need, so it should rarely need + * to re-roll. + */ + for (;;) { + r = arc4random(); + if (r >= min) + break; + } + + return r % upper_bound; +} From 2582f02a01cd56c56a4e6c9de4444a6ec937cc37 Mon Sep 17 00:00:00 2001 From: Sreeram Ramachandran Date: Sun, 20 Jul 2014 14:10:45 -0700 Subject: [PATCH 048/148] Cleanup: Delete dead code. Bug: 15413389 Change-Id: I315468832ef18ffc84174e54774ab63b86d284dc --- libc/dns/gethnamaddr.c | 4 ++-- libc/dns/include/resolv_netid.h | 5 +---- libc/dns/resolv/res_cache.c | 11 ----------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/libc/dns/gethnamaddr.c b/libc/dns/gethnamaddr.c index 80fdcbee1..1d847b834 100644 --- a/libc/dns/gethnamaddr.c +++ b/libc/dns/gethnamaddr.c @@ -565,7 +565,7 @@ android_read_hostent(FILE* proxy) char buf[4]; if (fread(buf, 1, sizeof(buf), proxy) != sizeof(buf)) return NULL; - /* This is reading serialized data from system/netd/DnsProxyListener.cpp + /* This is reading serialized data from system/netd/server/DnsProxyListener.cpp * and changes here need to be matched there */ int result_code = strtol(buf, NULL, 10); if (result_code != DnsProxyQueryResult) { @@ -763,7 +763,7 @@ gethostbyname_internal(const char *name, int af, res_state res, unsigned netid, netid = __netdClientDispatch.netIdForResolv(netid); - /* This is writing to system/netd/DnsProxyListener.cpp and changes + /* This is writing to system/netd/server/DnsProxyListener.cpp and changes * here need to be matched there */ if (fprintf(proxy, "gethostbyname %u %s %d", netid, diff --git a/libc/dns/include/resolv_netid.h b/libc/dns/include/resolv_netid.h index d4668c3dc..f1b88920e 100644 --- a/libc/dns/include/resolv_netid.h +++ b/libc/dns/include/resolv_netid.h @@ -36,7 +36,7 @@ #include /* - * Passing NETID_UNSET as the netId causes system/netd/DnsProxyListener.cpp to + * Passing NETID_UNSET as the netId causes system/netd/server/DnsProxyListener.cpp to * fill in the appropriate default netId for the query. */ #define NETID_UNSET 0u @@ -61,9 +61,6 @@ int android_getaddrinfofornet(const char *, const char *, const struct addrinfo extern void _resolv_set_nameservers_for_net(unsigned netid, const char** servers, int numservers, const char *domains) __used_in_netd; -/* flush the cache associated with a certain network */ -extern void _resolv_flush_cache_for_net(unsigned netid) __used_in_netd; - /* delete the cache associated with a certain network */ extern void _resolv_delete_cache_for_net(unsigned netid) __used_in_netd; diff --git a/libc/dns/resolv/res_cache.c b/libc/dns/resolv/res_cache.c index 419b748d4..c934b4ee6 100644 --- a/libc/dns/resolv/res_cache.c +++ b/libc/dns/resolv/res_cache.c @@ -1831,17 +1831,6 @@ _get_res_cache_for_net_locked(unsigned netid) return cache; } -void -_resolv_flush_cache_for_net(unsigned netid) -{ - pthread_once(&_res_cache_once, _res_cache_init); - pthread_mutex_lock(&_res_cache_list_lock); - - _flush_cache_for_net_locked(netid); - - pthread_mutex_unlock(&_res_cache_list_lock); -} - static void _flush_cache_for_net_locked(unsigned netid) { From 5d7775c6dfa8f9b2ae313c9493525d54a2d04b38 Mon Sep 17 00:00:00 2001 From: Duane Sand Date: Wed, 16 Jul 2014 12:29:34 -0700 Subject: [PATCH 049/148] [MIPS] Allow united mipsel and mips64el gcc toolchain Explicitly tell 32-bit links that they are doing 32-bit links. This is needed when using united 32-bit and 64-bit toolchains. This is harmless when using older separate 32-only toolchains. (cherry picked from commit f541650828f75b3dab22c9c0caab845be78b80fc) Change-Id: I8df0ee7d36c6409458e18bea4e0e8b132edf77dc --- libc/arch-mips/mips.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libc/arch-mips/mips.mk b/libc/arch-mips/mips.mk index 0a3718bc4..5705c8a95 100644 --- a/libc/arch-mips/mips.mk +++ b/libc/arch-mips/mips.mk @@ -83,3 +83,6 @@ libc_crt_target_crtbegin_so_file_mips := \ libc_crt_target_so_cflags_mips := \ -fPIC + +libc_crt_target_ldflags_mips := \ + -melf32ltsmip From 3ff6d95a9b26154c94b5cf130649cf99eb6a4010 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 22 Jul 2014 20:21:31 -0700 Subject: [PATCH 050/148] Remove the unused swab.S. (cherry picked from commit ca70453e84a88405d30f64d603f9a9b5f53f1243) Change-Id: I4dc13de0bdeb7abb3bd47b0397546ad7d1f11d49 --- libc/arch-x86/generic/string/swab.S | 68 ----------------------------- 1 file changed, 68 deletions(-) delete mode 100644 libc/arch-x86/generic/string/swab.S diff --git a/libc/arch-x86/generic/string/swab.S b/libc/arch-x86/generic/string/swab.S deleted file mode 100644 index b44d13413..000000000 --- a/libc/arch-x86/generic/string/swab.S +++ /dev/null @@ -1,68 +0,0 @@ -/* $OpenBSD: swab.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */ -/* - * Written by J.T. Conklin . - * Public domain. - */ - -#include - -/* - * On the i486, this code is negligibly faster than the code generated - * by gcc at about half the size. If my i386 databook is correct, it - * should be considerably faster than the gcc code on a i386. - */ - -ENTRY(swab) - pushl %esi - pushl %edi - movl 12(%esp),%esi - movl 16(%esp),%edi - movl 20(%esp),%ecx - - cld # set direction forward - - shrl $1,%ecx - testl $7,%ecx # copy first group of 1 to 7 words - jz L2 # while swaping alternate bytes. - .align 2,0x90 -L1: lodsw - rorw $8,%ax - stosw - decl %ecx - testl $7,%ecx - jnz L1 - -L2: shrl $3,%ecx # copy remainder 8 words at a time - jz L4 # while swapping alternate bytes. - .align 2,0x90 -L3: lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - decl %ecx - jnz L3 - -L4: popl %edi - popl %esi - ret -END(swab) From 4ac83fad3cdc486c00199eef9ea2a95d354839c4 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 22 Jul 2014 21:24:47 -0700 Subject: [PATCH 051/148] Fix a couple of bugs in generate-NOTICE and regenerate the NOTICE files. (cherry picked from commit 3758a244cf758046b40f630a11aed41e68c9cfc2) Change-Id: I6ffb83b4a7b7746b095205c664cf025a72ead179 --- libc/NOTICE | 317 +++++++++++++++++----------------- libc/tools/generate-NOTICE.py | 4 +- libstdc++/NOTICE | 8 +- linker/NOTICE | 24 +-- 4 files changed, 181 insertions(+), 172 deletions(-) diff --git a/libc/NOTICE b/libc/NOTICE index afbaecf97..7f0195f6a 100644 --- a/libc/NOTICE +++ b/libc/NOTICE @@ -3,12 +3,12 @@ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Linaro nor the + * Neither the name of the Linaro nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -34,12 +34,12 @@ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the company nor the names of its contributors + * Neither the name of the company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -184,9 +184,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -228,9 +228,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -257,9 +257,9 @@ Copyright (c) 2013-2014, NVIDIA Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -285,9 +285,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -329,9 +329,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -373,9 +373,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -448,9 +448,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -492,9 +492,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -536,9 +536,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -565,9 +565,9 @@ Copyright (c) 2013-2014 NVIDIA Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -594,9 +594,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -638,9 +638,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -804,35 +804,6 @@ SUCH DAMAGE. ------------------------------------------------------------------- -Copyright (c) 1983, 1988, 1993 - The Regents of the University of California. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - Copyright (c) 1983, 1989 The Regents of the University of California. All rights reserved. @@ -3164,35 +3135,6 @@ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ------------------------------------------------------------------- -Copyright (c) 1999 The NetBSD Foundation, Inc. -All rights reserved. - -This code is derived from software contributed to The NetBSD Foundation -by Michael Graff. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------- - Copyright (c) 2000 Ben Harris. Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. All rights reserved. @@ -4132,6 +4074,22 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ------------------------------------------------------------------- +Copyright (c) 2008, Damien Miller + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +------------------------------------------------------------------- + Copyright (c) 2009 MIPS Technologies, Inc., California. @@ -4253,13 +4211,13 @@ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of MIPS Technologies Inc. nor the names of its + * Neither the name of MIPS Technologies Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -4299,16 +4257,16 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. - Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -4329,16 +4287,16 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. - Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -4412,16 +4370,16 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. - Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -4471,16 +4429,16 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. - Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -4501,16 +4459,16 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. - Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -4530,12 +4488,12 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the VMware, Inc. nor the names of its contributors + * Neither the name of the VMware, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -4557,12 +4515,12 @@ Copyright (c) 2012, Linaro Limited Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Linaro nor the + * Neither the name of the Linaro nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -4586,12 +4544,12 @@ Copyright (c) 2012, Linaro Limited Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Linaro nor the + * Neither the name of the Linaro nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -4660,14 +4618,14 @@ Copyright (c) 2013, Linaro Limited modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Linaro Limited nor the names of its + * Neither the name of Linaro Limited nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -4685,22 +4643,42 @@ Copyright (c) 2013, Linaro Limited ------------------------------------------------------------------- +Copyright (c) 2014 Theo de Raadt +Copyright (c) 2014 Bob Beck + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Emulation of getentropy(2) as documented at: +http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2 + +------------------------------------------------------------------- + Copyright (c) 2014, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. - Neither the name of Intel Corporation nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. + * Neither the name of Intel Corporation nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -4720,12 +4698,12 @@ Copyright (c) 2014, Linaro Limited Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Linaro nor the + * Neither the name of the Linaro nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -5149,3 +5127,34 @@ THIS SOFTWARE. ------------------------------------------------------------------- +memchr - find a character in a memory zone + +Copyright (c) 2014, ARM Limited +All rights Reserved. +Copyright (c) 2014, Linaro Ltd. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the company nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------- + diff --git a/libc/tools/generate-NOTICE.py b/libc/tools/generate-NOTICE.py index 6d4c761f5..4c9e92784 100755 --- a/libc/tools/generate-NOTICE.py +++ b/libc/tools/generate-NOTICE.py @@ -77,7 +77,7 @@ def ExtractCopyrightAt(lines, i): for line in lines[start:end]: line = line.replace("\t", " ") line = line.replace("/* ", "") - line = line.replace(" * ", "") + line = re.sub("^ \* ", "", line) line = line.replace("** ", "") line = line.replace("# ", "") if line.startswith("++Copyright++"): @@ -144,7 +144,7 @@ for arg in args: i = 0 while i < len(lines): - if "Copyright" in lines[i]: + if "Copyright" in lines[i] and not "__COPYRIGHT" in lines[i]: i = ExtractCopyrightAt(lines, i) i += 1 diff --git a/libstdc++/NOTICE b/libstdc++/NOTICE index 59d610681..492770d4f 100644 --- a/libstdc++/NOTICE +++ b/libstdc++/NOTICE @@ -4,9 +4,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -32,9 +32,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. diff --git a/linker/NOTICE b/linker/NOTICE index db4ec7b4f..cb3a1dded 100644 --- a/linker/NOTICE +++ b/linker/NOTICE @@ -20,9 +20,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -48,9 +48,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -76,9 +76,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -104,9 +104,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -132,9 +132,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. @@ -176,9 +176,9 @@ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. From 2aa142ffb20337e60f81642bed1c11d24a3756b1 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 23 Jul 2014 11:10:48 -0700 Subject: [PATCH 052/148] Fix generate-NOTICE to cope better with BSD __COPYRIGHT macros. (cherry picked from commit 5d2f86f36341b76f84770d8966d7686a59555ae9) Change-Id: Iddf22c8d9ff7a4d1205d37bb58c6235af681d795 --- libc/tools/generate-NOTICE.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/tools/generate-NOTICE.py b/libc/tools/generate-NOTICE.py index 4c9e92784..8cd75a3b7 100755 --- a/libc/tools/generate-NOTICE.py +++ b/libc/tools/generate-NOTICE.py @@ -144,7 +144,7 @@ for arg in args: i = 0 while i < len(lines): - if "Copyright" in lines[i] and not "__COPYRIGHT" in lines[i]: + if "Copyright" in lines[i] and not "@(#) Copyright" in lines[i]: i = ExtractCopyrightAt(lines, i) i += 1 From 4126c129613e27717c110626070c44ea7e3f29ce Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 23 Jul 2014 11:38:38 -0700 Subject: [PATCH 053/148] Fix belated review comments on syslog change. Bug: 14292866 (cherry picked from commit afe6360627ef3f0e9bc8f45535fbfae3354f3ae0) Change-Id: I8e3cc6b37b2539e51a27261ffb5d6e58266ce11d --- libc/bionic/libc_logging.cpp | 3 +- libc/bionic/syslog.cpp | 6 +-- libc/include/syslog.h | 77 +++++++++++++++++++----------------- 3 files changed, 45 insertions(+), 41 deletions(-) diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp index 88d979091..cdbf7236c 100644 --- a/libc/bionic/libc_logging.cpp +++ b/libc/bionic/libc_logging.cpp @@ -230,6 +230,7 @@ static void SendRepeat(Out& o, char ch, int count) { /* Perform formatted output to an output target 'o' */ template static void out_vformat(Out& o, const char* format, va_list args) { + int caller_errno = errno; int nn = 0; for (;;) { @@ -380,7 +381,7 @@ static void out_vformat(Out& o, const char* format, va_list args) { buffer[1] = '\0'; } else if (c == 'm') { // syslog-like %m for strerror(errno). - str = strerror(errno); + str = strerror(caller_errno); } else { __assert(__FILE__, __LINE__, "conversion specifier unsupported"); } diff --git a/libc/bionic/syslog.cpp b/libc/bionic/syslog.cpp index 7e153eb16..29f892a20 100644 --- a/libc/bionic/syslog.cpp +++ b/libc/bionic/syslog.cpp @@ -14,9 +14,8 @@ * limitations under the License. */ -#include - #include +#include #include "private/libc_logging.h" @@ -24,6 +23,7 @@ static const char* syslog_log_tag = NULL; static int syslog_priority_mask = 0xff; void closelog() { + syslog_log_tag = NULL; } void openlog(const char* log_tag, int /*options*/, int /*facility*/) { @@ -61,7 +61,7 @@ void vsyslog(int priority, const char* fmt, va_list args) { // What's our Android log priority? priority &= LOG_PRIMASK; int android_log_priority; - if (priority < LOG_ERR) { + if (priority <= LOG_ERR) { android_log_priority = ANDROID_LOG_ERROR; } else if (priority == LOG_WARNING) { android_log_priority = ANDROID_LOG_WARN; diff --git a/libc/include/syslog.h b/libc/include/syslog.h index f396feca7..cbceab287 100644 --- a/libc/include/syslog.h +++ b/libc/include/syslog.h @@ -35,45 +35,48 @@ __BEGIN_DECLS -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 +/* Priorities are translated to Android log priorities as shown. */ +#define LOG_EMERG 0 /* ERROR */ +#define LOG_ALERT 1 /* ERROR */ +#define LOG_CRIT 2 /* ERROR */ +#define LOG_ERR 3 /* ERROR */ +#define LOG_WARNING 4 /* WARN */ +#define LOG_NOTICE 5 /* INFO */ +#define LOG_INFO 6 /* INFO */ +#define LOG_DEBUG 7 /* DEBUG */ -#define LOG_PRIMASK 7 -#define LOG_PRI(x) ((x) & LOG_PRIMASK) +#define LOG_PRIMASK 7 +#define LOG_PRI(x) ((x) & LOG_PRIMASK) -#define LOG_KERN 0000 -#define LOG_USER 0010 -#define LOG_MAIL 0020 -#define LOG_DAEMON 0030 -#define LOG_AUTH 0040 -#define LOG_SYSLOG 0050 -#define LOG_LPR 0060 -#define LOG_NEWS 0070 -#define LOG_UUCP 0100 -#define LOG_CRON 0110 -#define LOG_AUTHPRIV 0120 -#define LOG_FTP 0130 -#define LOG_LOCAL0 0200 -#define LOG_LOCAL1 0210 -#define LOG_LOCAL2 0220 -#define LOG_LOCAL3 0230 -#define LOG_LOCAL4 0240 -#define LOG_LOCAL5 0250 -#define LOG_LOCAL6 0260 -#define LOG_LOCAL7 0270 +/* Facilities are currently ignored on Android. */ +#define LOG_KERN 0000 +#define LOG_USER 0010 +#define LOG_MAIL 0020 +#define LOG_DAEMON 0030 +#define LOG_AUTH 0040 +#define LOG_SYSLOG 0050 +#define LOG_LPR 0060 +#define LOG_NEWS 0070 +#define LOG_UUCP 0100 +#define LOG_CRON 0110 +#define LOG_AUTHPRIV 0120 +#define LOG_FTP 0130 +#define LOG_LOCAL0 0200 +#define LOG_LOCAL1 0210 +#define LOG_LOCAL2 0220 +#define LOG_LOCAL3 0230 +#define LOG_LOCAL4 0240 +#define LOG_LOCAL5 0250 +#define LOG_LOCAL6 0260 +#define LOG_LOCAL7 0270 -#define LOG_FACMASK 01770 -#define LOG_FAC(x) (((x) >> 3) & (LOG_FACMASK >> 3)) +#define LOG_FACMASK 01770 +#define LOG_FAC(x) (((x) >> 3) & (LOG_FACMASK >> 3)) #define LOG_MASK(pri) (1 << (pri)) #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) +/* openlog(3) flags are currently ignored on Android. */ #define LOG_PID 0x01 #define LOG_CONS 0x02 #define LOG_ODELAY 0x04 @@ -81,11 +84,11 @@ __BEGIN_DECLS #define LOG_NOWAIT 0x10 #define LOG_PERROR 0x20 -extern void closelog(void); -extern void openlog(const char*, int, int); -extern int setlogmask(int); -extern void syslog(int, const char*, ...) __printflike(2, 3); -extern void vsyslog(int, const char*, va_list) __printflike(2, 0); +void closelog(void); +void openlog(const char*, int, int); +int setlogmask(int); +void syslog(int, const char*, ...) __printflike(2, 3); +void vsyslog(int, const char*, va_list) __printflike(2, 0); __END_DECLS From 49fbec6d9aee62462a4acf3ba47788ca1e35be37 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 23 Jul 2014 14:43:44 -0700 Subject: [PATCH 054/148] HACK: remove %m support from printf. The change that added this support causes a cpu hard lock on one device. This code clearly isn't at fault, but disabling it to unblock until we can find a real fix. Bug: 16484311 Change-Id: I33834dc49d959ae403b10d2c7cad12ae2950f772 --- libc/bionic/libc_logging.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp index cdbf7236c..1fb8a84ab 100644 --- a/libc/bionic/libc_logging.cpp +++ b/libc/bionic/libc_logging.cpp @@ -230,7 +230,9 @@ static void SendRepeat(Out& o, char ch, int count) { /* Perform formatted output to an output target 'o' */ template static void out_vformat(Out& o, const char* format, va_list args) { +#if 0 int caller_errno = errno; +#endif int nn = 0; for (;;) { @@ -379,9 +381,11 @@ static void out_vformat(Out& o, const char* format, va_list args) { } else if (c == '%') { buffer[0] = '%'; buffer[1] = '\0'; +#if 0 } else if (c == 'm') { // syslog-like %m for strerror(errno). str = strerror(caller_errno); +#endif } else { __assert(__FILE__, __LINE__, "conversion specifier unsupported"); } From 92d8b2320a4c3911452227f560ae4a39e83b0abf Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Wed, 23 Jul 2014 13:56:23 -0700 Subject: [PATCH 055/148] debuggerd: if PR_GET_DUMPABLE=0, don't ask for dumping PR_GET_DUMPABLE is used by an application to indicate whether or not core dumps / PTRACE_ATTACH should work. Security sensitive applications often set PR_SET_DUMPABLE to 0 to disable core dumps, to avoid leaking sensitive memory to persistent storage. Similarly, they also set PR_SET_DUMPABLE to zero to prevent PTRACE_ATTACH from working, again to avoid leaking the contents of sensitive memory. Honor PR_GET_DUMPABLE when connecting to debuggerd. If an application has said it doesn't want its memory dumped, then we shouldn't ask debuggerd to dump memory on its behalf. FORTIFY_SOURCE tests: Modify the fortify_source tests to set PR_SET_DUMPABLE=0. This reduces the total runtime of /data/nativetest/bionic-unit-tests/bionic-unit-tests32 from approx 53 seconds to 25 seconds. There's no need to connect to debuggerd when running these tests. Bug: 16513137 (cherry picked from commit be0e43b77676338fd5e6a82c9cc2b6302d579de2) Change-Id: I6e1a9bce564e94fc19893d639b15f38c549cabfa --- linker/debugger.cpp | 9 +++ tests/fortify_test.cpp | 132 +++++++++++++++++++++++------------------ 2 files changed, 83 insertions(+), 58 deletions(-) diff --git a/linker/debugger.cpp b/linker/debugger.cpp index 9ebb09ba6..079682cab 100644 --- a/linker/debugger.cpp +++ b/linker/debugger.cpp @@ -206,6 +206,15 @@ static bool have_siginfo(int signum) { } static void send_debuggerd_packet(siginfo_t* info) { + if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 0) { + // process has disabled core dumps and PTRACE_ATTACH, and does not want to be dumped. + // Honor that intention by not connecting to debuggerd and asking it + // to dump our internal state. + __libc_format_log(ANDROID_LOG_INFO, "libc", + "Suppressing debuggerd output because prctl(PR_GET_DUMPABLE)==0"); + return; + } + int s = socket_abstract_client(DEBUGGER_SOCKET_NAME, SOCK_STREAM); if (s == -1) { __libc_format_log(ANDROID_LOG_FATAL, "libc", "Unable to open connection to debuggerd: %s", diff --git a/tests/fortify_test.cpp b/tests/fortify_test.cpp index 873c71eb1..352cac694 100644 --- a/tests/fortify_test.cpp +++ b/tests/fortify_test.cpp @@ -23,6 +23,7 @@ #include #include #include +#include // We have to say "DeathTest" here so gtest knows to run this test (which exits) // in its own process. Unfortunately, the C preprocessor doesn't give us an @@ -32,6 +33,21 @@ #define DEATHTEST_EVALUATOR(name) DEATHTEST_PASTER(name) #define DEATHTEST DEATHTEST_EVALUATOR(TEST_NAME) +class DEATHTEST : public testing::Test { + protected: + virtual void SetUp() { + old_dumpable_ = prctl(PR_GET_DUMPABLE, 0, 0, 0, 0); + // Suppress debuggerd stack traces. Too slow. + prctl(PR_SET_DUMPABLE, 0, 0, 0, 0); + } + + virtual void TearDown() { + prctl(PR_SET_DUMPABLE, old_dumpable_, 0, 0, 0, 0); + } + private: + int old_dumpable_; +}; + #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE == 2 struct foo { char empty[0]; @@ -43,7 +59,7 @@ struct foo { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, stpncpy_fortified2) { +TEST_F(DEATHTEST, stpncpy_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; int copy_amt = atoi("11"); @@ -55,7 +71,7 @@ TEST(DEATHTEST, stpncpy_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, stpncpy2_fortified2) { +TEST_F(DEATHTEST, stpncpy2_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; memset(&myfoo, 0, sizeof(myfoo)); @@ -68,7 +84,7 @@ TEST(DEATHTEST, stpncpy2_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strncpy_fortified2) { +TEST_F(DEATHTEST, strncpy_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; int copy_amt = atoi("11"); @@ -80,7 +96,7 @@ TEST(DEATHTEST, strncpy_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strncpy2_fortified2) { +TEST_F(DEATHTEST, strncpy2_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; memset(&myfoo, 0, sizeof(myfoo)); @@ -93,7 +109,7 @@ TEST(DEATHTEST, strncpy2_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, sprintf_fortified2) { +TEST_F(DEATHTEST, sprintf_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; char source_buf[15]; @@ -106,7 +122,7 @@ TEST(DEATHTEST, sprintf_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, sprintf2_fortified2) { +TEST_F(DEATHTEST, sprintf2_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; ASSERT_EXIT(sprintf(myfoo.a, "0123456789"), @@ -128,12 +144,12 @@ static int vsprintf_helper2(const char *fmt, ...) { return result; } -TEST(DEATHTEST, vsprintf_fortified2) { +TEST_F(DEATHTEST, vsprintf_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; ASSERT_EXIT(vsprintf_helper2("%s", "0123456789"), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, vsprintf2_fortified2) { +TEST_F(DEATHTEST, vsprintf2_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; ASSERT_EXIT(vsprintf_helper2("0123456789"), testing::KilledBySignal(SIGABRT), ""); } @@ -154,12 +170,12 @@ static int vsnprintf_helper2(const char *fmt, ...) { return result; } -TEST(DEATHTEST, vsnprintf_fortified2) { +TEST_F(DEATHTEST, vsnprintf_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; ASSERT_EXIT(vsnprintf_helper2("%s", "0123456789"), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, vsnprintf2_fortified2) { +TEST_F(DEATHTEST, vsnprintf2_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; ASSERT_EXIT(vsnprintf_helper2("0123456789"), testing::KilledBySignal(SIGABRT), ""); } @@ -169,7 +185,7 @@ TEST(DEATHTEST, vsnprintf2_fortified2) { // zero sized target with "\0" source (should fail) // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, stpcpy_fortified2) { +TEST_F(DEATHTEST, stpcpy_fortified2) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; @@ -187,7 +203,7 @@ TEST(DEATHTEST, stpcpy_fortified2) { // zero sized target with "\0" source (should fail) // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strcpy_fortified2) { +TEST_F(DEATHTEST, strcpy_fortified2) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; @@ -205,7 +221,7 @@ TEST(DEATHTEST, strcpy_fortified2) { // zero sized target with longer source (should fail) // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strcpy2_fortified2) { +TEST_F(DEATHTEST, strcpy2_fortified2) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; @@ -223,7 +239,7 @@ TEST(DEATHTEST, strcpy2_fortified2) { // one byte target with longer source (should fail) // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strcpy3_fortified2) { +TEST_F(DEATHTEST, strcpy3_fortified2) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; @@ -240,7 +256,7 @@ TEST(DEATHTEST, strcpy3_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strchr_fortified2) { +TEST_F(DEATHTEST, strchr_fortified2) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; @@ -257,7 +273,7 @@ TEST(DEATHTEST, strchr_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strrchr_fortified2) { +TEST_F(DEATHTEST, strrchr_fortified2) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; @@ -274,7 +290,7 @@ TEST(DEATHTEST, strrchr_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strlcpy_fortified2) { +TEST_F(DEATHTEST, strlcpy_fortified2) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; @@ -291,7 +307,7 @@ TEST(DEATHTEST, strlcpy_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strlcat_fortified2) { +TEST_F(DEATHTEST, strlcat_fortified2) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; @@ -309,7 +325,7 @@ TEST(DEATHTEST, strlcat_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strncat_fortified2) { +TEST_F(DEATHTEST, strncat_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; size_t n = atoi("10"); // avoid compiler optimizations @@ -321,7 +337,7 @@ TEST(DEATHTEST, strncat_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strncat2_fortified2) { +TEST_F(DEATHTEST, strncat2_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; myfoo.a[0] = '\0'; @@ -330,7 +346,7 @@ TEST(DEATHTEST, strncat2_fortified2) { } #endif -TEST(DEATHTEST, strncat3_fortified2) { +TEST_F(DEATHTEST, strncat3_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; memcpy(myfoo.a, "0123456789", sizeof(myfoo.a)); // unterminated string @@ -342,7 +358,7 @@ TEST(DEATHTEST, strncat3_fortified2) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, strcat_fortified2) { +TEST_F(DEATHTEST, strcat_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char src[11]; strcpy(src, "0123456789"); @@ -352,7 +368,7 @@ TEST(DEATHTEST, strcat_fortified2) { } #endif -TEST(DEATHTEST, strcat2_fortified2) { +TEST_F(DEATHTEST, strcat2_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; memcpy(myfoo.a, "0123456789", sizeof(myfoo.a)); // unterminated string @@ -360,7 +376,7 @@ TEST(DEATHTEST, strcat2_fortified2) { ASSERT_EXIT(strcat(myfoo.b, myfoo.a), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, snprintf_fortified2) { +TEST_F(DEATHTEST, snprintf_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; strcpy(myfoo.a, "012345678"); @@ -368,7 +384,7 @@ TEST(DEATHTEST, snprintf_fortified2) { ASSERT_EXIT(snprintf(myfoo.b, n, "a%s", myfoo.a), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, bzero_fortified2) { +TEST_F(DEATHTEST, bzero_fortified2) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; foo myfoo; memcpy(myfoo.b, "0123456789", sizeof(myfoo.b)); @@ -379,7 +395,7 @@ TEST(DEATHTEST, bzero_fortified2) { #endif /* defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE=2 */ // multibyte target where we over fill (should fail) -TEST(DEATHTEST, strcpy_fortified) { +TEST_F(DEATHTEST, strcpy_fortified) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[10]; @@ -392,7 +408,7 @@ TEST(DEATHTEST, strcpy_fortified) { } // zero sized target with "\0" source (should fail) -TEST(DEATHTEST, strcpy2_fortified) { +TEST_F(DEATHTEST, strcpy2_fortified) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[0]; @@ -405,7 +421,7 @@ TEST(DEATHTEST, strcpy2_fortified) { } // zero sized target with longer source (should fail) -TEST(DEATHTEST, strcpy3_fortified) { +TEST_F(DEATHTEST, strcpy3_fortified) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[0]; @@ -418,7 +434,7 @@ TEST(DEATHTEST, strcpy3_fortified) { } // one byte target with longer source (should fail) -TEST(DEATHTEST, strcpy4_fortified) { +TEST_F(DEATHTEST, strcpy4_fortified) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[1]; @@ -430,7 +446,7 @@ TEST(DEATHTEST, strcpy4_fortified) { #endif // __BIONIC__ } -TEST(DEATHTEST, strlen_fortified) { +TEST_F(DEATHTEST, strlen_fortified) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[10]; @@ -441,7 +457,7 @@ TEST(DEATHTEST, strlen_fortified) { #endif // __BIONIC__ } -TEST(DEATHTEST, strchr_fortified) { +TEST_F(DEATHTEST, strchr_fortified) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[10]; @@ -452,7 +468,7 @@ TEST(DEATHTEST, strchr_fortified) { #endif // __BIONIC__ } -TEST(DEATHTEST, strrchr_fortified) { +TEST_F(DEATHTEST, strrchr_fortified) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[10]; @@ -463,7 +479,7 @@ TEST(DEATHTEST, strrchr_fortified) { #endif // __BIONIC__ } -TEST(DEATHTEST, strlcpy_fortified) { +TEST_F(DEATHTEST, strlcpy_fortified) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char bufa[15]; @@ -476,7 +492,7 @@ TEST(DEATHTEST, strlcpy_fortified) { #endif // __BIONIC__ } -TEST(DEATHTEST, strlcat_fortified) { +TEST_F(DEATHTEST, strlcat_fortified) { #if defined(__BIONIC__) ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char bufa[15]; @@ -490,7 +506,7 @@ TEST(DEATHTEST, strlcat_fortified) { #endif // __BIONIC__ } -TEST(DEATHTEST, sprintf_fortified) { +TEST_F(DEATHTEST, sprintf_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[10]; char source_buf[15]; @@ -501,7 +517,7 @@ TEST(DEATHTEST, sprintf_fortified) { #ifndef __clang__ // This test is disabled in clang because clang doesn't properly detect // this buffer overflow. TODO: Fix clang. -TEST(DEATHTEST, sprintf_malloc_fortified) { +TEST_F(DEATHTEST, sprintf_malloc_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char* buf = (char *) malloc(10); char source_buf[11]; @@ -511,7 +527,7 @@ TEST(DEATHTEST, sprintf_malloc_fortified) { } #endif -TEST(DEATHTEST, sprintf2_fortified) { +TEST_F(DEATHTEST, sprintf2_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[5]; ASSERT_EXIT(sprintf(buf, "aaaaa"), testing::KilledBySignal(SIGABRT), ""); @@ -528,12 +544,12 @@ static int vsprintf_helper(const char *fmt, ...) { return result; } -TEST(DEATHTEST, vsprintf_fortified) { +TEST_F(DEATHTEST, vsprintf_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; ASSERT_EXIT(vsprintf_helper("%s", "0123456789"), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, vsprintf2_fortified) { +TEST_F(DEATHTEST, vsprintf2_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; ASSERT_EXIT(vsprintf_helper("0123456789"), testing::KilledBySignal(SIGABRT), ""); } @@ -550,17 +566,17 @@ static int vsnprintf_helper(const char *fmt, ...) { return result; } -TEST(DEATHTEST, vsnprintf_fortified) { +TEST_F(DEATHTEST, vsnprintf_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; ASSERT_EXIT(vsnprintf_helper("%s", "0123456789"), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, vsnprintf2_fortified) { +TEST_F(DEATHTEST, vsnprintf2_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; ASSERT_EXIT(vsnprintf_helper("0123456789"), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, strncat_fortified) { +TEST_F(DEATHTEST, strncat_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[10]; size_t n = atoi("10"); // avoid compiler optimizations @@ -568,7 +584,7 @@ TEST(DEATHTEST, strncat_fortified) { ASSERT_EXIT(strncat(buf, "9", n), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, strncat2_fortified) { +TEST_F(DEATHTEST, strncat2_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[10]; buf[0] = '\0'; @@ -576,7 +592,7 @@ TEST(DEATHTEST, strncat2_fortified) { ASSERT_EXIT(strncat(buf, "0123456789", n), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, strcat_fortified) { +TEST_F(DEATHTEST, strcat_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char src[11]; strcpy(src, "0123456789"); @@ -585,7 +601,7 @@ TEST(DEATHTEST, strcat_fortified) { ASSERT_EXIT(strcat(buf, src), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, memmove_fortified) { +TEST_F(DEATHTEST, memmove_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[20]; strcpy(buf, "0123456789"); @@ -593,7 +609,7 @@ TEST(DEATHTEST, memmove_fortified) { ASSERT_EXIT(memmove(buf + 11, buf, n), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, memcpy_fortified) { +TEST_F(DEATHTEST, memcpy_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char bufa[10]; char bufb[10]; @@ -602,7 +618,7 @@ TEST(DEATHTEST, memcpy_fortified) { ASSERT_EXIT(memcpy(bufb, bufa, n), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, stpncpy_fortified) { +TEST_F(DEATHTEST, stpncpy_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char bufa[15]; char bufb[10]; @@ -611,7 +627,7 @@ TEST(DEATHTEST, stpncpy_fortified) { ASSERT_EXIT(stpncpy(bufb, bufa, n), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, stpncpy2_fortified) { +TEST_F(DEATHTEST, stpncpy2_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char dest[11]; char src[10]; @@ -619,7 +635,7 @@ TEST(DEATHTEST, stpncpy2_fortified) { ASSERT_EXIT(stpncpy(dest, src, sizeof(dest)), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, strncpy_fortified) { +TEST_F(DEATHTEST, strncpy_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char bufa[15]; char bufb[10]; @@ -629,7 +645,7 @@ TEST(DEATHTEST, strncpy_fortified) { } -TEST(DEATHTEST, strncpy2_fortified) { +TEST_F(DEATHTEST, strncpy2_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char dest[11]; char src[10]; @@ -637,7 +653,7 @@ TEST(DEATHTEST, strncpy2_fortified) { ASSERT_EXIT(strncpy(dest, src, sizeof(dest)), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, snprintf_fortified) { +TEST_F(DEATHTEST, snprintf_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char bufa[15]; char bufb[10]; @@ -646,7 +662,7 @@ TEST(DEATHTEST, snprintf_fortified) { ASSERT_EXIT(snprintf(bufb, n, "%s", bufa), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, bzero_fortified) { +TEST_F(DEATHTEST, bzero_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[10]; memcpy(buf, "0123456789", sizeof(buf)); @@ -654,20 +670,20 @@ TEST(DEATHTEST, bzero_fortified) { ASSERT_EXIT(bzero(buf, n), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, umask_fortified) { +TEST_F(DEATHTEST, umask_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; mode_t mask = atoi("1023"); // 01777 in octal ASSERT_EXIT(umask(mask), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, recv_fortified) { +TEST_F(DEATHTEST, recv_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; size_t data_len = atoi("11"); // suppress compiler optimizations char buf[10]; ASSERT_EXIT(recv(0, buf, data_len, 0), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, FD_ISSET_fortified) { +TEST_F(DEATHTEST, FD_ISSET_fortified) { #if defined(__BIONIC__) // glibc catches this at compile-time. ::testing::FLAGS_gtest_death_test_style = "threadsafe"; fd_set set; @@ -676,7 +692,7 @@ TEST(DEATHTEST, FD_ISSET_fortified) { #endif } -TEST(DEATHTEST, FD_ISSET_2_fortified) { +TEST_F(DEATHTEST, FD_ISSET_2_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[1]; fd_set* set = (fd_set*) buf; @@ -686,14 +702,14 @@ TEST(DEATHTEST, FD_ISSET_2_fortified) { // gtest's ASSERT_EXIT needs a valid expression, but glibc has a do-while macro. static void FD_ZERO_function(fd_set* s) { FD_ZERO(s); } -TEST(DEATHTEST, FD_ZERO_fortified) { +TEST_F(DEATHTEST, FD_ZERO_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[1]; fd_set* set = (fd_set*) buf; ASSERT_EXIT(FD_ZERO_function(set), testing::KilledBySignal(SIGABRT), ""); } -TEST(DEATHTEST, read_fortified) { +TEST_F(DEATHTEST, read_fortified) { ::testing::FLAGS_gtest_death_test_style = "threadsafe"; char buf[1]; size_t ct = atoi("2"); // prevent optimizations From bc74ecfaf5de47056fd8a48db65c0e5aef892f0c Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 23 Jul 2014 18:05:58 -0700 Subject: [PATCH 056/148] HACK: Disable syslog going to android log. Bug: 14292866 Change-Id: I3adc448dbacfeecd32508ddccf27be3aa653e466 --- libc/bionic/syslog.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libc/bionic/syslog.cpp b/libc/bionic/syslog.cpp index 29f892a20..d3b1b1eb7 100644 --- a/libc/bionic/syslog.cpp +++ b/libc/bionic/syslog.cpp @@ -46,7 +46,10 @@ void syslog(int priority, const char* fmt, ...) { va_end(args); } -void vsyslog(int priority, const char* fmt, va_list args) { +void vsyslog(int /*priority*/, const char* /*fmt*/, va_list /*args*/) { +// HACK to avoid lock up on certain devices. This will be reverted when +// that is fixed. +#if 0 // Check whether we're supposed to be logging messages of this priority. if ((syslog_priority_mask & LOG_MASK(LOG_PRI(priority))) == 0) { return; @@ -72,4 +75,5 @@ void vsyslog(int priority, const char* fmt, va_list args) { } __libc_format_log_va_list(android_log_priority, log_tag, fmt, args); +#endif } From c86950cb3f50ead0c9a9d0366b870d6c6e1b91c8 Mon Sep 17 00:00:00 2001 From: Duane Sand Date: Mon, 14 Jul 2014 15:30:14 -0700 Subject: [PATCH 057/148] [MIPSR6] setjmp supports mips32r6 and FP64A/FPXX reg models Save and restore floating point registers via 64-bit load/stores when possible. Use assembler's builtin macro ops to generate pairs of 32-bit load/stores on Mips I cpus. Some cpus or FR modes have only 16 even-numbered dp fp regs. This is exposed by _MIPS_FPSET, defined by existing compilers. (cherry picked from commit dd37251c473e1483faba0fd5aaf30e7a55582e8a) Change-Id: Ibd43653701a363a77af85121d3cbd229d132a06a --- libc/arch-mips/bionic/_setjmp.S | 85 +++++++++---------------------- libc/arch-mips/bionic/setjmp.S | 85 +++++++++---------------------- libc/arch-mips64/bionic/_setjmp.S | 85 +++++++++---------------------- libc/arch-mips64/bionic/setjmp.S | 85 +++++++++---------------------- 4 files changed, 96 insertions(+), 244 deletions(-) diff --git a/libc/arch-mips/bionic/_setjmp.S b/libc/arch-mips/bionic/_setjmp.S index 4465cd20e..d237e6d19 100644 --- a/libc/arch-mips/bionic/_setjmp.S +++ b/libc/arch-mips/bionic/_setjmp.S @@ -44,17 +44,6 @@ FRAMESZ= MKFSIZ(0,4) GPOFF= FRAMESZ-2*REGSZ -#define FPREG64_S(FPR, OFF, BASE) \ - swc1 FPR, OFF(BASE) ; \ - mfhc1 t0, FPR ; \ - sw t0, OFF+4(BASE) ; - -#define FPREG64_L(FPR, OFF, BASE) \ - lw t0, OFF+4(BASE) ; \ - lw t1, OFF(BASE) ; \ - mtc1 t1, FPR ; \ - mthc1 t0, FPR ; \ - LEAF(_setjmp, FRAMESZ) PTR_SUBU sp, FRAMESZ SETUP_GP64(GPOFF, _setjmp) @@ -85,32 +74,19 @@ LEAF(_setjmp, FRAMESZ) li v0, 1 # be nice if we could tell REG_S v0, SC_FPUSED(a0) # sc_fpused = 1 cfc1 v0, $31 + s.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + s.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + s.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + s.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + s.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + s.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) #if _MIPS_FPSET == 32 - FPREG64_S($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) - FPREG64_S($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) - FPREG64_S($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) - FPREG64_S($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) - FPREG64_S($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) - FPREG64_S($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) - FPREG64_S($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) - FPREG64_S($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) - FPREG64_S($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) - FPREG64_S($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) - FPREG64_S($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) - FPREG64_S($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) -#else - swc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) - swc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) - swc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) - swc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) - swc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) - swc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) - swc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) - swc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) - swc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) - swc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) - swc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) - swc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) + s.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + s.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + s.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + s.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + s.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + s.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) #endif REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0) #endif /* !SOFTFLOAT */ @@ -142,32 +118,19 @@ LEAF(_longjmp, FRAMESZ) REG_L sp, SC_REGS+SP*REGSZ(a0) #if !defined(SOFTFLOAT) ctc1 v0, $31 + l.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + l.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + l.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + l.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + l.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + l.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) #if _MIPS_FPSET == 32 - FPREG64_L($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) - FPREG64_L($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) - FPREG64_L($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) - FPREG64_L($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) - FPREG64_L($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) - FPREG64_L($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) - FPREG64_L($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) - FPREG64_L($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) - FPREG64_L($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) - FPREG64_L($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) - FPREG64_L($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) - FPREG64_L($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) -#else - lwc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) - lwc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) - lwc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) - lwc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) - lwc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) - lwc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) - lwc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) - lwc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) - lwc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) - lwc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) - lwc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) - lwc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) + l.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + l.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + l.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + l.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + l.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + l.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) #endif #endif /* !SOFTFLOAT */ bne a1, zero, 1f diff --git a/libc/arch-mips/bionic/setjmp.S b/libc/arch-mips/bionic/setjmp.S index 2af1fbdce..31786be50 100644 --- a/libc/arch-mips/bionic/setjmp.S +++ b/libc/arch-mips/bionic/setjmp.S @@ -45,17 +45,6 @@ A0OFF= FRAMESZ-3*REGSZ GPOFF= FRAMESZ-2*REGSZ RAOFF= FRAMESZ-1*REGSZ -#define FPREG64_S(FPR, OFF, BASE) \ - swc1 FPR, OFF(BASE) ; \ - mfhc1 t0, FPR ; \ - sw t0, OFF+4(BASE) ; - -#define FPREG64_L(FPR, OFF, BASE) \ - lw t0, OFF+4(BASE) ; \ - lw t1, OFF(BASE) ; \ - mtc1 t1, FPR ; \ - mthc1 t0, FPR ; \ - NON_LEAF(setjmp, FRAMESZ, ra) .mask 0x80000000, RAOFF PTR_SUBU sp, FRAMESZ # allocate stack frame @@ -98,32 +87,19 @@ NON_LEAF(setjmp, FRAMESZ, ra) li v0, 1 # be nice if we could tell REG_S v0, SC_FPUSED(a0) # sc_fpused = 1 cfc1 v0, $31 + s.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + s.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + s.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + s.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + s.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + s.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) #if _MIPS_FPSET == 32 - FPREG64_S($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) - FPREG64_S($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) - FPREG64_S($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) - FPREG64_S($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) - FPREG64_S($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) - FPREG64_S($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) - FPREG64_S($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) - FPREG64_S($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) - FPREG64_S($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) - FPREG64_S($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) - FPREG64_S($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) - FPREG64_S($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) -#else - swc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) - swc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) - swc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) - swc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) - swc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) - swc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) - swc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) - swc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) - swc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) - swc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) - swc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) - swc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) + s.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + s.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + s.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + s.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + s.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + s.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) #endif REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0) #endif /* !SOFTFLOAT */ @@ -173,32 +149,19 @@ LEAF(longjmp, FRAMESZ) #if !defined(SOFTFLOAT) REG_L v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0) ctc1 v0, $31 + l.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + l.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + l.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + l.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + l.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + l.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) #if _MIPS_FPSET == 32 - FPREG64_L($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) - FPREG64_L($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) - FPREG64_L($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) - FPREG64_L($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) - FPREG64_L($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) - FPREG64_L($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) - FPREG64_L($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) - FPREG64_L($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) - FPREG64_L($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) - FPREG64_L($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) - FPREG64_L($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) - FPREG64_L($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) -#else - lwc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) - lwc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) - lwc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) - lwc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) - lwc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) - lwc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) - lwc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) - lwc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) - lwc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) - lwc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) - lwc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) - lwc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) + l.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + l.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + l.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + l.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + l.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + l.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) #endif #endif /* !SOFTFLOAT */ bne a1, zero, 1f diff --git a/libc/arch-mips64/bionic/_setjmp.S b/libc/arch-mips64/bionic/_setjmp.S index 4465cd20e..d237e6d19 100644 --- a/libc/arch-mips64/bionic/_setjmp.S +++ b/libc/arch-mips64/bionic/_setjmp.S @@ -44,17 +44,6 @@ FRAMESZ= MKFSIZ(0,4) GPOFF= FRAMESZ-2*REGSZ -#define FPREG64_S(FPR, OFF, BASE) \ - swc1 FPR, OFF(BASE) ; \ - mfhc1 t0, FPR ; \ - sw t0, OFF+4(BASE) ; - -#define FPREG64_L(FPR, OFF, BASE) \ - lw t0, OFF+4(BASE) ; \ - lw t1, OFF(BASE) ; \ - mtc1 t1, FPR ; \ - mthc1 t0, FPR ; \ - LEAF(_setjmp, FRAMESZ) PTR_SUBU sp, FRAMESZ SETUP_GP64(GPOFF, _setjmp) @@ -85,32 +74,19 @@ LEAF(_setjmp, FRAMESZ) li v0, 1 # be nice if we could tell REG_S v0, SC_FPUSED(a0) # sc_fpused = 1 cfc1 v0, $31 + s.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + s.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + s.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + s.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + s.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + s.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) #if _MIPS_FPSET == 32 - FPREG64_S($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) - FPREG64_S($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) - FPREG64_S($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) - FPREG64_S($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) - FPREG64_S($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) - FPREG64_S($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) - FPREG64_S($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) - FPREG64_S($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) - FPREG64_S($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) - FPREG64_S($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) - FPREG64_S($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) - FPREG64_S($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) -#else - swc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) - swc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) - swc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) - swc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) - swc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) - swc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) - swc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) - swc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) - swc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) - swc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) - swc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) - swc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) + s.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + s.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + s.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + s.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + s.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + s.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) #endif REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0) #endif /* !SOFTFLOAT */ @@ -142,32 +118,19 @@ LEAF(_longjmp, FRAMESZ) REG_L sp, SC_REGS+SP*REGSZ(a0) #if !defined(SOFTFLOAT) ctc1 v0, $31 + l.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + l.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + l.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + l.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + l.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + l.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) #if _MIPS_FPSET == 32 - FPREG64_L($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) - FPREG64_L($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) - FPREG64_L($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) - FPREG64_L($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) - FPREG64_L($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) - FPREG64_L($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) - FPREG64_L($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) - FPREG64_L($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) - FPREG64_L($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) - FPREG64_L($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) - FPREG64_L($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) - FPREG64_L($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) -#else - lwc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) - lwc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) - lwc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) - lwc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) - lwc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) - lwc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) - lwc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) - lwc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) - lwc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) - lwc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) - lwc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) - lwc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) + l.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + l.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + l.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + l.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + l.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + l.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) #endif #endif /* !SOFTFLOAT */ bne a1, zero, 1f diff --git a/libc/arch-mips64/bionic/setjmp.S b/libc/arch-mips64/bionic/setjmp.S index 2af1fbdce..31786be50 100644 --- a/libc/arch-mips64/bionic/setjmp.S +++ b/libc/arch-mips64/bionic/setjmp.S @@ -45,17 +45,6 @@ A0OFF= FRAMESZ-3*REGSZ GPOFF= FRAMESZ-2*REGSZ RAOFF= FRAMESZ-1*REGSZ -#define FPREG64_S(FPR, OFF, BASE) \ - swc1 FPR, OFF(BASE) ; \ - mfhc1 t0, FPR ; \ - sw t0, OFF+4(BASE) ; - -#define FPREG64_L(FPR, OFF, BASE) \ - lw t0, OFF+4(BASE) ; \ - lw t1, OFF(BASE) ; \ - mtc1 t1, FPR ; \ - mthc1 t0, FPR ; \ - NON_LEAF(setjmp, FRAMESZ, ra) .mask 0x80000000, RAOFF PTR_SUBU sp, FRAMESZ # allocate stack frame @@ -98,32 +87,19 @@ NON_LEAF(setjmp, FRAMESZ, ra) li v0, 1 # be nice if we could tell REG_S v0, SC_FPUSED(a0) # sc_fpused = 1 cfc1 v0, $31 + s.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + s.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + s.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + s.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + s.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + s.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) #if _MIPS_FPSET == 32 - FPREG64_S($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) - FPREG64_S($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) - FPREG64_S($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) - FPREG64_S($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) - FPREG64_S($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) - FPREG64_S($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) - FPREG64_S($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) - FPREG64_S($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) - FPREG64_S($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) - FPREG64_S($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) - FPREG64_S($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) - FPREG64_S($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) -#else - swc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) - swc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) - swc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) - swc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) - swc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) - swc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) - swc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) - swc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) - swc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) - swc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) - swc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) - swc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) + s.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + s.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + s.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + s.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + s.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + s.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) #endif REG_S v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0) #endif /* !SOFTFLOAT */ @@ -173,32 +149,19 @@ LEAF(longjmp, FRAMESZ) #if !defined(SOFTFLOAT) REG_L v0, SC_FPREGS+((FSR-F0)*REGSZ)(a0) ctc1 v0, $31 + l.d $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) + l.d $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) + l.d $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) + l.d $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) + l.d $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) + l.d $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) #if _MIPS_FPSET == 32 - FPREG64_L($f20, SC_FPREGS+((F20-F0)*REGSZ_FP), a0) - FPREG64_L($f21, SC_FPREGS+((F21-F0)*REGSZ_FP), a0) - FPREG64_L($f22, SC_FPREGS+((F22-F0)*REGSZ_FP), a0) - FPREG64_L($f23, SC_FPREGS+((F23-F0)*REGSZ_FP), a0) - FPREG64_L($f24, SC_FPREGS+((F24-F0)*REGSZ_FP), a0) - FPREG64_L($f25, SC_FPREGS+((F25-F0)*REGSZ_FP), a0) - FPREG64_L($f26, SC_FPREGS+((F26-F0)*REGSZ_FP), a0) - FPREG64_L($f27, SC_FPREGS+((F27-F0)*REGSZ_FP), a0) - FPREG64_L($f28, SC_FPREGS+((F28-F0)*REGSZ_FP), a0) - FPREG64_L($f29, SC_FPREGS+((F29-F0)*REGSZ_FP), a0) - FPREG64_L($f30, SC_FPREGS+((F30-F0)*REGSZ_FP), a0) - FPREG64_L($f31, SC_FPREGS+((F31-F0)*REGSZ_FP), a0) -#else - lwc1 $f20, SC_FPREGS+((F20-F0)*REGSZ_FP)(a0) - lwc1 $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) - lwc1 $f22, SC_FPREGS+((F22-F0)*REGSZ_FP)(a0) - lwc1 $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) - lwc1 $f24, SC_FPREGS+((F24-F0)*REGSZ_FP)(a0) - lwc1 $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) - lwc1 $f26, SC_FPREGS+((F26-F0)*REGSZ_FP)(a0) - lwc1 $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) - lwc1 $f28, SC_FPREGS+((F28-F0)*REGSZ_FP)(a0) - lwc1 $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) - lwc1 $f30, SC_FPREGS+((F30-F0)*REGSZ_FP)(a0) - lwc1 $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) + l.d $f21, SC_FPREGS+((F21-F0)*REGSZ_FP)(a0) + l.d $f23, SC_FPREGS+((F23-F0)*REGSZ_FP)(a0) + l.d $f25, SC_FPREGS+((F25-F0)*REGSZ_FP)(a0) + l.d $f27, SC_FPREGS+((F27-F0)*REGSZ_FP)(a0) + l.d $f29, SC_FPREGS+((F29-F0)*REGSZ_FP)(a0) + l.d $f31, SC_FPREGS+((F31-F0)*REGSZ_FP)(a0) #endif #endif /* !SOFTFLOAT */ bne a1, zero, 1f From 5ade7e3f6bb43d419402aab2c7adca2173e2c584 Mon Sep 17 00:00:00 2001 From: Duane Sand Date: Thu, 24 Jul 2014 10:56:54 -0700 Subject: [PATCH 058/148] [MIPS] Drop soft-fp targets (cherry picked from commit ba23bd0a409bb0e43c57dabee96b2ae52481d5b7) Change-Id: Ica09192c2760d38ceebc14e23a5d3ba94c20764c --- libc/arch-mips/mips.mk | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libc/arch-mips/mips.mk b/libc/arch-mips/mips.mk index 5705c8a95..cb76985f0 100644 --- a/libc/arch-mips/mips.mk +++ b/libc/arch-mips/mips.mk @@ -47,11 +47,6 @@ libc_common_src_files_mips += \ bionic/__strcat_chk.cpp \ -ifneq ($(ARCH_MIPS_HAS_FPU),true) -libc_common_cflags_mips := \ - -DSOFTFLOAT -endif - ########################################## ### CPU specific source files libc_bionic_src_files_mips += \ From b902641d7303d2ea24c10f6d6e7ff49e7ee75611 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 23 Jul 2014 16:02:26 -0700 Subject: [PATCH 059/148] Implement twalk(3), add unit tests. I've also added insque(3) and remque(3) (from NetBSD because the OpenBSD ones are currently broken for non-circular lists). I've not added the three hash table functions that should be in this header because they operate on a single global hash table and thus aren't likely to be useful. Bug: https://code.google.com/p/android/issues/detail?id=73719 (cherry picked from commit 3e424d0a241f8ae5194514dabc4ad899f5a5416d) Change-Id: I5882a6b48c80fea8ac6b9c27e7b9de10b202b4ff --- libc/Android.mk | 9 +- libc/NOTICE | 28 +++ libc/bionic/tdestroy.cpp | 2 +- libc/include/search.h | 3 + libc/upstream-netbsd/lib/libc/stdlib/insque.c | 58 +++++ libc/upstream-netbsd/lib/libc/stdlib/remque.c | 53 +++++ .../upstream-netbsd/lib/libc/stdlib/tdelete.c | 67 ------ libc/upstream-netbsd/lib/libc/stdlib/tfind.c | 47 ---- .../upstream-netbsd/lib/libc/stdlib/tsearch.c | 56 ----- .../lib/libc/stdlib/lsearch.c | 53 ++--- libc/upstream-openbsd/lib/libc/stdlib/tfind.c | 41 ++++ .../lib/libc/stdlib/tsearch.c | 119 ++++++++++ tests/Android.mk | 1 + tests/search_test.cpp | 210 ++++++++++++++++++ 14 files changed, 534 insertions(+), 213 deletions(-) create mode 100644 libc/upstream-netbsd/lib/libc/stdlib/insque.c create mode 100644 libc/upstream-netbsd/lib/libc/stdlib/remque.c delete mode 100644 libc/upstream-netbsd/lib/libc/stdlib/tdelete.c delete mode 100644 libc/upstream-netbsd/lib/libc/stdlib/tfind.c delete mode 100644 libc/upstream-netbsd/lib/libc/stdlib/tsearch.c rename libc/{upstream-netbsd => upstream-openbsd}/lib/libc/stdlib/lsearch.c (70%) create mode 100644 libc/upstream-openbsd/lib/libc/stdlib/tfind.c create mode 100644 libc/upstream-openbsd/lib/libc/stdlib/tsearch.c create mode 100644 tests/search_test.cpp diff --git a/libc/Android.mk b/libc/Android.mk index 0bdf1a552..1fb5e84ae 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -287,20 +287,18 @@ libc_upstream_netbsd_src_files := \ upstream-netbsd/lib/libc/stdlib/div.c \ upstream-netbsd/lib/libc/stdlib/drand48.c \ upstream-netbsd/lib/libc/stdlib/erand48.c \ + upstream-netbsd/lib/libc/stdlib/insque.c \ upstream-netbsd/lib/libc/stdlib/jrand48.c \ upstream-netbsd/lib/libc/stdlib/ldiv.c \ upstream-netbsd/lib/libc/stdlib/lldiv.c \ upstream-netbsd/lib/libc/stdlib/lrand48.c \ - upstream-netbsd/lib/libc/stdlib/lsearch.c \ upstream-netbsd/lib/libc/stdlib/mrand48.c \ upstream-netbsd/lib/libc/stdlib/nrand48.c \ upstream-netbsd/lib/libc/stdlib/_rand48.c \ upstream-netbsd/lib/libc/stdlib/rand_r.c \ + upstream-netbsd/lib/libc/stdlib/remque.c \ upstream-netbsd/lib/libc/stdlib/seed48.c \ upstream-netbsd/lib/libc/stdlib/srand48.c \ - upstream-netbsd/lib/libc/stdlib/tdelete.c \ - upstream-netbsd/lib/libc/stdlib/tfind.c \ - upstream-netbsd/lib/libc/stdlib/tsearch.c \ upstream-netbsd/lib/libc/string/memccpy.c \ upstream-netbsd/lib/libc/string/strcasestr.c \ upstream-netbsd/lib/libc/string/strcoll.c \ @@ -469,6 +467,7 @@ libc_upstream_openbsd_src_files := \ upstream-openbsd/lib/libc/stdlib/atoll.c \ upstream-openbsd/lib/libc/stdlib/exit.c \ upstream-openbsd/lib/libc/stdlib/getenv.c \ + upstream-openbsd/lib/libc/stdlib/lsearch.c \ upstream-openbsd/lib/libc/stdlib/setenv.c \ upstream-openbsd/lib/libc/stdlib/strtoimax.c \ upstream-openbsd/lib/libc/stdlib/strtol.c \ @@ -477,6 +476,8 @@ libc_upstream_openbsd_src_files := \ upstream-openbsd/lib/libc/stdlib/strtoull.c \ upstream-openbsd/lib/libc/stdlib/strtoumax.c \ upstream-openbsd/lib/libc/stdlib/system.c \ + upstream-openbsd/lib/libc/stdlib/tfind.c \ + upstream-openbsd/lib/libc/stdlib/tsearch.c \ upstream-openbsd/lib/libc/string/strcasecmp.c \ upstream-openbsd/lib/libc/string/strcspn.c \ upstream-openbsd/lib/libc/string/strdup.c \ diff --git a/libc/NOTICE b/libc/NOTICE index 7f0195f6a..80d9a27cc 100644 --- a/libc/NOTICE +++ b/libc/NOTICE @@ -55,6 +55,34 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------- + + Copyright (c) 1993 John Brezak + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + ------------------------------------------------------------------- ==================================================== diff --git a/libc/bionic/tdestroy.cpp b/libc/bionic/tdestroy.cpp index decde4da8..49614b8b1 100644 --- a/libc/bionic/tdestroy.cpp +++ b/libc/bionic/tdestroy.cpp @@ -19,7 +19,7 @@ #include // Destroy a tree and free all allocated resources. -// This is a GNU extension, not available from NetBSD. +// This is a GNU extension, not available from BSD. void tdestroy(void* root, void (*destroy_func)(void*)) { node_t* root_node = (node_t*) root; if (root_node == NULL) { diff --git a/libc/include/search.h b/libc/include/search.h index b2c0e6b50..9b01e12b2 100644 --- a/libc/include/search.h +++ b/libc/include/search.h @@ -29,6 +29,9 @@ typedef struct node { __BEGIN_DECLS +void insque(void*, void*); +void remque(void*); + void* lfind(const void*, const void*, size_t*, size_t, int (*)(const void*, const void*)); void* lsearch(const void*, void*, size_t*, size_t, int (*)(const void*, const void*)); diff --git a/libc/upstream-netbsd/lib/libc/stdlib/insque.c b/libc/upstream-netbsd/lib/libc/stdlib/insque.c new file mode 100644 index 000000000..09020ae2a --- /dev/null +++ b/libc/upstream-netbsd/lib/libc/stdlib/insque.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 1993 John Brezak + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: insque.c,v 1.3 2012/06/25 22:32:45 abs Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +struct qelem { + struct qelem *q_forw; + struct qelem *q_back; +}; + +void +insque(void *entry, void *pred) +{ + struct qelem *e = (struct qelem *) entry; + struct qelem *p = (struct qelem *) pred; + + _DIAGASSERT(e != 0); + + e->q_back = p; + if (p) { + e->q_forw = p->q_forw; + if (p->q_forw) + p->q_forw->q_back = e; + p->q_forw = e; + } else + e->q_forw = 0; +} diff --git a/libc/upstream-netbsd/lib/libc/stdlib/remque.c b/libc/upstream-netbsd/lib/libc/stdlib/remque.c new file mode 100644 index 000000000..6060ad84b --- /dev/null +++ b/libc/upstream-netbsd/lib/libc/stdlib/remque.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1993 John Brezak + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: remque.c,v 1.3 2012/06/25 22:32:45 abs Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +struct qelem { + struct qelem *q_forw; + struct qelem *q_back; +}; + +void +remque(void *element) +{ + struct qelem *e = (struct qelem *) element; + + _DIAGASSERT(e != 0); + + if (e->q_forw) + e->q_forw->q_back = e->q_back; + if (e->q_back) + e->q_back->q_forw = e->q_forw; +} diff --git a/libc/upstream-netbsd/lib/libc/stdlib/tdelete.c b/libc/upstream-netbsd/lib/libc/stdlib/tdelete.c deleted file mode 100644 index 84017dc0e..000000000 --- a/libc/upstream-netbsd/lib/libc/stdlib/tdelete.c +++ /dev/null @@ -1,67 +0,0 @@ -/* $NetBSD: tdelete.c,v 1.6 2012/06/25 22:32:45 abs Exp $ */ - -/* - * Tree search generalized from Knuth (6.2.2) Algorithm T just like - * the AT&T man page says. - * - * The node_t structure is for internal use only, lint doesn't grok it. - * - * Written by reading the System V Interface Definition, not the code. - * - * Totally public domain. - */ - -#include -#if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: tdelete.c,v 1.6 2012/06/25 22:32:45 abs Exp $"); -#endif /* LIBC_SCCS and not lint */ - -#include -#define _SEARCH_PRIVATE -#include -#include - - -/* find a node with key "vkey" in tree "vrootp" */ -void * -tdelete(const void *vkey, void **vrootp, - int (*compar)(const void *, const void *)) -{ - node_t **rootp = (node_t **)vrootp; - node_t *p, *q, *r; - int cmp; - - _DIAGASSERT(vkey != NULL); - _DIAGASSERT(compar != NULL); - - if (rootp == NULL || (p = *rootp) == NULL) - return NULL; - - while ((cmp = (*compar)(vkey, (*rootp)->key)) != 0) { - p = *rootp; - rootp = (cmp < 0) ? - &(*rootp)->llink : /* follow llink branch */ - &(*rootp)->rlink; /* follow rlink branch */ - if (*rootp == NULL) - return NULL; /* key not found */ - } - r = (*rootp)->rlink; /* D1: */ - if ((q = (*rootp)->llink) == NULL) /* Left NULL? */ - q = r; - else if (r != NULL) { /* Right link is NULL? */ - if (r->llink == NULL) { /* D2: Find successor */ - r->llink = q; - q = r; - } else { /* D3: Find NULL link */ - for (q = r->llink; q->llink != NULL; q = r->llink) - r = q; - r->llink = q->rlink; - q->llink = (*rootp)->llink; - q->rlink = (*rootp)->rlink; - } - } - if (p != *rootp) - free(*rootp); /* D4: Free node */ - *rootp = q; /* link parent to new node */ - return p; -} diff --git a/libc/upstream-netbsd/lib/libc/stdlib/tfind.c b/libc/upstream-netbsd/lib/libc/stdlib/tfind.c deleted file mode 100644 index fd3f362a7..000000000 --- a/libc/upstream-netbsd/lib/libc/stdlib/tfind.c +++ /dev/null @@ -1,47 +0,0 @@ -/* $NetBSD: tfind.c,v 1.7 2012/06/25 22:32:45 abs Exp $ */ - -/* - * Tree search generalized from Knuth (6.2.2) Algorithm T just like - * the AT&T man page says. - * - * The node_t structure is for internal use only, lint doesn't grok it. - * - * Written by reading the System V Interface Definition, not the code. - * - * Totally public domain. - */ - -#include -#if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: tfind.c,v 1.7 2012/06/25 22:32:45 abs Exp $"); -#endif /* LIBC_SCCS and not lint */ - -#include -#define _SEARCH_PRIVATE -#include -#include - -/* find a node by key "vkey" in tree "vrootp", or return 0 */ -void * -tfind(const void *vkey, void * const *vrootp, - int (*compar)(const void *, const void *)) -{ - node_t * const *rootp = (node_t * const*)vrootp; - - _DIAGASSERT(vkey != NULL); - _DIAGASSERT(compar != NULL); - - if (rootp == NULL) - return NULL; - - while (*rootp != NULL) { /* T1: */ - int r; - - if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */ - return *rootp; /* key found */ - rootp = (r < 0) ? - &(*rootp)->llink : /* T3: follow left branch */ - &(*rootp)->rlink; /* T4: follow right branch */ - } - return NULL; -} diff --git a/libc/upstream-netbsd/lib/libc/stdlib/tsearch.c b/libc/upstream-netbsd/lib/libc/stdlib/tsearch.c deleted file mode 100644 index af2fe9c22..000000000 --- a/libc/upstream-netbsd/lib/libc/stdlib/tsearch.c +++ /dev/null @@ -1,56 +0,0 @@ -/* $NetBSD: tsearch.c,v 1.7 2012/06/25 22:32:45 abs Exp $ */ - -/* - * Tree search generalized from Knuth (6.2.2) Algorithm T just like - * the AT&T man page says. - * - * The node_t structure is for internal use only, lint doesn't grok it. - * - * Written by reading the System V Interface Definition, not the code. - * - * Totally public domain. - */ - -#include -#if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: tsearch.c,v 1.7 2012/06/25 22:32:45 abs Exp $"); -#endif /* LIBC_SCCS and not lint */ - -#include -#define _SEARCH_PRIVATE -#include -#include - -/* find or insert datum into search tree */ -void * -tsearch(const void *vkey, void **vrootp, - int (*compar)(const void *, const void *)) -{ - node_t *q; - node_t **rootp = (node_t **)vrootp; - - _DIAGASSERT(vkey != NULL); - _DIAGASSERT(compar != NULL); - - if (rootp == NULL) - return NULL; - - while (*rootp != NULL) { /* Knuth's T1: */ - int r; - - if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */ - return *rootp; /* we found it! */ - - rootp = (r < 0) ? - &(*rootp)->llink : /* T3: follow left branch */ - &(*rootp)->rlink; /* T4: follow right branch */ - } - - q = malloc(sizeof(node_t)); /* T5: key not found */ - if (q != 0) { /* make new node */ - *rootp = q; /* link new node to old */ - q->key = __UNCONST(vkey); /* initialize new node */ - q->llink = q->rlink = NULL; - } - return q; -} diff --git a/libc/upstream-netbsd/lib/libc/stdlib/lsearch.c b/libc/upstream-openbsd/lib/libc/stdlib/lsearch.c similarity index 70% rename from libc/upstream-netbsd/lib/libc/stdlib/lsearch.c rename to libc/upstream-openbsd/lib/libc/stdlib/lsearch.c index e17130b63..8cad05f51 100644 --- a/libc/upstream-netbsd/lib/libc/stdlib/lsearch.c +++ b/libc/upstream-openbsd/lib/libc/stdlib/lsearch.c @@ -1,3 +1,5 @@ +/* $OpenBSD: lsearch.c,v 1.5 2014/07/18 04:16:09 matthew Exp $ */ + /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -30,64 +32,39 @@ * SUCH DAMAGE. */ -#include -#if defined(LIBC_SCCS) && !defined(lint) -#if 0 -static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93"; -#else -__RCSID("$NetBSD: lsearch.c,v 1.7 2012/06/25 22:32:45 abs Exp $"); -#endif -#endif /* LIBC_SCCS and not lint */ - #include - -#include -#include #include #include typedef int (*cmp_fn_t)(const void *, const void *); -static void *linear_base(const void *, void *, size_t *, size_t, - cmp_fn_t, int); +static void *linear_base(const void *, const void *, size_t *, size_t, + cmp_fn_t, int); void * lsearch(const void *key, void *base, size_t *nelp, size_t width, - cmp_fn_t compar) + cmp_fn_t compar) { - _DIAGASSERT(key != NULL); - _DIAGASSERT(base != NULL); - _DIAGASSERT(compar != NULL); - return(linear_base(key, base, nelp, width, compar, 1)); } void * lfind(const void *key, const void *base, size_t *nelp, size_t width, - cmp_fn_t compar) + cmp_fn_t compar) { - - _DIAGASSERT(key != NULL); - _DIAGASSERT(base != NULL); - _DIAGASSERT(compar != NULL); - - return(linear_base(key, __UNCONST(base), nelp, width, compar, 0)); + return(linear_base(key, base, nelp, width, compar, 0)); } static void * -linear_base(const void *key, void *base, size_t *nelp, size_t width, +linear_base(const void *key, const void *base, size_t *nelp, size_t width, cmp_fn_t compar, int add_flag) { - char *element, *end; + const char *element, *end; - _DIAGASSERT(key != NULL); - _DIAGASSERT(base != NULL); - _DIAGASSERT(compar != NULL); - - end = (char *)base + *nelp * width; - for (element = (char *)base; element < end; element += width) - if (!compar(element, key)) /* key found */ - return element; + end = (const char *)base + *nelp * width; + for (element = base; element < end; element += width) + if (!compar(key, element)) /* key found */ + return((void *)element); if (!add_flag) /* key not found */ return(NULL); @@ -102,6 +79,6 @@ linear_base(const void *key, void *base, size_t *nelp, size_t width, * manual. */ ++*nelp; - memcpy(end, key, width); - return end; + memcpy((void *)end, key, width); + return((void *)end); } diff --git a/libc/upstream-openbsd/lib/libc/stdlib/tfind.c b/libc/upstream-openbsd/lib/libc/stdlib/tfind.c new file mode 100644 index 000000000..0d1d5196d --- /dev/null +++ b/libc/upstream-openbsd/lib/libc/stdlib/tfind.c @@ -0,0 +1,41 @@ +/* $OpenBSD: tfind.c,v 1.6 2014/03/16 18:38:30 guenther Exp $ */ + +/* + * Tree search generalized from Knuth (6.2.2) Algorithm T just like + * the AT&T man page says. + * + * The node_t structure is for internal use only + * + * Written by reading the System V Interface Definition, not the code. + * + * Totally public domain. + */ +/*LINTLIBRARY*/ +#include + +typedef struct node_t +{ + char *key; + struct node_t *llink, *rlink; +} node; + +/* find a node, or return 0 */ +void * +tfind(const void *vkey, void * const *vrootp, + int (*compar)(const void *, const void *)) +{ + char *key = (char *)vkey; + node **rootp = (node **)vrootp; + + if (rootp == (struct node_t **)0) + return ((struct node_t *)0); + while (*rootp != (struct node_t *)0) { /* T1: */ + int r; + if ((r = (*compar)(key, (*rootp)->key)) == 0) /* T2: */ + return (*rootp); /* key found */ + rootp = (r < 0) ? + &(*rootp)->llink : /* T3: follow left branch */ + &(*rootp)->rlink; /* T4: follow right branch */ + } + return (node *)0; +} diff --git a/libc/upstream-openbsd/lib/libc/stdlib/tsearch.c b/libc/upstream-openbsd/lib/libc/stdlib/tsearch.c new file mode 100644 index 000000000..a141085d2 --- /dev/null +++ b/libc/upstream-openbsd/lib/libc/stdlib/tsearch.c @@ -0,0 +1,119 @@ +/* $OpenBSD: tsearch.c,v 1.8 2014/03/16 18:38:30 guenther Exp $ */ + +/* + * Tree search generalized from Knuth (6.2.2) Algorithm T just like + * the AT&T man page says. + * + * The node_t structure is for internal use only + * + * Written by reading the System V Interface Definition, not the code. + * + * Totally public domain. + */ +/*LINTLIBRARY*/ + +#include +#include + +typedef struct node_t { + char *key; + struct node_t *left, *right; +} node; + +/* find or insert datum into search tree */ +void * +tsearch(const void *vkey, void **vrootp, + int (*compar)(const void *, const void *)) +{ + node *q; + char *key = (char *)vkey; + node **rootp = (node **)vrootp; + + if (rootp == (struct node_t **)0) + return ((void *)0); + while (*rootp != (struct node_t *)0) { /* Knuth's T1: */ + int r; + + if ((r = (*compar)(key, (*rootp)->key)) == 0) /* T2: */ + return ((void *)*rootp); /* we found it! */ + rootp = (r < 0) ? + &(*rootp)->left : /* T3: follow left branch */ + &(*rootp)->right; /* T4: follow right branch */ + } + q = (node *) malloc(sizeof(node)); /* T5: key not found */ + if (q != (struct node_t *)0) { /* make new node */ + *rootp = q; /* link new node to old */ + q->key = key; /* initialize new node */ + q->left = q->right = (struct node_t *)0; + } + return ((void *)q); +} + +/* delete node with given key */ +void * +tdelete(const void *vkey, void **vrootp, + int (*compar)(const void *, const void *)) +{ + node **rootp = (node **)vrootp; + char *key = (char *)vkey; + node *p = (node *)1; + node *q; + node *r; + int cmp; + + if (rootp == (struct node_t **)0 || *rootp == (struct node_t *)0) + return ((struct node_t *)0); + while ((cmp = (*compar)(key, (*rootp)->key)) != 0) { + p = *rootp; + rootp = (cmp < 0) ? + &(*rootp)->left : /* follow left branch */ + &(*rootp)->right; /* follow right branch */ + if (*rootp == (struct node_t *)0) + return ((void *)0); /* key not found */ + } + r = (*rootp)->right; /* D1: */ + if ((q = (*rootp)->left) == (struct node_t *)0) /* Left (struct node_t *)0? */ + q = r; + else if (r != (struct node_t *)0) { /* Right link is null? */ + if (r->left == (struct node_t *)0) { /* D2: Find successor */ + r->left = q; + q = r; + } else { /* D3: Find (struct node_t *)0 link */ + for (q = r->left; q->left != (struct node_t *)0; q = r->left) + r = q; + r->left = q->right; + q->left = (*rootp)->left; + q->right = (*rootp)->right; + } + } + free((struct node_t *) *rootp); /* D4: Free node */ + *rootp = q; /* link parent to new node */ + return(p); +} + +/* Walk the nodes of a tree */ +static void +trecurse(node *root, void (*action)(const void *, VISIT, int), int level) +{ + if (root->left == (struct node_t *)0 && root->right == (struct node_t *)0) + (*action)(root, leaf, level); + else { + (*action)(root, preorder, level); + if (root->left != (struct node_t *)0) + trecurse(root->left, action, level + 1); + (*action)(root, postorder, level); + if (root->right != (struct node_t *)0) + trecurse(root->right, action, level + 1); + (*action)(root, endorder, level); + } +} + +/* Walk the nodes of a tree */ +void +twalk(const void *vroot, void (*action)(const void *, VISIT, int)) +{ + node *root = (node *)vroot; + + if (root != (node *)0 && action != (void (*)(const void *, VISIT, int))0) + trecurse(root, action, 0); +} diff --git a/tests/Android.mk b/tests/Android.mk index 3e8fbe664..b370b92c1 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -85,6 +85,7 @@ libBionicStandardTests_src_files := \ pthread_test.cpp \ regex_test.cpp \ sched_test.cpp \ + search_test.cpp \ signal_test.cpp \ stack_protector_test.cpp \ stack_unwinding_test.cpp \ diff --git a/tests/search_test.cpp b/tests/search_test.cpp new file mode 100644 index 000000000..3900c89cf --- /dev/null +++ b/tests/search_test.cpp @@ -0,0 +1,210 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +static int int_cmp(const void* lhs, const void* rhs) { + return *reinterpret_cast(rhs) - *reinterpret_cast(lhs); +} + +TEST(search, lfind_lsearch) { + int xs[10]; + memset(xs, 0, sizeof(xs)); + size_t x_size = 0; + + int needle; + + // lfind(3) can't find '2' in the empty table. + needle = 2; + ASSERT_EQ(nullptr, lfind(&needle, xs, &x_size, sizeof(xs[0]), int_cmp)); + ASSERT_EQ(0U, x_size); + + // lsearch(3) will add it. + ASSERT_EQ(&xs[0], lsearch(&needle, xs, &x_size, sizeof(xs[0]), int_cmp)); + ASSERT_EQ(2, xs[0]); + ASSERT_EQ(1U, x_size); + + // And then lfind(3) can find it. + ASSERT_EQ(&xs[0], lfind(&needle, xs, &x_size, sizeof(xs[0]), int_cmp)); + ASSERT_EQ(1U, x_size); + + // Inserting a duplicate does nothing (but returns the existing element). + ASSERT_EQ(&xs[0], lsearch(&needle, xs, &x_size, sizeof(xs[0]), int_cmp)); + ASSERT_EQ(1U, x_size); +} + +struct node { + node(const char* s) : s(strdup(s)) {} + + char* s; +}; + +static int node_cmp(const void* lhs, const void* rhs) { + return strcmp(reinterpret_cast(lhs)->s, reinterpret_cast(rhs)->s); +} + +static std::vector g_nodes; + +static void node_walk(const void* p, VISIT order, int) { + const node* n = *reinterpret_cast(p); + if (order == postorder || order == leaf) { + g_nodes.push_back(n->s); + } +} + +static size_t g_free_calls; + +static void node_free(void* p) { + node* n = reinterpret_cast(p); + free(n->s); + ++g_free_calls; +} + +TEST(search, tfind_tsearch_twalk_tdestroy) { + void* root = nullptr; + + node n1("z"); + node n2("a"); + node n3("m"); + + // tfind(3) can't find anything in the empty tree. + ASSERT_EQ(nullptr, tfind(&n1, &root, node_cmp)); + ASSERT_EQ(nullptr, tfind(&n2, &root, node_cmp)); + ASSERT_EQ(nullptr, tfind(&n3, &root, node_cmp)); + + // tsearch(3) inserts and returns a pointer to a new node. + void* i1 = tsearch(&n1, &root, node_cmp); + ASSERT_NE(nullptr, i1); + + // ...which tfind(3) will then return. + ASSERT_EQ(i1, tfind(&n1, &root, node_cmp)); + ASSERT_EQ(nullptr, tfind(&n2, &root, node_cmp)); + ASSERT_EQ(nullptr, tfind(&n3, &root, node_cmp)); + + // Add the other nodes. + ASSERT_NE(nullptr, tsearch(&n2, &root, node_cmp)); + ASSERT_NE(nullptr, tsearch(&n3, &root, node_cmp)); + + // Use twalk(3) to iterate over the nodes. + g_nodes.clear(); + twalk(root, node_walk); + ASSERT_EQ(3U, g_nodes.size()); + ASSERT_EQ("a", g_nodes[0]); + ASSERT_EQ("m", g_nodes[1]); + ASSERT_EQ("z", g_nodes[2]); + + // tdestroy(3) removes nodes under a node, calling our callback to destroy each one. + g_free_calls = 0; + tdestroy(root, node_free); + ASSERT_EQ(3U, g_free_calls); +} + +struct pod_node { + pod_node(int i) : i(i) {} + int i; +}; + +static int pod_node_cmp(const void* lhs, const void* rhs) { + return reinterpret_cast(rhs)->i - reinterpret_cast(lhs)->i; +} + +TEST(search, tdelete) { + void* root = nullptr; + + pod_node n1(123); + ASSERT_NE(nullptr, tsearch(&n1, &root, pod_node_cmp)); + + // tdelete(3) leaks n1. + pod_node not_there(456); + ASSERT_EQ(nullptr, tdelete(¬_there, &root, pod_node_cmp)); + ASSERT_NE(nullptr, tdelete(&n1, &root, pod_node_cmp)); +} + +struct q_node { + q_node(int i) : i(i) {} + + q_node* next; + q_node* prev; + + int i; +}; + +TEST(search, insque_remque) { + q_node zero(0); + q_node one(1); + q_node two(2); + + // Linear (not circular). + + insque(&zero, NULL); + insque(&one, &zero); + insque(&two, &one); + + int expected = 0; + for (q_node* q = &zero; q != NULL; q = q->next) { + ASSERT_EQ(expected, q->i); + ++expected; + } + ASSERT_EQ(3, expected); + + for (q_node* q = &two; q != NULL; q = q->prev) { + --expected; + ASSERT_EQ(expected, q->i); + } + ASSERT_EQ(0, expected); + + q_node* head = &zero; + + remque(&one); + ASSERT_EQ(0, head->i); + ASSERT_EQ(2, head->next->i); + ASSERT_EQ(nullptr, head->next->next); + + remque(&two); + ASSERT_EQ(0, head->i); + ASSERT_EQ(nullptr, head->next); + + remque(&zero); + + // Circular. + + zero.next = &zero; + zero.prev = &zero; + + insque(&one, &zero); + insque(&two, &one); + + ASSERT_EQ(0, head->i); + ASSERT_EQ(1, head->next->i); + ASSERT_EQ(2, head->next->next->i); + ASSERT_EQ(0, head->next->next->next->i); + ASSERT_EQ(1, head->next->next->next->next->i); + ASSERT_EQ(2, head->next->next->next->next->next->i); + + remque(&one); + ASSERT_EQ(0, head->i); + ASSERT_EQ(2, head->next->i); + ASSERT_EQ(0, head->next->next->i); + ASSERT_EQ(2, head->next->next->next->i); + + remque(&two); + ASSERT_EQ(0, head->i); + ASSERT_EQ(0, head->next->i); + + remque(&zero); +} From 34b258dd692951ab2236e134e5520367cda60125 Mon Sep 17 00:00:00 2001 From: Raghu Gandham Date: Thu, 24 Jul 2014 15:56:51 -0700 Subject: [PATCH 060/148] [MIPS] Fix atomic_is_lock_free test for mips32. On 32-bit MIPS, 64-bit atomic ops are achieved through locks. So allow the test to fail for atomic_intmax_t on 32-bit MIPS. (cherry picked from commit f1837377d215a6eda294b6ac7552b226deee91ce) Change-Id: I973d999c31c9ab89b5a7b709beff6486b93408f2 --- tests/stdatomic_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp index d41bfa92e..5e88c8801 100644 --- a/tests/stdatomic_test.cpp +++ b/tests/stdatomic_test.cpp @@ -66,7 +66,12 @@ TEST(stdatomic, atomic_is_lock_free) { atomic_char small; atomic_intmax_t big; ASSERT_TRUE(atomic_is_lock_free(&small)); + // atomic_intmax_t(size = 64) is not lock free on mips32. +#if defined(__mips__) && !defined(__LP64__) + ASSERT_FALSE(atomic_is_lock_free(&big)); +#else ASSERT_TRUE(atomic_is_lock_free(&big)); +#endif } TEST(stdatomic, atomic_flag) { From 65549969488bbce7f5d1b57714ba32c466943470 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Thu, 24 Jul 2014 15:33:25 -0700 Subject: [PATCH 061/148] Fix global variable initialization for linker Linker now calls init functions for itself. (cherry picked from commit 4151ea73b75e274d1ff80b42d9d457a783208516) Change-Id: I3300fe22de8ad8466a5b1c2d551429769a42852d --- linker/linker.cpp | 9 +++------ linker/linker_allocator.cpp | 9 ++------- linker/linker_allocator.h | 6 ++---- linker/tests/linker_allocator_test.cpp | 4 ---- 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/linker/linker.cpp b/linker/linker.cpp index 04ffe5996..4c765944a 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -2077,12 +2077,6 @@ static ElfW(Addr) __linker_init_post_relocation(KernelArgumentBlock& args, ElfW( ldpreload_env = linker_env_get("LD_PRELOAD"); } - // Linker does not call constructors for its own - // global variables so we need to initialize - // the allocators explicitly. - g_soinfo_allocator.init(); - g_soinfo_links_allocator.init(); - INFO("[ android linker & debugger ]"); soinfo* si = soinfo_alloc(args.argv[0], NULL); @@ -2271,6 +2265,9 @@ extern "C" ElfW(Addr) __linker_init(void* raw_args) { _exit(EXIT_FAILURE); } + // lets properly initialize global variables + linker_so.CallConstructors(); + // We have successfully fixed our own relocations. It's safe to run // the main part of the linker now. args.abort_message_ptr = &g_abort_message; diff --git a/linker/linker_allocator.cpp b/linker/linker_allocator.cpp index c8b97b121..f5d3745b4 100644 --- a/linker/linker_allocator.cpp +++ b/linker/linker_allocator.cpp @@ -28,17 +28,12 @@ struct FreeBlockInfo { size_t num_free_blocks; }; -LinkerBlockAllocator::LinkerBlockAllocator() - : block_size_(0), +LinkerBlockAllocator::LinkerBlockAllocator(size_t block_size) + : block_size_(block_size < sizeof(FreeBlockInfo) ? sizeof(FreeBlockInfo) : block_size), page_list_(nullptr), free_block_list_(nullptr) {} -void LinkerBlockAllocator::init(size_t block_size) { - block_size_ = block_size < sizeof(FreeBlockInfo) ? sizeof(FreeBlockInfo) : block_size; -} - - void* LinkerBlockAllocator::alloc() { if (free_block_list_ == nullptr) { create_new_page(); diff --git a/linker/linker_allocator.h b/linker/linker_allocator.h index fbf58fec3..5d3563fbd 100644 --- a/linker/linker_allocator.h +++ b/linker/linker_allocator.h @@ -32,9 +32,8 @@ struct LinkerAllocatorPage; */ class LinkerBlockAllocator { public: - LinkerBlockAllocator(); + explicit LinkerBlockAllocator(size_t block_size); - void init(size_t block_size); void* alloc(); void free(void* block); void protect_all(int prot); @@ -60,8 +59,7 @@ class LinkerBlockAllocator { template class LinkerAllocator { public: - LinkerAllocator() : block_allocator_() {} - void init() { block_allocator_.init(sizeof(T)); } + LinkerAllocator() : block_allocator_(sizeof(T)) {} T* alloc() { return reinterpret_cast(block_allocator_.alloc()); } void free(T* t) { block_allocator_.free(t); } void protect_all(int prot) { block_allocator_.protect_all(prot); } diff --git a/linker/tests/linker_allocator_test.cpp b/linker/tests/linker_allocator_test.cpp index 0ed82528f..9292a054d 100644 --- a/linker/tests/linker_allocator_test.cpp +++ b/linker/tests/linker_allocator_test.cpp @@ -50,7 +50,6 @@ static size_t kPageSize = sysconf(_SC_PAGE_SIZE); TEST(linker_allocator, test_nominal) { LinkerAllocator allocator; - allocator.init(); test_struct_nominal* ptr1 = allocator.alloc(); ASSERT_TRUE(ptr1 != nullptr); @@ -67,7 +66,6 @@ TEST(linker_allocator, test_nominal) { TEST(linker_allocator, test_small) { LinkerAllocator allocator; - allocator.init(); char* ptr1 = reinterpret_cast(allocator.alloc()); char* ptr2 = reinterpret_cast(allocator.alloc()); @@ -79,7 +77,6 @@ TEST(linker_allocator, test_small) { TEST(linker_allocator, test_larger) { LinkerAllocator allocator; - allocator.init(); test_struct_larger* ptr1 = allocator.alloc(); test_struct_larger* ptr2 = allocator.alloc(); @@ -103,7 +100,6 @@ TEST(linker_allocator, test_larger) { static void protect_all() { LinkerAllocator allocator; - allocator.init(); // number of allocs to reach the end of first page size_t n = kPageSize/sizeof(test_struct_larger) - 1; From 708c11205443cda14cfb21138d441106aa77a5f9 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 25 Jul 2014 11:55:59 -0700 Subject: [PATCH 062/148] Start hiding "private/bionic_time.h". Bug: 15765976 (cherry picked from commit 905e6d58aaf515bf237e62078f8a321920fe4c6b) Change-Id: Ic7435308e8b521886f42ac7bf59531924921ea67 --- benchmarks/time_benchmark.cpp | 20 ------------------- libc/include/sys/cdefs_elf.h | 2 +- libc/private/bionic_time.h | 28 ++------------------------ libc/tzcode/localtime.c | 7 +++++-- libc/tzcode/strftime.c | 37 +++++++++++++++++++++++++++-------- tests/time_test.cpp | 37 ----------------------------------- 6 files changed, 37 insertions(+), 94 deletions(-) diff --git a/benchmarks/time_benchmark.cpp b/benchmarks/time_benchmark.cpp index 0a146aef7..22f6e8ea0 100644 --- a/benchmarks/time_benchmark.cpp +++ b/benchmarks/time_benchmark.cpp @@ -19,26 +19,6 @@ #include #include -#if defined(__BIONIC__) - -// Used by the horrible android.text.format.Time class, which is used by Calendar. http://b/8270865. -extern "C" void localtime_tz(const time_t* const timep, struct tm* tmp, const char* tz); - -static void BM_time_localtime_tz(int iters) { - StartBenchmarkTiming(); - - time_t now(time(NULL)); - tm broken_down_time; - for (int i = 0; i < iters; ++i) { - localtime_tz(&now, &broken_down_time, "Europe/Berlin"); - } - - StopBenchmarkTiming(); -} -BENCHMARK(BM_time_localtime_tz); - -#endif - static void BM_time_clock_gettime(int iters) { StartBenchmarkTiming(); diff --git a/libc/include/sys/cdefs_elf.h b/libc/include/sys/cdefs_elf.h index b5db13e64..4dd7dc347 100644 --- a/libc/include/sys/cdefs_elf.h +++ b/libc/include/sys/cdefs_elf.h @@ -68,7 +68,7 @@ #ifdef __LP64__ #define __LIBC64_HIDDEN__ __LIBC_HIDDEN__ #else -#define __LIBC64_HIDDEN__ +#define __LIBC64_HIDDEN__ __LIBC_ABI_PUBLIC__ #endif /* Used to tag non-static symbols that are public and exposed by the shared library. */ diff --git a/libc/private/bionic_time.h b/libc/private/bionic_time.h index ca5c14636..030dcfd99 100644 --- a/libc/private/bionic_time.h +++ b/libc/private/bionic_time.h @@ -33,32 +33,8 @@ __BEGIN_DECLS -#ifndef _BIONIC_STRFTIME_TZ_DECLARED -#define _BIONIC_STRFTIME_TZ_DECLARED - -struct strftime_locale { - const char * mon[12]; - const char * month[12]; - const char * standalone_month[12]; - const char * wday[7]; - const char * weekday[7]; - const char * X_fmt; - const char * x_fmt; - const char * c_fmt; - const char * am; - const char * pm; - const char * date_fmt; -}; - -/* - * Note: you should consider these extensions deprecated and use managed code or icu4c instead. - * We'd like to hide them but they're currently still used in frameworks code. - */ -extern size_t strftime_tz(char*, size_t, const char*, const struct tm*, const struct strftime_locale*); -extern time_t mktime_tz(struct tm* const, char const*); -extern void localtime_tz(const time_t* const, struct tm*, const char*); - -#endif /* _BIONIC_STRFTIME_TZ_DECLARED */ +// We can't remove this (and this file) until we fix MtpUtils.cpp. +time_t mktime_tz(struct tm* const, char const*); __END_DECLS diff --git a/libc/tzcode/localtime.c b/libc/tzcode/localtime.c index 4dd7ab044..2e6804ed3 100644 --- a/libc/tzcode/localtime.c +++ b/libc/tzcode/localtime.c @@ -2293,7 +2293,8 @@ static int __bionic_tzload_cached(const char* name, struct state* const sp, cons } // Non-standard API: mktime(3) but with an explicit timezone parameter. -time_t __attribute__((visibility("default"))) mktime_tz(struct tm* const tmp, const char* tz) { +// This can't actually be hidden/removed until we fix MtpUtils.cpp +__attribute__((visibility("default"))) time_t mktime_tz(struct tm* const tmp, const char* tz) { struct state* st = malloc(sizeof(*st)); time_t return_value; @@ -2310,7 +2311,8 @@ time_t __attribute__((visibility("default"))) mktime_tz(struct tm* const tmp, co } // Non-standard API: localtime(3) but with an explicit timezone parameter. -void __attribute__((visibility("default"))) localtime_tz(const time_t* const timep, struct tm* tmp, const char* tz) { +#if !defined(__LP64__) +__attribute__((visibility("default"))) void localtime_tz(const time_t* const timep, struct tm* tmp, const char* tz) { struct state* st = malloc(sizeof(*st)); if (st == NULL) @@ -2322,5 +2324,6 @@ void __attribute__((visibility("default"))) localtime_tz(const time_t* const tim localsub(timep, 0L, tmp, st); free(st); } +#endif // END android-added diff --git a/libc/tzcode/strftime.c b/libc/tzcode/strftime.c index f996f4841..c4ff19819 100644 --- a/libc/tzcode/strftime.c +++ b/libc/tzcode/strftime.c @@ -29,16 +29,38 @@ #include "locale.h" #if __ANDROID__ -/* Android: struct lc_time_T is defined as strftime_locale in "bionic_time.h" */ -#include "private/bionic_time.h" /* for strftime_tz */ -#define lc_time_T strftime_locale + +/* + * This has an extra standalone_month array field compared to upstream. + * We only need to keep that if we leave the strftime_tz symbol exposed. + * Even then, this structure was never in an NDK header file. + */ +struct lc_time_T { + const char * mon[12]; + const char * month[12]; + const char * standalone_month[12]; + const char * wday[7]; + const char * weekday[7]; + const char * X_fmt; + const char * x_fmt; + const char * c_fmt; + const char * am; + const char * pm; + const char * date_fmt; +}; + +/* LP32 had a 32-bit time_t, so we need to work around that here. */ #if defined(__LP64__) #define time64_t time_t #define mktime64 mktime #else #include #endif + #include + +size_t strftime_tz(char*, size_t, const char*, const struct tm*, const struct lc_time_T*); + #else // not __ANDROID__ struct lc_time_T { const char * mon[MONSPERYEAR]; @@ -116,7 +138,7 @@ static const struct lc_time_T C_time_locale = { static char * _add(const char *, char *, const char *, int); static char * _conv(int, const char *, char *, const char *); static char * _fmt(const char *, const struct tm *, char *, const char *, - int *, const struct strftime_locale*); + int *, const struct lc_time_T*); static char * _yconv(int, int, int, int, char *, const char *, int); static char * getformat(int, char *, char *, char *, char *); @@ -143,13 +165,12 @@ const struct tm * const t; return strftime_tz(s, maxsize, format, t, Locale); } -size_t -__attribute__((visibility("default"))) strftime_tz(s, maxsize, format, t, locale) +__LIBC64_HIDDEN__ size_t strftime_tz(s, maxsize, format, t, locale) char * const s; const size_t maxsize; const char * const format; const struct tm * const t; -const struct strftime_locale *locale; +const struct lc_time_T *locale; { char * p; int warn; @@ -202,7 +223,7 @@ const struct tm * const t; char * pt; const char * const ptlim; int * warnp; -const struct strftime_locale* locale; +const struct lc_time_T* locale; { for ( ; *format; ++format) { if (*format == '%') { diff --git a/tests/time_test.cpp b/tests/time_test.cpp index 12b1ea75e..241c4a0c4 100644 --- a/tests/time_test.cpp +++ b/tests/time_test.cpp @@ -27,34 +27,6 @@ #include "ScopedSignalHandler.h" -#if defined(__BIONIC__) // mktime_tz is a bionic extension. -#include -#endif // __BIONIC__ - -TEST(time, mktime_tz) { -#if defined(__BIONIC__) - struct tm epoch; - memset(&epoch, 0, sizeof(tm)); - epoch.tm_year = 1970 - 1900; - epoch.tm_mon = 1; - epoch.tm_mday = 1; - - // Alphabetically first. Coincidentally equivalent to UTC. - ASSERT_EQ(2678400, mktime_tz(&epoch, "Africa/Abidjan")); - - // Alphabetically last. Coincidentally equivalent to UTC. - ASSERT_EQ(2678400, mktime_tz(&epoch, "Zulu")); - - // Somewhere in the middle, not UTC. - ASSERT_EQ(2707200, mktime_tz(&epoch, "America/Los_Angeles")); - - // Missing. Falls back to UTC. - ASSERT_EQ(2678400, mktime_tz(&epoch, "PST")); -#else // __BIONIC__ - GTEST_LOG_(INFO) << "This test does nothing.\n"; -#endif // __BIONIC__ -} - TEST(time, gmtime) { time_t t = 0; tm* broken_down = gmtime(&t); @@ -108,9 +80,6 @@ TEST(time, mktime_10310929) { #if !defined(__LP64__) // 32-bit bionic stupidly had a signed 32-bit time_t. ASSERT_EQ(-1, mktime(&t)); -#if defined(__BIONIC__) - ASSERT_EQ(-1, mktime_tz(&t, "UTC")); -#endif #else // Everyone else should be using a signed 64-bit time_t. ASSERT_GE(sizeof(time_t) * 8, 64U); @@ -118,16 +87,10 @@ TEST(time, mktime_10310929) { setenv("TZ", "America/Los_Angeles", 1); tzset(); ASSERT_EQ(static_cast(4108348800U), mktime(&t)); -#if defined(__BIONIC__) - ASSERT_EQ(static_cast(4108320000U), mktime_tz(&t, "UTC")); -#endif setenv("TZ", "UTC", 1); tzset(); ASSERT_EQ(static_cast(4108320000U), mktime(&t)); -#if defined(__BIONIC__) - ASSERT_EQ(static_cast(4108348800U), mktime_tz(&t, "America/Los_Angeles")); -#endif #endif } From c1a6a7256026431a9ae49ef2a6139ea99410819b Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 25 Jul 2014 15:50:31 -0700 Subject: [PATCH 063/148] Remove localtime_tz and strftime_tz. This also brings our copy of strftime.c much closer to upstream, though we still have several GNU extensions and hacks to deal with Android32's broken time_t. Bug: 15765976 (cherry picked from commit 39d903aea901cd29a4eef3a82c2dbda59b5bc292) Change-Id: Ie278d3e976b7adc77bad5ce795dd4899cfbf3648 --- libc/tzcode/localtime.c | 16 ----- libc/tzcode/strftime.c | 149 +++++++++++----------------------------- 2 files changed, 41 insertions(+), 124 deletions(-) diff --git a/libc/tzcode/localtime.c b/libc/tzcode/localtime.c index 2e6804ed3..5e4e962f0 100644 --- a/libc/tzcode/localtime.c +++ b/libc/tzcode/localtime.c @@ -2310,20 +2310,4 @@ __attribute__((visibility("default"))) time_t mktime_tz(struct tm* const tmp, co return return_value; } -// Non-standard API: localtime(3) but with an explicit timezone parameter. -#if !defined(__LP64__) -__attribute__((visibility("default"))) void localtime_tz(const time_t* const timep, struct tm* tmp, const char* tz) { - struct state* st = malloc(sizeof(*st)); - - if (st == NULL) - return; - if (__bionic_tzload_cached(tz, st, TRUE) != 0) { - // TODO: not sure what's best here, but for now, we fall back to gmt. - gmtload(st); - } - localsub(timep, 0L, tmp, st); - free(st); -} -#endif - // END android-added diff --git a/libc/tzcode/strftime.c b/libc/tzcode/strftime.c index c4ff19819..4328b4c53 100644 --- a/libc/tzcode/strftime.c +++ b/libc/tzcode/strftime.c @@ -30,25 +30,6 @@ #if __ANDROID__ -/* - * This has an extra standalone_month array field compared to upstream. - * We only need to keep that if we leave the strftime_tz symbol exposed. - * Even then, this structure was never in an NDK header file. - */ -struct lc_time_T { - const char * mon[12]; - const char * month[12]; - const char * standalone_month[12]; - const char * wday[7]; - const char * weekday[7]; - const char * X_fmt; - const char * x_fmt; - const char * c_fmt; - const char * am; - const char * pm; - const char * date_fmt; -}; - /* LP32 had a 32-bit time_t, so we need to work around that here. */ #if defined(__LP64__) #define time64_t time_t @@ -59,9 +40,8 @@ struct lc_time_T { #include -size_t strftime_tz(char*, size_t, const char*, const struct tm*, const struct lc_time_T*); +#endif -#else // not __ANDROID__ struct lc_time_T { const char * mon[MONSPERYEAR]; const char * month[MONSPERYEAR]; @@ -74,9 +54,8 @@ struct lc_time_T { const char * pm; const char * date_fmt; }; -#endif -#if LOCALE_HOME +#ifdef LOCALE_HOME #include "sys/stat.h" static struct lc_time_T localebuf; static struct lc_time_T * _loc(void); @@ -93,9 +72,6 @@ static const struct lc_time_T C_time_locale = { }, { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - }, { - "January", "February", "March", "April", "May", "June", - "July", "August", "September", "October", "November", "December" }, { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" @@ -138,7 +114,7 @@ static const struct lc_time_T C_time_locale = { static char * _add(const char *, char *, const char *, int); static char * _conv(int, const char *, char *, const char *); static char * _fmt(const char *, const struct tm *, char *, const char *, - int *, const struct lc_time_T*); + int *); static char * _yconv(int, int, int, int, char *, const char *, int); static char * getformat(int, char *, char *, char *, char *); @@ -156,28 +132,18 @@ extern char * tzname[]; #define FORCE_LOWER_CASE 0x100 size_t -strftime(s, maxsize, format, t) -char * const s; -const size_t maxsize; -const char * const format; -const struct tm * const t; -{ - return strftime_tz(s, maxsize, format, t, Locale); -} - -__LIBC64_HIDDEN__ size_t strftime_tz(s, maxsize, format, t, locale) -char * const s; -const size_t maxsize; -const char * const format; -const struct tm * const t; -const struct lc_time_T *locale; +strftime(char * const s, const size_t maxsize, const char *const format, + const struct tm *const t) { char * p; int warn; tzset(); +#ifdef LOCALE_HOME + localebuf.mon[0] = 0; +#endif /* defined LOCALE_HOME */ warn = IN_NONE; - p = _fmt(((format == NULL) ? "%c" : format), t, s, s + maxsize, &warn, locale); + p = _fmt(((format == NULL) ? "%c" : format), t, s, s + maxsize, &warn); #ifndef NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU if (warn != IN_NONE && getenv(YEAR_2000_NAME) != NULL) { (void) fprintf(stderr, "\n"); @@ -217,13 +183,8 @@ static char *getformat(int modifier, char *normal, char *underscore, } static char * -_fmt(format, t, pt, ptlim, warnp, locale) -const char * format; -const struct tm * const t; -char * pt; -const char * const ptlim; -int * warnp; -const struct lc_time_T* locale; +_fmt(const char *format, const struct tm *const t, char * pt, + const char *const ptlim, int *warnp) { for ( ; *format; ++format) { if (*format == '%') { @@ -236,33 +197,26 @@ label: case 'A': pt = _add((t->tm_wday < 0 || t->tm_wday >= DAYSPERWEEK) ? - "?" : locale->weekday[t->tm_wday], + "?" : Locale->weekday[t->tm_wday], pt, ptlim, modifier); continue; case 'a': pt = _add((t->tm_wday < 0 || t->tm_wday >= DAYSPERWEEK) ? - "?" : locale->wday[t->tm_wday], + "?" : Locale->wday[t->tm_wday], pt, ptlim, modifier); continue; case 'B': - if (modifier == '-') { - pt = _add((t->tm_mon < 0 || + pt = _add((t->tm_mon < 0 || t->tm_mon >= MONSPERYEAR) ? - "?" : locale->standalone_month[t->tm_mon], + "?" : Locale->month[t->tm_mon], pt, ptlim, modifier); - } else { - pt = _add((t->tm_mon < 0 || - t->tm_mon >= MONSPERYEAR) ? - "?" : locale->month[t->tm_mon], - pt, ptlim, modifier); - } continue; case 'b': case 'h': pt = _add((t->tm_mon < 0 || t->tm_mon >= MONSPERYEAR) ? - "?" : locale->mon[t->tm_mon], + "?" : Locale->mon[t->tm_mon], pt, ptlim, modifier); continue; case 'C': @@ -280,7 +234,7 @@ label: { int warn2 = IN_SOME; - pt = _fmt(locale->c_fmt, t, pt, ptlim, warnp, locale); + pt = _fmt(Locale->c_fmt, t, pt, ptlim, &warn2); if (warn2 == IN_ALL) warn2 = IN_THIS; if (warn2 > *warnp) @@ -288,7 +242,7 @@ label: } continue; case 'D': - pt = _fmt("%m/%d/%y", t, pt, ptlim, warnp, locale); + pt = _fmt("%m/%d/%y", t, pt, ptlim, warnp); continue; case 'd': pt = _conv(t->tm_mday, @@ -322,7 +276,7 @@ label: pt, ptlim); continue; case 'F': - pt = _fmt("%Y-%m-%d", t, pt, ptlim, warnp, locale); + pt = _fmt("%Y-%m-%d", t, pt, ptlim, warnp); continue; case 'H': pt = _conv(t->tm_hour, @@ -363,7 +317,7 @@ label: /* ** After all this time, still unclaimed! */ - pt = _add("kitchen sink", pt, ptlim, modifier); + pt = _add("kitchen sink", pt, ptlim); continue; #endif /* defined KITCHEN_SINK */ case 'l': @@ -399,21 +353,21 @@ label: continue; case 'p': pt = _add((t->tm_hour >= (HOURSPERDAY / 2)) ? - locale->pm : - locale->am, + Locale->pm : + Locale->am, pt, ptlim, modifier); continue; case 'P': pt = _add((t->tm_hour >= (HOURSPERDAY / 2)) ? - locale->pm : - locale->am, + Locale->pm : + Locale->am, pt, ptlim, FORCE_LOWER_CASE); continue; case 'R': - pt = _fmt("%H:%M", t, pt, ptlim, warnp, locale); + pt = _fmt("%H:%M", t, pt, ptlim, warnp); continue; case 'r': - pt = _fmt("%I:%M:%S %p", t, pt, ptlim, warnp, locale); + pt = _fmt("%I:%M:%S %p", t, pt, ptlim, warnp); continue; case 'S': pt = _conv(t->tm_sec, @@ -439,7 +393,7 @@ label: } continue; case 'T': - pt = _fmt("%H:%M:%S", t, pt, ptlim, warnp, locale); + pt = _fmt("%H:%M:%S", t, pt, ptlim, warnp); continue; case 't': pt = _add("\t", pt, ptlim, modifier); @@ -470,7 +424,7 @@ label: ** (01-53)." ** (ado, 1993-05-24) ** -** From "http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html" by Markus Kuhn: +** From by Markus Kuhn: ** "Week 01 of a year is per definition the first week which has the ** Thursday in this year, which is equivalent to the week which contains ** the fourth day of January. In other words, the first week of a new year @@ -540,11 +494,7 @@ label: #endif /* defined XPG4_1994_04_09 */ if (*format == 'V') pt = _conv(w, - getformat(modifier, - "%02d", - "%2d", - "%d", - "%02d"), + getformat(modifier, "%02d", "%2d", "%d", "%02d"), pt, ptlim); else if (*format == 'g') { *warnp = IN_ALL; @@ -560,7 +510,7 @@ label: ** "date as dd-bbb-YYYY" ** (ado, 1993-05-24) */ - pt = _fmt("%e-%b-%Y", t, pt, ptlim, warnp, locale); + pt = _fmt("%e-%b-%Y", t, pt, ptlim, warnp); continue; case 'W': pt = _conv((t->tm_yday + DAYSPERWEEK - @@ -575,13 +525,13 @@ label: pt = _conv(t->tm_wday, "%d", pt, ptlim); continue; case 'X': - pt = _fmt(locale->X_fmt, t, pt, ptlim, warnp, locale); + pt = _fmt(Locale->X_fmt, t, pt, ptlim, warnp); continue; case 'x': { int warn2 = IN_SOME; - pt = _fmt(locale->x_fmt, t, pt, ptlim, &warn2, locale); + pt = _fmt(Locale->x_fmt, t, pt, ptlim, &warn2); if (warn2 == IN_ALL) warn2 = IN_THIS; if (warn2 > *warnp) @@ -670,8 +620,8 @@ label: } continue; case '+': - pt = _fmt(locale->date_fmt, t, pt, ptlim, - warnp, locale); + pt = _fmt(Locale->date_fmt, t, pt, ptlim, + warnp); continue; case '%': /* @@ -691,11 +641,8 @@ label: } static char * -_conv(n, format, pt, ptlim) -const int n; -const char * const format; -char * const pt; -const char * const ptlim; +_conv(const int n, const char *const format, char *const pt, + const char *const ptlim) { char buf[INT_STRLEN_MAXIMUM(int) + 1]; @@ -704,11 +651,7 @@ const char * const ptlim; } static char * -_add(str, pt, ptlim, modifier) -const char * str; -char * pt; -const char * const ptlim; -int modifier; +_add(const char *str, char *pt, const char *const ptlim, int modifier) { int c; @@ -756,14 +699,8 @@ int modifier; */ static char * -_yconv(a, b, convert_top, convert_yy, pt, ptlim, modifier) -const int a; -const int b; -const int convert_top; -const int convert_yy; -char * pt; -const char * const ptlim; -int modifier; +_yconv(const int a, const int b, const int convert_top, const int convert_yy, + char *pt, const char *const ptlim, int modifier) { register int lead; register int trail; @@ -782,13 +719,9 @@ int modifier; if (convert_top) { if (lead == 0 && trail < 0) pt = _add("-0", pt, ptlim, modifier); - else pt = _conv(lead, getformat(modifier, "%02d", - "%2d", "%d", "%02d"), - pt, ptlim); + else pt = _conv(lead, getformat(modifier, "%02d", "%2d", "%d", "%02d"), pt, ptlim); } if (convert_yy) - pt = _conv(((trail < 0) ? -trail : trail), - getformat(modifier, "%02d", "%2d", "%d", "%02d"), - pt, ptlim); + pt = _conv(((trail < 0) ? -trail : trail), getformat(modifier, "%02d", "%2d", "%d", "%02d"), pt, ptlim); return pt; } From b1b60c30bf321c0fc02264b953b5c16c49d34457 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 25 Jul 2014 20:31:47 -0700 Subject: [PATCH 064/148] Use vsnprintf(3) in syslog(3). It seemed like a clever trick to use the internal log message formatting code in syslog(3), but on reflection that means you can't (for example) format floating point numbers. This patch switches us over to using good old vsnprintf(3), even though that requires us to jump through a few hoops. There's no obvious way to unit test this, so I wrote a little program and ran that. Bug: 14292866 Change-Id: I9c83500ba9cbb209b6f496067a91bf69434eeef5 --- libc/bionic/libc_logging.cpp | 8 ------ libc/bionic/syslog.cpp | 54 ++++++++++++++++++++++++++++++++---- tests/libc_logging_test.cpp | 11 -------- 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp index 1fb8a84ab..e656a1255 100644 --- a/libc/bionic/libc_logging.cpp +++ b/libc/bionic/libc_logging.cpp @@ -230,9 +230,6 @@ static void SendRepeat(Out& o, char ch, int count) { /* Perform formatted output to an output target 'o' */ template static void out_vformat(Out& o, const char* format, va_list args) { -#if 0 - int caller_errno = errno; -#endif int nn = 0; for (;;) { @@ -381,11 +378,6 @@ static void out_vformat(Out& o, const char* format, va_list args) { } else if (c == '%') { buffer[0] = '%'; buffer[1] = '\0'; -#if 0 - } else if (c == 'm') { - // syslog-like %m for strerror(errno). - str = strerror(caller_errno); -#endif } else { __assert(__FILE__, __LINE__, "conversion specifier unsupported"); } diff --git a/libc/bionic/syslog.cpp b/libc/bionic/syslog.cpp index d3b1b1eb7..d8b8b190d 100644 --- a/libc/bionic/syslog.cpp +++ b/libc/bionic/syslog.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include @@ -46,10 +47,9 @@ void syslog(int priority, const char* fmt, ...) { va_end(args); } -void vsyslog(int /*priority*/, const char* /*fmt*/, va_list /*args*/) { -// HACK to avoid lock up on certain devices. This will be reverted when -// that is fixed. -#if 0 +void vsyslog(int priority, const char* fmt, va_list args) { + int caller_errno = errno; + // Check whether we're supposed to be logging messages of this priority. if ((syslog_priority_mask & LOG_MASK(LOG_PRI(priority))) == 0) { return; @@ -74,6 +74,48 @@ void vsyslog(int /*priority*/, const char* /*fmt*/, va_list /*args*/) { android_log_priority = ANDROID_LOG_DEBUG; } - __libc_format_log_va_list(android_log_priority, log_tag, fmt, args); -#endif + // glibc's printf family support %m directly, but our BSD-based one doesn't. + // If the format string seems to contain "%m", rewrite it. + const char* log_fmt = fmt; + if (strstr(fmt, "%m") != NULL) { + size_t dst_len = 1024; + char* dst = reinterpret_cast(malloc(dst_len)); + log_fmt = dst; + + const char* src = fmt; + for (; dst_len > 0 && *src != '\0'; ++src) { + if (*src == '%' && *(src + 1) == 'm') { + // Expand %m. + size_t n = strlcpy(dst, strerror(caller_errno), dst_len); + if (n >= dst_len) { + n = dst_len; + } + dst += n; + dst_len -= n; + ++src; + } else if (*src == '%' && *(src + 1) == '%') { + // We need to copy pairs of '%'s so the %m test works. + if (dst_len <= 2) { + break; + } + *dst++ = '%'; --dst_len; + *dst++ = '%'; --dst_len; + ++src; + } else { + *dst++ = *src; --dst_len; + } + } + *dst = '\0'; + } + + // We can't let __libc_format_log do the formatting because it doesn't support + // all the printf functionality. + char log_line[1024]; + vsnprintf(log_line, sizeof(log_line), log_fmt, args); + + if (log_fmt != fmt) { + free(const_cast(log_fmt)); + } + + __libc_format_log(android_log_priority, log_tag, "%s", log_line); } diff --git a/tests/libc_logging_test.cpp b/tests/libc_logging_test.cpp index ef39d1c03..950161e78 100644 --- a/tests/libc_logging_test.cpp +++ b/tests/libc_logging_test.cpp @@ -176,14 +176,3 @@ TEST(libc_logging, lld_LLONG_MIN) { GTEST_LOG_(INFO) << "This test does nothing.\n"; #endif // __BIONIC__ } - -TEST(libc_logging, m) { -#if defined(__BIONIC__) - char buf[BUFSIZ]; - errno = EBADF; - __libc_format_buffer(buf, sizeof(buf), "<%m>"); - EXPECT_STREQ("", buf); -#else // __BIONIC__ - GTEST_LOG_(INFO) << "This test does nothing.\n"; -#endif // __BIONIC__ -} From 78e4f8fed2c162f8ada55180e48487ef2180cf93 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 28 Jul 2014 12:24:22 -0700 Subject: [PATCH 065/148] syscall(3)'s return type should be long. This doesn't require us to change any of the syscall implementations because (a) the LP32 ones have sizeof(int) == sizeof(long) anyway, which is how we never noticed this bug before and (b) the LP64 ones all use a 64-bit register for the result (and for the syscall number too). Bug: https://code.google.com/p/android/issues/detail?id=73952 Bug: 16568314 (cherry picked from commit 21972b61ec0572395c5684eebc6cc7b3a4c9e3be) Change-Id: Ifbc424be29e5650ec72a24df25dd35f24fdd5b3c --- libc/include/sys/syscall.h | 2 +- tests/unistd_test.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libc/include/sys/syscall.h b/libc/include/sys/syscall.h index a44b2e5ba..34a29df3f 100644 --- a/libc/include/sys/syscall.h +++ b/libc/include/sys/syscall.h @@ -37,7 +37,7 @@ __BEGIN_DECLS -int syscall(int number, ...); +long syscall(long number, ...); __END_DECLS diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp index 58c9ad94f..2a656574c 100644 --- a/tests/unistd_test.cpp +++ b/tests/unistd_test.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -212,6 +213,14 @@ TEST(unistd, read_EBADF) { ASSERT_EQ(EBADF, errno); } +TEST(unistd, syscall_long) { + // Check that syscall(3) correctly returns long results. + // https://code.google.com/p/android/issues/detail?id=73952 + // We assume that the break is > 4GiB, but this is potentially flaky. + uintptr_t p = reinterpret_cast(sbrk(0)); + ASSERT_EQ(p, static_cast(syscall(__NR_brk, 0))); +} + TEST(unistd, alarm) { ASSERT_EQ(0U, alarm(0)); } From 2be1be47aa9b63568fe6ce1e0a4029b37d90764d Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 28 Jul 2014 16:16:38 -0700 Subject: [PATCH 066/148] Revert "Add a hack to until we can fix libvpx." This reverts commit 3fb5097a7eec40404760c304b36c8b657b374cab. libvpx is now fixed. Bug: 15598056 Change-Id: Icca974e667f92206505f484bd291726eb0150f68 --- libc/include/stdlib.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index 0dac6506a..195765aea 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -111,12 +111,6 @@ void arc4random_buf(void*, size_t); #define RAND_MAX 0x7fffffff -/* Work around x86/x86-64 libvpx build breakage caused by postproc_x86.c. */ -#if (defined(__i386__) || defined(__x86_64__)) && defined(rand) -#undef rand -#define __rand lrand48 -#endif - int rand(void); int rand_r(unsigned int*); void srand(unsigned int); From 5febb0da6f6d7106c403e6809917d89d6ee081ad Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Mon, 28 Jul 2014 15:05:51 -0700 Subject: [PATCH 067/148] Fix 'adb shell /system/bin/linker' crash Bug: https://code.google.com/p/android/issues/detail?id=63174 (cherry picked from commit efe13832dccf2cec2898b89ca4418a6aac29d3eb) Change-Id: I43629e4a14870f67abc2dd5ff2e3040c47b2168d --- linker/linker.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/linker/linker.cpp b/linker/linker.cpp index 4c765944a..59b99383e 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -2221,6 +2221,8 @@ static ElfW(Addr) get_elf_exec_load_bias(const ElfW(Ehdr)* elf) { return 0; } +extern "C" void _start(); + /* * This is the entry point for the linker, called from begin.S. This * method is responsible for fixing the linker's own relocations, and @@ -2238,12 +2240,23 @@ extern "C" ElfW(Addr) __linker_init(void* raw_args) { KernelArgumentBlock args(raw_args); ElfW(Addr) linker_addr = args.getauxval(AT_BASE); + ElfW(Addr) entry_point = args.getauxval(AT_ENTRY); ElfW(Ehdr)* elf_hdr = reinterpret_cast(linker_addr); ElfW(Phdr)* phdr = reinterpret_cast(linker_addr + elf_hdr->e_phoff); soinfo linker_so; memset(&linker_so, 0, sizeof(soinfo)); + // If the linker is not acting as PT_INTERP entry_point is equal to + // _start. Which means that the linker is running as an executable and + // already linked by PT_INTERP. + // + // This happens when user tries to run 'adb shell /system/bin/linker' + // see also https://code.google.com/p/android/issues/detail?id=63174 + if (reinterpret_cast(&_start) == entry_point) { + __libc_fatal("This is %s, the helper program for shared library executables.\n", args.argv[0]); + } + strcpy(linker_so.name, "[dynamic linker]"); linker_so.base = linker_addr; linker_so.size = phdr_table_get_load_size(phdr, elf_hdr->e_phnum); @@ -2265,7 +2278,7 @@ extern "C" ElfW(Addr) __linker_init(void* raw_args) { _exit(EXIT_FAILURE); } - // lets properly initialize global variables + // Initialize the linker's own global variables linker_so.CallConstructors(); // We have successfully fixed our own relocations. It's safe to run From 1a5db57d5a0f633a83f20e667a4698757a63413e Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Mon, 28 Jul 2014 17:53:29 -0700 Subject: [PATCH 068/148] Fix mips/mips64 build Add _start entry label to mips/mips64 linker begin.S (cherry picked from commit ed485347189e3dfe04a38207c416bdd8c8fac4bc) Change-Id: Id1b6bb3258f3bfbe3b7ec9491a977f56e44bed14 --- linker/arch/mips/begin.S | 2 ++ linker/arch/mips64/begin.S | 2 ++ 2 files changed, 4 insertions(+) diff --git a/linker/arch/mips/begin.S b/linker/arch/mips/begin.S index 4a855e6c3..cbe1e3756 100644 --- a/linker/arch/mips/begin.S +++ b/linker/arch/mips/begin.S @@ -32,7 +32,9 @@ .ent __start .globl __start + .globl _start __start: +_start: .set noreorder bal 1f nop diff --git a/linker/arch/mips64/begin.S b/linker/arch/mips64/begin.S index 6827a2cfa..8f6b94a43 100644 --- a/linker/arch/mips64/begin.S +++ b/linker/arch/mips64/begin.S @@ -46,7 +46,9 @@ .ent __start .globl __start + .globl _start __start: +_start: .set noreorder bal 1f nop From a09fe118b1a5eb876ddaa2620965c4a8fb8b007c Mon Sep 17 00:00:00 2001 From: Brigid Smith Date: Mon, 21 Jul 2014 15:38:06 -0700 Subject: [PATCH 069/148] Added a bionic systrace class and tracing to pthread_mutex.cpp. bionic_systrace.h contains an implementation of tracing that can be used with systrace.py and its associated viewer. pthread_mutex now uses this tracing to track pthread_mutex contention, which can be enabled by using the "bionic" command line option to systrace. Bug: 15116468 (cherry picked from commit a406ee6d5f616192e9a13afad6ac6a9969814fc1) Change-Id: Ic98fc303689fe9384974150d0d258c50806a55e4 --- libc/Android.mk | 1 + libc/bionic/bionic_systrace.cpp | 107 ++++++++++++++++++++++++++++++++ libc/bionic/pthread_mutex.cpp | 12 ++++ libc/private/bionic_systrace.h | 35 +++++++++++ 4 files changed, 155 insertions(+) create mode 100644 libc/bionic/bionic_systrace.cpp create mode 100644 libc/private/bionic_systrace.h diff --git a/libc/Android.mk b/libc/Android.mk index 1fb5e84ae..0487a8fc0 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -94,6 +94,7 @@ libc_bionic_src_files := \ bionic/access.cpp \ bionic/assert.cpp \ bionic/atof.cpp \ + bionic/bionic_systrace.cpp \ bionic/bionic_time_conversions.cpp \ bionic/brk.cpp \ bionic/c16rtomb.cpp \ diff --git a/libc/bionic/bionic_systrace.cpp b/libc/bionic/bionic_systrace.cpp new file mode 100644 index 000000000..b8e892e72 --- /dev/null +++ b/libc/bionic/bionic_systrace.cpp @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "private/bionic_systrace.h" +#include "private/libc_logging.h" + +#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ +#include + +#define WRITE_OFFSET 32 + +static const prop_info* g_pinfo = NULL; +static uint32_t g_serial = -1; +static uint64_t g_tags = 0; +static int g_trace_marker_fd = -1; + +static bool should_trace() { + // If g_pinfo is null, this means that systrace hasn't been run and it's safe to + // assume that no trace writing will need to take place. However, to avoid running + // this costly find check each time, we set it to a non-tracing value so that next + // time, it will just check the serial to see if the value has been changed. + // this function also deals with the bootup case, during which the call to property + // set will fail if the property server hasn't yet started. + if (g_pinfo == NULL) { + g_pinfo = __system_property_find("debug.atrace.tags.enableflags"); + if (g_pinfo == NULL) { + __system_property_set("debug.atrace.tags.enableflags", "0"); + g_pinfo = __system_property_find("debug.atrace.tags.enableflags"); + if (g_pinfo == NULL) { + return false; + } + } + } + + // Find out which tags have been enabled on the command line and set + // the value of tags accordingly. If the value of the property changes, + // the serial will also change, so the costly system_property_read function + // can be avoided by calling the much cheaper system_property_serial + // first. The values within pinfo may change, but its location is guaranteed + // not to move. + const uint32_t cur_serial = __system_property_serial(g_pinfo); + if (cur_serial != g_serial) { + g_serial = cur_serial; + char value[PROP_VALUE_MAX]; + __system_property_read(g_pinfo, 0, value); + g_tags = strtoull(value, NULL, 0); + } + + // Finally, verify that this tag value enables bionic tracing. + return ((g_tags & ATRACE_TAG_BIONIC) != 0); +} + +ScopedTrace::ScopedTrace(const char* message) { + if (!should_trace()) { + return; + } + + if (g_trace_marker_fd == -1) { + g_trace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_WRONLY | O_CLOEXEC); + if (g_trace_marker_fd == -1) { + __libc_fatal("Could not open kernel trace file: %s\n", strerror(errno)); + } + } + + // If bionic tracing has been enabled, then write the message to the + // kernel trace_marker. + int length = strlen(message); + char buf[length + WRITE_OFFSET]; + size_t len = snprintf(buf, length + WRITE_OFFSET, "B|%d|%s", getpid(), message); + ssize_t wbytes = TEMP_FAILURE_RETRY(write(g_trace_marker_fd, buf, len)); + + // Error while writing + if (static_cast(wbytes) != len) { + __libc_fatal("Could not write to kernel trace file: %s\n", strerror(errno)); + } +} + +ScopedTrace::~ScopedTrace() { + if (!should_trace()) { + return; + } + + ssize_t wbytes = TEMP_FAILURE_RETRY(write(g_trace_marker_fd, "E", 1)); + + // Error while writing + if (static_cast(wbytes) != 1) { + __libc_fatal("Could not write to kernel trace file: %s\n", strerror(errno)); + } +} diff --git a/libc/bionic/pthread_mutex.cpp b/libc/bionic/pthread_mutex.cpp index 546166166..e00ffb437 100644 --- a/libc/bionic/pthread_mutex.cpp +++ b/libc/bionic/pthread_mutex.cpp @@ -39,6 +39,8 @@ #include "private/bionic_futex.h" #include "private/bionic_tls.h" +#include "private/bionic_systrace.h" + extern void pthread_debug_mutex_lock_check(pthread_mutex_t *mutex); extern void pthread_debug_mutex_unlock_check(pthread_mutex_t *mutex); @@ -333,6 +335,10 @@ static inline void _normal_lock(pthread_mutex_t* mutex, int shared) { * that the mutex is in state 2 when we go to sleep on it, which * guarantees a wake-up call. */ + + ScopedTrace trace("Contending for pthread mutex"); + + while (__bionic_swap(locked_contended, &mutex->value) != unlocked) { __futex_wait_ex(&mutex->value, shared, locked_contended, NULL); } @@ -473,6 +479,8 @@ int pthread_mutex_lock(pthread_mutex_t* mutex) { mvalue = mutex->value; } + ScopedTrace trace("Contending for pthread mutex"); + for (;;) { int newval; @@ -626,6 +634,8 @@ static int __pthread_mutex_timedlock(pthread_mutex_t* mutex, const timespec* abs return 0; } + ScopedTrace trace("Contending for timed pthread mutex"); + // Loop while needed. while (__bionic_swap(locked_contended, &mutex->value) != unlocked) { if (__timespec_from_absolute(&ts, abs_timeout, clock) < 0) { @@ -658,6 +668,8 @@ static int __pthread_mutex_timedlock(pthread_mutex_t* mutex, const timespec* abs mvalue = mutex->value; } + ScopedTrace trace("Contending for timed pthread mutex"); + while (true) { // If the value is 'unlocked', try to acquire it directly. // NOTE: put state to 2 since we know there is contention. diff --git a/libc/private/bionic_systrace.h b/libc/private/bionic_systrace.h new file mode 100644 index 000000000..ad9ff7f71 --- /dev/null +++ b/libc/private/bionic_systrace.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BIONIC_SYSTRACE_H +#define BIONIC_SYSTRACE_H + +#include "bionic_macros.h" + +// Tracing class for bionic. To begin a trace at a specified point: +// ScopedTrace("Trace message"); +// The trace will end when the contructor goes out of scope. + +class ScopedTrace { + public: + explicit ScopedTrace(const char* message); + ~ScopedTrace(); + + private: + DISALLOW_COPY_AND_ASSIGN(ScopedTrace); +}; + +#endif From 2ea0a58e01c1ed6db1da9dd0314ee053f5a32026 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 25 Jul 2014 17:24:00 -0700 Subject: [PATCH 070/148] Fix linkage of grantpt(3). Also clean up the implementation of all the pty functions, add tests, and fix the stub implementations of ttyname(3) and ttyname_r(3). Bug: https://code.google.com/p/android/issues/detail?id=58888 (cherry picked from commit 4916706cfe590eb06c9b5bd4bd402ce056034d51) Change-Id: I5cb7a1c17b156456e4c4818e65f256eb8d045424 --- libc/Android.mk | 5 +- libc/bionic/getpt.c | 34 --------- libc/bionic/ptsname.c | 44 ----------- libc/bionic/{ptsname_r.c => pty.cpp} | 105 ++++++++++++++++++++------- libc/bionic/stubs.cpp | 10 --- libc/bionic/unlockpt.c | 36 --------- libc/include/stdlib.h | 18 ++--- libc/include/unistd.h | 2 +- tests/stdlib_test.cpp | 99 +++++++++++++++++++++++++ 9 files changed, 184 insertions(+), 169 deletions(-) delete mode 100644 libc/bionic/getpt.c delete mode 100644 libc/bionic/ptsname.c rename libc/bionic/{ptsname_r.c => pty.cpp} (53%) delete mode 100644 libc/bionic/unlockpt.c diff --git a/libc/Android.mk b/libc/Android.mk index 0487a8fc0..15a68b921 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -45,7 +45,6 @@ libc_common_src_files := \ bionic/fts.c \ bionic/gethostname.c \ bionic/getpriority.c \ - bionic/getpt.c \ bionic/if_indextoname.c \ bionic/if_nametoindex.c \ bionic/initgroups.c \ @@ -53,8 +52,6 @@ libc_common_src_files := \ bionic/isatty.c \ bionic/memmem.c \ bionic/pathconf.c \ - bionic/ptsname.c \ - bionic/ptsname_r.c \ bionic/pututline.c \ bionic/sched_cpualloc.c \ bionic/sched_cpucount.c \ @@ -63,7 +60,6 @@ libc_common_src_files := \ bionic/siginterrupt.c \ bionic/sigsetmask.c \ bionic/system_properties_compat.c \ - bionic/unlockpt.c \ stdio/snprintf.c\ stdio/sprintf.c \ @@ -175,6 +171,7 @@ libc_bionic_src_files := \ bionic/pthread_setschedparam.cpp \ bionic/pthread_sigmask.cpp \ bionic/ptrace.cpp \ + bionic/pty.cpp \ bionic/raise.cpp \ bionic/rand.cpp \ bionic/readlink.cpp \ diff --git a/libc/bionic/getpt.c b/libc/bionic/getpt.c deleted file mode 100644 index 8bb5c1138..000000000 --- a/libc/bionic/getpt.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#include -#include - -int getpt(void) -{ - return open("/dev/ptmx", O_RDWR|O_NOCTTY); -} diff --git a/libc/bionic/ptsname.c b/libc/bionic/ptsname.c deleted file mode 100644 index 24d5d3099..000000000 --- a/libc/bionic/ptsname.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#include -#include -#include -#include - -/* not thread-safe */ -char* ptsname( int fd ) -{ - unsigned int pty_num; - static char buff[64]; - - if ( ioctl( fd, TIOCGPTN, &pty_num ) != 0 ) - return NULL; - - snprintf( buff, sizeof(buff), "/dev/pts/%u", pty_num ); - return buff; -} diff --git a/libc/bionic/ptsname_r.c b/libc/bionic/pty.cpp similarity index 53% rename from libc/bionic/ptsname_r.c rename to libc/bionic/pty.cpp index 2fa4c3d34..995e00608 100644 --- a/libc/bionic/ptsname_r.c +++ b/libc/bionic/pty.cpp @@ -25,34 +25,83 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include -#include -#include -#include + #include -#include +#include +#include +#include +#include +#include +#include -int ptsname_r( int fd, char* buf, size_t buflen) -{ - unsigned int pty_num; - char buff[64]; - int len; - - if (buf == NULL) { - errno = EINVAL; - return -1; - } - - if ( ioctl( fd, TIOCGPTN, &pty_num ) != 0 ) { - errno = ENOTTY; - return -1; - } - - len = snprintf( buff, sizeof(buff), "/dev/pts/%u", pty_num ); - if (len+1 > (int)buflen) { - errno = ERANGE; - return -1; - } - memcpy( buf, buff, len+1 ); - return 0; +int getpt(void) { + return posix_openpt(O_RDWR|O_NOCTTY); +} + +int grantpt(int) { + return 0; +} + +int posix_openpt(int flags) { + return open("/dev/ptmx", flags); +} + +char* ptsname(int fd) { + static char buf[64]; + return ptsname_r(fd, buf, sizeof(buf)) == 0 ? buf : NULL; +} + +int ptsname_r(int fd, char* buf, size_t len) { + if (buf == NULL) { + errno = EINVAL; + return errno; + } + + unsigned int pty_num; + if (ioctl(fd, TIOCGPTN, &pty_num) != 0) { + errno = ENOTTY; + return errno; + } + + if (snprintf(buf, len, "/dev/pts/%u", pty_num) >= static_cast(len)) { + errno = ERANGE; + return errno; + } + + return 0; +} + +char* ttyname(int fd) { + static char buf[64]; + return ttyname_r(fd, buf, sizeof(buf)) == 0 ? buf : NULL; +} + +int ttyname_r(int fd, char* buf, size_t len) { + if (buf == NULL) { + errno = EINVAL; + return errno; + } + + if (!isatty(fd)) { + return errno; + } + + char path[64]; + snprintf(path, sizeof(path), "/proc/self/fd/%d", fd); + + ssize_t count = readlink(path, buf, len); + if (count == -1) { + return errno; + } + if (static_cast(count) == len) { + errno = ERANGE; + return errno; + } + buf[count] = '\0'; + return 0; +} + +int unlockpt(int fd) { + int unlock = 0; + return ioctl(fd, TIOCSPTLCK, &unlock); } diff --git a/libc/bionic/stubs.cpp b/libc/bionic/stubs.cpp index 0937e9c06..b1e38be8f 100644 --- a/libc/bionic/stubs.cpp +++ b/libc/bionic/stubs.cpp @@ -444,16 +444,6 @@ void endpwent() { UNIMPLEMENTED; } -char* ttyname(int /*fd*/) { // NOLINT: implementing bad function. - UNIMPLEMENTED; - return NULL; -} - -int ttyname_r(int /*fd*/, char* /*buf*/, size_t /*buflen*/) { - UNIMPLEMENTED; - return -ERANGE; -} - char* getusershell() { UNIMPLEMENTED; return NULL; diff --git a/libc/bionic/unlockpt.c b/libc/bionic/unlockpt.c deleted file mode 100644 index 998b7a312..000000000 --- a/libc/bionic/unlockpt.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#include -#include - -int unlockpt( int fd ) -{ - int unlock = 0; - - return ioctl( fd, TIOCSPTLCK, &unlock ); -} diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index 195765aea..857d6313f 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -120,18 +120,12 @@ long random(void); char* setstate(char*); void srandom(unsigned int); -/* Basic PTY functions. These only work if devpts is mounted! */ - -extern int unlockpt(int); -extern char* ptsname(int); -extern int ptsname_r(int, char*, size_t); -extern int getpt(void); - -static __inline__ int grantpt(int __fd __attribute((unused))) -{ - (void)__fd; - return 0; /* devpts does this all for us! */ -} +int getpt(void); +int grantpt(int); +int posix_openpt(int); +char* ptsname(int) __warnattr("ptsname is not thread-safe; use ptsname_r instead"); +int ptsname_r(int, char*, size_t); +int unlockpt(int); typedef struct { int quot; diff --git a/libc/include/unistd.h b/libc/include/unistd.h index 12e625743..82c53e813 100644 --- a/libc/include/unistd.h +++ b/libc/include/unistd.h @@ -170,7 +170,7 @@ extern char *optarg; extern int optind, opterr, optopt; extern int isatty(int); -extern char* ttyname(int); +extern char* ttyname(int) __warnattr("ttyname is not thread-safe; use ttyname_r instead"); extern int ttyname_r(int, char*, size_t); extern int acct(const char* filepath); diff --git a/tests/stdlib_test.cpp b/tests/stdlib_test.cpp index 6d29421d0..553f018ed 100644 --- a/tests/stdlib_test.cpp +++ b/tests/stdlib_test.cpp @@ -262,3 +262,102 @@ TEST(unistd, _Exit) { ASSERT_TRUE(WIFEXITED(status)); ASSERT_EQ(99, WEXITSTATUS(status)); } + +TEST(stdlib, pty_smoke) { + // getpt returns a pty with O_RDWR|O_NOCTTY. + int fd = getpt(); + ASSERT_NE(-1, fd); + + // grantpt is a no-op. + ASSERT_EQ(0, grantpt(fd)); + + // ptsname_r should start "/dev/pts/". + char name_r[128]; + ASSERT_EQ(0, ptsname_r(fd, name_r, sizeof(name_r))); + name_r[9] = 0; + ASSERT_STREQ("/dev/pts/", name_r); + + close(fd); +} + +TEST(stdlib, posix_openpt) { + int fd = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC); + ASSERT_NE(-1, fd); + close(fd); +} + +TEST(stdlib, ptsname_r_ENOTTY) { + errno = 0; + char buf[128]; + ASSERT_EQ(ENOTTY, ptsname_r(STDOUT_FILENO, buf, sizeof(buf))); + ASSERT_EQ(ENOTTY, errno); +} + +TEST(stdlib, ptsname_r_EINVAL) { + int fd = getpt(); + ASSERT_NE(-1, fd); + errno = 0; + char* buf = NULL; + ASSERT_EQ(EINVAL, ptsname_r(fd, buf, 128)); + ASSERT_EQ(EINVAL, errno); + close(fd); +} + +TEST(stdlib, ptsname_r_ERANGE) { + int fd = getpt(); + ASSERT_NE(-1, fd); + errno = 0; + char buf[1]; + ASSERT_EQ(ERANGE, ptsname_r(fd, buf, sizeof(buf))); + ASSERT_EQ(ERANGE, errno); + close(fd); +} + +TEST(stdlib, ttyname_r) { + int fd = getpt(); + ASSERT_NE(-1, fd); + + // ttyname_r returns "/dev/ptmx" for a pty. + char name_r[128]; + ASSERT_EQ(0, ttyname_r(fd, name_r, sizeof(name_r))); + ASSERT_STREQ("/dev/ptmx", name_r); + + close(fd); +} + +TEST(stdlib, ttyname_r_ENOTTY) { + int fd = open("/dev/null", O_WRONLY); + errno = 0; + char buf[128]; + ASSERT_EQ(ENOTTY, ttyname_r(fd, buf, sizeof(buf))); + ASSERT_EQ(ENOTTY, errno); + close(fd); +} + +TEST(stdlib, ttyname_r_EINVAL) { + int fd = getpt(); + ASSERT_NE(-1, fd); + errno = 0; + char* buf = NULL; + ASSERT_EQ(EINVAL, ttyname_r(fd, buf, 128)); + ASSERT_EQ(EINVAL, errno); + close(fd); +} + +TEST(stdlib, ttyname_r_ERANGE) { + int fd = getpt(); + ASSERT_NE(-1, fd); + errno = 0; + char buf[1]; + ASSERT_EQ(ERANGE, ttyname_r(fd, buf, sizeof(buf))); + ASSERT_EQ(ERANGE, errno); + close(fd); +} + +TEST(stdlib, unlockpt_ENOTTY) { + int fd = open("/dev/null", O_WRONLY); + errno = 0; + ASSERT_EQ(-1, unlockpt(fd)); + ASSERT_EQ(ENOTTY, errno); + close(fd); +} From 1dd1b88bdee77b32d316de2a9a2ed52856f75483 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sun, 20 Jul 2014 11:49:46 -0700 Subject: [PATCH 071/148] __libc_fatal should print a newline to stderr. Change-Id: I088dc880d7488a65beac8cda95f530f3db41f112 (cherry picked from commit 97e31dedf056b07bcfcd46c49b60bf0798c60843) --- libc/bionic/libc_logging.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp index e656a1255..d0172edaa 100644 --- a/libc/bionic/libc_logging.cpp +++ b/libc/bionic/libc_logging.cpp @@ -620,7 +620,11 @@ static void __libc_fatal(const char* format, va_list args) { out_vformat(os, format, args); // log to stderr for the benefit of "adb shell" users. - write(2, msg, strlen(msg)); + struct iovec iov[2] = { + {msg, strlen(msg)}, + {const_cast(static_cast("\n")), 1}, + }; + writev(2, iov, 2); // Log to the log for the benefit of regular app developers (whose stdout and stderr are closed). __libc_write_log(ANDROID_LOG_FATAL, "libc", msg); From 4e5860958767ecc7bc455d2a5e1d2a2096a1c79f Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sun, 20 Jul 2014 11:51:26 -0700 Subject: [PATCH 072/148] Fix mbsrtowcs(3)'s handling of len parameter. The len parameter is a _maximum_ length. The previous code was treating it as an exact length, causing the following typical call to fail: mbsrtowcs(out, &in, sizeof(out), state); // sizeof(out) > strlen(in) Change-Id: I48e474fd54ea5f122bc168a4d74bfe08704f28cc (cherry picked from commit 6b55ba54eff4657cffe053b71e1c9cce2944a8a9) --- libc/bionic/wchar.cpp | 7 +++---- tests/wchar_test.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libc/bionic/wchar.cpp b/libc/bionic/wchar.cpp index ecb8b3391..438ce0379 100644 --- a/libc/bionic/wchar.cpp +++ b/libc/bionic/wchar.cpp @@ -116,11 +116,10 @@ size_t mbsnrtowcs(wchar_t* dst, const char** src, size_t nmc, size_t len, mbstat if (static_cast((*src)[i]) < 0x80) { // Fast path for plain ASCII characters. dst[o] = (*src)[i]; - if ((*src)[i] == '\0') { - *src = NULL; - return reset_and_return_illegal(EILSEQ, state); - } r = 1; + if ((*src)[i] == '\0') { + break; + } } else { r = mbrtowc(dst + o, *src + i, nmc - i, state); if (r == __MB_ERR_ILLEGAL_SEQUENCE) { diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp index a5f5f63a2..f052ce6f1 100644 --- a/tests/wchar_test.cpp +++ b/tests/wchar_test.cpp @@ -340,8 +340,19 @@ void test_mbsrtowcs(mbstate_t* ps) { ASSERT_EQ(static_cast(0x00a2), out[1]); ASSERT_EQ(static_cast(0x20ac), out[2]); ASSERT_EQ(static_cast(0x24b62), out[3]); + // Check that valid has advanced to the next unread character. ASSERT_EQ('e', *valid); + wmemset(out, L'x', sizeof(out) / sizeof(wchar_t)); + ASSERT_EQ(2U, mbsrtowcs(out, &valid, 4, ps)); + ASSERT_EQ(L'e', out[0]); + ASSERT_EQ(L'f', out[1]); + ASSERT_EQ(L'\0', out[2]); + // Check that we didn't clobber the rest of out. + ASSERT_EQ(L'x', out[3]); + // Check that valid has advanced to the end of the string. + ASSERT_EQ(L'\0', *valid); + const char* invalid = "A" "\xc2\x20" "ef"; ASSERT_EQ(static_cast(-1), mbsrtowcs(out, &invalid, 4, ps)); EXPECT_EQ(EILSEQ, errno); From d0a80a927f874472f5397a02a818eb2e6fce9456 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Mon, 21 Jul 2014 17:16:30 -0700 Subject: [PATCH 073/148] There is no _MIN for unsigned types. Change-Id: I49c38e51197b750210bdbf28c9cf6db30452a206 (cherry picked from commit ee7f1b5946dffa3aa95394b8cf6f15527f1068eb) --- libc/include/stdint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/include/stdint.h b/libc/include/stdint.h index f34843c09..a6f8505f4 100644 --- a/libc/include/stdint.h +++ b/libc/include/stdint.h @@ -203,7 +203,7 @@ typedef int64_t intmax_t; #if defined(__WINT_UNSIGNED__) # define WINT_MAX UINT32_MAX -# define WINT_MIN UINT32_MIN +# define WINT_MIN 0 #else # define WINT_MAX INT32_MAX # define WINT_MIN INT32_MIN From 7149362d33e47d75261dbb66b562713e8312633c Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 25 Jul 2014 11:24:03 -0700 Subject: [PATCH 074/148] en_US.UTF-8 is also supported. Change-Id: Ic35fad3596dc5e24ee8ae35543a274a471f27bb2 (cherry picked from commit 1abb8bd21d64c2bd21258469b688483f821974d5) --- libc/bionic/locale.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libc/bionic/locale.cpp b/libc/bionic/locale.cpp index 5a1da431f..363140e92 100644 --- a/libc/bionic/locale.cpp +++ b/libc/bionic/locale.cpp @@ -79,7 +79,9 @@ static bool __bionic_current_locale_is_utf8 = false; static bool __is_supported_locale(const char* locale) { return (strcmp(locale, "") == 0 || - strcmp(locale, "C") == 0 || strcmp(locale, "C.UTF-8") == 0 || + strcmp(locale, "C") == 0 || + strcmp(locale, "C.UTF-8") == 0 || + strcmp(locale, "en_US.UTF-8") == 0 || strcmp(locale, "POSIX") == 0); } From 26c1420fbb68916d66a8621b5efe8bb25cfdad7b Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 29 Jul 2014 23:52:29 +0000 Subject: [PATCH 075/148] Revert "Added a bionic systrace class and tracing to pthread_mutex.cpp." This reverts commit a09fe118b1a5eb876ddaa2620965c4a8fb8b007c. Change-Id: Ia2eb07b57a25dc2ac76fecc0925efb2bed998156 --- libc/Android.mk | 1 - libc/bionic/bionic_systrace.cpp | 107 -------------------------------- libc/bionic/pthread_mutex.cpp | 12 ---- libc/private/bionic_systrace.h | 35 ----------- 4 files changed, 155 deletions(-) delete mode 100644 libc/bionic/bionic_systrace.cpp delete mode 100644 libc/private/bionic_systrace.h diff --git a/libc/Android.mk b/libc/Android.mk index 0487a8fc0..1fb5e84ae 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -94,7 +94,6 @@ libc_bionic_src_files := \ bionic/access.cpp \ bionic/assert.cpp \ bionic/atof.cpp \ - bionic/bionic_systrace.cpp \ bionic/bionic_time_conversions.cpp \ bionic/brk.cpp \ bionic/c16rtomb.cpp \ diff --git a/libc/bionic/bionic_systrace.cpp b/libc/bionic/bionic_systrace.cpp deleted file mode 100644 index b8e892e72..000000000 --- a/libc/bionic/bionic_systrace.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include - -#include "private/bionic_systrace.h" -#include "private/libc_logging.h" - -#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ -#include - -#define WRITE_OFFSET 32 - -static const prop_info* g_pinfo = NULL; -static uint32_t g_serial = -1; -static uint64_t g_tags = 0; -static int g_trace_marker_fd = -1; - -static bool should_trace() { - // If g_pinfo is null, this means that systrace hasn't been run and it's safe to - // assume that no trace writing will need to take place. However, to avoid running - // this costly find check each time, we set it to a non-tracing value so that next - // time, it will just check the serial to see if the value has been changed. - // this function also deals with the bootup case, during which the call to property - // set will fail if the property server hasn't yet started. - if (g_pinfo == NULL) { - g_pinfo = __system_property_find("debug.atrace.tags.enableflags"); - if (g_pinfo == NULL) { - __system_property_set("debug.atrace.tags.enableflags", "0"); - g_pinfo = __system_property_find("debug.atrace.tags.enableflags"); - if (g_pinfo == NULL) { - return false; - } - } - } - - // Find out which tags have been enabled on the command line and set - // the value of tags accordingly. If the value of the property changes, - // the serial will also change, so the costly system_property_read function - // can be avoided by calling the much cheaper system_property_serial - // first. The values within pinfo may change, but its location is guaranteed - // not to move. - const uint32_t cur_serial = __system_property_serial(g_pinfo); - if (cur_serial != g_serial) { - g_serial = cur_serial; - char value[PROP_VALUE_MAX]; - __system_property_read(g_pinfo, 0, value); - g_tags = strtoull(value, NULL, 0); - } - - // Finally, verify that this tag value enables bionic tracing. - return ((g_tags & ATRACE_TAG_BIONIC) != 0); -} - -ScopedTrace::ScopedTrace(const char* message) { - if (!should_trace()) { - return; - } - - if (g_trace_marker_fd == -1) { - g_trace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_WRONLY | O_CLOEXEC); - if (g_trace_marker_fd == -1) { - __libc_fatal("Could not open kernel trace file: %s\n", strerror(errno)); - } - } - - // If bionic tracing has been enabled, then write the message to the - // kernel trace_marker. - int length = strlen(message); - char buf[length + WRITE_OFFSET]; - size_t len = snprintf(buf, length + WRITE_OFFSET, "B|%d|%s", getpid(), message); - ssize_t wbytes = TEMP_FAILURE_RETRY(write(g_trace_marker_fd, buf, len)); - - // Error while writing - if (static_cast(wbytes) != len) { - __libc_fatal("Could not write to kernel trace file: %s\n", strerror(errno)); - } -} - -ScopedTrace::~ScopedTrace() { - if (!should_trace()) { - return; - } - - ssize_t wbytes = TEMP_FAILURE_RETRY(write(g_trace_marker_fd, "E", 1)); - - // Error while writing - if (static_cast(wbytes) != 1) { - __libc_fatal("Could not write to kernel trace file: %s\n", strerror(errno)); - } -} diff --git a/libc/bionic/pthread_mutex.cpp b/libc/bionic/pthread_mutex.cpp index e00ffb437..546166166 100644 --- a/libc/bionic/pthread_mutex.cpp +++ b/libc/bionic/pthread_mutex.cpp @@ -39,8 +39,6 @@ #include "private/bionic_futex.h" #include "private/bionic_tls.h" -#include "private/bionic_systrace.h" - extern void pthread_debug_mutex_lock_check(pthread_mutex_t *mutex); extern void pthread_debug_mutex_unlock_check(pthread_mutex_t *mutex); @@ -335,10 +333,6 @@ static inline void _normal_lock(pthread_mutex_t* mutex, int shared) { * that the mutex is in state 2 when we go to sleep on it, which * guarantees a wake-up call. */ - - ScopedTrace trace("Contending for pthread mutex"); - - while (__bionic_swap(locked_contended, &mutex->value) != unlocked) { __futex_wait_ex(&mutex->value, shared, locked_contended, NULL); } @@ -479,8 +473,6 @@ int pthread_mutex_lock(pthread_mutex_t* mutex) { mvalue = mutex->value; } - ScopedTrace trace("Contending for pthread mutex"); - for (;;) { int newval; @@ -634,8 +626,6 @@ static int __pthread_mutex_timedlock(pthread_mutex_t* mutex, const timespec* abs return 0; } - ScopedTrace trace("Contending for timed pthread mutex"); - // Loop while needed. while (__bionic_swap(locked_contended, &mutex->value) != unlocked) { if (__timespec_from_absolute(&ts, abs_timeout, clock) < 0) { @@ -668,8 +658,6 @@ static int __pthread_mutex_timedlock(pthread_mutex_t* mutex, const timespec* abs mvalue = mutex->value; } - ScopedTrace trace("Contending for timed pthread mutex"); - while (true) { // If the value is 'unlocked', try to acquire it directly. // NOTE: put state to 2 since we know there is contention. diff --git a/libc/private/bionic_systrace.h b/libc/private/bionic_systrace.h deleted file mode 100644 index ad9ff7f71..000000000 --- a/libc/private/bionic_systrace.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef BIONIC_SYSTRACE_H -#define BIONIC_SYSTRACE_H - -#include "bionic_macros.h" - -// Tracing class for bionic. To begin a trace at a specified point: -// ScopedTrace("Trace message"); -// The trace will end when the contructor goes out of scope. - -class ScopedTrace { - public: - explicit ScopedTrace(const char* message); - ~ScopedTrace(); - - private: - DISALLOW_COPY_AND_ASSIGN(ScopedTrace); -}; - -#endif From 422106a24d620af4be58e8d92a2e9b7b6167b72d Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Mon, 28 Jul 2014 17:32:20 -0700 Subject: [PATCH 076/148] Fix dlsym(3) to do breadth first search. dlsym(3) with handle != RTLD_DEFAULT|RTLD_NEXT performs breadth first search through the dependency tree. Bug: 16653281 (cherry picked from commit aa0f2bdbc22d4b7aec5d3f8f5f01eaeaa13414c2) Change-Id: I0ba8c2034ab341f8a279cdb4e2e7e47f1aef7897 --- linker/dlfcn.cpp | 3 +- linker/linked_list.h | 37 +++++++++++++++++++++- linker/linker.cpp | 51 ++++++++++++++++++++++++------- linker/linker.h | 2 +- linker/tests/linked_list_test.cpp | 20 ++++++++++++ tests/dlfcn_test.cpp | 21 ++++++++++--- tests/libs/Android.mk | 13 ++++++++ 7 files changed, 128 insertions(+), 19 deletions(-) diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp index efb829e7a..8ebf3576b 100644 --- a/linker/dlfcn.cpp +++ b/linker/dlfcn.cpp @@ -111,8 +111,7 @@ void* dlsym(void* handle, const char* symbol) { sym = dlsym_linear_lookup(symbol, &found, caller_si->next, caller_si); } } else { - found = reinterpret_cast(handle); - sym = dlsym_handle_lookup(found, symbol, caller_si); + sym = dlsym_handle_lookup(reinterpret_cast(handle), &found, symbol, caller_si); } if (sym != NULL && sym->st_shndx != 0) { diff --git a/linker/linked_list.h b/linker/linked_list.h index 52af0f110..7f8c90160 100644 --- a/linker/linked_list.h +++ b/linker/linked_list.h @@ -31,13 +31,45 @@ struct LinkedListEntry { template class LinkedList { public: - LinkedList() : head_(nullptr) {} + LinkedList() : head_(nullptr), tail_(nullptr) {} void push_front(T* const element) { LinkedListEntry* new_entry = Allocator::alloc(); new_entry->next = head_; new_entry->element = element; head_ = new_entry; + if (tail_ == nullptr) { + tail_ = new_entry; + } + } + + void push_back(T* const element) { + LinkedListEntry* new_entry = Allocator::alloc(); + new_entry->next = nullptr; + new_entry->element = element; + if (tail_ == nullptr) { + tail_ = head_ = new_entry; + } else { + tail_->next = new_entry; + tail_ = new_entry; + } + } + + T* pop_front() { + if (head_ == nullptr) { + return nullptr; + } + + LinkedListEntry* entry = head_; + T* element = entry->element; + head_ = entry->next; + Allocator::free(entry); + + if (head_ == nullptr) { + tail_ = nullptr; + } + + return element; } void clear() { @@ -46,6 +78,8 @@ class LinkedList { head_ = head_->next; Allocator::free(p); } + + tail_ = nullptr; } template @@ -68,6 +102,7 @@ class LinkedList { private: LinkedListEntry* head_; + LinkedListEntry* tail_; DISALLOW_COPY_AND_ASSIGN(LinkedList); }; diff --git a/linker/linker.cpp b/linker/linker.cpp index 59b99383e..f8b35d7a8 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -469,6 +469,10 @@ static ElfW(Sym)* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name, } } + TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p %x %zd", + name, si->name, reinterpret_cast(si->base), hash, hash % si->nbucket); + + return NULL; } @@ -585,18 +589,43 @@ done: return NULL; } -/* This is used by dlsym(3). It performs symbol lookup only within the - specified soinfo object and not in any of its dependencies. +// Another soinfo list allocator to use in dlsym. We don't reuse +// SoinfoListAllocator because it is write-protected most of the time. +static LinkerAllocator> g_soinfo_list_allocator_rw; +class SoinfoListAllocatorRW { + public: + static LinkedListEntry* alloc() { + return g_soinfo_list_allocator_rw.alloc(); + } - TODO: Only looking in the specified soinfo seems wrong. dlsym(3) says - that it should do a breadth first search through the dependency - tree. This agrees with the ELF spec (aka System V Application - Binary Interface) where in Chapter 5 it discuss resolving "Shared - Object Dependencies" in breadth first search order. - */ -ElfW(Sym)* dlsym_handle_lookup(soinfo* si, const char* name, soinfo* caller) { - return soinfo_elf_lookup(si, elfhash(name), name, - caller == si ? SymbolLookupScope::kAllowLocal : SymbolLookupScope::kExcludeLocal); + static void free(LinkedListEntry* ptr) { + g_soinfo_list_allocator_rw.free(ptr); + } +}; + +// This is used by dlsym(3). It performs symbol lookup only within the +// specified soinfo object and its dependencies in breadth first order. +ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soinfo* caller) { + LinkedList visit_list; + visit_list.push_back(si); + soinfo* current_soinfo; + while ((current_soinfo = visit_list.pop_front()) != nullptr) { + ElfW(Sym)* result = soinfo_elf_lookup(current_soinfo, elfhash(name), name, + caller == current_soinfo ? SymbolLookupScope::kAllowLocal : SymbolLookupScope::kExcludeLocal); + + if (result != nullptr) { + *found = current_soinfo; + visit_list.clear(); + return result; + } + + current_soinfo->get_children().for_each([&](soinfo* child) { + visit_list.push_back(child); + }); + } + + visit_list.clear(); + return nullptr; } /* This is used by dlsym(3) to performs a global symbol lookup. If the diff --git a/linker/linker.h b/linker/linker.h index e1112e6e6..03672b2c6 100644 --- a/linker/linker.h +++ b/linker/linker.h @@ -238,7 +238,7 @@ ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start, soinfo* find_containing_library(const void* addr); ElfW(Sym)* dladdr_find_symbol(soinfo* si, const void* addr); -ElfW(Sym)* dlsym_handle_lookup(soinfo* si, const char* name, soinfo* caller_si); +ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soinfo* caller_si); void debuggerd_init(); extern "C" abort_msg_t* g_abort_message; diff --git a/linker/tests/linked_list_test.cpp b/linker/tests/linked_list_test.cpp index 31ec7d505..b9816fa10 100644 --- a/linker/tests/linked_list_test.cpp +++ b/linker/tests/linked_list_test.cpp @@ -95,3 +95,23 @@ TEST(linked_list, simple) { ASSERT_TRUE(free_called); ASSERT_EQ("", test_list_to_string(list)); } + +TEST(linked_list, push_pop) { + test_list_t list; + list.push_front("b"); + list.push_front("a"); + ASSERT_EQ("ab", test_list_to_string(list)); + list.push_back("c"); + ASSERT_EQ("abc", test_list_to_string(list)); + ASSERT_EQ("a", list.pop_front()); + ASSERT_EQ("bc", test_list_to_string(list)); + ASSERT_EQ("b", list.pop_front()); + ASSERT_EQ("c", test_list_to_string(list)); + ASSERT_EQ("c", list.pop_front()); + ASSERT_EQ("", test_list_to_string(list)); + ASSERT_TRUE(list.pop_front() == nullptr); + list.push_back("r"); + ASSERT_EQ("r", test_list_to_string(list)); + ASSERT_EQ("r", list.pop_front()); + ASSERT_TRUE(list.pop_front() == nullptr); +} diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp index f056fb692..9bc25574b 100644 --- a/tests/dlfcn_test.cpp +++ b/tests/dlfcn_test.cpp @@ -62,10 +62,9 @@ TEST(dlfcn, dlsym_in_self) { ASSERT_EQ(0, dlclose(self)); } -#if !defined(__LP64__) -// Current compiler/static linker used for aarch64 -// platform optimizes LOCAL PROTECTED symbol -// in libtest_local_symbol.so out of existence +#if defined(__arm__) +// This seems to be working only for arm. +// Others platforms optimize LOCAL PROTECTED symbols. TEST(dlfcn, dlsym_local_symbol) { void* handle = dlopen("libtest_local_symbol.so", RTLD_NOW); ASSERT_TRUE(handle != NULL); @@ -78,9 +77,23 @@ TEST(dlfcn, dlsym_local_symbol) { f = reinterpret_cast(dlsym(handle, "dlsym_local_symbol_get_taxicab_number_using_dlsym")); ASSERT_TRUE(f != NULL); ASSERT_EQ(1729U, f()); + dlclose(handle); } #endif +TEST(dlfcn, dlsym_with_dependencies) { + void* handle = dlopen("libtest_with_dependency.so", RTLD_NOW); + ASSERT_TRUE(handle != NULL); + dlerror(); + // This symbol is in DT_NEEDED library. + void* sym = dlsym(handle, "getRandomNumber"); + ASSERT_TRUE(sym != NULL); + int (*fn)(void); + fn = reinterpret_cast(sym); + EXPECT_EQ(4, fn()); + dlclose(handle); +} + TEST(dlfcn, dlopen_noload) { void* handle = dlopen("libtest_simple.so", RTLD_NOW | RTLD_NOLOAD); ASSERT_TRUE(handle == NULL); diff --git a/tests/libs/Android.mk b/tests/libs/Android.mk index a374e4839..7ed3e7b07 100644 --- a/tests/libs/Android.mk +++ b/tests/libs/Android.mk @@ -101,6 +101,19 @@ build_type := target build_target := SHARED_LIBRARY include $(TEST_PATH)/Android.build.mk +# ----------------------------------------------------------------------------- +# Library with dependency used by dlfcn tests +# ----------------------------------------------------------------------------- +libtest_with_dependency_src_files := \ + dlopen_testlib_simple.cpp + +libtest_with_dependency_shared_libraries := libdlext_test + +module := libtest_with_dependency +build_type := target +build_target := SHARED_LIBRARY +include $(TEST_PATH)/Android.build.mk + # ----------------------------------------------------------------------------- # Library used to test local symbol lookup # ----------------------------------------------------------------------------- From 1242f7eb67c678922b55e2077d9cf2d5cdc85b15 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 29 Jul 2014 16:43:55 -0700 Subject: [PATCH 077/148] Remove declarations for things that don't exist. The ones prevent gdb from building out of the box. (cherry picked from commit f4c1a36a4500bc7f12e3065be3da4e8669ee011d) Change-Id: I6958f2f1731de8c03df20b383decd414b78100aa --- libc/include/grp.h | 11 +---------- libc/include/stdio.h | 9 --------- libc/include/stdlib.h | 4 ---- libc/include/unistd.h | 10 ---------- libstdc++/include/cstdlib | 3 --- 5 files changed, 1 insertion(+), 36 deletions(-) diff --git a/libc/include/grp.h b/libc/include/grp.h index 86d99f357..fc4d52031 100644 --- a/libc/include/grp.h +++ b/libc/include/grp.h @@ -43,10 +43,6 @@ #include #include -#if __BSD_VISIBLE -#define _PATH_GROUP "/etc/group" -#endif - struct group { char *gr_name; /* group name */ char *gr_passwd; /* group password */ @@ -57,7 +53,7 @@ struct group { __BEGIN_DECLS struct group *getgrgid(gid_t); struct group *getgrnam(const char *); -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE +#if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE struct group *getgrent(void); void setgrent(void); void endgrent(void); @@ -66,11 +62,6 @@ int getgrgid_r(gid_t, struct group *, char *, int getgrnam_r(const char *, struct group *, char *, size_t, struct group **); #endif -#if __BSD_VISIBLE -void setgrfile(const char *); -int setgroupent(int); -char *group_from_gid(gid_t, int); -#endif int getgrouplist (const char *user, gid_t group, gid_t *groups, int *ngroups); diff --git a/libc/include/stdio.h b/libc/include/stdio.h index e532de46f..9c6bd3f94 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -223,12 +223,6 @@ ssize_t getdelim(char ** __restrict, size_t * __restrict, int, FILE * __restrict); ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict); -#if __BSD_VISIBLE && !defined(__SYS_ERRLIST) -#define __SYS_ERRLIST -extern int sys_nerr; /* perror(3) external variables */ -extern char *sys_errlist[]; -#endif - void perror(const char *); int printf(const char * __restrict, ...) __printflike(1, 2); @@ -300,9 +294,6 @@ __END_DECLS #define L_ctermid 1024 /* size for ctermid(); PATH_MAX */ __BEGIN_DECLS -#if 0 /* MISSING FROM BIONIC */ -char *ctermid(char *); -#endif /* MISSING */ FILE *fdopen(int, const char *); int fileno(FILE *); diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index 857d6313f..e29fdba4c 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -163,10 +163,6 @@ extern size_t wcstombs(char *, const wchar_t *, size_t); #define MB_CUR_MAX 4U -#if 0 /* MISSING FROM BIONIC */ -extern int on_exit(void (*)(int, void *), void *); -#endif /* MISSING */ - __END_DECLS #endif /* _STDLIB_H_ */ diff --git a/libc/include/unistd.h b/libc/include/unistd.h index 82c53e813..7fbafdf27 100644 --- a/libc/include/unistd.h +++ b/libc/include/unistd.h @@ -189,16 +189,6 @@ extern int cacheflush(long, long, long); extern pid_t tcgetpgrp(int fd); extern int tcsetpgrp(int fd, pid_t _pid); -#if 0 /* MISSING FROM BIONIC */ -extern int execlpe(const char *, const char *, ...); -extern int getfsuid(uid_t); -extern int setfsuid(uid_t); -extern int getlogin_r(char* name, size_t namesize); -extern int sethostname(const char *, size_t); -extern int getdomainname(char *, size_t); -extern int setdomainname(const char *, size_t); -#endif /* MISSING */ - /* Used to retry syscalls that can return EINTR. */ #define TEMP_FAILURE_RETRY(exp) ({ \ __typeof__(exp) _rc; \ diff --git a/libstdc++/include/cstdlib b/libstdc++/include/cstdlib index bb6f5a5cd..bd1deae6e 100644 --- a/libstdc++/include/cstdlib +++ b/libstdc++/include/cstdlib @@ -42,9 +42,6 @@ namespace std { using ::exit; using ::abort; using ::atexit; -#if 0 /* MISSING FROM BIONIC */ -using ::on_exit; -#endif using ::getenv; using ::putenv; From c701e5b3357b6484572d46f29c5d1e51063dfcbb Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 24 Jul 2014 17:52:23 -0700 Subject: [PATCH 078/148] Use libunwindbacktrace for debug malloc code. Create a method of disabling the debug allocation code paths so that it's possible to use the libunwindbacktrace library without any modifications. Use this path to create and destroy the maps for the process. It's not stricly necessary in the init code since the symbols are not modified until after the initialize calls. Also, remove the debug_XXX source files that doesn't need to be in libc.so. Fix the maps reading code since it was completely broken for 64 bit. Bug: 16408686 (cherry picked from commit 861c0ef37bcfcae56d88572cb01c18bcfe1faded) Change-Id: I04445f0cf9a1e85172b64d57df92eb7939ce2332 --- libc/Android.mk | 8 ++-- libc/bionic/debug_mapinfo.cpp | 53 +++++++++++++++---------- libc/bionic/debug_mapinfo.h | 4 +- libc/bionic/debug_stacktrace.cpp | 13 +++++- libc/bionic/malloc_debug_check.cpp | 43 ++++++++++++++++++++ libc/bionic/malloc_debug_disable.h | 64 ++++++++++++++++++++++++++++++ libc/bionic/malloc_debug_leak.cpp | 41 +++++++++++++++++++ 7 files changed, 198 insertions(+), 28 deletions(-) create mode 100644 libc/bionic/malloc_debug_disable.h diff --git a/libc/Android.mk b/libc/Android.mk index d641d89f9..46c96764a 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -979,8 +979,6 @@ LOCAL_SRC_FILES := \ $(libc_arch_dynamic_src_files) \ $(libc_static_common_src_files) \ bionic/malloc_debug_common.cpp \ - bionic/debug_mapinfo.cpp \ - bionic/debug_stacktrace.cpp \ bionic/libc_init_dynamic.cpp \ bionic/NetdClient.cpp \ @@ -1046,7 +1044,10 @@ LOCAL_CFLAGS := \ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) -LOCAL_C_INCLUDES := $(libc_common_c_includes) +# Make sure that unwind.h comes from libunwind. +LOCAL_C_INCLUDES := \ + external/libunwind/include \ + $(libc_common_c_includes) \ LOCAL_SRC_FILES := \ bionic/debug_mapinfo.cpp \ @@ -1061,6 +1062,7 @@ LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SHARED_LIBRARIES := libc libdl LOCAL_SYSTEM_SHARED_LIBRARIES := +LOCAL_WHOLE_STATIC_LIBRARIES := libunwindbacktrace LOCAL_ALLOW_UNDEFINED_SYMBOLS := true # Don't install on release build diff --git a/libc/bionic/debug_mapinfo.cpp b/libc/bionic/debug_mapinfo.cpp index 17276ce40..d83799afa 100644 --- a/libc/bionic/debug_mapinfo.cpp +++ b/libc/bionic/debug_mapinfo.cpp @@ -26,39 +26,48 @@ * SUCH DAMAGE. */ +#include +#include #include #include #include -#include #include "debug_mapinfo.h" +#include "malloc_debug_disable.h" -// 6f000000-6f01e000 rwxp 00000000 00:0c 16389419 /system/lib/libcomposer.so -// 012345678901234567890123456789012345678901234567890123456789 -// 0 1 2 3 4 5 - +// Format of /proc//maps: +// 6f000000-6f01e000 rwxp 00000000 00:0c 16389419 /system/lib/libcomposer.so static mapinfo_t* parse_maps_line(char* line) { - int len = strlen(line); + uintptr_t start; + uintptr_t end; + int name_pos; + if (sscanf(line, "%" PRIxPTR "-%" PRIxPTR " %*4s %*x %*x:%*x %*d%n", &start, + &end, &name_pos) < 2) { + return NULL; + } - if (len < 1) return 0; - line[--len] = 0; - - if (len < 50) return 0; - if (line[20] != 'x') return 0; - - mapinfo_t* mi = static_cast( - mmap(NULL, sizeof(mapinfo_t) + (len - 47), PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0)); - if (mi == MAP_FAILED) return 0; - - mi->start = strtoul(line, 0, 16); - mi->end = strtoul(line + 9, 0, 16); - mi->next = 0; - strcpy(mi->name, line + 49); + while (isspace(line[name_pos])) { + name_pos += 1; + } + const char* name = line + name_pos; + size_t name_len = strlen(name); + if (name_len && name[name_len - 1] == '\n') { + name_len -= 1; + } + mapinfo_t* mi = reinterpret_cast(calloc(1, sizeof(mapinfo_t) + name_len + 1)); + if (mi) { + mi->start = start; + mi->end = end; + memcpy(mi->name, name, name_len); + mi->name[name_len] = '\0'; + } return mi; } __LIBC_HIDDEN__ mapinfo_t* mapinfo_create(pid_t pid) { + ScopedDisableDebugCalls disable; + struct mapinfo_t* milist = NULL; char data[1024]; // Used to read lines as well as to construct the filename. snprintf(data, sizeof(data), "/proc/%d/maps", pid); @@ -77,10 +86,12 @@ __LIBC_HIDDEN__ mapinfo_t* mapinfo_create(pid_t pid) { } __LIBC_HIDDEN__ void mapinfo_destroy(mapinfo_t* mi) { + ScopedDisableDebugCalls disable; + while (mi != NULL) { mapinfo_t* del = mi; mi = mi->next; - munmap(del, sizeof(mapinfo_t) + strlen(del->name) + 2); + free(del); } } diff --git a/libc/bionic/debug_mapinfo.h b/libc/bionic/debug_mapinfo.h index cccd2e374..926b37762 100644 --- a/libc/bionic/debug_mapinfo.h +++ b/libc/bionic/debug_mapinfo.h @@ -33,8 +33,8 @@ struct mapinfo_t { struct mapinfo_t* next; - unsigned start; - unsigned end; + uintptr_t start; + uintptr_t end; char name[]; }; diff --git a/libc/bionic/debug_stacktrace.cpp b/libc/bionic/debug_stacktrace.cpp index 713e76113..b86e2afdc 100644 --- a/libc/bionic/debug_stacktrace.cpp +++ b/libc/bionic/debug_stacktrace.cpp @@ -35,6 +35,7 @@ #include #include "debug_mapinfo.h" +#include "malloc_debug_disable.h" #include "private/libc_logging.h" #if defined(__LP64__) @@ -56,6 +57,8 @@ typedef char* (*DemanglerFn)(const char*, char*, size_t*, int*); static DemanglerFn g_demangler_fn = NULL; __LIBC_HIDDEN__ void backtrace_startup() { + ScopedDisableDebugCalls disable; + g_map_info = mapinfo_create(getpid()); g_demangler = dlopen("libgccdemangle.so", RTLD_NOW); if (g_demangler != NULL) { @@ -65,6 +68,8 @@ __LIBC_HIDDEN__ void backtrace_startup() { } __LIBC_HIDDEN__ void backtrace_shutdown() { + ScopedDisableDebugCalls disable; + mapinfo_destroy(g_map_info); dlclose(g_demangler); } @@ -98,7 +103,7 @@ static _Unwind_Reason_Code trace_function(__unwind_context* context, void* arg) return _URC_NO_REASON; } -#ifdef __arm__ +#if defined(__arm__) /* * The instruction pointer is pointing at the instruction after the bl(x), and * the _Unwind_Backtrace routine already masks the Thumb mode indicator (LSB @@ -121,12 +126,16 @@ static _Unwind_Reason_Code trace_function(__unwind_context* context, void* arg) } __LIBC_HIDDEN__ int get_backtrace(uintptr_t* frames, size_t max_depth) { + ScopedDisableDebugCalls disable; + stack_crawl_state_t state(frames, max_depth); _Unwind_Backtrace(trace_function, &state); return state.frame_count; } __LIBC_HIDDEN__ void log_backtrace(uintptr_t* frames, size_t frame_count) { + ScopedDisableDebugCalls disable; + uintptr_t self_bt[16]; if (frames == NULL) { frame_count = get_backtrace(self_bt, 16); @@ -146,7 +155,7 @@ __LIBC_HIDDEN__ void log_backtrace(uintptr_t* frames, size_t frame_count) { symbol = info.dli_sname; } - uintptr_t rel_pc; + uintptr_t rel_pc = offset; const mapinfo_t* mi = (g_map_info != NULL) ? mapinfo_find(g_map_info, frames[i], &rel_pc) : NULL; const char* soname = (mi != NULL) ? mi->name : info.dli_fname; if (soname == NULL) { diff --git a/libc/bionic/malloc_debug_check.cpp b/libc/bionic/malloc_debug_check.cpp index 1c63d4dcf..94ba6f5ec 100644 --- a/libc/bionic/malloc_debug_check.cpp +++ b/libc/bionic/malloc_debug_check.cpp @@ -49,6 +49,7 @@ #include "debug_mapinfo.h" #include "debug_stacktrace.h" #include "malloc_debug_common.h" +#include "malloc_debug_disable.h" #include "private/bionic_macros.h" #include "private/libc_logging.h" #include "private/ScopedPthreadMutexLocker.h" @@ -331,6 +332,9 @@ static inline void add_to_backlog(hdr_t* hdr) { extern "C" void* chk_malloc(size_t bytes) { // log_message("%s: %s\n", __FILE__, __FUNCTION__); + if (DebugCallsDisabled()) { + return g_malloc_dispatch->malloc(bytes); + } size_t size = sizeof(hdr_t) + bytes + sizeof(ftr_t); if (size < bytes) { // Overflow @@ -348,6 +352,10 @@ extern "C" void* chk_malloc(size_t bytes) { } extern "C" void* chk_memalign(size_t alignment, size_t bytes) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->memalign(alignment, bytes); + } + if (alignment <= MALLOC_ALIGNMENT) { return chk_malloc(bytes); } @@ -386,6 +394,9 @@ extern "C" void* chk_memalign(size_t alignment, size_t bytes) { extern "C" void chk_free(void* ptr) { // log_message("%s: %s\n", __FILE__, __FUNCTION__); + if (DebugCallsDisabled()) { + return g_malloc_dispatch->free(ptr); + } if (!ptr) /* ignore free(NULL) */ return; @@ -421,6 +432,9 @@ extern "C" void chk_free(void* ptr) { extern "C" void* chk_realloc(void* ptr, size_t bytes) { // log_message("%s: %s\n", __FILE__, __FUNCTION__); + if (DebugCallsDisabled()) { + return g_malloc_dispatch->realloc(ptr, bytes); + } if (!ptr) { return chk_malloc(bytes); @@ -496,6 +510,10 @@ extern "C" void* chk_realloc(void* ptr, size_t bytes) { extern "C" void* chk_calloc(size_t nmemb, size_t bytes) { // log_message("%s: %s\n", __FILE__, __FUNCTION__); + if (DebugCallsDisabled()) { + return g_malloc_dispatch->calloc(nmemb, bytes); + } + size_t total_bytes = nmemb * bytes; size_t size = sizeof(hdr_t) + total_bytes + sizeof(ftr_t); if (size < total_bytes || (nmemb && SIZE_MAX / nmemb < bytes)) { // Overflow @@ -513,6 +531,10 @@ extern "C" void* chk_calloc(size_t nmemb, size_t bytes) { } extern "C" size_t chk_malloc_usable_size(const void* ptr) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->malloc_usable_size(ptr); + } + // malloc_usable_size returns 0 for NULL and unknown blocks. if (ptr == NULL) return 0; @@ -529,6 +551,10 @@ extern "C" struct mallinfo chk_mallinfo() { } extern "C" int chk_posix_memalign(void** memptr, size_t alignment, size_t size) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->posix_memalign(memptr, alignment, size); + } + if (!powerof2(alignment)) { return EINVAL; } @@ -538,7 +564,12 @@ extern "C" int chk_posix_memalign(void** memptr, size_t alignment, size_t size) return (*memptr != NULL) ? 0 : ENOMEM; } +#if defined(HAVE_DEPRECATED_MALLOC_FUNCS) extern "C" void* chk_pvalloc(size_t bytes) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->pvalloc(bytes); + } + size_t pagesize = getpagesize(); size_t size = BIONIC_ALIGN(bytes, pagesize); if (size < bytes) { // Overflow @@ -548,10 +579,16 @@ extern "C" void* chk_pvalloc(size_t bytes) { } extern "C" void* chk_valloc(size_t size) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->valloc(size); + } return chk_memalign(getpagesize(), size); } +#endif static void ReportMemoryLeaks() { + ScopedDisableDebugCalls disable; + // Use /proc/self/exe link to obtain the program name for logging // purposes. If it's not available, we set it to "". char exe[PATH_MAX]; @@ -585,10 +622,14 @@ static void ReportMemoryLeaks() { } } +pthread_key_t g_debug_calls_disabled; + extern "C" bool malloc_debug_initialize(HashTable* hash_table, const MallocDebug* malloc_dispatch) { g_hash_table = hash_table; g_malloc_dispatch = malloc_dispatch; + pthread_key_create(&g_debug_calls_disabled, NULL); + char debug_backlog[PROP_VALUE_MAX]; if (__system_property_get("libc.debug.malloc.backlog", debug_backlog)) { g_malloc_debug_backlog = atoi(debug_backlog); @@ -605,4 +646,6 @@ extern "C" void malloc_debug_finalize(int malloc_debug_level) { ReportMemoryLeaks(); } backtrace_shutdown(); + + pthread_setspecific(g_debug_calls_disabled, NULL); } diff --git a/libc/bionic/malloc_debug_disable.h b/libc/bionic/malloc_debug_disable.h new file mode 100644 index 000000000..9503128c4 --- /dev/null +++ b/libc/bionic/malloc_debug_disable.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef MALLOC_DEBUG_DISABLE_H +#define MALLOC_DEBUG_DISABLE_H + +#include + +#include "private/bionic_macros.h" + +// ============================================================================= +// Used to disable the debug allocation calls. +// ============================================================================= +extern pthread_key_t g_debug_calls_disabled; + +static inline bool DebugCallsDisabled() { + return pthread_getspecific(g_debug_calls_disabled) != NULL; +} + +class ScopedDisableDebugCalls { + public: + ScopedDisableDebugCalls() : disabled_(DebugCallsDisabled()) { + if (!disabled_) { + pthread_setspecific(g_debug_calls_disabled, reinterpret_cast(1)); + } + } + ~ScopedDisableDebugCalls() { + if (!disabled_) { + pthread_setspecific(g_debug_calls_disabled, NULL); + } + } + + private: + bool disabled_; + + DISALLOW_COPY_AND_ASSIGN(ScopedDisableDebugCalls); +}; + +#endif // MALLOC_DEBUG_DISABLE_H diff --git a/libc/bionic/malloc_debug_leak.cpp b/libc/bionic/malloc_debug_leak.cpp index d9824f09f..7926a1f27 100644 --- a/libc/bionic/malloc_debug_leak.cpp +++ b/libc/bionic/malloc_debug_leak.cpp @@ -48,6 +48,7 @@ #include "debug_stacktrace.h" #include "malloc_debug_common.h" +#include "malloc_debug_disable.h" #include "private/bionic_macros.h" #include "private/libc_logging.h" @@ -267,6 +268,7 @@ extern "C" int fill_posix_memalign(void** memptr, size_t alignment, size_t size) return (*memptr != NULL) ? 0 : ENOMEM; } +#if defined(HAVE_DEPRECATED_MALLOC_FUNCS) extern "C" void* fill_pvalloc(size_t bytes) { size_t pagesize = getpagesize(); size_t size = BIONIC_ALIGN(bytes, pagesize); @@ -279,6 +281,7 @@ extern "C" void* fill_pvalloc(size_t bytes) { extern "C" void* fill_valloc(size_t size) { return fill_memalign(getpagesize(), size); } +#endif // ============================================================================= // malloc leak functions @@ -287,6 +290,10 @@ extern "C" void* fill_valloc(size_t size) { static uint32_t MEMALIGN_GUARD = 0xA1A41520; extern "C" void* leak_malloc(size_t bytes) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->malloc(bytes); + } + // allocate enough space infront of the allocation to store the pointer for // the alloc structure. This will making free'ing the structer really fast! @@ -319,6 +326,10 @@ extern "C" void* leak_malloc(size_t bytes) { } extern "C" void leak_free(void* mem) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->free(mem); + } + if (mem == NULL) { return; } @@ -355,6 +366,10 @@ extern "C" void leak_free(void* mem) { } extern "C" void* leak_calloc(size_t n_elements, size_t elem_size) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->calloc(n_elements, elem_size); + } + // Fail on overflow - just to be safe even though this code runs only // within the debugging C library, not the production one. if (n_elements && SIZE_MAX / n_elements < elem_size) { @@ -370,6 +385,10 @@ extern "C" void* leak_calloc(size_t n_elements, size_t elem_size) { } extern "C" void* leak_realloc(void* oldMem, size_t bytes) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->realloc(oldMem, bytes); + } + if (oldMem == NULL) { return leak_malloc(bytes); } @@ -398,6 +417,10 @@ extern "C" void* leak_realloc(void* oldMem, size_t bytes) { } extern "C" void* leak_memalign(size_t alignment, size_t bytes) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->memalign(alignment, bytes); + } + // we can just use malloc if (alignment <= MALLOC_ALIGNMENT) { return leak_malloc(bytes); @@ -439,6 +462,10 @@ extern "C" void* leak_memalign(size_t alignment, size_t bytes) { } extern "C" size_t leak_malloc_usable_size(const void* mem) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->malloc_usable_size(mem); + } + if (mem != NULL) { // Check the guard to make sure it is valid. const AllocationEntry* header = const_to_header((void*)mem); @@ -467,6 +494,10 @@ extern "C" struct mallinfo leak_mallinfo() { } extern "C" int leak_posix_memalign(void** memptr, size_t alignment, size_t size) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->posix_memalign(memptr, alignment, size); + } + if (!powerof2(alignment)) { return EINVAL; } @@ -476,7 +507,12 @@ extern "C" int leak_posix_memalign(void** memptr, size_t alignment, size_t size) return (*memptr != NULL) ? 0 : ENOMEM; } +#if defined(HAVE_DEPRECATED_MALLOC_FUNCS) extern "C" void* leak_pvalloc(size_t bytes) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->pvalloc(bytes); + } + size_t pagesize = getpagesize(); size_t size = BIONIC_ALIGN(bytes, pagesize); if (size < bytes) { // Overflow @@ -486,5 +522,10 @@ extern "C" void* leak_pvalloc(size_t bytes) { } extern "C" void* leak_valloc(size_t size) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->valloc(size); + } + return leak_memalign(getpagesize(), size); } +#endif From 11bf8a3025a7b5aee891c521255a7db1860e5b12 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 30 Jul 2014 14:48:10 -0700 Subject: [PATCH 079/148] Only wipe TLS for user-supplied stacks. Bug: 16667988 (cherry picked from commit 40a521744825b6060960c296d5fb3da4c6593d94) Change-Id: I7550fa47b76e643323aa3e2a53529e393c829e47 --- libc/bionic/pthread_create.cpp | 10 +++---- libc/bionic/pthread_exit.cpp | 2 +- libc/bionic/pthread_internal.h | 30 +++++++++++--------- tests/pthread_test.cpp | 51 ++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 19 deletions(-) diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp index 174e30807..fc8afa2ff 100644 --- a/libc/bionic/pthread_create.cpp +++ b/libc/bionic/pthread_create.cpp @@ -51,9 +51,9 @@ extern "C" int __isthreaded; // This code is used both by each new pthread and the code that initializes the main thread. void __init_tls(pthread_internal_t* thread) { - // Zero-initialize all the slots after TLS_SLOT_SELF and TLS_SLOT_THREAD_ID. - for (size_t i = TLS_SLOT_ERRNO; i < BIONIC_TLS_SLOTS; ++i) { - thread->tls[i] = NULL; + if (thread->user_allocated_stack()) { + // We don't know where the user got their stack, so assume the worst and zero the TLS area. + memset(&thread->tls[0], 0, BIONIC_TLS_SLOTS * sizeof(void*)); } // Slot 0 must point to itself. The x86 Linux kernel reads the TLS from %fs:0. @@ -66,7 +66,7 @@ void __init_tls(pthread_internal_t* thread) { void __init_alternate_signal_stack(pthread_internal_t* thread) { // Create and set an alternate signal stack. stack_t ss; - ss.ss_sp = mmap(NULL, SIGSTKSZ, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); + ss.ss_sp = mmap(NULL, SIGSTKSZ, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); if (ss.ss_sp != MAP_FAILED) { ss.ss_size = SIGSTKSZ; ss.ss_flags = 0; @@ -227,7 +227,7 @@ int pthread_create(pthread_t* thread_out, pthread_attr_t const* attr, // be unblocked, but we're about to unmap the memory the mutex is stored in, so this serves as a // reminder that you can't rewrite this function to use a ScopedPthreadMutexLocker. pthread_mutex_unlock(&thread->startup_handshake_mutex); - if ((thread->attr.flags & PTHREAD_ATTR_FLAG_USER_ALLOCATED_STACK) == 0) { + if (!thread->user_allocated_stack()) { munmap(thread->attr.stack_base, thread->attr.stack_size); } free(thread); diff --git a/libc/bionic/pthread_exit.cpp b/libc/bionic/pthread_exit.cpp index 2470c9cb6..a6bb36312 100644 --- a/libc/bionic/pthread_exit.cpp +++ b/libc/bionic/pthread_exit.cpp @@ -90,7 +90,7 @@ void pthread_exit(void* return_value) { // Keep track of what we need to know about the stack before we lose the pthread_internal_t. void* stack_base = thread->attr.stack_base; size_t stack_size = thread->attr.stack_size; - bool user_allocated_stack = ((thread->attr.flags & PTHREAD_ATTR_FLAG_USER_ALLOCATED_STACK) != 0); + bool user_allocated_stack = thread->user_allocated_stack(); pthread_mutex_lock(&g_thread_list_lock); if ((thread->attr.flags & PTHREAD_ATTR_FLAG_DETACHED) != 0) { diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h index e05d15c79..7bcd758d1 100644 --- a/libc/bionic/pthread_internal.h +++ b/libc/bionic/pthread_internal.h @@ -30,6 +30,18 @@ #include +/* Has the thread been detached by a pthread_join or pthread_detach call? */ +#define PTHREAD_ATTR_FLAG_DETACHED 0x00000001 + +/* Was the thread's stack allocated by the user rather than by us? */ +#define PTHREAD_ATTR_FLAG_USER_ALLOCATED_STACK 0x00000002 + +/* Has the thread been joined by another thread? */ +#define PTHREAD_ATTR_FLAG_JOINED 0x00000004 + +/* Is this the main thread? */ +#define PTHREAD_ATTR_FLAG_MAIN_THREAD 0x80000000 + struct pthread_internal_t { struct pthread_internal_t* next; struct pthread_internal_t* prev; @@ -56,6 +68,10 @@ struct pthread_internal_t { return (*cached_pid != 0); } + bool user_allocated_stack() { + return (attr.flags & PTHREAD_ATTR_FLAG_USER_ALLOCATED_STACK) != 0; + } + void** tls; pthread_attr_t attr; @@ -87,20 +103,8 @@ __LIBC_HIDDEN__ pthread_internal_t* __get_thread(void); __LIBC_HIDDEN__ void pthread_key_clean_all(void); __LIBC_HIDDEN__ void _pthread_internal_remove_locked(pthread_internal_t* thread); -/* Has the thread been detached by a pthread_join or pthread_detach call? */ -#define PTHREAD_ATTR_FLAG_DETACHED 0x00000001 - -/* Was the thread's stack allocated by the user rather than by us? */ -#define PTHREAD_ATTR_FLAG_USER_ALLOCATED_STACK 0x00000002 - -/* Has the thread been joined by another thread? */ -#define PTHREAD_ATTR_FLAG_JOINED 0x00000004 - -/* Is this the main thread? */ -#define PTHREAD_ATTR_FLAG_MAIN_THREAD 0x80000000 - /* - * Traditionally we give threads a 1MiB stack. When we started + * Traditionally we gave threads a 1MiB stack. When we started * allocating per-thread alternate signal stacks to ease debugging of * stack overflows, we subtracted the same amount we were using there * from the default thread stack size. This should keep memory usage diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp index 36da481c5..4da003f3a 100644 --- a/tests/pthread_test.cpp +++ b/tests/pthread_test.cpp @@ -82,6 +82,57 @@ TEST(pthread, pthread_key_delete) { ASSERT_EQ(EINVAL, pthread_setspecific(key, expected)); } +TEST(pthread, pthread_key_fork) { + void* expected = reinterpret_cast(1234); + pthread_key_t key; + ASSERT_EQ(0, pthread_key_create(&key, NULL)); + ASSERT_EQ(0, pthread_setspecific(key, expected)); + ASSERT_EQ(expected, pthread_getspecific(key)); + + pid_t pid = fork(); + ASSERT_NE(-1, pid) << strerror(errno); + + if (pid == 0) { + // The surviving thread inherits all the forking thread's TLS values... + ASSERT_EQ(expected, pthread_getspecific(key)); + _exit(99); + } + + int status; + ASSERT_EQ(pid, waitpid(pid, &status, 0)); + ASSERT_TRUE(WIFEXITED(status)); + ASSERT_EQ(99, WEXITSTATUS(status)); + + ASSERT_EQ(expected, pthread_getspecific(key)); +} + +static void* DirtyKeyFn(void* key) { + return pthread_getspecific(*reinterpret_cast(key)); +} + +TEST(pthread, pthread_key_dirty) { + pthread_key_t key; + ASSERT_EQ(0, pthread_key_create(&key, NULL)); + + size_t stack_size = 128 * 1024; + void* stack = mmap(NULL, stack_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + ASSERT_NE(MAP_FAILED, stack); + memset(stack, 0xff, stack_size); + + pthread_attr_t attr; + ASSERT_EQ(0, pthread_attr_init(&attr)); + ASSERT_EQ(0, pthread_attr_setstack(&attr, stack, stack_size)); + + pthread_t t; + ASSERT_EQ(0, pthread_create(&t, &attr, DirtyKeyFn, &key)); + + void* result; + ASSERT_EQ(0, pthread_join(t, &result)); + ASSERT_EQ(nullptr, result); // Not ~0! + + ASSERT_EQ(0, munmap(stack, stack_size)); +} + static void* IdFn(void* arg) { return arg; } From cd54195262ac5531fff892255849925ebbbd303e Mon Sep 17 00:00:00 2001 From: Duane Sand Date: Thu, 10 Jul 2014 15:24:27 -0700 Subject: [PATCH 080/148] [MIPSR6] Use C-coded string ops on mips32r6/mips64r6 The existing assembler code uses deprecated lwl/lwr/swl/swr ops. Replacing those with misalignment-forgiving lw/sw ops may involve careful performance tuning. (cherry picked from commit bc5a3ec6df66d2456667ddf1d6dfaf623552169d) Change-Id: I35167da27f2d406339b7f24b4a1fb270c87bc12e --- libc/arch-mips/mips.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libc/arch-mips/mips.mk b/libc/arch-mips/mips.mk index cb76985f0..bf3b8ae00 100644 --- a/libc/arch-mips/mips.mk +++ b/libc/arch-mips/mips.mk @@ -59,10 +59,21 @@ libc_bionic_src_files_mips += \ arch-mips/bionic/setjmp.S \ arch-mips/bionic/sigsetjmp.S \ arch-mips/bionic/syscall.S \ + +ifndef ARCH_MIPS_REV6 +libc_bionic_src_files_mips += \ arch-mips/string/memcpy.S \ arch-mips/string/memset.S \ arch-mips/string/mips_strlen.c \ +else +libc_bionic_src_files_mips += \ + bionic/memcpy.cpp \ + bionic/memset.c +libc_common_src_files_mips += \ + upstream-openbsd/lib/libc/string/strlen.c +endif + libc_netbsd_src_files_mips := \ upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \ From 4f76469e88e255bab1f8264e9ff8b95bff84365f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 30 Jul 2014 15:05:09 -0700 Subject: [PATCH 081/148] Implement . (cherry picked from commit 79310994d2b3826a10598f7e7795acb5edb42a20) Change-Id: I47688273691e5c95e5e9302eba254ccaaaad40ca --- libc/SYSCALLS.TXT | 3 +++ libc/arch-arm/syscalls/setfsgid.S | 14 ++++++++++++++ libc/arch-arm/syscalls/setfsuid.S | 14 ++++++++++++++ libc/arch-arm64/syscalls/setfsgid.S | 14 ++++++++++++++ libc/arch-arm64/syscalls/setfsuid.S | 14 ++++++++++++++ libc/arch-mips/syscalls/setfsgid.S | 19 +++++++++++++++++++ libc/arch-mips/syscalls/setfsuid.S | 19 +++++++++++++++++++ libc/arch-mips64/syscalls/setfsgid.S | 25 +++++++++++++++++++++++++ libc/arch-mips64/syscalls/setfsuid.S | 25 +++++++++++++++++++++++++ libc/arch-x86/syscalls/setfsgid.S | 21 +++++++++++++++++++++ libc/arch-x86/syscalls/setfsuid.S | 21 +++++++++++++++++++++ libc/arch-x86_64/syscalls/setfsgid.S | 15 +++++++++++++++ libc/arch-x86_64/syscalls/setfsuid.S | 15 +++++++++++++++ libc/include/sys/fsuid.h | 3 +-- 14 files changed, 220 insertions(+), 2 deletions(-) create mode 100644 libc/arch-arm/syscalls/setfsgid.S create mode 100644 libc/arch-arm/syscalls/setfsuid.S create mode 100644 libc/arch-arm64/syscalls/setfsgid.S create mode 100644 libc/arch-arm64/syscalls/setfsuid.S create mode 100644 libc/arch-mips/syscalls/setfsgid.S create mode 100644 libc/arch-mips/syscalls/setfsuid.S create mode 100644 libc/arch-mips64/syscalls/setfsgid.S create mode 100644 libc/arch-mips64/syscalls/setfsuid.S create mode 100644 libc/arch-x86/syscalls/setfsgid.S create mode 100644 libc/arch-x86/syscalls/setfsuid.S create mode 100644 libc/arch-x86_64/syscalls/setfsgid.S create mode 100644 libc/arch-x86_64/syscalls/setfsuid.S diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index 014d55444..128ec6bd0 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -303,6 +303,9 @@ int __ppoll:ppoll(pollfd*, unsigned int, timespec*, const sigset_t*, size_t) al int __set_tid_address:set_tid_address(int*) all +int setfsgid(gid_t) all +int setfsuid(uid_t) all + pid_t wait4(pid_t, int*, int, struct rusage*) all int __waitid:waitid(int, pid_t, struct siginfo_t*, int, void*) all diff --git a/libc/arch-arm/syscalls/setfsgid.S b/libc/arch-arm/syscalls/setfsgid.S new file mode 100644 index 000000000..e36e6eac8 --- /dev/null +++ b/libc/arch-arm/syscalls/setfsgid.S @@ -0,0 +1,14 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsgid) + mov ip, r7 + ldr r7, =__NR_setfsgid + swi #0 + mov r7, ip + cmn r0, #(MAX_ERRNO + 1) + bxls lr + neg r0, r0 + b __set_errno +END(setfsgid) diff --git a/libc/arch-arm/syscalls/setfsuid.S b/libc/arch-arm/syscalls/setfsuid.S new file mode 100644 index 000000000..e3c9c009f --- /dev/null +++ b/libc/arch-arm/syscalls/setfsuid.S @@ -0,0 +1,14 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsuid) + mov ip, r7 + ldr r7, =__NR_setfsuid + swi #0 + mov r7, ip + cmn r0, #(MAX_ERRNO + 1) + bxls lr + neg r0, r0 + b __set_errno +END(setfsuid) diff --git a/libc/arch-arm64/syscalls/setfsgid.S b/libc/arch-arm64/syscalls/setfsgid.S new file mode 100644 index 000000000..d2f29ab76 --- /dev/null +++ b/libc/arch-arm64/syscalls/setfsgid.S @@ -0,0 +1,14 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsgid) + mov x8, __NR_setfsgid + svc #0 + + cmn x0, #(MAX_ERRNO + 1) + cneg x0, x0, hi + b.hi __set_errno + + ret +END(setfsgid) diff --git a/libc/arch-arm64/syscalls/setfsuid.S b/libc/arch-arm64/syscalls/setfsuid.S new file mode 100644 index 000000000..852f97cbe --- /dev/null +++ b/libc/arch-arm64/syscalls/setfsuid.S @@ -0,0 +1,14 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsuid) + mov x8, __NR_setfsuid + svc #0 + + cmn x0, #(MAX_ERRNO + 1) + cneg x0, x0, hi + b.hi __set_errno + + ret +END(setfsuid) diff --git a/libc/arch-mips/syscalls/setfsgid.S b/libc/arch-mips/syscalls/setfsgid.S new file mode 100644 index 000000000..6a5956581 --- /dev/null +++ b/libc/arch-mips/syscalls/setfsgid.S @@ -0,0 +1,19 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsgid) + .set noreorder + .cpload t9 + li v0, __NR_setfsgid + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + la t9,__set_errno + j t9 + nop + .set reorder +END(setfsgid) diff --git a/libc/arch-mips/syscalls/setfsuid.S b/libc/arch-mips/syscalls/setfsuid.S new file mode 100644 index 000000000..1c2317a7b --- /dev/null +++ b/libc/arch-mips/syscalls/setfsuid.S @@ -0,0 +1,19 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsuid) + .set noreorder + .cpload t9 + li v0, __NR_setfsuid + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + la t9,__set_errno + j t9 + nop + .set reorder +END(setfsuid) diff --git a/libc/arch-mips64/syscalls/setfsgid.S b/libc/arch-mips64/syscalls/setfsgid.S new file mode 100644 index 000000000..7f75ed923 --- /dev/null +++ b/libc/arch-mips64/syscalls/setfsgid.S @@ -0,0 +1,25 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsgid) + .set push + .set noreorder + li v0, __NR_setfsgid + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + move t0, ra + bal 2f + nop +2: + .cpsetup ra, t1, 2b + LA t9,__set_errno + .cpreturn + j t9 + move ra, t0 + .set pop +END(setfsgid) diff --git a/libc/arch-mips64/syscalls/setfsuid.S b/libc/arch-mips64/syscalls/setfsuid.S new file mode 100644 index 000000000..4cab9d4cb --- /dev/null +++ b/libc/arch-mips64/syscalls/setfsuid.S @@ -0,0 +1,25 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsuid) + .set push + .set noreorder + li v0, __NR_setfsuid + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + move t0, ra + bal 2f + nop +2: + .cpsetup ra, t1, 2b + LA t9,__set_errno + .cpreturn + j t9 + move ra, t0 + .set pop +END(setfsuid) diff --git a/libc/arch-x86/syscalls/setfsgid.S b/libc/arch-x86/syscalls/setfsgid.S new file mode 100644 index 000000000..fa7a5c59f --- /dev/null +++ b/libc/arch-x86/syscalls/setfsgid.S @@ -0,0 +1,21 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsgid) + pushl %ebx + .cfi_def_cfa_offset 8 + .cfi_rel_offset ebx, 0 + mov 8(%esp), %ebx + movl $__NR_setfsgid, %eax + int $0x80 + cmpl $-MAX_ERRNO, %eax + jb 1f + negl %eax + pushl %eax + call __set_errno + addl $4, %esp +1: + popl %ebx + ret +END(setfsgid) diff --git a/libc/arch-x86/syscalls/setfsuid.S b/libc/arch-x86/syscalls/setfsuid.S new file mode 100644 index 000000000..5856a16e0 --- /dev/null +++ b/libc/arch-x86/syscalls/setfsuid.S @@ -0,0 +1,21 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsuid) + pushl %ebx + .cfi_def_cfa_offset 8 + .cfi_rel_offset ebx, 0 + mov 8(%esp), %ebx + movl $__NR_setfsuid, %eax + int $0x80 + cmpl $-MAX_ERRNO, %eax + jb 1f + negl %eax + pushl %eax + call __set_errno + addl $4, %esp +1: + popl %ebx + ret +END(setfsuid) diff --git a/libc/arch-x86_64/syscalls/setfsgid.S b/libc/arch-x86_64/syscalls/setfsgid.S new file mode 100644 index 000000000..e9f50b80d --- /dev/null +++ b/libc/arch-x86_64/syscalls/setfsgid.S @@ -0,0 +1,15 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsgid) + movl $__NR_setfsgid, %eax + syscall + cmpq $-MAX_ERRNO, %rax + jb 1f + negl %eax + movl %eax, %edi + call __set_errno +1: + ret +END(setfsgid) diff --git a/libc/arch-x86_64/syscalls/setfsuid.S b/libc/arch-x86_64/syscalls/setfsuid.S new file mode 100644 index 000000000..cfdb86cc8 --- /dev/null +++ b/libc/arch-x86_64/syscalls/setfsuid.S @@ -0,0 +1,15 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(setfsuid) + movl $__NR_setfsuid, %eax + syscall + cmpq $-MAX_ERRNO, %rax + jb 1f + negl %eax + movl %eax, %edi + call __set_errno +1: + ret +END(setfsuid) diff --git a/libc/include/sys/fsuid.h b/libc/include/sys/fsuid.h index bc47e3d95..03355b794 100644 --- a/libc/include/sys/fsuid.h +++ b/libc/include/sys/fsuid.h @@ -25,6 +25,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + #ifndef _SYS_FSUID_H_ #define _SYS_FSUID_H_ @@ -33,10 +34,8 @@ __BEGIN_DECLS -#if 0 /* MISSING FROM BIONIC */ extern int setfsuid(uid_t); extern int setfsgid(gid_t); -#endif /* MISSING */ __END_DECLS From 61833de613990f2fdaf357bb3d854d72a4980890 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 30 Jul 2014 16:06:56 -0700 Subject: [PATCH 082/148] Fix memchr with a zero length. The memchr implementation for 64 bit fails if these conditions occur: - The buffer is 32 byte aligned. - The buffer contains the character in the first byte. - The count sent in is zero. The function should return NULL, but it's not. Bug: 16676625 (cherry picked from commit e03e1eac0b7682884b6628df1305d34299680cb4) Change-Id: Ie4cca2c445127a0936ee2b96651a8e7204fbaffd --- libc/arch-arm64/generic/bionic/memchr.S | 5 +++++ tests/string_test.cpp | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/libc/arch-arm64/generic/bionic/memchr.S b/libc/arch-arm64/generic/bionic/memchr.S index fbb00caaa..e5ea57d8c 100644 --- a/libc/arch-arm64/generic/bionic/memchr.S +++ b/libc/arch-arm64/generic/bionic/memchr.S @@ -75,6 +75,7 @@ ENTRY(memchr) * Magic constant 0x40100401 allows us to identify which lane matches * the requested byte. */ + cbz cntin, .Lzero_length mov wtmp2, #0x0401 movk wtmp2, #0x4010, lsl #16 dup vrepchr.16b, chrin @@ -157,4 +158,8 @@ ENTRY(memchr) /* Select result or NULL */ csel result, xzr, result, eq ret + +.Lzero_length: + mov result, xzr + ret END(memchr) diff --git a/tests/string_test.cpp b/tests/string_test.cpp index bc2c05b40..73c94c602 100644 --- a/tests/string_test.cpp +++ b/tests/string_test.cpp @@ -763,6 +763,14 @@ TEST(string, memchr) { } } +TEST(string, memchr_zero) { + uint8_t* buffer; + ASSERT_EQ(0, posix_memalign(reinterpret_cast(&buffer), 64, 64)); + memset(buffer, 10, 64); + ASSERT_TRUE(NULL == memchr(buffer, 5, 0)); + ASSERT_TRUE(NULL == memchr(buffer, 10, 0)); +} + TEST(string, memrchr) { int seek_char = random() & 255; StringTestState state(SMALL); From 1b1966d9448e979d1503a3d8843708bfa8880dc6 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Mon, 4 Aug 2014 15:21:16 +0000 Subject: [PATCH 083/148] Revert "Fix dlsym(3) to do breadth first search." This reverts commit 422106a24d620af4be58e8d92a2e9b7b6167b72d. Change-Id: I9e26a6933d10eb30438b521450f2010997ca5aee --- linker/dlfcn.cpp | 3 +- linker/linked_list.h | 37 +--------------------- linker/linker.cpp | 51 +++++++------------------------ linker/linker.h | 2 +- linker/tests/linked_list_test.cpp | 20 ------------ tests/dlfcn_test.cpp | 21 +++---------- tests/libs/Android.mk | 13 -------- 7 files changed, 19 insertions(+), 128 deletions(-) diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp index 8ebf3576b..efb829e7a 100644 --- a/linker/dlfcn.cpp +++ b/linker/dlfcn.cpp @@ -111,7 +111,8 @@ void* dlsym(void* handle, const char* symbol) { sym = dlsym_linear_lookup(symbol, &found, caller_si->next, caller_si); } } else { - sym = dlsym_handle_lookup(reinterpret_cast(handle), &found, symbol, caller_si); + found = reinterpret_cast(handle); + sym = dlsym_handle_lookup(found, symbol, caller_si); } if (sym != NULL && sym->st_shndx != 0) { diff --git a/linker/linked_list.h b/linker/linked_list.h index 7f8c90160..52af0f110 100644 --- a/linker/linked_list.h +++ b/linker/linked_list.h @@ -31,45 +31,13 @@ struct LinkedListEntry { template class LinkedList { public: - LinkedList() : head_(nullptr), tail_(nullptr) {} + LinkedList() : head_(nullptr) {} void push_front(T* const element) { LinkedListEntry* new_entry = Allocator::alloc(); new_entry->next = head_; new_entry->element = element; head_ = new_entry; - if (tail_ == nullptr) { - tail_ = new_entry; - } - } - - void push_back(T* const element) { - LinkedListEntry* new_entry = Allocator::alloc(); - new_entry->next = nullptr; - new_entry->element = element; - if (tail_ == nullptr) { - tail_ = head_ = new_entry; - } else { - tail_->next = new_entry; - tail_ = new_entry; - } - } - - T* pop_front() { - if (head_ == nullptr) { - return nullptr; - } - - LinkedListEntry* entry = head_; - T* element = entry->element; - head_ = entry->next; - Allocator::free(entry); - - if (head_ == nullptr) { - tail_ = nullptr; - } - - return element; } void clear() { @@ -78,8 +46,6 @@ class LinkedList { head_ = head_->next; Allocator::free(p); } - - tail_ = nullptr; } template @@ -102,7 +68,6 @@ class LinkedList { private: LinkedListEntry* head_; - LinkedListEntry* tail_; DISALLOW_COPY_AND_ASSIGN(LinkedList); }; diff --git a/linker/linker.cpp b/linker/linker.cpp index f8b35d7a8..59b99383e 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -469,10 +469,6 @@ static ElfW(Sym)* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name, } } - TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p %x %zd", - name, si->name, reinterpret_cast(si->base), hash, hash % si->nbucket); - - return NULL; } @@ -589,43 +585,18 @@ done: return NULL; } -// Another soinfo list allocator to use in dlsym. We don't reuse -// SoinfoListAllocator because it is write-protected most of the time. -static LinkerAllocator> g_soinfo_list_allocator_rw; -class SoinfoListAllocatorRW { - public: - static LinkedListEntry* alloc() { - return g_soinfo_list_allocator_rw.alloc(); - } +/* This is used by dlsym(3). It performs symbol lookup only within the + specified soinfo object and not in any of its dependencies. - static void free(LinkedListEntry* ptr) { - g_soinfo_list_allocator_rw.free(ptr); - } -}; - -// This is used by dlsym(3). It performs symbol lookup only within the -// specified soinfo object and its dependencies in breadth first order. -ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soinfo* caller) { - LinkedList visit_list; - visit_list.push_back(si); - soinfo* current_soinfo; - while ((current_soinfo = visit_list.pop_front()) != nullptr) { - ElfW(Sym)* result = soinfo_elf_lookup(current_soinfo, elfhash(name), name, - caller == current_soinfo ? SymbolLookupScope::kAllowLocal : SymbolLookupScope::kExcludeLocal); - - if (result != nullptr) { - *found = current_soinfo; - visit_list.clear(); - return result; - } - - current_soinfo->get_children().for_each([&](soinfo* child) { - visit_list.push_back(child); - }); - } - - visit_list.clear(); - return nullptr; + TODO: Only looking in the specified soinfo seems wrong. dlsym(3) says + that it should do a breadth first search through the dependency + tree. This agrees with the ELF spec (aka System V Application + Binary Interface) where in Chapter 5 it discuss resolving "Shared + Object Dependencies" in breadth first search order. + */ +ElfW(Sym)* dlsym_handle_lookup(soinfo* si, const char* name, soinfo* caller) { + return soinfo_elf_lookup(si, elfhash(name), name, + caller == si ? SymbolLookupScope::kAllowLocal : SymbolLookupScope::kExcludeLocal); } /* This is used by dlsym(3) to performs a global symbol lookup. If the diff --git a/linker/linker.h b/linker/linker.h index 03672b2c6..e1112e6e6 100644 --- a/linker/linker.h +++ b/linker/linker.h @@ -238,7 +238,7 @@ ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start, soinfo* find_containing_library(const void* addr); ElfW(Sym)* dladdr_find_symbol(soinfo* si, const void* addr); -ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soinfo* caller_si); +ElfW(Sym)* dlsym_handle_lookup(soinfo* si, const char* name, soinfo* caller_si); void debuggerd_init(); extern "C" abort_msg_t* g_abort_message; diff --git a/linker/tests/linked_list_test.cpp b/linker/tests/linked_list_test.cpp index b9816fa10..31ec7d505 100644 --- a/linker/tests/linked_list_test.cpp +++ b/linker/tests/linked_list_test.cpp @@ -95,23 +95,3 @@ TEST(linked_list, simple) { ASSERT_TRUE(free_called); ASSERT_EQ("", test_list_to_string(list)); } - -TEST(linked_list, push_pop) { - test_list_t list; - list.push_front("b"); - list.push_front("a"); - ASSERT_EQ("ab", test_list_to_string(list)); - list.push_back("c"); - ASSERT_EQ("abc", test_list_to_string(list)); - ASSERT_EQ("a", list.pop_front()); - ASSERT_EQ("bc", test_list_to_string(list)); - ASSERT_EQ("b", list.pop_front()); - ASSERT_EQ("c", test_list_to_string(list)); - ASSERT_EQ("c", list.pop_front()); - ASSERT_EQ("", test_list_to_string(list)); - ASSERT_TRUE(list.pop_front() == nullptr); - list.push_back("r"); - ASSERT_EQ("r", test_list_to_string(list)); - ASSERT_EQ("r", list.pop_front()); - ASSERT_TRUE(list.pop_front() == nullptr); -} diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp index 9bc25574b..f056fb692 100644 --- a/tests/dlfcn_test.cpp +++ b/tests/dlfcn_test.cpp @@ -62,9 +62,10 @@ TEST(dlfcn, dlsym_in_self) { ASSERT_EQ(0, dlclose(self)); } -#if defined(__arm__) -// This seems to be working only for arm. -// Others platforms optimize LOCAL PROTECTED symbols. +#if !defined(__LP64__) +// Current compiler/static linker used for aarch64 +// platform optimizes LOCAL PROTECTED symbol +// in libtest_local_symbol.so out of existence TEST(dlfcn, dlsym_local_symbol) { void* handle = dlopen("libtest_local_symbol.so", RTLD_NOW); ASSERT_TRUE(handle != NULL); @@ -77,23 +78,9 @@ TEST(dlfcn, dlsym_local_symbol) { f = reinterpret_cast(dlsym(handle, "dlsym_local_symbol_get_taxicab_number_using_dlsym")); ASSERT_TRUE(f != NULL); ASSERT_EQ(1729U, f()); - dlclose(handle); } #endif -TEST(dlfcn, dlsym_with_dependencies) { - void* handle = dlopen("libtest_with_dependency.so", RTLD_NOW); - ASSERT_TRUE(handle != NULL); - dlerror(); - // This symbol is in DT_NEEDED library. - void* sym = dlsym(handle, "getRandomNumber"); - ASSERT_TRUE(sym != NULL); - int (*fn)(void); - fn = reinterpret_cast(sym); - EXPECT_EQ(4, fn()); - dlclose(handle); -} - TEST(dlfcn, dlopen_noload) { void* handle = dlopen("libtest_simple.so", RTLD_NOW | RTLD_NOLOAD); ASSERT_TRUE(handle == NULL); diff --git a/tests/libs/Android.mk b/tests/libs/Android.mk index 7ed3e7b07..a374e4839 100644 --- a/tests/libs/Android.mk +++ b/tests/libs/Android.mk @@ -101,19 +101,6 @@ build_type := target build_target := SHARED_LIBRARY include $(TEST_PATH)/Android.build.mk -# ----------------------------------------------------------------------------- -# Library with dependency used by dlfcn tests -# ----------------------------------------------------------------------------- -libtest_with_dependency_src_files := \ - dlopen_testlib_simple.cpp - -libtest_with_dependency_shared_libraries := libdlext_test - -module := libtest_with_dependency -build_type := target -build_target := SHARED_LIBRARY -include $(TEST_PATH)/Android.build.mk - # ----------------------------------------------------------------------------- # Library used to test local symbol lookup # ----------------------------------------------------------------------------- From db7a17d4ff56a05af01ee2fee1f3c55245bfc630 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Mon, 4 Aug 2014 23:39:22 +0000 Subject: [PATCH 084/148] Revert "Revert "Fix dlsym(3) to do breadth first search."" This reverts commit 1b1966d9448e979d1503a3d8843708bfa8880dc6. Change-Id: I05d6d3481aaf8f3e260d2e5e950248519a1d347f --- linker/dlfcn.cpp | 3 +- linker/linked_list.h | 37 +++++++++++++++++++++- linker/linker.cpp | 51 ++++++++++++++++++++++++------- linker/linker.h | 2 +- linker/tests/linked_list_test.cpp | 20 ++++++++++++ tests/dlfcn_test.cpp | 21 ++++++++++--- tests/libs/Android.mk | 13 ++++++++ 7 files changed, 128 insertions(+), 19 deletions(-) diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp index efb829e7a..8ebf3576b 100644 --- a/linker/dlfcn.cpp +++ b/linker/dlfcn.cpp @@ -111,8 +111,7 @@ void* dlsym(void* handle, const char* symbol) { sym = dlsym_linear_lookup(symbol, &found, caller_si->next, caller_si); } } else { - found = reinterpret_cast(handle); - sym = dlsym_handle_lookup(found, symbol, caller_si); + sym = dlsym_handle_lookup(reinterpret_cast(handle), &found, symbol, caller_si); } if (sym != NULL && sym->st_shndx != 0) { diff --git a/linker/linked_list.h b/linker/linked_list.h index 52af0f110..7f8c90160 100644 --- a/linker/linked_list.h +++ b/linker/linked_list.h @@ -31,13 +31,45 @@ struct LinkedListEntry { template class LinkedList { public: - LinkedList() : head_(nullptr) {} + LinkedList() : head_(nullptr), tail_(nullptr) {} void push_front(T* const element) { LinkedListEntry* new_entry = Allocator::alloc(); new_entry->next = head_; new_entry->element = element; head_ = new_entry; + if (tail_ == nullptr) { + tail_ = new_entry; + } + } + + void push_back(T* const element) { + LinkedListEntry* new_entry = Allocator::alloc(); + new_entry->next = nullptr; + new_entry->element = element; + if (tail_ == nullptr) { + tail_ = head_ = new_entry; + } else { + tail_->next = new_entry; + tail_ = new_entry; + } + } + + T* pop_front() { + if (head_ == nullptr) { + return nullptr; + } + + LinkedListEntry* entry = head_; + T* element = entry->element; + head_ = entry->next; + Allocator::free(entry); + + if (head_ == nullptr) { + tail_ = nullptr; + } + + return element; } void clear() { @@ -46,6 +78,8 @@ class LinkedList { head_ = head_->next; Allocator::free(p); } + + tail_ = nullptr; } template @@ -68,6 +102,7 @@ class LinkedList { private: LinkedListEntry* head_; + LinkedListEntry* tail_; DISALLOW_COPY_AND_ASSIGN(LinkedList); }; diff --git a/linker/linker.cpp b/linker/linker.cpp index 59b99383e..f8b35d7a8 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -469,6 +469,10 @@ static ElfW(Sym)* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name, } } + TRACE_TYPE(LOOKUP, "NOT FOUND %s in %s@%p %x %zd", + name, si->name, reinterpret_cast(si->base), hash, hash % si->nbucket); + + return NULL; } @@ -585,18 +589,43 @@ done: return NULL; } -/* This is used by dlsym(3). It performs symbol lookup only within the - specified soinfo object and not in any of its dependencies. +// Another soinfo list allocator to use in dlsym. We don't reuse +// SoinfoListAllocator because it is write-protected most of the time. +static LinkerAllocator> g_soinfo_list_allocator_rw; +class SoinfoListAllocatorRW { + public: + static LinkedListEntry* alloc() { + return g_soinfo_list_allocator_rw.alloc(); + } - TODO: Only looking in the specified soinfo seems wrong. dlsym(3) says - that it should do a breadth first search through the dependency - tree. This agrees with the ELF spec (aka System V Application - Binary Interface) where in Chapter 5 it discuss resolving "Shared - Object Dependencies" in breadth first search order. - */ -ElfW(Sym)* dlsym_handle_lookup(soinfo* si, const char* name, soinfo* caller) { - return soinfo_elf_lookup(si, elfhash(name), name, - caller == si ? SymbolLookupScope::kAllowLocal : SymbolLookupScope::kExcludeLocal); + static void free(LinkedListEntry* ptr) { + g_soinfo_list_allocator_rw.free(ptr); + } +}; + +// This is used by dlsym(3). It performs symbol lookup only within the +// specified soinfo object and its dependencies in breadth first order. +ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soinfo* caller) { + LinkedList visit_list; + visit_list.push_back(si); + soinfo* current_soinfo; + while ((current_soinfo = visit_list.pop_front()) != nullptr) { + ElfW(Sym)* result = soinfo_elf_lookup(current_soinfo, elfhash(name), name, + caller == current_soinfo ? SymbolLookupScope::kAllowLocal : SymbolLookupScope::kExcludeLocal); + + if (result != nullptr) { + *found = current_soinfo; + visit_list.clear(); + return result; + } + + current_soinfo->get_children().for_each([&](soinfo* child) { + visit_list.push_back(child); + }); + } + + visit_list.clear(); + return nullptr; } /* This is used by dlsym(3) to performs a global symbol lookup. If the diff --git a/linker/linker.h b/linker/linker.h index e1112e6e6..03672b2c6 100644 --- a/linker/linker.h +++ b/linker/linker.h @@ -238,7 +238,7 @@ ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start, soinfo* find_containing_library(const void* addr); ElfW(Sym)* dladdr_find_symbol(soinfo* si, const void* addr); -ElfW(Sym)* dlsym_handle_lookup(soinfo* si, const char* name, soinfo* caller_si); +ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soinfo* caller_si); void debuggerd_init(); extern "C" abort_msg_t* g_abort_message; diff --git a/linker/tests/linked_list_test.cpp b/linker/tests/linked_list_test.cpp index 31ec7d505..b9816fa10 100644 --- a/linker/tests/linked_list_test.cpp +++ b/linker/tests/linked_list_test.cpp @@ -95,3 +95,23 @@ TEST(linked_list, simple) { ASSERT_TRUE(free_called); ASSERT_EQ("", test_list_to_string(list)); } + +TEST(linked_list, push_pop) { + test_list_t list; + list.push_front("b"); + list.push_front("a"); + ASSERT_EQ("ab", test_list_to_string(list)); + list.push_back("c"); + ASSERT_EQ("abc", test_list_to_string(list)); + ASSERT_EQ("a", list.pop_front()); + ASSERT_EQ("bc", test_list_to_string(list)); + ASSERT_EQ("b", list.pop_front()); + ASSERT_EQ("c", test_list_to_string(list)); + ASSERT_EQ("c", list.pop_front()); + ASSERT_EQ("", test_list_to_string(list)); + ASSERT_TRUE(list.pop_front() == nullptr); + list.push_back("r"); + ASSERT_EQ("r", test_list_to_string(list)); + ASSERT_EQ("r", list.pop_front()); + ASSERT_TRUE(list.pop_front() == nullptr); +} diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp index f056fb692..9bc25574b 100644 --- a/tests/dlfcn_test.cpp +++ b/tests/dlfcn_test.cpp @@ -62,10 +62,9 @@ TEST(dlfcn, dlsym_in_self) { ASSERT_EQ(0, dlclose(self)); } -#if !defined(__LP64__) -// Current compiler/static linker used for aarch64 -// platform optimizes LOCAL PROTECTED symbol -// in libtest_local_symbol.so out of existence +#if defined(__arm__) +// This seems to be working only for arm. +// Others platforms optimize LOCAL PROTECTED symbols. TEST(dlfcn, dlsym_local_symbol) { void* handle = dlopen("libtest_local_symbol.so", RTLD_NOW); ASSERT_TRUE(handle != NULL); @@ -78,9 +77,23 @@ TEST(dlfcn, dlsym_local_symbol) { f = reinterpret_cast(dlsym(handle, "dlsym_local_symbol_get_taxicab_number_using_dlsym")); ASSERT_TRUE(f != NULL); ASSERT_EQ(1729U, f()); + dlclose(handle); } #endif +TEST(dlfcn, dlsym_with_dependencies) { + void* handle = dlopen("libtest_with_dependency.so", RTLD_NOW); + ASSERT_TRUE(handle != NULL); + dlerror(); + // This symbol is in DT_NEEDED library. + void* sym = dlsym(handle, "getRandomNumber"); + ASSERT_TRUE(sym != NULL); + int (*fn)(void); + fn = reinterpret_cast(sym); + EXPECT_EQ(4, fn()); + dlclose(handle); +} + TEST(dlfcn, dlopen_noload) { void* handle = dlopen("libtest_simple.so", RTLD_NOW | RTLD_NOLOAD); ASSERT_TRUE(handle == NULL); diff --git a/tests/libs/Android.mk b/tests/libs/Android.mk index a374e4839..7ed3e7b07 100644 --- a/tests/libs/Android.mk +++ b/tests/libs/Android.mk @@ -101,6 +101,19 @@ build_type := target build_target := SHARED_LIBRARY include $(TEST_PATH)/Android.build.mk +# ----------------------------------------------------------------------------- +# Library with dependency used by dlfcn tests +# ----------------------------------------------------------------------------- +libtest_with_dependency_src_files := \ + dlopen_testlib_simple.cpp + +libtest_with_dependency_shared_libraries := libdlext_test + +module := libtest_with_dependency +build_type := target +build_target := SHARED_LIBRARY +include $(TEST_PATH)/Android.build.mk + # ----------------------------------------------------------------------------- # Library used to test local symbol lookup # ----------------------------------------------------------------------------- From 1544eae56e2713a199e085438809078ebad8e7d1 Mon Sep 17 00:00:00 2001 From: Paul Jensen Date: Wed, 6 Aug 2014 17:34:22 +0000 Subject: [PATCH 085/148] Revert most of "Cleanup: Delete dead code." This reverts most of commit 2582f02a01cd56c56a4e6c9de4444a6ec937cc37. The DNS cache flushing code needs to be called when routes change. Change-Id: I5b04121bc428cc6a2e136b6c3269c395bfb4981f bug:16549455 --- libc/dns/include/resolv_netid.h | 3 +++ libc/dns/resolv/res_cache.c | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/libc/dns/include/resolv_netid.h b/libc/dns/include/resolv_netid.h index f1b88920e..e5521b809 100644 --- a/libc/dns/include/resolv_netid.h +++ b/libc/dns/include/resolv_netid.h @@ -61,6 +61,9 @@ int android_getaddrinfofornet(const char *, const char *, const struct addrinfo extern void _resolv_set_nameservers_for_net(unsigned netid, const char** servers, int numservers, const char *domains) __used_in_netd; +/* flush the cache associated with a certain network */ +extern void _resolv_flush_cache_for_net(unsigned netid) __used_in_netd; + /* delete the cache associated with a certain network */ extern void _resolv_delete_cache_for_net(unsigned netid) __used_in_netd; diff --git a/libc/dns/resolv/res_cache.c b/libc/dns/resolv/res_cache.c index c934b4ee6..419b748d4 100644 --- a/libc/dns/resolv/res_cache.c +++ b/libc/dns/resolv/res_cache.c @@ -1831,6 +1831,17 @@ _get_res_cache_for_net_locked(unsigned netid) return cache; } +void +_resolv_flush_cache_for_net(unsigned netid) +{ + pthread_once(&_res_cache_once, _res_cache_init); + pthread_mutex_lock(&_res_cache_list_lock); + + _flush_cache_for_net_locked(netid); + + pthread_mutex_unlock(&_res_cache_list_lock); +} + static void _flush_cache_for_net_locked(unsigned netid) { From 7aa27e1c1a53afe28f6180fd1fc50d096cabea7b Mon Sep 17 00:00:00 2001 From: Dehao Chen Date: Tue, 5 Aug 2014 15:23:00 -0700 Subject: [PATCH 086/148] Workaround b/16818336 which fails build under aggressive inlining. Change-Id: Ifcd596714c427a2ec39502b9c0af9082ded91884 --- libc/include/string.h | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/libc/include/string.h b/libc/include/string.h index af1c0c100..8df68e38d 100644 --- a/libc/include/string.h +++ b/libc/include/string.h @@ -94,9 +94,6 @@ extern size_t strxfrm_l(char* __restrict, const char* __restrict, size_t, locale #if defined(__BIONIC_FORTIFY) -__errordecl(__memcpy_dest_size_error, "memcpy: prevented write past end of buffer"); -__errordecl(__memcpy_src_size_error, "memcpy: prevented read past end of buffer"); - __BIONIC_FORTIFY_INLINE void* memcpy(void* __restrict dest, const void* __restrict src, size_t copy_amount) { char *d = (char *) dest; @@ -104,14 +101,6 @@ void* memcpy(void* __restrict dest, const void* __restrict src, size_t copy_amou size_t s_len = __bos0(s); size_t d_len = __bos0(d); - if (__builtin_constant_p(copy_amount) && (copy_amount > d_len)) { - __memcpy_dest_size_error(); - } - - if (__builtin_constant_p(copy_amount) && (copy_amount > s_len)) { - __memcpy_src_size_error(); - } - return __builtin___memcpy_chk(dest, src, copy_amount, d_len); } @@ -130,16 +119,12 @@ char* strcpy(char* __restrict dest, const char* __restrict src) { return __builtin___strcpy_chk(dest, src, __bos(dest)); } -__errordecl(__stpncpy_error, "stpncpy: prevented write past end of buffer"); extern char* __stpncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t); __BIONIC_FORTIFY_INLINE char* stpncpy(char* __restrict dest, const char* __restrict src, size_t n) { size_t bos_dest = __bos(dest); size_t bos_src = __bos(src); - if (__builtin_constant_p(n) && (n > bos_dest)) { - __stpncpy_error(); - } if (bos_src == __BIONIC_FORTIFY_UNKNOWN_SIZE) { return __builtin___stpncpy_chk(dest, src, n, bos_dest); @@ -157,16 +142,12 @@ char* stpncpy(char* __restrict dest, const char* __restrict src, size_t n) { return __stpncpy_chk2(dest, src, n, bos_dest, bos_src); } -__errordecl(__strncpy_error, "strncpy: prevented write past end of buffer"); extern char* __strncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t); __BIONIC_FORTIFY_INLINE char* strncpy(char* __restrict dest, const char* __restrict src, size_t n) { size_t bos_dest = __bos(dest); size_t bos_src = __bos(src); - if (__builtin_constant_p(n) && (n > bos_dest)) { - __strncpy_error(); - } if (bos_src == __BIONIC_FORTIFY_UNKNOWN_SIZE) { return __builtin___strncpy_chk(dest, src, n, bos_dest); @@ -201,7 +182,6 @@ void* memset(void *s, int c, size_t n) { extern size_t __strlcpy_real(char* __restrict, const char* __restrict, size_t) __asm__(__USER_LABEL_PREFIX__ "strlcpy"); -__errordecl(__strlcpy_error, "strlcpy: prevented write past end of buffer"); extern size_t __strlcpy_chk(char *, const char *, size_t, size_t); __BIONIC_FORTIFY_INLINE @@ -219,12 +199,6 @@ size_t strlcpy(char* __restrict dest, const char* __restrict src, size_t size) { if (__builtin_constant_p(size) && (size <= bos)) { return __strlcpy_real(dest, src, size); } - - // Compiler can prove, at compile time, that the passed in size - // is always > the actual object size. Force a compiler error. - if (__builtin_constant_p(size) && (size > bos)) { - __strlcpy_error(); - } #endif /* !defined(__clang__) */ return __strlcpy_chk(dest, src, size, bos); @@ -232,7 +206,6 @@ size_t strlcpy(char* __restrict dest, const char* __restrict src, size_t size) { extern size_t __strlcat_real(char* __restrict, const char* __restrict, size_t) __asm__(__USER_LABEL_PREFIX__ "strlcat"); -__errordecl(__strlcat_error, "strlcat: prevented write past end of buffer"); extern size_t __strlcat_chk(char* __restrict, const char* __restrict, size_t, size_t); @@ -251,12 +224,6 @@ size_t strlcat(char* __restrict dest, const char* __restrict src, size_t size) { if (__builtin_constant_p(size) && (size <= bos)) { return __strlcat_real(dest, src, size); } - - // Compiler can prove, at compile time, that the passed in size - // is always > the actual object size. Force a compiler error. - if (__builtin_constant_p(size) && (size > bos)) { - __strlcat_error(); - } #endif /* !defined(__clang__) */ return __strlcat_chk(dest, src, size, bos); From 6035e6cc8317600c3100fdf1070890c3e42715a7 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 30 Jul 2014 10:53:48 -0700 Subject: [PATCH 087/148] Proper MB_CUR_MAX. Previously this was hard coded to 4. This is only the case for UTF-8 locales. As a side effect, this properly reports C.UTF-8 as the default locale instead of C. Change-Id: I7c73cc8fe6ffac61d211cd5f75287e36de06f4fc (cherry picked from commit 1aec7c1a35b2d03038b194967d5ebdc8e2c24b80) --- libc/bionic/locale.cpp | 42 +++++++++++++++++++++++++++++------------- libc/include/stdlib.h | 3 ++- tests/locale_test.cpp | 21 +++++++++++++++++++-- tests/stdio_test.cpp | 5 +++++ 4 files changed, 55 insertions(+), 16 deletions(-) diff --git a/libc/bionic/locale.cpp b/libc/bionic/locale.cpp index 363140e92..4c3fd7f31 100644 --- a/libc/bionic/locale.cpp +++ b/libc/bionic/locale.cpp @@ -30,10 +30,27 @@ #include #include +#include "private/bionic_macros.h" + // We currently support a single locale, the "C" locale (also known as "POSIX"). +static bool __bionic_current_locale_is_utf8 = true; + struct __locale_t { - // Because we only support one locale, these are just tokens with no data. + size_t mb_cur_max; + + __locale_t(size_t mb_cur_max) : mb_cur_max(mb_cur_max) { + } + + __locale_t(const __locale_t* other) { + if (other == LC_GLOBAL_LOCALE) { + mb_cur_max = __bionic_current_locale_is_utf8 ? 4 : 1; + } else { + mb_cur_max = other->mb_cur_max; + } + } + + DISALLOW_COPY_AND_ASSIGN(__locale_t); }; static pthread_once_t g_locale_once = PTHREAD_ONCE_INIT; @@ -75,7 +92,14 @@ static void __locale_init() { g_locale.int_n_sign_posn = CHAR_MAX; } -static bool __bionic_current_locale_is_utf8 = false; +size_t __mb_cur_max() { + locale_t l = reinterpret_cast(pthread_getspecific(g_uselocale_key)); + if (l == nullptr || l == LC_GLOBAL_LOCALE) { + return __bionic_current_locale_is_utf8 ? 4 : 1; + } else { + return l->mb_cur_max; + } +} static bool __is_supported_locale(const char* locale) { return (strcmp(locale, "") == 0 || @@ -85,25 +109,17 @@ static bool __is_supported_locale(const char* locale) { strcmp(locale, "POSIX") == 0); } -static locale_t __new_locale() { - return reinterpret_cast(malloc(sizeof(__locale_t))); -} - lconv* localeconv() { pthread_once(&g_locale_once, __locale_init); return &g_locale; } locale_t duplocale(locale_t l) { - locale_t clone = __new_locale(); - if (clone != NULL && l != LC_GLOBAL_LOCALE) { - *clone = *l; - } - return clone; + return new __locale_t(l); } void freelocale(locale_t l) { - free(l); + delete l; } locale_t newlocale(int category_mask, const char* locale_name, locale_t /*base*/) { @@ -118,7 +134,7 @@ locale_t newlocale(int category_mask, const char* locale_name, locale_t /*base*/ return NULL; } - return __new_locale(); + return new __locale_t(strstr(locale_name, "UTF-8") != NULL ? 4 : 1); } char* setlocale(int category, const char* locale_name) { diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index e29fdba4c..a5eb3d15b 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -161,7 +161,8 @@ extern int mbtowc(wchar_t *, const char *, size_t); extern int wctomb(char *, wchar_t); extern size_t wcstombs(char *, const wchar_t *, size_t); -#define MB_CUR_MAX 4U +extern size_t __mb_cur_max(void); +#define MB_CUR_MAX __mb_cur_max() __END_DECLS diff --git a/tests/locale_test.cpp b/tests/locale_test.cpp index 7d063f9dd..325f6ceda 100644 --- a/tests/locale_test.cpp +++ b/tests/locale_test.cpp @@ -48,8 +48,8 @@ TEST(locale, localeconv) { } TEST(locale, setlocale) { - EXPECT_STREQ("C", setlocale(LC_ALL, NULL)); - EXPECT_STREQ("C", setlocale(LC_CTYPE, NULL)); + EXPECT_STREQ("C.UTF-8", setlocale(LC_ALL, NULL)); + EXPECT_STREQ("C.UTF-8", setlocale(LC_CTYPE, NULL)); errno = 0; EXPECT_EQ(NULL, setlocale(-1, NULL)); @@ -105,3 +105,20 @@ TEST(locale, uselocale) { EXPECT_EQ(n, uselocale(NULL)); } + +TEST(locale, mb_cur_max) { + // We can't reliably test the behavior with setlocale(3) or the behavior for + // initial program conditions because (unless we're the only test that was + // run), another test has almost certainly called uselocale(3) in this thread. + // See b/16685652. + locale_t cloc = newlocale(LC_ALL, "C", 0); + locale_t cloc_utf8 = newlocale(LC_ALL, "C.UTF-8", 0); + + uselocale(cloc); + ASSERT_EQ(1U, MB_CUR_MAX); + uselocale(cloc_utf8); + ASSERT_EQ(4U, MB_CUR_MAX); + + freelocale(cloc); + freelocale(cloc_utf8); +} diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp index 18dae9c2f..bb86509c2 100644 --- a/tests/stdio_test.cpp +++ b/tests/stdio_test.cpp @@ -427,6 +427,9 @@ TEST(stdio, snprintf_negative_zero_5084292) { } TEST(stdio, snprintf_utf8_15439554) { + locale_t cloc = newlocale(LC_ALL, "C.UTF-8", 0); + uselocale(cloc); + // http://b/15439554 char buf[BUFSIZ]; @@ -442,6 +445,8 @@ TEST(stdio, snprintf_utf8_15439554) { // 4-byte character. snprintf(buf, sizeof(buf), "%d\xf0\xa4\xad\xa2%d", 1, 2); EXPECT_STREQ("1𤭢2", buf); + + freelocale(cloc); } TEST(stdio, fprintf_failures_7229520) { From 938a8008a61ecb6e975aa974dbf30ea7e1f298e2 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 31 Jul 2014 11:31:03 -0700 Subject: [PATCH 088/148] Fix mbsrtowcs(3) src param for finished string. A mistake I made while cleaning this up the first time through. mbstrtowcs(3) sets the src param to null if it finishes the string. Change-Id: I6263646e25d9537043b7025fd1dd6ae195f365e2 (cherry picked from commit b6cc8e00cd562bd0f81fe44a6bc646540a862f32) --- libc/bionic/wchar.cpp | 5 ++++- tests/wchar_test.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libc/bionic/wchar.cpp b/libc/bionic/wchar.cpp index 438ce0379..524ba07e7 100644 --- a/libc/bionic/wchar.cpp +++ b/libc/bionic/wchar.cpp @@ -84,6 +84,7 @@ size_t mbsnrtowcs(wchar_t* dst, const char** src, size_t nmc, size_t len, mbstat if (static_cast((*src)[i]) < 0x80) { // Fast path for plain ASCII characters. if ((*src)[i] == '\0') { + *src = nullptr; return reset_and_return(o, state); } r = 1; @@ -96,6 +97,7 @@ size_t mbsnrtowcs(wchar_t* dst, const char** src, size_t nmc, size_t len, mbstat return reset_and_return_illegal(EILSEQ, state); } if (r == 0) { + *src = nullptr; return reset_and_return(o, state); } } @@ -118,7 +120,8 @@ size_t mbsnrtowcs(wchar_t* dst, const char** src, size_t nmc, size_t len, mbstat dst[o] = (*src)[i]; r = 1; if ((*src)[i] == '\0') { - break; + *src = nullptr; + return reset_and_return(o, state); } } else { r = mbrtowc(dst + o, *src + i, nmc - i, state); diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp index f052ce6f1..d02c4bf2f 100644 --- a/tests/wchar_test.cpp +++ b/tests/wchar_test.cpp @@ -351,7 +351,7 @@ void test_mbsrtowcs(mbstate_t* ps) { // Check that we didn't clobber the rest of out. ASSERT_EQ(L'x', out[3]); // Check that valid has advanced to the end of the string. - ASSERT_EQ(L'\0', *valid); + ASSERT_EQ(nullptr, valid); const char* invalid = "A" "\xc2\x20" "ef"; ASSERT_EQ(static_cast(-1), mbsrtowcs(out, &invalid, 4, ps)); From 59b0933e6d4cd9671ad3b6baeae424bc72c8ece0 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 6 Aug 2014 10:47:33 -0700 Subject: [PATCH 089/148] Explain how wcswcs ended up in ndk_cruft.cpp. (cherry picked from commit 1628eb1d43008c52b00ec98d10c4fd9e8b6fc7c5) Change-Id: I335b35038781d0426b3647727e6c4f22c83e187b --- libc/bionic/ndk_cruft.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index e3e640a53..0c7201986 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -225,6 +225,7 @@ extern "C" int tkill(pid_t tid, int sig) { return syscall(__NR_tkill, tid, sig); } +// This was removed from POSIX 2008. extern "C" wchar_t* wcswcs(wchar_t* haystack, wchar_t* needle) { return wcsstr(haystack, needle); } @@ -267,7 +268,7 @@ extern "C" int getdtablesize() { return r.rlim_cur; } -// Only used by ftime, which was removed from POSIX. +// Only used by ftime, which was removed from POSIX 2008. struct timeb { time_t time; unsigned short millitm; From 5386a741e77bfff4e72ca6861fdd3fe2208452ce Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 5 Aug 2014 20:53:31 +0000 Subject: [PATCH 090/148] Revert "Replaces vfork() implementation with fork()" We're getting cold feet on this one... let's put it back. This reverts commit 210331d9762037afb9b5ed8413079c6f65872df9. Change-Id: I6b0d3c2b1dbf7f1dc9566979a91b7504c2189269 (cherry picked from commit 6a918870bab1a55a5f57dd7954abd9a8a27c1bc2) --- libc/SYSCALLS.TXT | 1 + libc/arch-arm/syscalls/vfork.S | 14 ++++ libc/arch-arm64/arm64.mk | 1 + libc/arch-arm64/bionic/vfork.S | 48 +++++++++++++ libc/arch-mips/bionic/vfork.S | 58 +++++++++++++++ libc/arch-mips/mips.mk | 1 + libc/arch-mips64/bionic/vfork.S | 71 +++++++++++++++++++ libc/arch-mips64/mips64.mk | 1 + libc/arch-x86/bionic/vfork.S | 44 ++++++++++++ libc/arch-x86/x86.mk | 1 + .../vfork.cpp => arch-x86_64/bionic/vfork.S} | 24 +++++-- libc/arch-x86_64/x86_64.mk | 1 + 12 files changed, 258 insertions(+), 7 deletions(-) create mode 100644 libc/arch-arm/syscalls/vfork.S create mode 100644 libc/arch-arm64/bionic/vfork.S create mode 100644 libc/arch-mips/bionic/vfork.S create mode 100644 libc/arch-mips64/bionic/vfork.S create mode 100644 libc/arch-x86/bionic/vfork.S rename libc/{bionic/vfork.cpp => arch-x86_64/bionic/vfork.S} (76%) diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index 128ec6bd0..38ae8310a 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -77,6 +77,7 @@ int prlimit64(pid_t, int, struct rlimit64*, const struct rlimit64*) arm,mips,x8 int setgroups:setgroups32(int, const gid_t*) arm,x86 int setgroups:setgroups(int, const gid_t*) arm64,mips,mips64,x86_64 int setpgid(pid_t, pid_t) all +pid_t vfork(void) arm int setregid:setregid32(gid_t, gid_t) arm,x86 int setregid:setregid(gid_t, gid_t) arm64,mips,mips64,x86_64 int chroot(const char*) all diff --git a/libc/arch-arm/syscalls/vfork.S b/libc/arch-arm/syscalls/vfork.S new file mode 100644 index 000000000..e12fba55a --- /dev/null +++ b/libc/arch-arm/syscalls/vfork.S @@ -0,0 +1,14 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(vfork) + mov ip, r7 + ldr r7, =__NR_vfork + swi #0 + mov r7, ip + cmn r0, #(MAX_ERRNO + 1) + bxls lr + neg r0, r0 + b __set_errno +END(vfork) diff --git a/libc/arch-arm64/arm64.mk b/libc/arch-arm64/arm64.mk index 314358e1f..ed991ce60 100644 --- a/libc/arch-arm64/arm64.mk +++ b/libc/arch-arm64/arm64.mk @@ -36,6 +36,7 @@ libc_bionic_src_files_arm64 := \ arch-arm64/bionic/__set_tls.c \ arch-arm64/bionic/sigsetjmp.S \ arch-arm64/bionic/syscall.S \ + arch-arm64/bionic/vfork.S \ libc_crt_target_cflags_arm64 := \ diff --git a/libc/arch-arm64/bionic/vfork.S b/libc/arch-arm64/bionic/vfork.S new file mode 100644 index 000000000..c70062317 --- /dev/null +++ b/libc/arch-arm64/bionic/vfork.S @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include + +ENTRY(vfork) + mov x0, #(CLONE_VM | CLONE_VFORK | SIGCHLD) + mov x1, xzr + mov x2, xzr + mov x3, xzr + mov x4, xzr + + mov x8, __NR_clone + svc #0 + + cmn x0, #(MAX_ERRNO + 1) + cneg x0, x0, hi + b.hi __set_errno + + ret +END(vfork) diff --git a/libc/arch-mips/bionic/vfork.S b/libc/arch-mips/bionic/vfork.S new file mode 100644 index 000000000..96de69e20 --- /dev/null +++ b/libc/arch-mips/bionic/vfork.S @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +// TODO: mips' uapi signal.h is missing #ifndef __ASSEMBLY__. +// #include +#define SIGCHLD 18 + +ENTRY(vfork) + .set noreorder + .cpload t9 + + li a0, (CLONE_VM | CLONE_VFORK | SIGCHLD) + li a1, 0 + li a2, 0 + li a3, 0 + subu sp, 8 + sw $0, 16(sp) + li v0, __NR_clone + syscall + addu sp, 8 + bnez a3, 1f + move a0, v0 + + j ra + nop +1: + la t9, __set_errno + j t9 + nop +END(vfork) diff --git a/libc/arch-mips/mips.mk b/libc/arch-mips/mips.mk index bf3b8ae00..8e415f957 100644 --- a/libc/arch-mips/mips.mk +++ b/libc/arch-mips/mips.mk @@ -59,6 +59,7 @@ libc_bionic_src_files_mips += \ arch-mips/bionic/setjmp.S \ arch-mips/bionic/sigsetjmp.S \ arch-mips/bionic/syscall.S \ + arch-mips/bionic/vfork.S \ ifndef ARCH_MIPS_REV6 libc_bionic_src_files_mips += \ diff --git a/libc/arch-mips64/bionic/vfork.S b/libc/arch-mips64/bionic/vfork.S new file mode 100644 index 000000000..911a264f2 --- /dev/null +++ b/libc/arch-mips64/bionic/vfork.S @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +// TODO: mips' uapi signal.h is missing #ifndef __ASSEMBLY__. +// #include +#define SIGCHLD 18 + + .text + +#if (_MIPS_SIM == _ABIO32) || (_MIPS_SIM == _ABI32) +FRAMESZ = MKFSIZ(5,0) +#else +FRAMESZ = MKFSIZ(0,0) +#endif + +LEAF(vfork,FRAMESZ) +#if FRAMESZ!=0 + PTR_SUBU sp, FRAMESZ +#endif + SETUP_GP64(a5, vfork) + LI a0, (CLONE_VM | CLONE_VFORK | SIGCHLD) + move a1, $0 + move a2, $0 + move a3, $0 +#if (_MIPS_SIM == _ABIO32) || (_MIPS_SIM == _ABI32) + REG_S $0, 4*REGSZ(sp) +#else + move a4, $0 +#endif + LI v0, __NR_clone + syscall +#if FRAMESZ!=0 + PTR_ADDU sp,FRAMESZ +#endif + move a0, v0 + bnez a3, 1f + RESTORE_GP64 + j ra +1: + LA t9,__set_errno + RESTORE_GP64 + j t9 + END(vfork) diff --git a/libc/arch-mips64/mips64.mk b/libc/arch-mips64/mips64.mk index 6f7a928b1..230cb26c5 100644 --- a/libc/arch-mips64/mips64.mk +++ b/libc/arch-mips64/mips64.mk @@ -46,6 +46,7 @@ libc_bionic_src_files_mips64 := \ arch-mips64/bionic/setjmp.S \ arch-mips64/bionic/sigsetjmp.S \ arch-mips64/bionic/syscall.S \ + arch-mips64/bionic/vfork.S \ # FIXME TODO ## libc_bionic_src_files_mips64 += arch-mips64/string/memcpy.S diff --git a/libc/arch-x86/bionic/vfork.S b/libc/arch-x86/bionic/vfork.S new file mode 100644 index 000000000..ffa6b16aa --- /dev/null +++ b/libc/arch-x86/bionic/vfork.S @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +// This custom code preserves the return address across the system call. + +ENTRY(vfork) + popl %ecx // Grab the return address. + movl $__NR_vfork, %eax + int $0x80 + cmpl $-MAX_ERRNO, %eax + jb 1f + negl %eax + pushl %eax + call __set_errno +1: + jmp *%ecx // Jump to the stored return address. +END(vfork) diff --git a/libc/arch-x86/x86.mk b/libc/arch-x86/x86.mk index 8aa2645d3..019dc8e81 100644 --- a/libc/arch-x86/x86.mk +++ b/libc/arch-x86/x86.mk @@ -31,6 +31,7 @@ libc_bionic_src_files_x86 += \ arch-x86/bionic/__set_tls.c \ arch-x86/bionic/sigsetjmp.S \ arch-x86/bionic/syscall.S \ + arch-x86/bionic/vfork.S \ ## ARCH variant specific source files arch_variant_mk := $(LOCAL_PATH)/arch-x86/$(TARGET_ARCH_VARIANT)/$(TARGET_ARCH_VARIANT).mk diff --git a/libc/bionic/vfork.cpp b/libc/arch-x86_64/bionic/vfork.S similarity index 76% rename from libc/bionic/vfork.cpp rename to libc/arch-x86_64/bionic/vfork.S index b706a7f7d..7c14cc0d9 100644 --- a/libc/bionic/vfork.cpp +++ b/libc/arch-x86_64/bionic/vfork.S @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 The Android Open Source Project + * Copyright (C) 2013 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,10 +26,20 @@ * SUCH DAMAGE. */ -#include +#include -// vfork(2) was removed from POSIX 2008, but it's common enough that we can't -// actually remove it entirely. -extern "C" pid_t vfork(void) { - return fork(); -} +// This custom code preserves the return address across the system call. + +ENTRY(vfork) + popq %rdi // Grab the return address. + movl $__NR_vfork, %eax + syscall + pushq %rdi // Restore the return address. + cmpq $-MAX_ERRNO, %rax + jb 1f + negl %eax + movl %eax, %edi + call __set_errno +1: + ret +END(vfork) diff --git a/libc/arch-x86_64/x86_64.mk b/libc/arch-x86_64/x86_64.mk index 234cf6703..7887c519e 100644 --- a/libc/arch-x86_64/x86_64.mk +++ b/libc/arch-x86_64/x86_64.mk @@ -37,6 +37,7 @@ libc_bionic_src_files_x86_64 := \ arch-x86_64/bionic/__set_tls.c \ arch-x86_64/bionic/sigsetjmp.S \ arch-x86_64/bionic/syscall.S \ + arch-x86_64/bionic/vfork.S \ libc_bionic_src_files_x86_64 += \ arch-x86_64/string/sse2-memcpy-slm.S \ From 40079b003168b39dab91e106c7a877b677e64ef1 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 5 Aug 2014 14:46:03 -0700 Subject: [PATCH 091/148] Fixes build. This change somehow went missing from the vfork change. Change-Id: I807a2072080eac20601c694e85ba5723220289d8 (cherry picked from commit 9eae8405e8f70e489f2fe350a0212ab8114cbd17) --- libc/Android.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/libc/Android.mk b/libc/Android.mk index 46c96764a..2007965fa 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -226,7 +226,6 @@ libc_bionic_src_files := \ bionic/unlink.cpp \ bionic/utimes.cpp \ bionic/vdso.cpp \ - bionic/vfork.cpp \ bionic/wait.cpp \ bionic/wchar.cpp \ bionic/wctype.cpp \ From 0dc2c1db6fc84b4526f2a5f8d73e1187500f2300 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 6 Aug 2014 15:26:13 -0700 Subject: [PATCH 092/148] Upgrade bionic to tzdata2014f. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the release notes: Changes affecting future time stamps Russia will subtract an hour from most of its time zones on 2014-10-26 at 02:00 local time. (Thanks to Alexander Krivenyshev.) There are a few exceptions: Magadan Oblast (Asia/Magadan) and Zabaykalsky Krai are subtracting two hours; conversely, Chukotka Autonomous Okrug (Asia/Anadyr), Kamchatka Krai (Asia/Kamchatka), Kemerovo Oblast (Asia/Novokuznetsk), and the Samara Oblast and the Udmurt Republic (Europe/Samara) are not changing their clocks. The changed zones are Europe/Kaliningrad, Europe/Moscow, Europe/Simferopol, Europe/Volgograd, Asia/Yekaterinburg, Asia/Omsk, Asia/Novosibirsk, Asia/Krasnoyarsk, Asia/Irkutsk, Asia/Yakutsk, Asia/Vladivostok, Asia/Khandyga, Asia/Sakhalin, and Asia/Ust-Nera; Asia/Magadan will have two hours subtracted; and Asia/Novokuznetsk's time zone abbreviation is affected, but not its UTC offset. Two zones are added: Asia/Chita (split from Asia/Yakutsk, and also with two hours subtracted) and Asia/Srednekolymsk (split from Asia/Magadan, but with only one hour subtracted). (Thanks to Tim Parenti for much of the above.) Changes affecting past time stamps China's five zones have been simplified to two, since the post-1970 differences in the other three seem to have been imaginary. The zones Asia/Harbin, Asia/Chongqing, and Asia/Kashgar have been removed; backwards-compatibility links still work, albeit with different behaviors for time stamps before May 1980. Asia/Urumqi's 1980 transition to UTC+8 has been removed, so that it is now at UTC+6 and not UTC+8. (Thanks to Luther Ma and to Alois Treindl; Treindl sent helpful translations of two papers by Guo Qingsheng.) Some zones have been turned into links, when they differed from existing zones only for older UTC offsets where the data were likely invented. These changes affect UTC offsets in pre-1970 time stamps only. This is similar to the change in release 2013e, except this time for western Africa. The affected zones are: Africa/Bamako, Africa/Banjul, Africa/Conakry, Africa/Dakar, Africa/Freetown, Africa/Lome, Africa/Nouakchott, Africa/Ouagadougou, Africa/Sao_Tome, and Atlantic/St_Helena. This also affects the backwards-compatibility link Africa/Timbuktu. (Thanks to Alan Barrett, Stephen Colebourne, Tim Parenti, and David Patte for reporting problems in earlier versions of this change.) Asia/Shanghai's pre-standard-time UT offset has been changed from 8:05:57 to 8:05:43, the location of Xujiahui Observatory. Its transition to standard time has been changed from 1928 to 1901. Asia/Taipei switched to JWST on 1896-01-01, then to JST on 1937-10-01, then to CST on 1945-09-21 at 01:00, and did not observe DST in 1945. In 1946 it observed DST from 05-15 through 09-30; in 1947 from 04-15 through 10-31; and in 1979 from 07-01 through 09-30. (Thanks to Yu-Cheng Chuang.) Asia/Riyadh's transition to standard time is now 1947-03-14, not 1950. Europe/Helsinki's 1942 fall-back transition was 10-04 at 01:00, not 10-03 at 00:00. (Thanks to Konstantin Hyppönen.) Pacific/Pago_Pago has been changed from UTC-11:30 to UTC-11 for the period from 1911 to 1950. Pacific/Chatham has been changed to New Zealand standard time plus 45 minutes for the period before 1957, reflecting a 1956 remark in the New Zealand parliament. Europe/Budapest has several pre-1946 corrections: in 1918 the transition out of DST was on 09-16, not 09-29; in 1919 it was on 11-24, not 09-15; in 1945 it was on 11-01, not 11-03; in 1941 the transition to DST was 04-08 not 04-06 at 02:00; and there was no DST in 1920. Africa/Accra is now assumed to have observed DST from 1920 through 1935. Time in Russia before 1927 or so has been corrected by a few seconds in the following zones: Europe/Moscow, Asia/Irkutsk, Asia/Tbilisi, Asia/Tashkent, Asia/Vladivostok, Asia/Yekaterinburg, Europe/Helsinki, and Europe/Riga. Also, Moscow's location has been changed to its Kilometer 0 point. (Thanks to Vladimir Karpinsky for the Moscow changes.) Bug: 16168653 Change-Id: I23827254bcf50dd07a2192ed34b02224d73e07a0 --- libc/zoneinfo/tzdata | Bin 569217 -> 568999 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libc/zoneinfo/tzdata b/libc/zoneinfo/tzdata index a5ae1f6f5274233e274a22a8c64d3dccb826452b..9547f584c50ca416c607c0c764ed9c4c6d7a152a 100644 GIT binary patch delta 16568 zcmcJ0349dAwtn}dduF-1px9|9iu)yZWm-b+$Tn zs;WEOajxUm4?9LxFD`UeJ5!R9d(M>bi;|?8FC=^6u(eUsEq?viF72WFy@&c|sd4SI zhOXQzNtTZU`ohp{v+?u>Ar>RIfH|_UHcgc`vRb)^Zchfq!-8yYQ~eimqWm_CvZUJU zJdG^Z(oO5$Ou5ox+TR3Pjf=f#>1H1GqO_p<3`PzfA0g^Nd{`YA9fYs1PcWs78 ztsW2Du=dbLLlNm8xFpuoW@tI{@gy8M%Vuh0EI>lo2Aipm*$ngwE{Pqp8IfbBdm5W$ zXFIEkDr;D>U#vE^5p73_vX9-=a*yDto=}P1)bmR4^fE4q)!PlrxbEzzJw+d{pu%mn zT{HB28myCoXduB;c)TEBh33(|UZe42C$&Uf&0tWjVTH*7Oq){BQbbnKyi{aFIi^hd$+pv<+IAGNge%YJ*q#aHWnXZ=x?n+1dI@H3ZTzO z)&ahE44H*uS7NV*7}`gtVDfQ7KZTguXNWBINkV38Q~w6~Nat}$te~|K>5YLV71EuH ziptn=C07475mYY-(!;F{{o60`2rr=Ljn;z{~ zSwlb@mgcAXgcLg(YG{@WIAj3zY78}Xzgj#Uz=b>zW@t2~HkwszR+#BCtQ*2iOTZp> zI4ngELa5tAsR!S^1lcnxJVKBB3&KI8I@UMb(A(Yz*HJ>1SSer^wAi6LV12mnTsj$U z>fIj!ZJubfM;Ll<#JUCDK|3(Q(E5R~^bMi%2vf@(2iltmJrZH+e@jJtzz2Y5(6c`t zEpG}K5NT*P!$h%iu)&e0o`F;pM{AM9s?j(TT?2{A2ktMdQjj2C>KVqduP&gk4#anGc^aB_cK_T&X9!IKaY!j-#wjOov zgd5Y=R}+>4cys~eEG91OF2IxD0b(8i?gc!15LUSRego*uS}ZQc&_Db;42UCQKIt)g zTUH(uq<@B4s=M>|N|1bq!PeRn3ELNA_?Ubt#y1u_#TvSN4gQecC(`^_!(YCB8)UDRhJP>R8%DEEjo2|OGGj+Q^;^s5abxJ!!(_xhS81-D!&eQ_n56dJ% zuK;-?<0qh2mr?&YwVCZrEeI1+CEu`V?akouF+d`fxd)$333N|JpS*myy`i;5*xBJX ziCqVe&cW!lj!n7ekl80|NF1TmYl& z{RAupTy`&ptA~K~fGe?bx#u4@pTq!P>KLT2x)UUnYb1W_6ZW=I^yK|n?%(feW&=8z z+QUCLq4G|qz76XYR}*u&ZW&fz{odA75upBoF^D@BLkE{66}Eg&r@EWL}VHN1qUPYEsPV(JHx zuiQ@Hbqg^$8@fbjZ+w7>P)Zc%x|os2hc`K*Y2uG9npIrJc6W-^PPN9`bc!g4-DGN~ zKWpl@@y zBFuk>&@&(njfarqg7k~7hTi5XAm%YzW8zz+>Kwq16_64pTJMVYjSg45shf96QY*KY zziH9fKEZcxcdB+ZO>H_RmOsTIn+)V_TLUyV6I?^7 z?G>P!sh~_I^pk1owQJCJ8A##>7u!SG;BJxnJTw=bThQI-J!pQ5bI{@>k@&4 z|M>M;$g?vo!MYzyNAtTxavdc1V-~0vfh3mH9b2&*c%lfyD&F1D7OlhpVAf!ocQ>_% zUXY}Y{RtiEZtDB4;At~1X&;VP4w_dpIt2W zg@TRV8f3~IYGgxG3@vgVG+az*L5it;k6a@|4o(Lx(76<|bsM-+o=hEuc0-*rSV&O^ zUFm`>A&Z%REH5bO{$y zL@z_DEQ9GQ2#xM#hR^>uEFVIR!k!V8B{kJmOpc9On`ZS_7WVOO`qZ0KWzZ$}ubB0_~N zndPM=PBG>IlH!d97T?#1%3x-~hRr(3-wxs0(o+Bds>6Q?tOy*0zmV zo2K|H&+kMvsUxwU!RCc5crTEU+0XPr)B2f_`;oR4K`OM#c9uA+s$kZIfw9`bAJOL; z^*e-qFC!(1BNe+2^lBpNg~f^efsiC^G$YuI{-%C(6L=Dm*aQ6y{dff+(l6jq!1vmC zjFQ$3F!X=I3}ujL>V_)TXP~Knz67*>g0^&^p?`5Z9^EdfA83SoqfMBd>nxe=ME)Nc12-vOw#99~=xVV^YLOtBQ;* z*?2*_ZIEv`pB-dsdOjM+KP+gl8QP58I^~s@EMjuMIDge2^5ks6W8q-KXVkY3#$I%m zXXdeUgUzsJRF=ERcrk;Sv3A|gV{;b2$dcTS=e4QFU zcbJwz_p-1dDS8HSha{F$mNUe#-0~?~IwXaPU1;>KPV5^rX5U~@=_!`U3t3iriZ<5Jq({_WPB*mrG063QBh+cAsTUyt?b}4-grSB$_Y{09 zVxK3@#V&AN?=XM09IQzL5#&*sT5Wo8*YSpj{`$0or{Z06EmF5F(NM1 z&$}P>Gzj*rVYoH0`LrdaXXIgJila3}-S!z=(pxaDAAw9914!wRog86mOB)b&1%zxP zeRppIfV`XS@{wkQcY~PjEOQn*6SK=}%BtCgq*#C1=Ox6Mk%sR^Hz3pS**y-EN$idtf>twEjz{X<_T8q zF1BT-v_68}hD3Q+%BY@^I4nEQWOX?mwIeh`@5IF-M`5ubB0|_bj54&NlvzdNvQcK} zTUkIYIHb}Dg{p56S&Ihd924g+sc$#QWNk;A`r9N*kg=T6M(8_O!dv$0L+rxTcV7N& zLtkpp)njR%2KF`B9eb&XjK$>`WNlVXihdj$Ly5Kt5?h&LXvbf~({e&D=9v14K^}x; zkz<6NKxz|>O)lx4Ocu5GS5J~|)D7`v37 z;%3(^SNLHoAFTTYJep@{ zU*{muL^f&6GcAkXX5Gf6=vTrKos@)e#u#Vl*Xx^79@_|b@@{mYLB?kSK;<#;uN6=k zZ)m|?&^l1?1IfZSTU}!}c zE_)<(JPVq+)0ll?N~G7`jGD^wilW4<^0Goq_1*JgNnpjq6#bsIP@_($v11}$vv0?K zw}XJ^0XH25GzAQsgl{;_+6|jz>f4a%)g;llbdsSz-4&e51>7~sh%qSqL_R-Ys6_WYc%u%$jWIhgI;oL-47cY()IdhMY?0tQtCA2S`?*A^T#op?!cU zZr_5gtnCz2zlbGQpCTCLOfj@eBcKqaCbqm~cEtZb5K);$YvchNfY2VW-$;m(bX{45%}Z#5zy)4U+t+rq*U1 z8bxwlHP!Tur-rFUgx3;}FUJ=bm6Zt%Y#n!^<0FD={4_%|#{%9)GA2(mwbXZDhmFvh zX=Y^K_u!BPMCxHP$vLaCXu4S9y*9F+!6rQ$Y!LBS;tN`+Q&1pcb#*}sMNmUQivH#a zkj*EqtTwv~&J2Dkl3Bb{OyVi-qRyG(@1+}#r6EBZ3vDFQhBZ3Pz~(cWG-5^(OB)uw zZd5DUI~7b%(Q~1U^a(DBZJdrX8O0nWM)uBhGd%BWJgvqhjVLQDc9tckm(Os2Nwke4 z?rW%t^_^kpACGWLq zw$`@h_dTfWo<7_mwmpHE2FrEa$Y&B;I;+Kdx?Qt;k2*QId3|$88QoSo$)gO5oNekg zNZ|@iEv)9VeP0(Xn{7sTx#u`%6wfT4k(fTarpA4YS9ROHbeg5K#y+3zyK`wq7vSz8ctREg+*^#z8j?u6dkKAAY--0SqW(&#{Tx#}uHfl4 zLb-EH{Wz_pn{i?3o@3}IkSnE40`8lGHJE~rR!(*aJx{)cr)z{dmH483pi@Le`mj|c zrv5H1Is0%ST1v3mHjO{~0i>rpqMmeRT}w^6(j{Uvz3 zOt8seql!fu4a6}0vjp{rsgeDRu4hy6v`4^ha{<2ur)~lk%rzoE#40M3Z|0QaEX6Cd z4zptQkAl#)T96)|i?50s@JMe{*!8)1Kb(ap8Wg-ZEW>`=3k%B(?Hsm-63t1*%S`P& z(x!!yB|8H2G1Y%csIkn9_`L#o&e_FG#`j0tCo4f!Pn5IDP3>YlooM`GMdfSNn9%@t;_H>>89S60`|V!J9k zDw1{Xv~}}R0-I0c(%8|N?m2^(Ouondc}B4Jgr8SaSyHr!=t3aS+WhuO8kgR5obXez zDN-s^d_VA~RT`nqU!tXPxrvU-;>B3!ksgA<$Kw5*FfNz18rcbdU*PjC_H1Q~Pm#e@ zMr-eP6EGX@T;MFGlR0v`Zu5rjf-2MJ6W8`C)Au{+d2sQ5MFkfTb?m|jmU&rTBx#4$P^pZP5Om!?NZNV>v%{WOEmEVzGNVdDUygk5r_R)D$IDrIOSYB~+%8 z)TWYDr;^mCl1!kI%%GA?p_0s@l1!qK%%XB<%(6QL0og|tWFwVirzl}7m1M6dVKbFv zwLlxv7Dus`}nZJyD^vv7^8x%2) z-!5Ir8cu~jQ+fN2-p}mXv(Lur-wJys`e2crnxAR+<`;H$`G`Ne?bHr-{aDTW?R>a*d?g3b&q?~+QIk<+> zE>h+P95CvO)K|KIjEfy6b4<7b?`~^^aQuxVhb; z@rw)Ps1?_?SzOn)`85>Et@w+9iV>hmQbnz#EMB}=a`4N6%0M)9Z>0?C;MC`EoeZiXemm2|%no$7uJdqe5k zjUUTaHRbQEgP!BV|E-XLr-R)F!ZXezJmhXQjBor=nI28s2sl~_C9TKrxw99Q)X^3B zlhUj`dLN%-3+0yze)ZoxabA5hQ$(Q9o zKKQzlAUoDClRHrKqhix_rI+k*oxHAmlt9yi7k5?n%jvGJ@oKQ#JRHe80qVuH+wISGufw)$U5{uF5jGK(J5)K4W1cbpgglx_UN%`LcX z8K5@l*n(y%FPwxAm6+0`V(B2YUgvM$quO0zBcLrf{*Xi*Z?@Yt9fLHcfv2UYJ@|@| z>I^sC_ajxgiSwV*V(H5q>sUWUZOaSBssZv4*YRu=&Fo|N)lq5}Xx(nKx)`kwj#h(P zGWDg%SM*V%$MezmDQ-bslOm>U*HF4*}|G z4ZIK-^1I>B#E~(SPnfEE7SJkk7H#XkhJ3WE_txUaN zKFu9vY8>BHg$T(>Rl{6M%hlUu?;;Zz_GEPG#pfQ`c0RmopByf)RIhk*5-nnNG5ph; z)s)U6BE$lg?HHCP;f9HjJ2oSajQURt81Z*KF~GZkd6JnA^OXMyb0J6EbckJ_ZI7W8 z*dZQOaG4bH%D54=C-NrNo?Nx0_SBH4F29@6QF<@yz-8Wbo_dGv?3UWrc^_8r?y#xJaZ4Hcnf^{(_a1eKH!2o0lrjxxQPdc9QK0bZD0nuDN0stFPOXK*}kf-J$jh5l)jd zcRs`haU_?Q$#LW@%^y9;TOqvQPBq+u9t-YNXSDWYH<3cznbh_5ooa<2ZC@jI{rW;7 z_KIU;NL*flJN-=<$(_ox9)OW1$xsY?3zEC+W^a>pQV$gyku_0{TU zVqsUdP8>FgKmS*;9Rwe-9fa&9kMn(N)m-ngCZ;M8yK2{Xr^oMlOcLw8$nV78pWm`h z{T0SF?KHu9QJvUn@_E?)jyZTB}Xn}1Af(oQFuZ%(%b1Ule343X4kOY5gT=TB5B zxALA`-K^wg$!YxHL)g+{T>HMy%_^k_&v-zs3Tf^^fg^e~OhB6Xpi0^7y8A(OfM>`0 zC;f92ePTu?51EV|2Cdt!r#Gmv1KnHCm1op_imda7pOL#Zey--Zp8rstUPSb}InsIkuc~_`=Go^}yVi=dsft(?#*?n9!}(WVsXJU_FQ_p}f6Q?7gS)`P z^Gw0$pe0=}17l<|x??L#)!qB`PfbD-zvE}s5QivAyWk+{{M@JNfKVv11@-A z_kS{;Rz7Vl`q0W3>RR`eYN*2?6?S4hgv~9U-5Lm+eGP9?`ZYF&>Sd zs&>9V(3<6X>M{l;-0cJ0VIGcD#1rSLEx)SW`NP3hc)>OD2Q^4df)d_il~)P!1%6&P z!0pLN!~#wqVO z2-u3Dl3MXms`d2$J~Vl`6uGT6Yril!=tPd{u|Sp^4PM0{OMrpH?H^FTH7j~IrP7@lh>WHg}WxlS>Gs^AK)K6 zXp829>a6ylyLeswLnq?4G`w8*#t*Ml@Q~BiXzPOu&!4#WMc2|gYbWeb)>*%jALOf< zHKPrvDYH@!DybKh=*iZ>l5?1MasDR9uT5urBYWwLS9on1Z7XpBA{( z*Q{w4zasp3Ze5WziWeNRj*QwsT^_9}Z%ZXnQVD84Yn8RD>&rvdPyB4?AxV)%eB&Bx z8`rl-tc|)n%JuDg)`3{&v&;&faK@UAWxjr+tqrd`W8Ex|b|t-UUFccPiDKJX>nJq< z`LQqmuDvaWM|@yi&ibE;6*~ae%O6-r<#ox15LyE}ZkX2Y(8GhiU$n{i*VRow^()?d zSN_%dGo@c{ks>r#uVh;oiH$AbBT{Txk=WOF5^vd)S5QoJqHiYBV9vLv*!YN1ct*fW zH<3}}_cR=$lGsy8BB&%WqJ$_aNgS0Vl1d?VRjMt%$sUM)rk4$WVbmlV3P3azAY~TN zGZcvFZCl1HhukkxTn)W#N^G>U`K~oe{mNVJsz0(^dFu1;E*{=lSn%fbq8u9jaM$;_ zwrq=iBU#XShs@uuu=V4$<85~&6p|jBo?nT#grwgZQ4$}*#EVMe=Q8qbxk{j55wVdp z>Ab^r?_^th|8RQ8PZ#|hxaiq*y)@H?)aq{uu&m!`?dTU2+=~0nwk0NqNs^I7|9#a+ zlCdp}iIX~r8l1Xr$&tG>-TS7IjJ|1d7k=w(jQ)%dtRVrp4t(+>F<4mm+7eq^-nc-G z`V$4-m~D%*{GThZy~Nf{&UT$CvGw%?Pw-q@7G9uCnQMCj!E7zFRrn0={0dvPZ0E03 z*ti%%dI{rNHqTbkPwbX7@*l-j>{eyF&BO4*)3#_#0{JPmizP6Cci3rj42l-M!5zL7 z&r&oc-n?7~j&FImjUSx_SK*FBU2Z0M3_p4wNjE<4VKv!D)`cB5A07WdUe5oYJh$|w zyAFkzdhfkyC=f@#_~Ttme) z60DA2vHk4Fci)3ooCS{*;KSth8^j5`VH0>`D+1nlraRf^!yj}QH&?A}pFS4bkMQ`l z>UI0I6XSNZF_V(;>Iv5VOg6(!a2f76g5VyI#S`=Fkc(ha799tL-@Z>5i`J3+!X9e9G!-T0mj_Ees}!9F=AKD)eXM)?9WDLKwLv%07zdMEIQH`t^2mmBP_ zb!{f=`Fpas?s1t#`0uaf^UL|ZjrOXMy;71=&E(|Nl)i4o=zkkHwI)HmZE`a@=u zoYS3)N}Q!tC5v3f!}eR`Wz8M>{9%V|=PdlqW0^j7oM!g!lhW5r?v>gz)h#>M=Wn7* znsw+4oipOZpJR868x@yXQ(0UZH=;^#=#`q33=Vx$`?)z}I(gkDduy+!`u$!BzGag= zbXFFMA%#Ycva+J;>LMsoiiU1+j#6h;iPKfH O-CiZT5}&enJi%2UNO1@SE?3W%?iqadKXMDTUHf~Dn6Q)H@L znnkahnWdJu<4sFSD=Sk{E7S5(zHV8fdDE=q_g(w&ICSg&@BRJ$hmY*DX05$md#$zC z-hvmIrQn5gKu908wTK`5^jl$<-)2hXyIOV{7sN3#Ut`A*^44=dO2 z)HTZof?zo%^!vVY{Uu$KHv{)R;mi=R6__gOR_lCV>&!~Ak7i56*G)9d+y#v76u?X7 zB{5Qb*9^AADyulU@Jlnz5}|f$rd?$*l(zw`5rEoliBQG~Lbvw`xMGPAgUk?*ShZ9T z6p?eD?4etSEC6|(xyqxDH6aOK-!}Jn^a)Iq@%0nZGjUF7{%l9&u(|oOicQDd5HCSU zJOSh;ZbVN>*M=_QAgMZC(k)5;<|--1I_eYH{g_!R^-;$bf#4fb;)Z0X$&)!bAVUW9 zPeA`9+)UXB9Cs0uIOj&OV;zMh4pTHpY|1wv{gsP7AnRHSt@(?rs}oi2>^$1aJ!ekS>+Yj`jM_Z zP|-|r4inbC*$f7I>ss}%08{w-t{y~H@_3sjuJ$q1 z!$6AdNteAoMo`^VkS=V+rZ~5_%zR1?)sE)EhKr=9+0$3oj-jBaqigxH8u=rz=a>Lh9ze5Png=|0F=eKS) zYrQ&{2_BkzFdg*MRTY&%97tRm{0vPS2@!ialQ@4}^|Zo{zmXle{)XGCZuB=Set$L( z_{XS$17Nw|?NMt?j{rmKl#Dn~`TY0*UF(tor~Qe81ptjY&~D%c)C9Pv%u!5@n+w`> zPOAj!+MNh;%UVu5C{R}uz*x9UY8D3?>csw_?M_0U2{g2gw-6fhIq7lCOoSsWA8@aE z1?lQA3xrmY4MTzqEg4n7p2v}8Ko(%CS3V)12XYB&h;2M)^aYSDDcv^MaD$QnRiZYD zT}hus!G^Z{)8>`g8mz1L+z+HcTu%oZ0rvv(&H~gNtD_tX&C~^`$zs(-7&4Db9MxXe zHcZ6C&Ex|X_M8%8KH9#GyLH>!>*~|1C{<^)Py@;w~eSzk)wSWEBOcq}$hD9?u z|Ktw3_V+^|e-M)ecJ{AIfcbET0IhZ!;-;LF>;%a>SR;^7*k1y8@GgL7IT+Fr)uhGM zsQ`}-2K%La%~k+Bu?t`wC*B3{E9}*xYwl%$Ze`0JqHE{!VThgA&vby_{Y4P8eKePS z_^i^AHUzhicoXZdcIK@2gt&X*N{D-4hKHi@5aA->b8>%XsP1X841*f0`P4O`y)=sl z_61K53ZA{8hP&LEHE@aADZnkzdvr3iHb)Ro7kJ1_@1(1~Fj9Pu7GPZ`L-m7yEK^C= zK0qxIa|2L-6M9@EoYC1(1D}AOm(skMoeiImU_iIYbFQ>Er+d57)2)0T=&Y++vx6BsdJ(+($rriX){ix>iyK+Pxf%2e>R2 z*Z~|Y0C-;k)~pX-;TnMJHt@Wx4i{M6W_bD^T>`Y~Y>-g(X?zwM9-wV}(*0Q{b85Jk z`s|6uXJ&D@p}iac{avN**>GKZ^&ha#RTqx~+zB~K8?J>{S6$nK&Qt8p%}W6I22wyA z$y03aO6+Y9boJNv5A{p>}hB* za|EGH_l6;FB$$_5Av^bS&x^EH(EY8T-GCC-K=&x}!IfS{;Ltr#R-y1{a#wm@d4YK~ z0q*ih+K*NHhAhd{4Q=$x@cm!-GOf{dw;f_HkkgQ*jWK;4$d)wiVHj%OHPnNFlt$A4 zwcyqPD(elde0SRi=2cizW-_-#iPE*3 z-vVsI!9f6j`3XzCo`WS(dSDC4*$j2$=4CswsiX7sXn25nIBv`Fs9v6u2X+Ir_GFt^ zbT3Vk;B4C?!pYaoA<;&FCt6_$VQ%-(qc^Ne7q)A?xFgS;|`_YE#kMNR$$f}co zf{$X_Zd$RnF^1+`ffZB5KAmgL#WA|tel0XuO2`*u3^h~%awS2hV~oIN$mM{f;)3Er zoEb@TsT0;qoW|LViq+Mg-vBHiiGPYU)XtZ%v=-84TddKp8Rud%EWf}Ei?e$Pl0FHO zg2eAukh$h?W_AOLI6tlgS3%H@xp8~EH6yE8+v#QRQF4AbWIUa|6LRJN!@n7Fxj4mOY_NgIi)!Zd5p^4J%PDG z#$QY{G#zp1eV?mo7^M8Tw&=?wm zlVY@%UC2yN(kE2ok=mO;|0uI-B2BFUP;nz@+@>?!Vc3utdBP9Jha%! zdzZ<>a3tu7(tbZFzj_!N)yDvBu&AHcnzcZdpfeRW5%LEh=hHd#4UX(N+;fA^t z3Gd>wZn&Y{>yL?cPP%`%uC0K0@lEl}U(c8~F>@ta2jvE_HAWa(75Xk)s3qY*f|)f! zSJ(anv|kg_Y>hksBm>eV<>wKGo9>Y#Tgl8GsjD?5;IoUOl#MjpEcpQpeK#g2=?#rs%MHTHJcy_|dxB+`*gkMz`u6Yewsy z%_kut$y{FE(?{O24JP)Z<{~LAy>U>p=N4ls~hi=W8Is) zw#kNDyPTA4c(2)u%_)>R(4=zgq_K9?G%vSf`*5;VlXsuQ(x+3wJ)LZ{-4}@-lN7!qGd+08*Vw}0 zM}+3bjtO>8K|YKF511jTI*vEA!$h`>CsOKo-LK9i3HKFEv-(2WFuytyxr`goD5M`f zS3maV&#|Q6g4xHbIYjql_Eg>P2r3LFjat*pYyf9=1eYRsj@#2lA-$vMIT^h(HAXus z16{#yUh7kJ|D)JzgnN-nO<5g5K_vDgr%3&t@(r+z}wipZWn&fz@k9#F8@Fr`7y9wVBf=>gs3Ymn0k0 zpAokT+7X&8;O_7{-j+W{*=%~=pEEm-4ifZq1c*q})z3+{3d-u4X-2!xaqIzv-Lr8L zdBZLVGW=1S#$(|+h7+D<&vXpS&FQY8$~EjykI_!tz~Ll^TvnZ-2VR(tKzf6q;pL^p zB{`9aWqCP8coCq<-{EdWd52;(H^Z>p{hawwMvV5)QwZSI+~IW@y7p^6I#Zd0(j;B` zWIU$4%fWbnR_wo?l^iUXgd36Xfi;QYlao*uaKcb?Ir122lV1blYz``!x*AR`Z!Xae z%rvy##CH-$mSpM{1pechFL#^R9=- zCdX)w(dg$s<);ImDSAL|X9x+xM4{0Y$@vRrp{?lTVJ+@wmP~17{MIR4;PELjK@Xs~ zdsdMejq_3**`@i}=7cGs+9TMFwJ@&YsHr%zJp<6-;N4SoH&wSyHG;Mrf;v&8P7|Nv zBFF4v&S%?g$SCF$gQw~0?n01mrwAK6%}`sqxQb~;K+7)K$R^cMn$O?tSl@>P&*hxU zrD?kRT82z-wRox1b^lYyeTDk;CU;CME~FE68$_V>0#-|#&N=OxuB%tuL7y(9&$rWY z2hoDG-_=S?`dzyEBeq7o;dxUFCa9Y7Vip>5;oPwnCLnKx6F%yr1Ud0 zXBe6v;#ld*RagULOTg@%VFZMr)l)*M1$I*?sR}%<1zIa z&bMl&u126@D}N@T`(_$y-^u7D-X`U5%rvw+&?RY$IB7&yD?_ugaG|^&GrQ4DGt2O5 z5jt`xs(zpz|1iKT_=}g1YRVNx4ufY zu1=;}yop>jFdJ{~=$_yeSMLqvl%oK7XZQ?|Q{U#KR6mbr>t54vHsv#g(WPi4!{~S* zyS2^-ZafSMW^KnXn5?uBTkes^I7(~RXY;!~ zAqBg1FVAVeVBvT}l471s?&)dEjsf{Xer2|n1dAP-wyraC+^>-Qat*EJ!qyy> zt9v!ywhH5>HZHqnYq_e~mTUN|pn~<4Wlz?bagK$Kxy3|AJBZlwRwQ*I+9HY>t53_( zL`Y3bk55I@&`m9Tf@_4Usfs)t(;q^R_UGH#&OG<)o{K=XNHat7b#)D`a1}M5u`2Xy2PK<`j*w|lOk9ccjcB)=Z3pQ{HRg(<=lB&A7(k>w88 z3p?AfLBPF7%4W_p)K5GB-J;fJbt`D^JR|6nUx7PFTX++fvBe8Y9p;YgQ0>$Af!o9F z=vjc>x;Yl66&UJqBsk1~rt1m}?Q;_G^shg5PcZiv=-TIK%|tJ1pUj(>d142!^+anF z8rsRH03G1StU_J;0z0Gdnq|>zwdO+rzr^MuMsT4A0G=94>&uCM0eBkq9C=1JH&I2p zdKx!gxTvNJ`yxX-vjtEUpZaK#?hYOV?OAf>Gvt$oA|vqZmx5sFO7)=0Zk&xN7eY1L zIT4iSi88m?aM$4RVqHCV0mvG1=HX&PJ%1k;3Clc6P|pLQ>;S&B@g?pdGq1!@FJfzk zb|8JS#0a=}8W1gXv-~NPiaDLUZOxG;q!v>>;&%r&w-P#NzHY%rn>RnkyXA;Ias1fE z$oG_ftc4!@z;1qdXIHZ%&gynD_bfHscKIQt1~owir7`aB-#3@Kznni=YPj9x(OZ>GtZb zC5xr%kNoXk)fXNS_Ehhx{NDF|AJHNUkKXIg#;KAL;YB=%nns#I z;~&k6JP=_1eMyu#Y}sF!&k)gz+0zs?qWZ!UA#dtE9>4xtKgjZEXsAc6=fAluLE&<} zl2g)!p{CEF!NYw>2F;?8X43ed%m#)CMXa|6rgG*f%s>*=*J?OKnGwh)=7>c5~N~ zP%Oi%YyY;#W}dm`RnZBm&=Ju0;i{N|H?PK5?X9*()gFDL>aDWXQE%_O>a#E7&F%Xi z>00$pziUzNE}HD~UU0YV2c~@KbKusN?Zo?olc%B%h79vL_=fNHi)-%oxs+B}dFkMu zl5gU63g5hRrT%ij#mdX;!b`rpSy1`?{LLj-KCcn#C!Vao`ufqzYjJ69ODyn7s~_1z zYWZns_yK!RL&MLhqHE1my!7!ACGJ7AVECvb;PtfRw5BCsb+KYMR^@H+sz9j}=(rX@ zo|w9H^JN;zQX0ux8p&cB$!Z$OavI5c8p#7Rk{4(sPtZu-ppiU6BYB07@C=O~46N{} z;$Pq*8p%z3gsW&IchN{L<0ITgBe{-`a3782LO#NcG?FW6BzMwCE~Sy&N+Y?J#%oes z+Y*uebi>wZM3W!kP52SsR4Cg7co5!n3o;>cttTQ>(qPK9CofbEC$rEl2Xx24Feh7 z8U(P{p0qqGO6=}QmXHpD54tHKH530*@o!kVkdlK3@C-{eEI3}^E5&4cr?bX#hbUUv zwWlmyp~kvO!JnM}2h+g-v+%*7rR1=v45cI2<8s^d2m6jYyDGEY9Nl-|Y;c3oy+e+6LJ4+svmU?if z`qB}QCi!l^z4;-(!uNgHygWIox9DMU`w@iMmq8=UDk0isRU&Etbmx(pJboN&J70FK zQTt|gw5Y_Arg64G`Eu5O$u@O~7{~_4${nasI)AK^+Q)K#hf<=@x=Mdbr-N@YS2#fWg>pM2qD1gZ*_sDYIx5*#PZf!?LPId$=V@qY|-Hv|PiO?=>+p zx>=0Nn1}b!NaAQDku;K6;>$&ok^fiGS4w4_8{Bcf)FXm5WJ#*@bi20O+4y?t7dAgm zPJsT7I`+_2X(79_P*!~XNRLUc-NQ49NS)!=q?;mh%(3~gFJm&jtN(UCI)%WvBlr^g)XGN9j~A?)3obEgHT4&an5^ zhi>*OJRilqJqWID*)cqz-$-ijg_OzU-w~;eUUrL`v5DNzi|}5X3H&%CUTxW?$OnH^iaNjbXBnNS=&lXS&F~P_ZI_U0oyfVZFP{sq9p& z7{tai*$bqPhRea0KO&vPW}lb4Ke9(wpWo447Wq;=|9TI6qg7%JJ>{kJ%-eZiFZq|2 zhnbQ#c48t+oF{kWo1`-(LPmY0g?_#;7PCL^DBtNJOA1@oU(RG-WJxj3fqms$B73M) z3t|SlK3!?gYF5ksPBmVx(ZmGjmZ7r3<=p9^s2V#pLM~;S@}+Q~9vmhs+>mC}0%_d% zN$D&)Q|`cOtK=Z(eIsQHf@Z9o$PSHy>XBbraE`_62Zg)S1t`r3{Bs^8I_()QGkg&p7GvOnrFrO_L~C_(b$E9@s|8 z&(R!Ls=JaL^Chb7W7E=E=RCOw4+v+?WciwGIpJVuXJ9eTM9MMrZ8({(C_(qtf3$1g zp_Q!PO!?R5Wa@*+UU`7nH&qYnVmH@{*iTWBaeLuc;B*k?^E3?6oX;1ZVFP zL`stg8X?B%?~s3LN!tIroN!4?OB~Bix0OOzWEsNb+u8DZiz}CD^QT-^+}+Qfn)up->44+4{q}~9Y+9b2U_N!k&oci!Taz!_S!%r) z?%Pa5KIC*a^5loa^G=Y|iRe4L!g_)Q>Mk6t#k(km*jGZgz z%d+SR&h#PfX4o^mVD0=%WWr!tlmKZ<`+F58u8^j%)eGdF;!QTbMv7o(7Rd7u;I~uc zzp?!}=#~P?x1)laG#>nav!Nfqr-F)X!O9_HFqo~mxDu&vQyk~Rft?>H}q z@LkM10s2yQc6h4YOZ9AUfpix;^053Q2@hruJ|g$T{P;Sy<1u+z%iibPJc}ZM&-^%F z>g0TY$tSqpznQv%Iqqt#@NC@Uvg(|@LG~X+r;wm8hHjjU-v8ES=s+K74B}>F3X48y z3#BsLzI*Q{n_or2IED!-toKG5jRJ`;~h?mG_`PITKFG2Q6foxtY4+m5&Mn z>wHS?FDlN=Q*y8zgXwsP-ymrG&dV@jmOdiQ!bd~X*L%Pnu~BG79RAjR?DW^NB1?~t z`|IQE>Q8XvvhQVu`J9tusl9D!!G|;ZDY*+TsA^NMsIax?`w1n^0D9d0zYIv z(kMi6M*J#g{&(K!=S^?jp%MQ2>R+NMn8kQl<9^ruTrjR`U3)a!;bHyk{~c1>Bx{VQ zI=_;v!!3T0X>KOTv~m;`$)lL~jpT|}R%FBadpj4|tRa#g41QBwf>h;GZ<@8<8RF&XP_^@?~+PE_`Ri8SZaWE4>_Z` zA>m8?o0VobKlfr3=D$%t!+9dmn)z?lzq|c^tA0OLd(@^n57yagEvzEh=Iwkh%=$}# zxPk3{)YhJTxz?%#KD^tfX2TKtQ`t+Zo-XNWe`e}CKJQ;0#17B526)!p5=%aQZ1I^R z56*DmbQ_ z>k;e92sQY_Lld$N?p;~uT(!@dVDZR9nT*V~2D7i~EUX0`{c z-JJ#RTEF(NVTvFG<*|WltsR^tA6OeSF~wQ(iFJ_3wts3(Ve60Ef?42a)~CdA&Rw5b z7h72T3F|m4l3zTFe#O?AZ8>4BWNKFwd}>*oX(z4Y(z_*tDV6Uo8)tSpzG?8aN1xEI z1V3?Oz^W%#Ob)I&UWixLfjyn?M%w&Eb}Gu2jD!g9Nt#6GQI?0(`yFA(VwM zox-O(=|AbU+Wj;VV;YG$jU<4N5JDpfqLGBr$OVSQ*m_#ngg9FYT9j~pkcC(Xgji$= z#Ns=|?vArnuvhMAJVejzYm-9TD^IRir_`((v8v|7dzF_iUcGc+TXxn5vvN{d-F&OR zvudJkoJGMtg+I^VEV7r1Z39^64BPTvc_jUbzpvt25D$Wh4Dz zUE+k;1(eqjsiJ?=@Aw3=ElbWdM;sGn$@OEkHU227qFNP=`Q}@@;!;q5*_H?| zEPL73UKH5!a&&l|3#FjnvOD{t&GNru7w9o*d@@^3K3(?!ls)^ht>8}9c9$*0O!zc3 zwxMAr)NN>(F^cYsb5aGhpwvz3u)UHP{a5VRpewduXT}xV0af<7xcY6$=~ZvT9Y&|0ZTED2@fT<&yfvMY z@YQ4ie~nJRd1o~$5!bD_NK0e2Kil|yr?(^nO^mVz6 zO-RGldB&@u!hwfJSJNgGoCUbI1ON;wFz*y6`)D zXSa0avo37aV#UYlu}B$fZENptPjeJF>`Uw;iwkp>vT=V_23F)a7L?hO^74xu_TKiP zIr($*i*h6Ec!ge+n~lE^iLf{RnR9-GJ*RATA1!H|YQ*)8>uW^E^oxsD`CkIle+I}e zQb*-AI;vl6Uz%Luz~7Q! z(tLZIX?C=`jXPbn`dqLHh$7^*-iM-hD)S)RW%uejV@x!AaPBPzbX zi@zf>qqMwme!f~*3_FYG*wgc8<&?n_lko-$!op1hG8Pm~fM8!e~YxkHE!Ac)fruy`TdkgXZ2qNqm*@fk$Wvt(0%D_i9 zDDSlCZ68;>uy|hi(xRNQ1@qYD4ax%N%NvzMQSEK#f1>XwVwsziUTo7QCEEGzCgpiA w=fy2bk;tmIC|&F+Ib{Woc@F%7E`>Q*sKg?0D$B8tUQmGlZ{SSbs$^RJ2m4We0{{R3 From 90cb5ffb85a9bc2e725824b3ca8db932d02c45db Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 6 Aug 2014 15:23:11 -0700 Subject: [PATCH 093/148] Fix the tzdata update tools. The recent libcore ZoneInfo changes mean that we can no longer compile libcore's ZoneInfo against the RI. Luckily, the field in our data file that we needed ZoneInfo for isn't actually used. This change removes our dependence on libcore. I've left the field in to avoid a file format change. We can remove the field if/when we next have a real need to bump the file format. Bug: 16168653 Change-Id: Iedad2252c2b49f4d8bb2c7d9078b39b622444ca7 --- libc/tools/zoneinfo/ZoneCompactor.java | 87 +++++--------------------- libc/tools/zoneinfo/update-tzdata.py | 7 +-- libc/tzcode/localtime.c | 2 +- 3 files changed, 19 insertions(+), 77 deletions(-) diff --git a/libc/tools/zoneinfo/ZoneCompactor.java b/libc/tools/zoneinfo/ZoneCompactor.java index f47afd13e..bf3153eff 100644 --- a/libc/tools/zoneinfo/ZoneCompactor.java +++ b/libc/tools/zoneinfo/ZoneCompactor.java @@ -1,9 +1,6 @@ import java.io.*; -import java.nio.ByteOrder; import java.util.*; -import libcore.io.BufferIterator; -import libcore.util.ZoneInfo; // usage: java ZoneCompiler // @@ -27,66 +24,20 @@ import libcore.util.ZoneInfo; // public class ZoneCompactor { - public static class ByteArrayBufferIteratorBE extends BufferIterator { - private final byte[] bytes; - private int offset = 0; - - public ByteArrayBufferIteratorBE(byte[] bytes) { - this.bytes = bytes; - this.offset = 0; - } - - public void seek(int offset) { - this.offset = offset; - } - - public void skip(int byteCount) { - this.offset += byteCount; - } - - public void readByteArray(byte[] dst, int dstOffset, int byteCount) { - System.arraycopy(bytes, offset, dst, dstOffset, byteCount); - offset += byteCount; - } - - public byte readByte() { - return bytes[offset++]; - } - - public int readInt() { - return ((readByte() & 0xff) << 24) | ((readByte() & 0xff) << 16) | ((readByte() & 0xff) << 8) | (readByte() & 0xff); - } - - public void readIntArray(int[] dst, int dstOffset, int intCount) { - for (int i = 0; i < intCount; ++i) { - dst[dstOffset++] = readInt(); - } - } - - public short readShort() { - throw new UnsupportedOperationException(); - } - } - - // Maximum number of characters in a zone name, including '\0' terminator + // Maximum number of characters in a zone name, including '\0' terminator. private static final int MAXNAME = 40; - // Zone name synonyms + // Zone name synonyms. private Map links = new HashMap(); - // File starting bytes by zone name - private Map starts = new HashMap(); + // File offsets by zone name. + private Map offsets = new HashMap(); - // File lengths by zone name + // File lengths by zone name. private Map lengths = new HashMap(); - // Raw GMT offsets by zone name - private Map offsets = new HashMap(); - private int start = 0; - - // Concatenate the contents of 'inFile' onto 'out' - // and return the contents as a byte array. - private static byte[] copyFile(File inFile, OutputStream out) throws Exception { + // Concatenate the contents of 'inFile' onto 'out'. + private static void copyFile(File inFile, OutputStream out) throws Exception { byte[] ret = new byte[0]; InputStream in = new FileInputStream(inFile); @@ -104,14 +55,14 @@ public class ZoneCompactor { ret = nret; } out.flush(); - return ret; } public ZoneCompactor(String setupFile, String dataDirectory, String zoneTabFile, String outputDirectory, String version) throws Exception { - // Read the setup file, and concatenate all the data. + // Read the setup file and concatenate all the data. ByteArrayOutputStream allData = new ByteArrayOutputStream(); BufferedReader reader = new BufferedReader(new FileReader(setupFile)); String s; + int offset = 0; while ((s = reader.readLine()) != null) { s = s.trim(); if (s.startsWith("Link")) { @@ -125,16 +76,11 @@ public class ZoneCompactor { if (link == null) { File sourceFile = new File(dataDirectory, s); long length = sourceFile.length(); - starts.put(s, start); + offsets.put(s, offset); lengths.put(s, (int) length); - start += length; - byte[] data = copyFile(sourceFile, allData); - - BufferIterator it = new ByteArrayBufferIteratorBE(data); - TimeZone tz = ZoneInfo.makeTimeZone(s, it); - int gmtOffset = tz.getRawOffset(); - offsets.put(s, gmtOffset); + offset += length; + copyFile(sourceFile, allData); } } } @@ -146,9 +92,8 @@ public class ZoneCompactor { String from = it.next(); String to = links.get(from); - starts.put(from, starts.get(to)); - lengths.put(from, lengths.get(to)); offsets.put(from, offsets.get(to)); + lengths.put(from, lengths.get(to)); } // Create/truncate the destination file. @@ -178,7 +123,7 @@ public class ZoneCompactor { // Write the index. ArrayList sortedOlsonIds = new ArrayList(); - sortedOlsonIds.addAll(starts.keySet()); + sortedOlsonIds.addAll(offsets.keySet()); Collections.sort(sortedOlsonIds); it = sortedOlsonIds.iterator(); while (it.hasNext()) { @@ -188,9 +133,9 @@ public class ZoneCompactor { } f.write(toAscii(new byte[MAXNAME], zoneName)); - f.writeInt(starts.get(zoneName)); - f.writeInt(lengths.get(zoneName)); f.writeInt(offsets.get(zoneName)); + f.writeInt(lengths.get(zoneName)); + f.writeInt(0); // Used to be raw GMT offset. No longer used. } int data_offset = (int) f.getFilePointer(); diff --git a/libc/tools/zoneinfo/update-tzdata.py b/libc/tools/zoneinfo/update-tzdata.py index 6b69a5a95..e800e8f8b 100755 --- a/libc/tools/zoneinfo/update-tzdata.py +++ b/libc/tools/zoneinfo/update-tzdata.py @@ -115,7 +115,7 @@ def BuildIcuToolsAndData(data_filename): print 'Configuring ICU tools...' subprocess.check_call(['%s/runConfigureICU' % icu_dir, 'Linux']) print 'Making ICU tools...' - subprocess.check_call(['make', '-j6']) + subprocess.check_call(['make', '-j32']) # Run the ICU tools. os.chdir('tools/tzcode') @@ -169,11 +169,8 @@ def BuildBionicToolsAndData(data_filename): WriteSetupFile() print 'Calling ZoneCompactor to update bionic to %s...' % new_version - libcore_src_dir = '%s/../libcore/luni/src/main/java/' % bionic_dir subprocess.check_call(['javac', '-d', '.', - '%s/ZoneCompactor.java' % bionic_libc_tools_zoneinfo_dir, - '%s/libcore/util/ZoneInfo.java' % libcore_src_dir, - '%s/libcore/io/BufferIterator.java' % libcore_src_dir]) + '%s/ZoneCompactor.java' % bionic_libc_tools_zoneinfo_dir]) subprocess.check_call(['java', 'ZoneCompactor', 'setup', 'data', 'extracted/zone.tab', bionic_libc_zoneinfo_dir, new_version]) diff --git a/libc/tzcode/localtime.c b/libc/tzcode/localtime.c index 5e4e962f0..3bbed9086 100644 --- a/libc/tzcode/localtime.c +++ b/libc/tzcode/localtime.c @@ -2210,7 +2210,7 @@ static int __bionic_open_tzdata_path(const char* path_prefix_variable, const cha char buf[NAME_LENGTH]; int32_t start; int32_t length; - int32_t raw_gmt_offset; + int32_t unused; // Was raw GMT offset; always 0 since tzdata2014f (L). }; size_t id_count = (ntohl(header.data_offset) - ntohl(header.index_offset)) / sizeof(struct index_entry_t); From 18d93f2793fad393b6aa6eae6afe1054958339d5 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 6 Aug 2014 14:15:01 -0700 Subject: [PATCH 094/148] Do a second key cleanup in pthread_exit. During pthread_exit, the keys are cleaned. Unfortunately, a call to free occurs after the cleanup and the memory for some of the keys is recreated when using jemalloc. The solution is to do the key cleanup twice. Also, modify the pthread_detach__leak test to be less flaky when run on a jemalloc system. Bug: 16513133 Change-Id: Ic17e8344bdc1ba053c4f5b6d827a4c19c57860c1 --- libc/bionic/pthread_exit.cpp | 6 ++++++ tests/pthread_test.cpp | 37 ++++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/libc/bionic/pthread_exit.cpp b/libc/bionic/pthread_exit.cpp index a6bb36312..6cd5311ed 100644 --- a/libc/bionic/pthread_exit.cpp +++ b/libc/bionic/pthread_exit.cpp @@ -112,6 +112,12 @@ void pthread_exit(void* return_value) { } pthread_mutex_unlock(&g_thread_list_lock); + // Perform a second key cleanup. When using jemalloc, a call to free from + // _pthread_internal_remove_locked causes the memory associated with a key + // to be reallocated. + // TODO: When b/16847284 is fixed this call can be removed. + pthread_key_clean_all(); + if (user_allocated_stack) { // Cleaning up this thread's stack is the creator's responsibility, not ours. __exit(0); diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp index 4da003f3a..5328e48cf 100644 --- a/tests/pthread_test.cpp +++ b/tests/pthread_test.cpp @@ -400,27 +400,36 @@ TEST(pthread, pthread_detach__no_such_thread) { } TEST(pthread, pthread_detach__leak) { - size_t initial_bytes = mallinfo().uordblks; + size_t initial_bytes = 0; + // Run this loop more than once since the first loop causes some memory + // to be allocated permenantly. Run an extra loop to help catch any subtle + // memory leaks. + for (size_t loop = 0; loop < 3; loop++) { + // Set the initial bytes on the second loop since the memory in use + // should have stabilized. + if (loop == 1) { + initial_bytes = mallinfo().uordblks; + } - pthread_attr_t attr; - ASSERT_EQ(0, pthread_attr_init(&attr)); - ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE)); + pthread_attr_t attr; + ASSERT_EQ(0, pthread_attr_init(&attr)); + ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE)); - std::vector threads; - for (size_t i = 0; i < 32; ++i) { - pthread_t t; - ASSERT_EQ(0, pthread_create(&t, &attr, IdFn, NULL)); - threads.push_back(t); - } + std::vector threads; + for (size_t i = 0; i < 32; ++i) { + pthread_t t; + ASSERT_EQ(0, pthread_create(&t, &attr, IdFn, NULL)); + threads.push_back(t); + } - sleep(1); + sleep(1); - for (size_t i = 0; i < 32; ++i) { - ASSERT_EQ(0, pthread_detach(threads[i])) << i; + for (size_t i = 0; i < 32; ++i) { + ASSERT_EQ(0, pthread_detach(threads[i])) << i; + } } size_t final_bytes = mallinfo().uordblks; - int leaked_bytes = (final_bytes - initial_bytes); // User code (like this test) doesn't know how large pthread_internal_t is. From 43227c0b400a33dc9722269beda26313c391fb1e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 7 Aug 2014 10:51:32 -0700 Subject: [PATCH 095/148] Android is all-PIC/PIE. Clean up the x86/x86_64 assembler. The motivator (other than reducing confusion) was that asm.h incorrectly checked PIC rather than __PIC__. Bug: 16823325 (cherry picked from commit 6b6364a7fc7c3ba37ee907776a29bdc8c9793db9) Change-Id: I89ca57fa0eb34a36de6cb11ea85f71054fce709d --- libc/arch-x86/bionic/__stack_chk_fail_local.h | 7 ++----- libc/arch-x86/bionic/setjmp.S | 8 -------- libc/arch-x86/bionic/sigsetjmp.S | 8 -------- libc/arch-x86/include/machine/asm.h | 8 -------- libc/arch-x86_64/bionic/setjmp.S | 8 -------- libc/arch-x86_64/bionic/sigsetjmp.S | 8 -------- libc/arch-x86_64/include/machine/asm.h | 5 ----- 7 files changed, 2 insertions(+), 50 deletions(-) diff --git a/libc/arch-x86/bionic/__stack_chk_fail_local.h b/libc/arch-x86/bionic/__stack_chk_fail_local.h index 4f3699a35..0b0fd7f8b 100644 --- a/libc/arch-x86/bionic/__stack_chk_fail_local.h +++ b/libc/arch-x86/bionic/__stack_chk_fail_local.h @@ -26,6 +26,7 @@ * SUCH DAMAGE. */ +#include /* __stack_chk_fail routine is runtime part of stack protector compiler @@ -48,13 +49,9 @@ */ #ifdef __i386__ -#ifdef __PIC__ extern void __stack_chk_fail(); -__attribute__ ((visibility ("hidden"))) -void __stack_chk_fail_local() -{ +__LIBC_HIDDEN__ void __stack_chk_fail_local() { __stack_chk_fail(); } #endif -#endif diff --git a/libc/arch-x86/bionic/setjmp.S b/libc/arch-x86/bionic/setjmp.S index 5b943118c..8f9d67c23 100644 --- a/libc/arch-x86/bionic/setjmp.S +++ b/libc/arch-x86/bionic/setjmp.S @@ -46,11 +46,7 @@ ENTRY(setjmp) PIC_PROLOGUE pushl $0 -#ifdef PIC call PIC_PLT(sigblock) -#else - call sigblock -#endif addl $4,%esp PIC_EPILOGUE @@ -71,11 +67,7 @@ ENTRY(longjmp) movl 4(%esp),%edx PIC_PROLOGUE pushl 24(%edx) -#ifdef PIC call PIC_PLT(sigsetmask) -#else - call sigsetmask -#endif addl $4,%esp PIC_EPILOGUE diff --git a/libc/arch-x86/bionic/sigsetjmp.S b/libc/arch-x86/bionic/sigsetjmp.S index 7ef732ef2..250c606d7 100644 --- a/libc/arch-x86/bionic/sigsetjmp.S +++ b/libc/arch-x86/bionic/sigsetjmp.S @@ -42,11 +42,7 @@ ENTRY(sigsetjmp) PIC_PROLOGUE pushl $0 -#ifdef PIC call PIC_PLT(sigblock) -#else - call sigblock -#endif addl $4,%esp PIC_EPILOGUE @@ -70,11 +66,7 @@ ENTRY(siglongjmp) PIC_PROLOGUE pushl 24(%edx) -#ifdef PIC call PIC_PLT(sigsetmask) -#else - call sigsetmask -#endif addl $4,%esp PIC_EPILOGUE diff --git a/libc/arch-x86/include/machine/asm.h b/libc/arch-x86/include/machine/asm.h index 913e6c840..bf77525ee 100644 --- a/libc/arch-x86/include/machine/asm.h +++ b/libc/arch-x86/include/machine/asm.h @@ -37,7 +37,6 @@ #ifndef _I386_ASM_H_ #define _I386_ASM_H_ -#ifdef PIC #define PIC_PROLOGUE \ pushl %ebx; \ call 1f; \ @@ -49,13 +48,6 @@ #define PIC_PLT(x) x@PLT #define PIC_GOT(x) x@GOT(%ebx) #define PIC_GOTOFF(x) x@GOTOFF(%ebx) -#else -#define PIC_PROLOGUE -#define PIC_EPILOGUE -#define PIC_PLT(x) x -#define PIC_GOT(x) x -#define PIC_GOTOFF(x) x -#endif /* let kernels and others override entrypoint alignment */ #if !defined(_ALIGN_TEXT) && !defined(_KERNEL) diff --git a/libc/arch-x86_64/bionic/setjmp.S b/libc/arch-x86_64/bionic/setjmp.S index c81b5734c..f356877dd 100644 --- a/libc/arch-x86_64/bionic/setjmp.S +++ b/libc/arch-x86_64/bionic/setjmp.S @@ -52,11 +52,7 @@ ENTRY(setjmp) pushq %rdi xorq %rdi,%rdi -#ifdef __PIC__ call PIC_PLT(sigblock) -#else - call sigblock -#endif popq %rdi movq %rax,(_JB_SIGMASK * 8)(%rdi) @@ -80,11 +76,7 @@ ENTRY(longjmp) movq (_JB_SIGMASK * 8)(%rdi),%rdi pushq %r8 -#ifdef __PIC__ call PIC_PLT(sigsetmask) -#else - call sigsetmask -#endif popq %r8 movq (_JB_RBX * 8)(%r12),%rbx movq (_JB_RBP * 8)(%r12),%rbp diff --git a/libc/arch-x86_64/bionic/sigsetjmp.S b/libc/arch-x86_64/bionic/sigsetjmp.S index 718743f94..571fea3f8 100644 --- a/libc/arch-x86_64/bionic/sigsetjmp.S +++ b/libc/arch-x86_64/bionic/sigsetjmp.S @@ -57,11 +57,7 @@ ENTRY(sigsetjmp) pushq %rdi xorq %rdi,%rdi -#ifdef __PIC__ call PIC_PLT(sigblock) -#else - call sigblock -#endif popq %rdi movq %rax,(_JB_SIGMASK * 8)(%rdi) @@ -86,11 +82,7 @@ ENTRY(siglongjmp) jz 2f movq (_JB_SIGMASK * 8)(%rdi),%rdi -#ifdef __PIC__ call PIC_PLT(sigsetmask) -#else - call sigsetmask -#endif 2: popq %rax movq (_JB_RBX * 8)(%r12),%rbx movq (_JB_RBP * 8)(%r12),%rbp diff --git a/libc/arch-x86_64/include/machine/asm.h b/libc/arch-x86_64/include/machine/asm.h index 0af6dae46..06da39aae 100644 --- a/libc/arch-x86_64/include/machine/asm.h +++ b/libc/arch-x86_64/include/machine/asm.h @@ -37,13 +37,8 @@ #ifndef _AMD64_ASM_H_ #define _AMD64_ASM_H_ -#ifdef __PIC__ #define PIC_PLT(x) x@PLT #define PIC_GOT(x) x@GOTPCREL(%rip) -#else -#define PIC_PLT(x) x -#define PIC_GOT(x) x -#endif /* let kernels and others override entrypoint alignment */ #ifndef _ALIGN_TEXT From 49de01a5be7bfb07baaea7415647d838383e1b59 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 7 Aug 2014 16:21:21 -0700 Subject: [PATCH 096/148] Add a way to disable backtracing in malloc debug. The property libc.debug.malloc.nobacktrace set to non-zero disables getting backtracing when using mode 1 or mode 10. Bug: 16874447 Change-Id: I7650ba9f4385b5110b743cab01e877fc69545b3c --- libc/bionic/malloc_debug_backtrace.h | 37 +++++++++++ libc/bionic/malloc_debug_check.cpp | 93 ++++++++++++++++++---------- libc/bionic/malloc_debug_leak.cpp | 3 +- 3 files changed, 98 insertions(+), 35 deletions(-) create mode 100644 libc/bionic/malloc_debug_backtrace.h diff --git a/libc/bionic/malloc_debug_backtrace.h b/libc/bionic/malloc_debug_backtrace.h new file mode 100644 index 000000000..774548b59 --- /dev/null +++ b/libc/bionic/malloc_debug_backtrace.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef MALLOC_DEBUG_BACKTRACE_H +#define MALLOC_DEBUG_BACKTRACE_H + +extern bool g_backtrace_enabled; + +#define GET_BACKTRACE(bt, depth) \ + (g_backtrace_enabled ? get_backtrace(bt, depth) : 0) + +#endif // MALLOC_DEBUG_BACKTRACE_H diff --git a/libc/bionic/malloc_debug_check.cpp b/libc/bionic/malloc_debug_check.cpp index 94ba6f5ec..dee03fae1 100644 --- a/libc/bionic/malloc_debug_check.cpp +++ b/libc/bionic/malloc_debug_check.cpp @@ -48,6 +48,7 @@ #include "debug_mapinfo.h" #include "debug_stacktrace.h" +#include "malloc_debug_backtrace.h" #include "malloc_debug_common.h" #include "malloc_debug_disable.h" #include "private/bionic_macros.h" @@ -123,6 +124,10 @@ static pthread_mutex_t backlog_lock = PTHREAD_MUTEX_INITIALIZER; // It determines the size of the backlog we use to detect multiple frees. static unsigned g_malloc_debug_backlog = 100; +// This variable is set to false if the property libc.debug.malloc.nobacktrace +// is set to non-zero. +__LIBC_HIDDEN__ bool g_backtrace_enabled = true; + __LIBC_HIDDEN__ HashTable* g_hash_table; __LIBC_HIDDEN__ const MallocDebug* g_malloc_dispatch; @@ -273,7 +278,7 @@ static inline int check_allocation_locked(hdr_t* hdr, int* safe) { valid = check_guards(hdr, safe); } - if (!valid && *safe) { + if (!valid && *safe && g_backtrace_enabled) { log_message("+++ ALLOCATION %p SIZE %d ALLOCATED HERE:\n", user(hdr), hdr->size); log_backtrace(hdr->bt, hdr->bt_depth); @@ -344,7 +349,7 @@ extern "C" void* chk_malloc(size_t bytes) { hdr_t* hdr = static_cast(g_malloc_dispatch->malloc(size)); if (hdr) { hdr->base = hdr; - hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH); + hdr->bt_depth = GET_BACKTRACE(hdr->bt, MAX_BACKTRACE_DEPTH); add(hdr, bytes); return user(hdr); } @@ -385,7 +390,7 @@ extern "C" void* chk_memalign(size_t alignment, size_t bytes) { hdr_t* hdr = meta(reinterpret_cast(ptr)); hdr->base = base; - hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH); + hdr->bt_depth = GET_BACKTRACE(hdr->bt, MAX_BACKTRACE_DEPTH); add(hdr, bytes); return user(hdr); } @@ -405,27 +410,31 @@ extern "C" void chk_free(void* ptr) { if (del(hdr) < 0) { uintptr_t bt[MAX_BACKTRACE_DEPTH]; - int depth = get_backtrace(bt, MAX_BACKTRACE_DEPTH); + int depth = GET_BACKTRACE(bt, MAX_BACKTRACE_DEPTH); if (hdr->tag == BACKLOG_TAG) { log_message("+++ ALLOCATION %p SIZE %d BYTES MULTIPLY FREED!\n", user(hdr), hdr->size); - log_message("+++ ALLOCATION %p SIZE %d ALLOCATED HERE:\n", - user(hdr), hdr->size); - log_backtrace(hdr->bt, hdr->bt_depth); - /* hdr->freed_bt_depth should be nonzero here */ - log_message("+++ ALLOCATION %p SIZE %d FIRST FREED HERE:\n", - user(hdr), hdr->size); - log_backtrace(hdr->freed_bt, hdr->freed_bt_depth); - log_message("+++ ALLOCATION %p SIZE %d NOW BEING FREED HERE:\n", - user(hdr), hdr->size); - log_backtrace(bt, depth); + if (g_backtrace_enabled) { + log_message("+++ ALLOCATION %p SIZE %d ALLOCATED HERE:\n", + user(hdr), hdr->size); + log_backtrace(hdr->bt, hdr->bt_depth); + /* hdr->freed_bt_depth should be nonzero here */ + log_message("+++ ALLOCATION %p SIZE %d FIRST FREED HERE:\n", + user(hdr), hdr->size); + log_backtrace(hdr->freed_bt, hdr->freed_bt_depth); + log_message("+++ ALLOCATION %p SIZE %d NOW BEING FREED HERE:\n", + user(hdr), hdr->size); + log_backtrace(bt, depth); + } } else { log_message("+++ ALLOCATION %p IS CORRUPTED OR NOT ALLOCATED VIA TRACKER!\n", user(hdr)); - log_backtrace(bt, depth); + if (g_backtrace_enabled) { + log_backtrace(bt, depth); + } } } else { - hdr->freed_bt_depth = get_backtrace(hdr->freed_bt, MAX_BACKTRACE_DEPTH); + hdr->freed_bt_depth = GET_BACKTRACE(hdr->freed_bt, MAX_BACKTRACE_DEPTH); add_to_backlog(hdr); } } @@ -451,22 +460,24 @@ extern "C" void* chk_realloc(void* ptr, size_t bytes) { if (del(hdr) < 0) { uintptr_t bt[MAX_BACKTRACE_DEPTH]; - int depth = get_backtrace(bt, MAX_BACKTRACE_DEPTH); + int depth = GET_BACKTRACE(bt, MAX_BACKTRACE_DEPTH); if (hdr->tag == BACKLOG_TAG) { log_message("+++ REALLOCATION %p SIZE %d OF FREED MEMORY!\n", user(hdr), bytes, hdr->size); - log_message("+++ ALLOCATION %p SIZE %d ALLOCATED HERE:\n", - user(hdr), hdr->size); - log_backtrace(hdr->bt, hdr->bt_depth); - /* hdr->freed_bt_depth should be nonzero here */ - log_message("+++ ALLOCATION %p SIZE %d FIRST FREED HERE:\n", - user(hdr), hdr->size); - log_backtrace(hdr->freed_bt, hdr->freed_bt_depth); - log_message("+++ ALLOCATION %p SIZE %d NOW BEING REALLOCATED HERE:\n", - user(hdr), hdr->size); - log_backtrace(bt, depth); + if (g_backtrace_enabled) { + log_message("+++ ALLOCATION %p SIZE %d ALLOCATED HERE:\n", + user(hdr), hdr->size); + log_backtrace(hdr->bt, hdr->bt_depth); + /* hdr->freed_bt_depth should be nonzero here */ + log_message("+++ ALLOCATION %p SIZE %d FIRST FREED HERE:\n", + user(hdr), hdr->size); + log_backtrace(hdr->freed_bt, hdr->freed_bt_depth); + log_message("+++ ALLOCATION %p SIZE %d NOW BEING REALLOCATED HERE:\n", + user(hdr), hdr->size); + log_backtrace(bt, depth); + } - /* We take the memory out of the backlog and fall through so the + /* We take the memory out of the backlog and fall through so the * reallocation below succeeds. Since we didn't really free it, we * can default to this behavior. */ @@ -474,7 +485,9 @@ extern "C" void* chk_realloc(void* ptr, size_t bytes) { } else { log_message("+++ REALLOCATION %p SIZE %d IS CORRUPTED OR NOT ALLOCATED VIA TRACKER!\n", user(hdr), bytes); - log_backtrace(bt, depth); + if (g_backtrace_enabled) { + log_backtrace(bt, depth); + } // just get a whole new allocation and leak the old one return g_malloc_dispatch->realloc(0, bytes); // return realloc(user(hdr), bytes); // assuming it was allocated externally @@ -501,7 +514,7 @@ extern "C" void* chk_realloc(void* ptr, size_t bytes) { } if (hdr) { hdr->base = hdr; - hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH); + hdr->bt_depth = GET_BACKTRACE(hdr->bt, MAX_BACKTRACE_DEPTH); add(hdr, bytes); return user(hdr); } @@ -523,7 +536,7 @@ extern "C" void* chk_calloc(size_t nmemb, size_t bytes) { hdr_t* hdr = static_cast(g_malloc_dispatch->calloc(1, size)); if (hdr) { hdr->base = hdr; - hdr->bt_depth = get_backtrace(hdr->bt, MAX_BACKTRACE_DEPTH); + hdr->bt_depth = GET_BACKTRACE(hdr->bt, MAX_BACKTRACE_DEPTH); add(hdr, total_bytes); return user(hdr); } @@ -611,7 +624,7 @@ static void ReportMemoryLeaks() { hdr_t* block = head; log_message("+++ %s leaked block of size %d at %p (leak %d of %d)", exe, block->size, user(block), index++, total); - if (del_leak(block, &safe)) { + if (del_leak(block, &safe) && g_backtrace_enabled) { /* safe == 1, because the allocation is valid */ log_backtrace(block->bt, block->bt_depth); } @@ -636,7 +649,17 @@ extern "C" bool malloc_debug_initialize(HashTable* hash_table, const MallocDebug info_log("%s: setting backlog length to %d\n", getprogname(), g_malloc_debug_backlog); } - backtrace_startup(); + // Check if backtracing should be disabled. + char env[PROP_VALUE_MAX]; + if (__system_property_get("libc.debug.malloc.nobacktrace", env) && atoi(env) != 0) { + g_backtrace_enabled = false; + __libc_format_log(ANDROID_LOG_INFO, "libc", "not gathering backtrace information\n"); + } + + if (g_backtrace_enabled) { + backtrace_startup(); + } + return true; } @@ -645,7 +668,9 @@ extern "C" void malloc_debug_finalize(int malloc_debug_level) { if (malloc_debug_level == 10) { ReportMemoryLeaks(); } - backtrace_shutdown(); + if (g_backtrace_enabled) { + backtrace_shutdown(); + } pthread_setspecific(g_debug_calls_disabled, NULL); } diff --git a/libc/bionic/malloc_debug_leak.cpp b/libc/bionic/malloc_debug_leak.cpp index 7926a1f27..837dccc5a 100644 --- a/libc/bionic/malloc_debug_leak.cpp +++ b/libc/bionic/malloc_debug_leak.cpp @@ -47,6 +47,7 @@ #include #include "debug_stacktrace.h" +#include "malloc_debug_backtrace.h" #include "malloc_debug_common.h" #include "malloc_debug_disable.h" @@ -311,7 +312,7 @@ extern "C" void* leak_malloc(size_t bytes) { ScopedPthreadMutexLocker locker(&g_hash_table->lock); uintptr_t backtrace[BACKTRACE_SIZE]; - size_t numEntries = get_backtrace(backtrace, BACKTRACE_SIZE); + size_t numEntries = GET_BACKTRACE(backtrace, BACKTRACE_SIZE); AllocationEntry* header = reinterpret_cast(base); header->entry = record_backtrace(backtrace, numEntries, bytes); From e35fd48a832cddbedcf84773fd1922f735ae7829 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 8 Aug 2014 15:19:20 -0700 Subject: [PATCH 097/148] Make __set_errno hidden in asm. This fixes the build after the -Bsymbolic change. Bug: 16853291 Change-Id: I989c9fec3c32e0289ea257a3bd2b7fd2709b6ce2 (cherry picked from commit bc9f9f25bf1247a6a638a2a2df8441bdd9fabad7) --- libc/arch-arm/syscalls/__accept4.S | 2 ++ libc/arch-arm/syscalls/__brk.S | 2 ++ libc/arch-arm/syscalls/__connect.S | 2 ++ libc/arch-arm/syscalls/__epoll_pwait.S | 2 ++ libc/arch-arm/syscalls/__exit.S | 2 ++ libc/arch-arm/syscalls/__fcntl64.S | 2 ++ libc/arch-arm/syscalls/__fstatfs64.S | 2 ++ libc/arch-arm/syscalls/__getcpu.S | 2 ++ libc/arch-arm/syscalls/__getcwd.S | 2 ++ libc/arch-arm/syscalls/__getdents64.S | 2 ++ libc/arch-arm/syscalls/__getpid.S | 2 ++ libc/arch-arm/syscalls/__getpriority.S | 2 ++ libc/arch-arm/syscalls/__ioctl.S | 2 ++ libc/arch-arm/syscalls/__llseek.S | 2 ++ libc/arch-arm/syscalls/__mmap2.S | 2 ++ libc/arch-arm/syscalls/__openat.S | 2 ++ libc/arch-arm/syscalls/__ppoll.S | 2 ++ libc/arch-arm/syscalls/__pselect6.S | 2 ++ libc/arch-arm/syscalls/__ptrace.S | 2 ++ libc/arch-arm/syscalls/__reboot.S | 2 ++ libc/arch-arm/syscalls/__rt_sigaction.S | 2 ++ libc/arch-arm/syscalls/__rt_sigpending.S | 2 ++ libc/arch-arm/syscalls/__rt_sigprocmask.S | 2 ++ libc/arch-arm/syscalls/__rt_sigsuspend.S | 2 ++ libc/arch-arm/syscalls/__rt_sigtimedwait.S | 2 ++ libc/arch-arm/syscalls/__sched_getaffinity.S | 2 ++ libc/arch-arm/syscalls/__set_tid_address.S | 2 ++ libc/arch-arm/syscalls/__set_tls.S | 2 ++ libc/arch-arm/syscalls/__sigaction.S | 2 ++ libc/arch-arm/syscalls/__signalfd4.S | 2 ++ libc/arch-arm/syscalls/__socket.S | 2 ++ libc/arch-arm/syscalls/__statfs64.S | 2 ++ libc/arch-arm/syscalls/__timer_create.S | 2 ++ libc/arch-arm/syscalls/__timer_delete.S | 2 ++ libc/arch-arm/syscalls/__timer_getoverrun.S | 2 ++ libc/arch-arm/syscalls/__timer_gettime.S | 2 ++ libc/arch-arm/syscalls/__timer_settime.S | 2 ++ libc/arch-arm/syscalls/__waitid.S | 2 ++ libc/arch-arm/syscalls/_exit.S | 2 ++ libc/arch-arm/syscalls/acct.S | 2 ++ libc/arch-arm/syscalls/bind.S | 2 ++ libc/arch-arm/syscalls/cacheflush.S | 2 ++ libc/arch-arm/syscalls/capget.S | 2 ++ libc/arch-arm/syscalls/capset.S | 2 ++ libc/arch-arm/syscalls/chdir.S | 2 ++ libc/arch-arm/syscalls/chroot.S | 2 ++ libc/arch-arm/syscalls/clock_getres.S | 2 ++ libc/arch-arm/syscalls/clock_gettime.S | 2 ++ libc/arch-arm/syscalls/clock_nanosleep.S | 2 ++ libc/arch-arm/syscalls/clock_settime.S | 2 ++ libc/arch-arm/syscalls/close.S | 2 ++ libc/arch-arm/syscalls/delete_module.S | 2 ++ libc/arch-arm/syscalls/dup.S | 2 ++ libc/arch-arm/syscalls/dup3.S | 2 ++ libc/arch-arm/syscalls/epoll_create1.S | 2 ++ libc/arch-arm/syscalls/epoll_ctl.S | 2 ++ libc/arch-arm/syscalls/eventfd.S | 2 ++ libc/arch-arm/syscalls/execve.S | 2 ++ libc/arch-arm/syscalls/faccessat.S | 2 ++ libc/arch-arm/syscalls/fallocate64.S | 2 ++ libc/arch-arm/syscalls/fchdir.S | 2 ++ libc/arch-arm/syscalls/fchmod.S | 2 ++ libc/arch-arm/syscalls/fchmodat.S | 2 ++ libc/arch-arm/syscalls/fchown.S | 2 ++ libc/arch-arm/syscalls/fchownat.S | 2 ++ libc/arch-arm/syscalls/fdatasync.S | 2 ++ libc/arch-arm/syscalls/fgetxattr.S | 2 ++ libc/arch-arm/syscalls/flistxattr.S | 2 ++ libc/arch-arm/syscalls/flock.S | 2 ++ libc/arch-arm/syscalls/fremovexattr.S | 2 ++ libc/arch-arm/syscalls/fsetxattr.S | 2 ++ libc/arch-arm/syscalls/fstat64.S | 2 ++ libc/arch-arm/syscalls/fstatat64.S | 2 ++ libc/arch-arm/syscalls/fsync.S | 2 ++ libc/arch-arm/syscalls/ftruncate.S | 2 ++ libc/arch-arm/syscalls/ftruncate64.S | 2 ++ libc/arch-arm/syscalls/getegid.S | 2 ++ libc/arch-arm/syscalls/geteuid.S | 2 ++ libc/arch-arm/syscalls/getgid.S | 2 ++ libc/arch-arm/syscalls/getgroups.S | 2 ++ libc/arch-arm/syscalls/getitimer.S | 2 ++ libc/arch-arm/syscalls/getpeername.S | 2 ++ libc/arch-arm/syscalls/getpgid.S | 2 ++ libc/arch-arm/syscalls/getppid.S | 2 ++ libc/arch-arm/syscalls/getresgid.S | 2 ++ libc/arch-arm/syscalls/getresuid.S | 2 ++ libc/arch-arm/syscalls/getrlimit.S | 2 ++ libc/arch-arm/syscalls/getrusage.S | 2 ++ libc/arch-arm/syscalls/getsid.S | 2 ++ libc/arch-arm/syscalls/getsockname.S | 2 ++ libc/arch-arm/syscalls/getsockopt.S | 2 ++ libc/arch-arm/syscalls/gettimeofday.S | 2 ++ libc/arch-arm/syscalls/getuid.S | 2 ++ libc/arch-arm/syscalls/getxattr.S | 2 ++ libc/arch-arm/syscalls/init_module.S | 2 ++ libc/arch-arm/syscalls/inotify_add_watch.S | 2 ++ libc/arch-arm/syscalls/inotify_init1.S | 2 ++ libc/arch-arm/syscalls/inotify_rm_watch.S | 2 ++ libc/arch-arm/syscalls/kill.S | 2 ++ libc/arch-arm/syscalls/klogctl.S | 2 ++ libc/arch-arm/syscalls/lgetxattr.S | 2 ++ libc/arch-arm/syscalls/linkat.S | 2 ++ libc/arch-arm/syscalls/listen.S | 2 ++ libc/arch-arm/syscalls/listxattr.S | 2 ++ libc/arch-arm/syscalls/llistxattr.S | 2 ++ libc/arch-arm/syscalls/lremovexattr.S | 2 ++ libc/arch-arm/syscalls/lseek.S | 2 ++ libc/arch-arm/syscalls/lsetxattr.S | 2 ++ libc/arch-arm/syscalls/madvise.S | 2 ++ libc/arch-arm/syscalls/mincore.S | 2 ++ libc/arch-arm/syscalls/mkdirat.S | 2 ++ libc/arch-arm/syscalls/mknodat.S | 2 ++ libc/arch-arm/syscalls/mlock.S | 2 ++ libc/arch-arm/syscalls/mlockall.S | 2 ++ libc/arch-arm/syscalls/mount.S | 2 ++ libc/arch-arm/syscalls/mprotect.S | 2 ++ libc/arch-arm/syscalls/mremap.S | 2 ++ libc/arch-arm/syscalls/msync.S | 2 ++ libc/arch-arm/syscalls/munlock.S | 2 ++ libc/arch-arm/syscalls/munlockall.S | 2 ++ libc/arch-arm/syscalls/munmap.S | 2 ++ libc/arch-arm/syscalls/nanosleep.S | 2 ++ libc/arch-arm/syscalls/personality.S | 2 ++ libc/arch-arm/syscalls/pipe2.S | 2 ++ libc/arch-arm/syscalls/prctl.S | 2 ++ libc/arch-arm/syscalls/pread64.S | 2 ++ libc/arch-arm/syscalls/prlimit64.S | 2 ++ libc/arch-arm/syscalls/pwrite64.S | 2 ++ libc/arch-arm/syscalls/read.S | 2 ++ libc/arch-arm/syscalls/readahead.S | 2 ++ libc/arch-arm/syscalls/readlinkat.S | 2 ++ libc/arch-arm/syscalls/readv.S | 2 ++ libc/arch-arm/syscalls/recvfrom.S | 2 ++ libc/arch-arm/syscalls/recvmmsg.S | 2 ++ libc/arch-arm/syscalls/recvmsg.S | 2 ++ libc/arch-arm/syscalls/removexattr.S | 2 ++ libc/arch-arm/syscalls/renameat.S | 2 ++ libc/arch-arm/syscalls/sched_get_priority_max.S | 2 ++ libc/arch-arm/syscalls/sched_get_priority_min.S | 2 ++ libc/arch-arm/syscalls/sched_getparam.S | 2 ++ libc/arch-arm/syscalls/sched_getscheduler.S | 2 ++ libc/arch-arm/syscalls/sched_rr_get_interval.S | 2 ++ libc/arch-arm/syscalls/sched_setaffinity.S | 2 ++ libc/arch-arm/syscalls/sched_setparam.S | 2 ++ libc/arch-arm/syscalls/sched_setscheduler.S | 2 ++ libc/arch-arm/syscalls/sched_yield.S | 2 ++ libc/arch-arm/syscalls/sendfile.S | 2 ++ libc/arch-arm/syscalls/sendfile64.S | 2 ++ libc/arch-arm/syscalls/sendmmsg.S | 2 ++ libc/arch-arm/syscalls/sendmsg.S | 2 ++ libc/arch-arm/syscalls/sendto.S | 2 ++ libc/arch-arm/syscalls/setfsgid.S | 2 ++ libc/arch-arm/syscalls/setfsuid.S | 2 ++ libc/arch-arm/syscalls/setgid.S | 2 ++ libc/arch-arm/syscalls/setgroups.S | 2 ++ libc/arch-arm/syscalls/setitimer.S | 2 ++ libc/arch-arm/syscalls/setns.S | 2 ++ libc/arch-arm/syscalls/setpgid.S | 2 ++ libc/arch-arm/syscalls/setpriority.S | 2 ++ libc/arch-arm/syscalls/setregid.S | 2 ++ libc/arch-arm/syscalls/setresgid.S | 2 ++ libc/arch-arm/syscalls/setresuid.S | 2 ++ libc/arch-arm/syscalls/setreuid.S | 2 ++ libc/arch-arm/syscalls/setrlimit.S | 2 ++ libc/arch-arm/syscalls/setsid.S | 2 ++ libc/arch-arm/syscalls/setsockopt.S | 2 ++ libc/arch-arm/syscalls/settimeofday.S | 2 ++ libc/arch-arm/syscalls/setuid.S | 2 ++ libc/arch-arm/syscalls/setxattr.S | 2 ++ libc/arch-arm/syscalls/shutdown.S | 2 ++ libc/arch-arm/syscalls/sigaltstack.S | 2 ++ libc/arch-arm/syscalls/socketpair.S | 2 ++ libc/arch-arm/syscalls/splice.S | 2 ++ libc/arch-arm/syscalls/swapoff.S | 2 ++ libc/arch-arm/syscalls/swapon.S | 2 ++ libc/arch-arm/syscalls/symlinkat.S | 2 ++ libc/arch-arm/syscalls/sync.S | 2 ++ libc/arch-arm/syscalls/sysinfo.S | 2 ++ libc/arch-arm/syscalls/tee.S | 2 ++ libc/arch-arm/syscalls/tgkill.S | 2 ++ libc/arch-arm/syscalls/timerfd_create.S | 2 ++ libc/arch-arm/syscalls/timerfd_gettime.S | 2 ++ libc/arch-arm/syscalls/timerfd_settime.S | 2 ++ libc/arch-arm/syscalls/times.S | 2 ++ libc/arch-arm/syscalls/truncate.S | 2 ++ libc/arch-arm/syscalls/truncate64.S | 2 ++ libc/arch-arm/syscalls/umask.S | 2 ++ libc/arch-arm/syscalls/umount2.S | 2 ++ libc/arch-arm/syscalls/uname.S | 2 ++ libc/arch-arm/syscalls/unlinkat.S | 2 ++ libc/arch-arm/syscalls/unshare.S | 2 ++ libc/arch-arm/syscalls/utimensat.S | 2 ++ libc/arch-arm/syscalls/vfork.S | 2 ++ libc/arch-arm/syscalls/vmsplice.S | 2 ++ libc/arch-arm/syscalls/wait4.S | 2 ++ libc/arch-arm/syscalls/write.S | 2 ++ libc/arch-arm/syscalls/writev.S | 2 ++ libc/arch-arm64/syscalls/__accept4.S | 2 ++ libc/arch-arm64/syscalls/__brk.S | 2 ++ libc/arch-arm64/syscalls/__clock_gettime.S | 2 ++ libc/arch-arm64/syscalls/__connect.S | 2 ++ libc/arch-arm64/syscalls/__epoll_pwait.S | 2 ++ libc/arch-arm64/syscalls/__exit.S | 2 ++ libc/arch-arm64/syscalls/__getcpu.S | 2 ++ libc/arch-arm64/syscalls/__getcwd.S | 2 ++ libc/arch-arm64/syscalls/__getdents64.S | 2 ++ libc/arch-arm64/syscalls/__getpid.S | 2 ++ libc/arch-arm64/syscalls/__getpriority.S | 2 ++ libc/arch-arm64/syscalls/__gettimeofday.S | 2 ++ libc/arch-arm64/syscalls/__ioctl.S | 2 ++ libc/arch-arm64/syscalls/__openat.S | 2 ++ libc/arch-arm64/syscalls/__ppoll.S | 2 ++ libc/arch-arm64/syscalls/__pselect6.S | 2 ++ libc/arch-arm64/syscalls/__ptrace.S | 2 ++ libc/arch-arm64/syscalls/__reboot.S | 2 ++ libc/arch-arm64/syscalls/__rt_sigaction.S | 2 ++ libc/arch-arm64/syscalls/__rt_sigpending.S | 2 ++ libc/arch-arm64/syscalls/__rt_sigprocmask.S | 2 ++ libc/arch-arm64/syscalls/__rt_sigsuspend.S | 2 ++ libc/arch-arm64/syscalls/__rt_sigtimedwait.S | 2 ++ libc/arch-arm64/syscalls/__sched_getaffinity.S | 2 ++ libc/arch-arm64/syscalls/__set_tid_address.S | 2 ++ libc/arch-arm64/syscalls/__signalfd4.S | 2 ++ libc/arch-arm64/syscalls/__socket.S | 2 ++ libc/arch-arm64/syscalls/__timer_create.S | 2 ++ libc/arch-arm64/syscalls/__timer_delete.S | 2 ++ libc/arch-arm64/syscalls/__timer_getoverrun.S | 2 ++ libc/arch-arm64/syscalls/__timer_gettime.S | 2 ++ libc/arch-arm64/syscalls/__timer_settime.S | 2 ++ libc/arch-arm64/syscalls/__waitid.S | 2 ++ libc/arch-arm64/syscalls/_exit.S | 2 ++ libc/arch-arm64/syscalls/acct.S | 2 ++ libc/arch-arm64/syscalls/bind.S | 2 ++ libc/arch-arm64/syscalls/capget.S | 2 ++ libc/arch-arm64/syscalls/capset.S | 2 ++ libc/arch-arm64/syscalls/chdir.S | 2 ++ libc/arch-arm64/syscalls/chroot.S | 2 ++ libc/arch-arm64/syscalls/clock_getres.S | 2 ++ libc/arch-arm64/syscalls/clock_nanosleep.S | 2 ++ libc/arch-arm64/syscalls/clock_settime.S | 2 ++ libc/arch-arm64/syscalls/close.S | 2 ++ libc/arch-arm64/syscalls/delete_module.S | 2 ++ libc/arch-arm64/syscalls/dup.S | 2 ++ libc/arch-arm64/syscalls/dup3.S | 2 ++ libc/arch-arm64/syscalls/epoll_create1.S | 2 ++ libc/arch-arm64/syscalls/epoll_ctl.S | 2 ++ libc/arch-arm64/syscalls/eventfd.S | 2 ++ libc/arch-arm64/syscalls/execve.S | 2 ++ libc/arch-arm64/syscalls/faccessat.S | 2 ++ libc/arch-arm64/syscalls/fallocate.S | 2 ++ libc/arch-arm64/syscalls/fchdir.S | 2 ++ libc/arch-arm64/syscalls/fchmod.S | 2 ++ libc/arch-arm64/syscalls/fchmodat.S | 2 ++ libc/arch-arm64/syscalls/fchown.S | 2 ++ libc/arch-arm64/syscalls/fchownat.S | 2 ++ libc/arch-arm64/syscalls/fcntl.S | 2 ++ libc/arch-arm64/syscalls/fdatasync.S | 2 ++ libc/arch-arm64/syscalls/fgetxattr.S | 2 ++ libc/arch-arm64/syscalls/flistxattr.S | 2 ++ libc/arch-arm64/syscalls/flock.S | 2 ++ libc/arch-arm64/syscalls/fremovexattr.S | 2 ++ libc/arch-arm64/syscalls/fsetxattr.S | 2 ++ libc/arch-arm64/syscalls/fstat64.S | 2 ++ libc/arch-arm64/syscalls/fstatat64.S | 2 ++ libc/arch-arm64/syscalls/fstatfs64.S | 2 ++ libc/arch-arm64/syscalls/fsync.S | 2 ++ libc/arch-arm64/syscalls/ftruncate.S | 2 ++ libc/arch-arm64/syscalls/getegid.S | 2 ++ libc/arch-arm64/syscalls/geteuid.S | 2 ++ libc/arch-arm64/syscalls/getgid.S | 2 ++ libc/arch-arm64/syscalls/getgroups.S | 2 ++ libc/arch-arm64/syscalls/getitimer.S | 2 ++ libc/arch-arm64/syscalls/getpeername.S | 2 ++ libc/arch-arm64/syscalls/getpgid.S | 2 ++ libc/arch-arm64/syscalls/getppid.S | 2 ++ libc/arch-arm64/syscalls/getresgid.S | 2 ++ libc/arch-arm64/syscalls/getresuid.S | 2 ++ libc/arch-arm64/syscalls/getrlimit.S | 2 ++ libc/arch-arm64/syscalls/getrusage.S | 2 ++ libc/arch-arm64/syscalls/getsid.S | 2 ++ libc/arch-arm64/syscalls/getsockname.S | 2 ++ libc/arch-arm64/syscalls/getsockopt.S | 2 ++ libc/arch-arm64/syscalls/getuid.S | 2 ++ libc/arch-arm64/syscalls/getxattr.S | 2 ++ libc/arch-arm64/syscalls/init_module.S | 2 ++ libc/arch-arm64/syscalls/inotify_add_watch.S | 2 ++ libc/arch-arm64/syscalls/inotify_init1.S | 2 ++ libc/arch-arm64/syscalls/inotify_rm_watch.S | 2 ++ libc/arch-arm64/syscalls/kill.S | 2 ++ libc/arch-arm64/syscalls/klogctl.S | 2 ++ libc/arch-arm64/syscalls/lgetxattr.S | 2 ++ libc/arch-arm64/syscalls/linkat.S | 2 ++ libc/arch-arm64/syscalls/listen.S | 2 ++ libc/arch-arm64/syscalls/listxattr.S | 2 ++ libc/arch-arm64/syscalls/llistxattr.S | 2 ++ libc/arch-arm64/syscalls/lremovexattr.S | 2 ++ libc/arch-arm64/syscalls/lseek.S | 2 ++ libc/arch-arm64/syscalls/lsetxattr.S | 2 ++ libc/arch-arm64/syscalls/madvise.S | 2 ++ libc/arch-arm64/syscalls/mincore.S | 2 ++ libc/arch-arm64/syscalls/mkdirat.S | 2 ++ libc/arch-arm64/syscalls/mknodat.S | 2 ++ libc/arch-arm64/syscalls/mlock.S | 2 ++ libc/arch-arm64/syscalls/mlockall.S | 2 ++ libc/arch-arm64/syscalls/mmap.S | 2 ++ libc/arch-arm64/syscalls/mount.S | 2 ++ libc/arch-arm64/syscalls/mprotect.S | 2 ++ libc/arch-arm64/syscalls/mremap.S | 2 ++ libc/arch-arm64/syscalls/msync.S | 2 ++ libc/arch-arm64/syscalls/munlock.S | 2 ++ libc/arch-arm64/syscalls/munlockall.S | 2 ++ libc/arch-arm64/syscalls/munmap.S | 2 ++ libc/arch-arm64/syscalls/nanosleep.S | 2 ++ libc/arch-arm64/syscalls/personality.S | 2 ++ libc/arch-arm64/syscalls/pipe2.S | 2 ++ libc/arch-arm64/syscalls/prctl.S | 2 ++ libc/arch-arm64/syscalls/pread64.S | 2 ++ libc/arch-arm64/syscalls/prlimit64.S | 2 ++ libc/arch-arm64/syscalls/pwrite64.S | 2 ++ libc/arch-arm64/syscalls/read.S | 2 ++ libc/arch-arm64/syscalls/readahead.S | 2 ++ libc/arch-arm64/syscalls/readlinkat.S | 2 ++ libc/arch-arm64/syscalls/readv.S | 2 ++ libc/arch-arm64/syscalls/recvfrom.S | 2 ++ libc/arch-arm64/syscalls/recvmmsg.S | 2 ++ libc/arch-arm64/syscalls/recvmsg.S | 2 ++ libc/arch-arm64/syscalls/removexattr.S | 2 ++ libc/arch-arm64/syscalls/renameat.S | 2 ++ libc/arch-arm64/syscalls/sched_get_priority_max.S | 2 ++ libc/arch-arm64/syscalls/sched_get_priority_min.S | 2 ++ libc/arch-arm64/syscalls/sched_getparam.S | 2 ++ libc/arch-arm64/syscalls/sched_getscheduler.S | 2 ++ libc/arch-arm64/syscalls/sched_rr_get_interval.S | 2 ++ libc/arch-arm64/syscalls/sched_setaffinity.S | 2 ++ libc/arch-arm64/syscalls/sched_setparam.S | 2 ++ libc/arch-arm64/syscalls/sched_setscheduler.S | 2 ++ libc/arch-arm64/syscalls/sched_yield.S | 2 ++ libc/arch-arm64/syscalls/sendfile.S | 2 ++ libc/arch-arm64/syscalls/sendmmsg.S | 2 ++ libc/arch-arm64/syscalls/sendmsg.S | 2 ++ libc/arch-arm64/syscalls/sendto.S | 2 ++ libc/arch-arm64/syscalls/setfsgid.S | 2 ++ libc/arch-arm64/syscalls/setfsuid.S | 2 ++ libc/arch-arm64/syscalls/setgid.S | 2 ++ libc/arch-arm64/syscalls/setgroups.S | 2 ++ libc/arch-arm64/syscalls/setitimer.S | 2 ++ libc/arch-arm64/syscalls/setns.S | 2 ++ libc/arch-arm64/syscalls/setpgid.S | 2 ++ libc/arch-arm64/syscalls/setpriority.S | 2 ++ libc/arch-arm64/syscalls/setregid.S | 2 ++ libc/arch-arm64/syscalls/setresgid.S | 2 ++ libc/arch-arm64/syscalls/setresuid.S | 2 ++ libc/arch-arm64/syscalls/setreuid.S | 2 ++ libc/arch-arm64/syscalls/setrlimit.S | 2 ++ libc/arch-arm64/syscalls/setsid.S | 2 ++ libc/arch-arm64/syscalls/setsockopt.S | 2 ++ libc/arch-arm64/syscalls/settimeofday.S | 2 ++ libc/arch-arm64/syscalls/setuid.S | 2 ++ libc/arch-arm64/syscalls/setxattr.S | 2 ++ libc/arch-arm64/syscalls/shutdown.S | 2 ++ libc/arch-arm64/syscalls/sigaltstack.S | 2 ++ libc/arch-arm64/syscalls/socketpair.S | 2 ++ libc/arch-arm64/syscalls/splice.S | 2 ++ libc/arch-arm64/syscalls/statfs64.S | 2 ++ libc/arch-arm64/syscalls/swapoff.S | 2 ++ libc/arch-arm64/syscalls/swapon.S | 2 ++ libc/arch-arm64/syscalls/symlinkat.S | 2 ++ libc/arch-arm64/syscalls/sync.S | 2 ++ libc/arch-arm64/syscalls/sysinfo.S | 2 ++ libc/arch-arm64/syscalls/tee.S | 2 ++ libc/arch-arm64/syscalls/tgkill.S | 2 ++ libc/arch-arm64/syscalls/timerfd_create.S | 2 ++ libc/arch-arm64/syscalls/timerfd_gettime.S | 2 ++ libc/arch-arm64/syscalls/timerfd_settime.S | 2 ++ libc/arch-arm64/syscalls/times.S | 2 ++ libc/arch-arm64/syscalls/truncate.S | 2 ++ libc/arch-arm64/syscalls/umask.S | 2 ++ libc/arch-arm64/syscalls/umount2.S | 2 ++ libc/arch-arm64/syscalls/uname.S | 2 ++ libc/arch-arm64/syscalls/unlinkat.S | 2 ++ libc/arch-arm64/syscalls/unshare.S | 2 ++ libc/arch-arm64/syscalls/utimensat.S | 2 ++ libc/arch-arm64/syscalls/vmsplice.S | 2 ++ libc/arch-arm64/syscalls/wait4.S | 2 ++ libc/arch-arm64/syscalls/write.S | 2 ++ libc/arch-arm64/syscalls/writev.S | 2 ++ libc/arch-mips/syscalls/__accept4.S | 2 ++ libc/arch-mips/syscalls/__brk.S | 2 ++ libc/arch-mips/syscalls/__connect.S | 2 ++ libc/arch-mips/syscalls/__epoll_pwait.S | 2 ++ libc/arch-mips/syscalls/__exit.S | 2 ++ libc/arch-mips/syscalls/__fcntl64.S | 2 ++ libc/arch-mips/syscalls/__fstatfs64.S | 2 ++ libc/arch-mips/syscalls/__getcpu.S | 2 ++ libc/arch-mips/syscalls/__getcwd.S | 2 ++ libc/arch-mips/syscalls/__getdents64.S | 2 ++ libc/arch-mips/syscalls/__getpid.S | 2 ++ libc/arch-mips/syscalls/__getpriority.S | 2 ++ libc/arch-mips/syscalls/__ioctl.S | 2 ++ libc/arch-mips/syscalls/__llseek.S | 2 ++ libc/arch-mips/syscalls/__mmap2.S | 2 ++ libc/arch-mips/syscalls/__openat.S | 2 ++ libc/arch-mips/syscalls/__ppoll.S | 2 ++ libc/arch-mips/syscalls/__pselect6.S | 2 ++ libc/arch-mips/syscalls/__ptrace.S | 2 ++ libc/arch-mips/syscalls/__reboot.S | 2 ++ libc/arch-mips/syscalls/__rt_sigaction.S | 2 ++ libc/arch-mips/syscalls/__rt_sigpending.S | 2 ++ libc/arch-mips/syscalls/__rt_sigprocmask.S | 2 ++ libc/arch-mips/syscalls/__rt_sigsuspend.S | 2 ++ libc/arch-mips/syscalls/__rt_sigtimedwait.S | 2 ++ libc/arch-mips/syscalls/__sched_getaffinity.S | 2 ++ libc/arch-mips/syscalls/__set_tid_address.S | 2 ++ libc/arch-mips/syscalls/__set_tls.S | 2 ++ libc/arch-mips/syscalls/__sigaction.S | 2 ++ libc/arch-mips/syscalls/__signalfd4.S | 2 ++ libc/arch-mips/syscalls/__socket.S | 2 ++ libc/arch-mips/syscalls/__statfs64.S | 2 ++ libc/arch-mips/syscalls/__timer_create.S | 2 ++ libc/arch-mips/syscalls/__timer_delete.S | 2 ++ libc/arch-mips/syscalls/__timer_getoverrun.S | 2 ++ libc/arch-mips/syscalls/__timer_gettime.S | 2 ++ libc/arch-mips/syscalls/__timer_settime.S | 2 ++ libc/arch-mips/syscalls/__waitid.S | 2 ++ libc/arch-mips/syscalls/_exit.S | 2 ++ libc/arch-mips/syscalls/_flush_cache.S | 2 ++ libc/arch-mips/syscalls/acct.S | 2 ++ libc/arch-mips/syscalls/bind.S | 2 ++ libc/arch-mips/syscalls/capget.S | 2 ++ libc/arch-mips/syscalls/capset.S | 2 ++ libc/arch-mips/syscalls/chdir.S | 2 ++ libc/arch-mips/syscalls/chroot.S | 2 ++ libc/arch-mips/syscalls/clock_getres.S | 2 ++ libc/arch-mips/syscalls/clock_gettime.S | 2 ++ libc/arch-mips/syscalls/clock_nanosleep.S | 2 ++ libc/arch-mips/syscalls/clock_settime.S | 2 ++ libc/arch-mips/syscalls/close.S | 2 ++ libc/arch-mips/syscalls/delete_module.S | 2 ++ libc/arch-mips/syscalls/dup.S | 2 ++ libc/arch-mips/syscalls/dup3.S | 2 ++ libc/arch-mips/syscalls/epoll_create1.S | 2 ++ libc/arch-mips/syscalls/epoll_ctl.S | 2 ++ libc/arch-mips/syscalls/eventfd.S | 2 ++ libc/arch-mips/syscalls/execve.S | 2 ++ libc/arch-mips/syscalls/faccessat.S | 2 ++ libc/arch-mips/syscalls/fallocate64.S | 2 ++ libc/arch-mips/syscalls/fchdir.S | 2 ++ libc/arch-mips/syscalls/fchmod.S | 2 ++ libc/arch-mips/syscalls/fchmodat.S | 2 ++ libc/arch-mips/syscalls/fchown.S | 2 ++ libc/arch-mips/syscalls/fchownat.S | 2 ++ libc/arch-mips/syscalls/fdatasync.S | 2 ++ libc/arch-mips/syscalls/fgetxattr.S | 2 ++ libc/arch-mips/syscalls/flistxattr.S | 2 ++ libc/arch-mips/syscalls/flock.S | 2 ++ libc/arch-mips/syscalls/fremovexattr.S | 2 ++ libc/arch-mips/syscalls/fsetxattr.S | 2 ++ libc/arch-mips/syscalls/fstat64.S | 2 ++ libc/arch-mips/syscalls/fstatat64.S | 2 ++ libc/arch-mips/syscalls/fsync.S | 2 ++ libc/arch-mips/syscalls/ftruncate.S | 2 ++ libc/arch-mips/syscalls/ftruncate64.S | 2 ++ libc/arch-mips/syscalls/getegid.S | 2 ++ libc/arch-mips/syscalls/geteuid.S | 2 ++ libc/arch-mips/syscalls/getgid.S | 2 ++ libc/arch-mips/syscalls/getgroups.S | 2 ++ libc/arch-mips/syscalls/getitimer.S | 2 ++ libc/arch-mips/syscalls/getpeername.S | 2 ++ libc/arch-mips/syscalls/getpgid.S | 2 ++ libc/arch-mips/syscalls/getppid.S | 2 ++ libc/arch-mips/syscalls/getresgid.S | 2 ++ libc/arch-mips/syscalls/getresuid.S | 2 ++ libc/arch-mips/syscalls/getrlimit.S | 2 ++ libc/arch-mips/syscalls/getrusage.S | 2 ++ libc/arch-mips/syscalls/getsid.S | 2 ++ libc/arch-mips/syscalls/getsockname.S | 2 ++ libc/arch-mips/syscalls/getsockopt.S | 2 ++ libc/arch-mips/syscalls/gettimeofday.S | 2 ++ libc/arch-mips/syscalls/getuid.S | 2 ++ libc/arch-mips/syscalls/getxattr.S | 2 ++ libc/arch-mips/syscalls/init_module.S | 2 ++ libc/arch-mips/syscalls/inotify_add_watch.S | 2 ++ libc/arch-mips/syscalls/inotify_init1.S | 2 ++ libc/arch-mips/syscalls/inotify_rm_watch.S | 2 ++ libc/arch-mips/syscalls/kill.S | 2 ++ libc/arch-mips/syscalls/klogctl.S | 2 ++ libc/arch-mips/syscalls/lgetxattr.S | 2 ++ libc/arch-mips/syscalls/linkat.S | 2 ++ libc/arch-mips/syscalls/listen.S | 2 ++ libc/arch-mips/syscalls/listxattr.S | 2 ++ libc/arch-mips/syscalls/llistxattr.S | 2 ++ libc/arch-mips/syscalls/lremovexattr.S | 2 ++ libc/arch-mips/syscalls/lseek.S | 2 ++ libc/arch-mips/syscalls/lsetxattr.S | 2 ++ libc/arch-mips/syscalls/madvise.S | 2 ++ libc/arch-mips/syscalls/mincore.S | 2 ++ libc/arch-mips/syscalls/mkdirat.S | 2 ++ libc/arch-mips/syscalls/mknodat.S | 2 ++ libc/arch-mips/syscalls/mlock.S | 2 ++ libc/arch-mips/syscalls/mlockall.S | 2 ++ libc/arch-mips/syscalls/mount.S | 2 ++ libc/arch-mips/syscalls/mprotect.S | 2 ++ libc/arch-mips/syscalls/mremap.S | 2 ++ libc/arch-mips/syscalls/msync.S | 2 ++ libc/arch-mips/syscalls/munlock.S | 2 ++ libc/arch-mips/syscalls/munlockall.S | 2 ++ libc/arch-mips/syscalls/munmap.S | 2 ++ libc/arch-mips/syscalls/nanosleep.S | 2 ++ libc/arch-mips/syscalls/personality.S | 2 ++ libc/arch-mips/syscalls/pipe2.S | 2 ++ libc/arch-mips/syscalls/prctl.S | 2 ++ libc/arch-mips/syscalls/pread64.S | 2 ++ libc/arch-mips/syscalls/prlimit64.S | 2 ++ libc/arch-mips/syscalls/pwrite64.S | 2 ++ libc/arch-mips/syscalls/read.S | 2 ++ libc/arch-mips/syscalls/readahead.S | 2 ++ libc/arch-mips/syscalls/readlinkat.S | 2 ++ libc/arch-mips/syscalls/readv.S | 2 ++ libc/arch-mips/syscalls/recvfrom.S | 2 ++ libc/arch-mips/syscalls/recvmmsg.S | 2 ++ libc/arch-mips/syscalls/recvmsg.S | 2 ++ libc/arch-mips/syscalls/removexattr.S | 2 ++ libc/arch-mips/syscalls/renameat.S | 2 ++ libc/arch-mips/syscalls/sched_get_priority_max.S | 2 ++ libc/arch-mips/syscalls/sched_get_priority_min.S | 2 ++ libc/arch-mips/syscalls/sched_getparam.S | 2 ++ libc/arch-mips/syscalls/sched_getscheduler.S | 2 ++ libc/arch-mips/syscalls/sched_rr_get_interval.S | 2 ++ libc/arch-mips/syscalls/sched_setaffinity.S | 2 ++ libc/arch-mips/syscalls/sched_setparam.S | 2 ++ libc/arch-mips/syscalls/sched_setscheduler.S | 2 ++ libc/arch-mips/syscalls/sched_yield.S | 2 ++ libc/arch-mips/syscalls/sendfile.S | 2 ++ libc/arch-mips/syscalls/sendfile64.S | 2 ++ libc/arch-mips/syscalls/sendmmsg.S | 2 ++ libc/arch-mips/syscalls/sendmsg.S | 2 ++ libc/arch-mips/syscalls/sendto.S | 2 ++ libc/arch-mips/syscalls/setfsgid.S | 2 ++ libc/arch-mips/syscalls/setfsuid.S | 2 ++ libc/arch-mips/syscalls/setgid.S | 2 ++ libc/arch-mips/syscalls/setgroups.S | 2 ++ libc/arch-mips/syscalls/setitimer.S | 2 ++ libc/arch-mips/syscalls/setns.S | 2 ++ libc/arch-mips/syscalls/setpgid.S | 2 ++ libc/arch-mips/syscalls/setpriority.S | 2 ++ libc/arch-mips/syscalls/setregid.S | 2 ++ libc/arch-mips/syscalls/setresgid.S | 2 ++ libc/arch-mips/syscalls/setresuid.S | 2 ++ libc/arch-mips/syscalls/setreuid.S | 2 ++ libc/arch-mips/syscalls/setrlimit.S | 2 ++ libc/arch-mips/syscalls/setsid.S | 2 ++ libc/arch-mips/syscalls/setsockopt.S | 2 ++ libc/arch-mips/syscalls/settimeofday.S | 2 ++ libc/arch-mips/syscalls/setuid.S | 2 ++ libc/arch-mips/syscalls/setxattr.S | 2 ++ libc/arch-mips/syscalls/shutdown.S | 2 ++ libc/arch-mips/syscalls/sigaltstack.S | 2 ++ libc/arch-mips/syscalls/socketpair.S | 2 ++ libc/arch-mips/syscalls/splice.S | 2 ++ libc/arch-mips/syscalls/swapoff.S | 2 ++ libc/arch-mips/syscalls/swapon.S | 2 ++ libc/arch-mips/syscalls/symlinkat.S | 2 ++ libc/arch-mips/syscalls/sync.S | 2 ++ libc/arch-mips/syscalls/sysinfo.S | 2 ++ libc/arch-mips/syscalls/tee.S | 2 ++ libc/arch-mips/syscalls/tgkill.S | 2 ++ libc/arch-mips/syscalls/timerfd_create.S | 2 ++ libc/arch-mips/syscalls/timerfd_gettime.S | 2 ++ libc/arch-mips/syscalls/timerfd_settime.S | 2 ++ libc/arch-mips/syscalls/times.S | 2 ++ libc/arch-mips/syscalls/truncate.S | 2 ++ libc/arch-mips/syscalls/truncate64.S | 2 ++ libc/arch-mips/syscalls/umask.S | 2 ++ libc/arch-mips/syscalls/umount2.S | 2 ++ libc/arch-mips/syscalls/uname.S | 2 ++ libc/arch-mips/syscalls/unlinkat.S | 2 ++ libc/arch-mips/syscalls/unshare.S | 2 ++ libc/arch-mips/syscalls/utimensat.S | 2 ++ libc/arch-mips/syscalls/vmsplice.S | 2 ++ libc/arch-mips/syscalls/wait4.S | 2 ++ libc/arch-mips/syscalls/write.S | 2 ++ libc/arch-mips/syscalls/writev.S | 2 ++ libc/arch-mips64/syscalls/__accept4.S | 2 ++ libc/arch-mips64/syscalls/__brk.S | 2 ++ libc/arch-mips64/syscalls/__connect.S | 2 ++ libc/arch-mips64/syscalls/__epoll_pwait.S | 2 ++ libc/arch-mips64/syscalls/__exit.S | 2 ++ libc/arch-mips64/syscalls/__getcpu.S | 2 ++ libc/arch-mips64/syscalls/__getcwd.S | 2 ++ libc/arch-mips64/syscalls/__getdents64.S | 2 ++ libc/arch-mips64/syscalls/__getpid.S | 2 ++ libc/arch-mips64/syscalls/__getpriority.S | 2 ++ libc/arch-mips64/syscalls/__ioctl.S | 2 ++ libc/arch-mips64/syscalls/__openat.S | 2 ++ libc/arch-mips64/syscalls/__ppoll.S | 2 ++ libc/arch-mips64/syscalls/__pselect6.S | 2 ++ libc/arch-mips64/syscalls/__ptrace.S | 2 ++ libc/arch-mips64/syscalls/__reboot.S | 2 ++ libc/arch-mips64/syscalls/__rt_sigaction.S | 2 ++ libc/arch-mips64/syscalls/__rt_sigpending.S | 2 ++ libc/arch-mips64/syscalls/__rt_sigprocmask.S | 2 ++ libc/arch-mips64/syscalls/__rt_sigsuspend.S | 2 ++ libc/arch-mips64/syscalls/__rt_sigtimedwait.S | 2 ++ libc/arch-mips64/syscalls/__sched_getaffinity.S | 2 ++ libc/arch-mips64/syscalls/__set_tid_address.S | 2 ++ libc/arch-mips64/syscalls/__set_tls.S | 2 ++ libc/arch-mips64/syscalls/__signalfd4.S | 2 ++ libc/arch-mips64/syscalls/__socket.S | 2 ++ libc/arch-mips64/syscalls/__timer_create.S | 2 ++ libc/arch-mips64/syscalls/__timer_delete.S | 2 ++ libc/arch-mips64/syscalls/__timer_getoverrun.S | 2 ++ libc/arch-mips64/syscalls/__timer_gettime.S | 2 ++ libc/arch-mips64/syscalls/__timer_settime.S | 2 ++ libc/arch-mips64/syscalls/__waitid.S | 2 ++ libc/arch-mips64/syscalls/_exit.S | 2 ++ libc/arch-mips64/syscalls/_flush_cache.S | 2 ++ libc/arch-mips64/syscalls/acct.S | 2 ++ libc/arch-mips64/syscalls/bind.S | 2 ++ libc/arch-mips64/syscalls/capget.S | 2 ++ libc/arch-mips64/syscalls/capset.S | 2 ++ libc/arch-mips64/syscalls/chdir.S | 2 ++ libc/arch-mips64/syscalls/chroot.S | 2 ++ libc/arch-mips64/syscalls/clock_getres.S | 2 ++ libc/arch-mips64/syscalls/clock_gettime.S | 2 ++ libc/arch-mips64/syscalls/clock_nanosleep.S | 2 ++ libc/arch-mips64/syscalls/clock_settime.S | 2 ++ libc/arch-mips64/syscalls/close.S | 2 ++ libc/arch-mips64/syscalls/delete_module.S | 2 ++ libc/arch-mips64/syscalls/dup.S | 2 ++ libc/arch-mips64/syscalls/dup3.S | 2 ++ libc/arch-mips64/syscalls/epoll_create1.S | 2 ++ libc/arch-mips64/syscalls/epoll_ctl.S | 2 ++ libc/arch-mips64/syscalls/eventfd.S | 2 ++ libc/arch-mips64/syscalls/execve.S | 2 ++ libc/arch-mips64/syscalls/faccessat.S | 2 ++ libc/arch-mips64/syscalls/fallocate.S | 2 ++ libc/arch-mips64/syscalls/fchdir.S | 2 ++ libc/arch-mips64/syscalls/fchmod.S | 2 ++ libc/arch-mips64/syscalls/fchmodat.S | 2 ++ libc/arch-mips64/syscalls/fchown.S | 2 ++ libc/arch-mips64/syscalls/fchownat.S | 2 ++ libc/arch-mips64/syscalls/fcntl.S | 2 ++ libc/arch-mips64/syscalls/fdatasync.S | 2 ++ libc/arch-mips64/syscalls/fgetxattr.S | 2 ++ libc/arch-mips64/syscalls/flistxattr.S | 2 ++ libc/arch-mips64/syscalls/flock.S | 2 ++ libc/arch-mips64/syscalls/fremovexattr.S | 2 ++ libc/arch-mips64/syscalls/fsetxattr.S | 2 ++ libc/arch-mips64/syscalls/fstat64.S | 2 ++ libc/arch-mips64/syscalls/fstatat64.S | 2 ++ libc/arch-mips64/syscalls/fstatfs64.S | 2 ++ libc/arch-mips64/syscalls/fsync.S | 2 ++ libc/arch-mips64/syscalls/ftruncate.S | 2 ++ libc/arch-mips64/syscalls/getegid.S | 2 ++ libc/arch-mips64/syscalls/geteuid.S | 2 ++ libc/arch-mips64/syscalls/getgid.S | 2 ++ libc/arch-mips64/syscalls/getgroups.S | 2 ++ libc/arch-mips64/syscalls/getitimer.S | 2 ++ libc/arch-mips64/syscalls/getpeername.S | 2 ++ libc/arch-mips64/syscalls/getpgid.S | 2 ++ libc/arch-mips64/syscalls/getppid.S | 2 ++ libc/arch-mips64/syscalls/getresgid.S | 2 ++ libc/arch-mips64/syscalls/getresuid.S | 2 ++ libc/arch-mips64/syscalls/getrlimit.S | 2 ++ libc/arch-mips64/syscalls/getrusage.S | 2 ++ libc/arch-mips64/syscalls/getsid.S | 2 ++ libc/arch-mips64/syscalls/getsockname.S | 2 ++ libc/arch-mips64/syscalls/getsockopt.S | 2 ++ libc/arch-mips64/syscalls/gettimeofday.S | 2 ++ libc/arch-mips64/syscalls/getuid.S | 2 ++ libc/arch-mips64/syscalls/getxattr.S | 2 ++ libc/arch-mips64/syscalls/init_module.S | 2 ++ libc/arch-mips64/syscalls/inotify_add_watch.S | 2 ++ libc/arch-mips64/syscalls/inotify_init1.S | 2 ++ libc/arch-mips64/syscalls/inotify_rm_watch.S | 2 ++ libc/arch-mips64/syscalls/kill.S | 2 ++ libc/arch-mips64/syscalls/klogctl.S | 2 ++ libc/arch-mips64/syscalls/lgetxattr.S | 2 ++ libc/arch-mips64/syscalls/linkat.S | 2 ++ libc/arch-mips64/syscalls/listen.S | 2 ++ libc/arch-mips64/syscalls/listxattr.S | 2 ++ libc/arch-mips64/syscalls/llistxattr.S | 2 ++ libc/arch-mips64/syscalls/lremovexattr.S | 2 ++ libc/arch-mips64/syscalls/lseek.S | 2 ++ libc/arch-mips64/syscalls/lsetxattr.S | 2 ++ libc/arch-mips64/syscalls/madvise.S | 2 ++ libc/arch-mips64/syscalls/mincore.S | 2 ++ libc/arch-mips64/syscalls/mkdirat.S | 2 ++ libc/arch-mips64/syscalls/mknodat.S | 2 ++ libc/arch-mips64/syscalls/mlock.S | 2 ++ libc/arch-mips64/syscalls/mlockall.S | 2 ++ libc/arch-mips64/syscalls/mmap.S | 2 ++ libc/arch-mips64/syscalls/mount.S | 2 ++ libc/arch-mips64/syscalls/mprotect.S | 2 ++ libc/arch-mips64/syscalls/mremap.S | 2 ++ libc/arch-mips64/syscalls/msync.S | 2 ++ libc/arch-mips64/syscalls/munlock.S | 2 ++ libc/arch-mips64/syscalls/munlockall.S | 2 ++ libc/arch-mips64/syscalls/munmap.S | 2 ++ libc/arch-mips64/syscalls/nanosleep.S | 2 ++ libc/arch-mips64/syscalls/personality.S | 2 ++ libc/arch-mips64/syscalls/pipe2.S | 2 ++ libc/arch-mips64/syscalls/prctl.S | 2 ++ libc/arch-mips64/syscalls/pread64.S | 2 ++ libc/arch-mips64/syscalls/prlimit64.S | 2 ++ libc/arch-mips64/syscalls/pwrite64.S | 2 ++ libc/arch-mips64/syscalls/read.S | 2 ++ libc/arch-mips64/syscalls/readahead.S | 2 ++ libc/arch-mips64/syscalls/readlinkat.S | 2 ++ libc/arch-mips64/syscalls/readv.S | 2 ++ libc/arch-mips64/syscalls/recvfrom.S | 2 ++ libc/arch-mips64/syscalls/recvmmsg.S | 2 ++ libc/arch-mips64/syscalls/recvmsg.S | 2 ++ libc/arch-mips64/syscalls/removexattr.S | 2 ++ libc/arch-mips64/syscalls/renameat.S | 2 ++ libc/arch-mips64/syscalls/sched_get_priority_max.S | 2 ++ libc/arch-mips64/syscalls/sched_get_priority_min.S | 2 ++ libc/arch-mips64/syscalls/sched_getparam.S | 2 ++ libc/arch-mips64/syscalls/sched_getscheduler.S | 2 ++ libc/arch-mips64/syscalls/sched_rr_get_interval.S | 2 ++ libc/arch-mips64/syscalls/sched_setaffinity.S | 2 ++ libc/arch-mips64/syscalls/sched_setparam.S | 2 ++ libc/arch-mips64/syscalls/sched_setscheduler.S | 2 ++ libc/arch-mips64/syscalls/sched_yield.S | 2 ++ libc/arch-mips64/syscalls/sendfile.S | 2 ++ libc/arch-mips64/syscalls/sendmmsg.S | 2 ++ libc/arch-mips64/syscalls/sendmsg.S | 2 ++ libc/arch-mips64/syscalls/sendto.S | 2 ++ libc/arch-mips64/syscalls/setfsgid.S | 2 ++ libc/arch-mips64/syscalls/setfsuid.S | 2 ++ libc/arch-mips64/syscalls/setgid.S | 2 ++ libc/arch-mips64/syscalls/setgroups.S | 2 ++ libc/arch-mips64/syscalls/setitimer.S | 2 ++ libc/arch-mips64/syscalls/setns.S | 2 ++ libc/arch-mips64/syscalls/setpgid.S | 2 ++ libc/arch-mips64/syscalls/setpriority.S | 2 ++ libc/arch-mips64/syscalls/setregid.S | 2 ++ libc/arch-mips64/syscalls/setresgid.S | 2 ++ libc/arch-mips64/syscalls/setresuid.S | 2 ++ libc/arch-mips64/syscalls/setreuid.S | 2 ++ libc/arch-mips64/syscalls/setrlimit.S | 2 ++ libc/arch-mips64/syscalls/setsid.S | 2 ++ libc/arch-mips64/syscalls/setsockopt.S | 2 ++ libc/arch-mips64/syscalls/settimeofday.S | 2 ++ libc/arch-mips64/syscalls/setuid.S | 2 ++ libc/arch-mips64/syscalls/setxattr.S | 2 ++ libc/arch-mips64/syscalls/shutdown.S | 2 ++ libc/arch-mips64/syscalls/sigaltstack.S | 2 ++ libc/arch-mips64/syscalls/socketpair.S | 2 ++ libc/arch-mips64/syscalls/splice.S | 2 ++ libc/arch-mips64/syscalls/statfs64.S | 2 ++ libc/arch-mips64/syscalls/swapoff.S | 2 ++ libc/arch-mips64/syscalls/swapon.S | 2 ++ libc/arch-mips64/syscalls/symlinkat.S | 2 ++ libc/arch-mips64/syscalls/sync.S | 2 ++ libc/arch-mips64/syscalls/sysinfo.S | 2 ++ libc/arch-mips64/syscalls/tee.S | 2 ++ libc/arch-mips64/syscalls/tgkill.S | 2 ++ libc/arch-mips64/syscalls/timerfd_create.S | 2 ++ libc/arch-mips64/syscalls/timerfd_gettime.S | 2 ++ libc/arch-mips64/syscalls/timerfd_settime.S | 2 ++ libc/arch-mips64/syscalls/times.S | 2 ++ libc/arch-mips64/syscalls/truncate.S | 2 ++ libc/arch-mips64/syscalls/umask.S | 2 ++ libc/arch-mips64/syscalls/umount2.S | 2 ++ libc/arch-mips64/syscalls/uname.S | 2 ++ libc/arch-mips64/syscalls/unlinkat.S | 2 ++ libc/arch-mips64/syscalls/unshare.S | 2 ++ libc/arch-mips64/syscalls/utimensat.S | 2 ++ libc/arch-mips64/syscalls/vmsplice.S | 2 ++ libc/arch-mips64/syscalls/wait4.S | 2 ++ libc/arch-mips64/syscalls/write.S | 2 ++ libc/arch-mips64/syscalls/writev.S | 2 ++ libc/arch-x86/syscalls/__accept4.S | 2 ++ libc/arch-x86/syscalls/__brk.S | 2 ++ libc/arch-x86/syscalls/__connect.S | 2 ++ libc/arch-x86/syscalls/__epoll_pwait.S | 2 ++ libc/arch-x86/syscalls/__exit.S | 2 ++ libc/arch-x86/syscalls/__fcntl64.S | 2 ++ libc/arch-x86/syscalls/__fstatfs64.S | 2 ++ libc/arch-x86/syscalls/__getcpu.S | 2 ++ libc/arch-x86/syscalls/__getcwd.S | 2 ++ libc/arch-x86/syscalls/__getdents64.S | 2 ++ libc/arch-x86/syscalls/__getpid.S | 2 ++ libc/arch-x86/syscalls/__getpriority.S | 2 ++ libc/arch-x86/syscalls/__ioctl.S | 2 ++ libc/arch-x86/syscalls/__llseek.S | 2 ++ libc/arch-x86/syscalls/__mmap2.S | 2 ++ libc/arch-x86/syscalls/__openat.S | 2 ++ libc/arch-x86/syscalls/__ppoll.S | 2 ++ libc/arch-x86/syscalls/__pselect6.S | 2 ++ libc/arch-x86/syscalls/__ptrace.S | 2 ++ libc/arch-x86/syscalls/__reboot.S | 2 ++ libc/arch-x86/syscalls/__rt_sigaction.S | 2 ++ libc/arch-x86/syscalls/__rt_sigpending.S | 2 ++ libc/arch-x86/syscalls/__rt_sigprocmask.S | 2 ++ libc/arch-x86/syscalls/__rt_sigsuspend.S | 2 ++ libc/arch-x86/syscalls/__rt_sigtimedwait.S | 2 ++ libc/arch-x86/syscalls/__sched_getaffinity.S | 2 ++ libc/arch-x86/syscalls/__set_thread_area.S | 2 ++ libc/arch-x86/syscalls/__set_tid_address.S | 2 ++ libc/arch-x86/syscalls/__sigaction.S | 2 ++ libc/arch-x86/syscalls/__signalfd4.S | 2 ++ libc/arch-x86/syscalls/__socket.S | 2 ++ libc/arch-x86/syscalls/__statfs64.S | 2 ++ libc/arch-x86/syscalls/__timer_create.S | 2 ++ libc/arch-x86/syscalls/__timer_delete.S | 2 ++ libc/arch-x86/syscalls/__timer_getoverrun.S | 2 ++ libc/arch-x86/syscalls/__timer_gettime.S | 2 ++ libc/arch-x86/syscalls/__timer_settime.S | 2 ++ libc/arch-x86/syscalls/__waitid.S | 2 ++ libc/arch-x86/syscalls/_exit.S | 2 ++ libc/arch-x86/syscalls/acct.S | 2 ++ libc/arch-x86/syscalls/bind.S | 2 ++ libc/arch-x86/syscalls/capget.S | 2 ++ libc/arch-x86/syscalls/capset.S | 2 ++ libc/arch-x86/syscalls/chdir.S | 2 ++ libc/arch-x86/syscalls/chroot.S | 2 ++ libc/arch-x86/syscalls/clock_getres.S | 2 ++ libc/arch-x86/syscalls/clock_gettime.S | 2 ++ libc/arch-x86/syscalls/clock_nanosleep.S | 2 ++ libc/arch-x86/syscalls/clock_settime.S | 2 ++ libc/arch-x86/syscalls/close.S | 2 ++ libc/arch-x86/syscalls/delete_module.S | 2 ++ libc/arch-x86/syscalls/dup.S | 2 ++ libc/arch-x86/syscalls/dup3.S | 2 ++ libc/arch-x86/syscalls/epoll_create1.S | 2 ++ libc/arch-x86/syscalls/epoll_ctl.S | 2 ++ libc/arch-x86/syscalls/eventfd.S | 2 ++ libc/arch-x86/syscalls/execve.S | 2 ++ libc/arch-x86/syscalls/faccessat.S | 2 ++ libc/arch-x86/syscalls/fallocate64.S | 2 ++ libc/arch-x86/syscalls/fchdir.S | 2 ++ libc/arch-x86/syscalls/fchmod.S | 2 ++ libc/arch-x86/syscalls/fchmodat.S | 2 ++ libc/arch-x86/syscalls/fchown.S | 2 ++ libc/arch-x86/syscalls/fchownat.S | 2 ++ libc/arch-x86/syscalls/fdatasync.S | 2 ++ libc/arch-x86/syscalls/fgetxattr.S | 2 ++ libc/arch-x86/syscalls/flistxattr.S | 2 ++ libc/arch-x86/syscalls/flock.S | 2 ++ libc/arch-x86/syscalls/fremovexattr.S | 2 ++ libc/arch-x86/syscalls/fsetxattr.S | 2 ++ libc/arch-x86/syscalls/fstat64.S | 2 ++ libc/arch-x86/syscalls/fstatat64.S | 2 ++ libc/arch-x86/syscalls/fsync.S | 2 ++ libc/arch-x86/syscalls/ftruncate.S | 2 ++ libc/arch-x86/syscalls/ftruncate64.S | 2 ++ libc/arch-x86/syscalls/getegid.S | 2 ++ libc/arch-x86/syscalls/geteuid.S | 2 ++ libc/arch-x86/syscalls/getgid.S | 2 ++ libc/arch-x86/syscalls/getgroups.S | 2 ++ libc/arch-x86/syscalls/getitimer.S | 2 ++ libc/arch-x86/syscalls/getpeername.S | 2 ++ libc/arch-x86/syscalls/getpgid.S | 2 ++ libc/arch-x86/syscalls/getppid.S | 2 ++ libc/arch-x86/syscalls/getresgid.S | 2 ++ libc/arch-x86/syscalls/getresuid.S | 2 ++ libc/arch-x86/syscalls/getrlimit.S | 2 ++ libc/arch-x86/syscalls/getrusage.S | 2 ++ libc/arch-x86/syscalls/getsid.S | 2 ++ libc/arch-x86/syscalls/getsockname.S | 2 ++ libc/arch-x86/syscalls/getsockopt.S | 2 ++ libc/arch-x86/syscalls/gettimeofday.S | 2 ++ libc/arch-x86/syscalls/getuid.S | 2 ++ libc/arch-x86/syscalls/getxattr.S | 2 ++ libc/arch-x86/syscalls/init_module.S | 2 ++ libc/arch-x86/syscalls/inotify_add_watch.S | 2 ++ libc/arch-x86/syscalls/inotify_init1.S | 2 ++ libc/arch-x86/syscalls/inotify_rm_watch.S | 2 ++ libc/arch-x86/syscalls/kill.S | 2 ++ libc/arch-x86/syscalls/klogctl.S | 2 ++ libc/arch-x86/syscalls/lgetxattr.S | 2 ++ libc/arch-x86/syscalls/linkat.S | 2 ++ libc/arch-x86/syscalls/listen.S | 2 ++ libc/arch-x86/syscalls/listxattr.S | 2 ++ libc/arch-x86/syscalls/llistxattr.S | 2 ++ libc/arch-x86/syscalls/lremovexattr.S | 2 ++ libc/arch-x86/syscalls/lseek.S | 2 ++ libc/arch-x86/syscalls/lsetxattr.S | 2 ++ libc/arch-x86/syscalls/madvise.S | 2 ++ libc/arch-x86/syscalls/mincore.S | 2 ++ libc/arch-x86/syscalls/mkdirat.S | 2 ++ libc/arch-x86/syscalls/mknodat.S | 2 ++ libc/arch-x86/syscalls/mlock.S | 2 ++ libc/arch-x86/syscalls/mlockall.S | 2 ++ libc/arch-x86/syscalls/mount.S | 2 ++ libc/arch-x86/syscalls/mprotect.S | 2 ++ libc/arch-x86/syscalls/mremap.S | 2 ++ libc/arch-x86/syscalls/msync.S | 2 ++ libc/arch-x86/syscalls/munlock.S | 2 ++ libc/arch-x86/syscalls/munlockall.S | 2 ++ libc/arch-x86/syscalls/munmap.S | 2 ++ libc/arch-x86/syscalls/nanosleep.S | 2 ++ libc/arch-x86/syscalls/personality.S | 2 ++ libc/arch-x86/syscalls/pipe2.S | 2 ++ libc/arch-x86/syscalls/prctl.S | 2 ++ libc/arch-x86/syscalls/pread64.S | 2 ++ libc/arch-x86/syscalls/prlimit64.S | 2 ++ libc/arch-x86/syscalls/pwrite64.S | 2 ++ libc/arch-x86/syscalls/read.S | 2 ++ libc/arch-x86/syscalls/readahead.S | 2 ++ libc/arch-x86/syscalls/readlinkat.S | 2 ++ libc/arch-x86/syscalls/readv.S | 2 ++ libc/arch-x86/syscalls/recvfrom.S | 2 ++ libc/arch-x86/syscalls/recvmmsg.S | 2 ++ libc/arch-x86/syscalls/recvmsg.S | 2 ++ libc/arch-x86/syscalls/removexattr.S | 2 ++ libc/arch-x86/syscalls/renameat.S | 2 ++ libc/arch-x86/syscalls/sched_get_priority_max.S | 2 ++ libc/arch-x86/syscalls/sched_get_priority_min.S | 2 ++ libc/arch-x86/syscalls/sched_getparam.S | 2 ++ libc/arch-x86/syscalls/sched_getscheduler.S | 2 ++ libc/arch-x86/syscalls/sched_rr_get_interval.S | 2 ++ libc/arch-x86/syscalls/sched_setaffinity.S | 2 ++ libc/arch-x86/syscalls/sched_setparam.S | 2 ++ libc/arch-x86/syscalls/sched_setscheduler.S | 2 ++ libc/arch-x86/syscalls/sched_yield.S | 2 ++ libc/arch-x86/syscalls/sendfile.S | 2 ++ libc/arch-x86/syscalls/sendfile64.S | 2 ++ libc/arch-x86/syscalls/sendmmsg.S | 2 ++ libc/arch-x86/syscalls/sendmsg.S | 2 ++ libc/arch-x86/syscalls/sendto.S | 2 ++ libc/arch-x86/syscalls/setfsgid.S | 2 ++ libc/arch-x86/syscalls/setfsuid.S | 2 ++ libc/arch-x86/syscalls/setgid.S | 2 ++ libc/arch-x86/syscalls/setgroups.S | 2 ++ libc/arch-x86/syscalls/setitimer.S | 2 ++ libc/arch-x86/syscalls/setns.S | 2 ++ libc/arch-x86/syscalls/setpgid.S | 2 ++ libc/arch-x86/syscalls/setpriority.S | 2 ++ libc/arch-x86/syscalls/setregid.S | 2 ++ libc/arch-x86/syscalls/setresgid.S | 2 ++ libc/arch-x86/syscalls/setresuid.S | 2 ++ libc/arch-x86/syscalls/setreuid.S | 2 ++ libc/arch-x86/syscalls/setrlimit.S | 2 ++ libc/arch-x86/syscalls/setsid.S | 2 ++ libc/arch-x86/syscalls/setsockopt.S | 2 ++ libc/arch-x86/syscalls/settimeofday.S | 2 ++ libc/arch-x86/syscalls/setuid.S | 2 ++ libc/arch-x86/syscalls/setxattr.S | 2 ++ libc/arch-x86/syscalls/shutdown.S | 2 ++ libc/arch-x86/syscalls/sigaltstack.S | 2 ++ libc/arch-x86/syscalls/socketpair.S | 2 ++ libc/arch-x86/syscalls/splice.S | 2 ++ libc/arch-x86/syscalls/swapoff.S | 2 ++ libc/arch-x86/syscalls/swapon.S | 2 ++ libc/arch-x86/syscalls/symlinkat.S | 2 ++ libc/arch-x86/syscalls/sync.S | 2 ++ libc/arch-x86/syscalls/sysinfo.S | 2 ++ libc/arch-x86/syscalls/tee.S | 2 ++ libc/arch-x86/syscalls/tgkill.S | 2 ++ libc/arch-x86/syscalls/timerfd_create.S | 2 ++ libc/arch-x86/syscalls/timerfd_gettime.S | 2 ++ libc/arch-x86/syscalls/timerfd_settime.S | 2 ++ libc/arch-x86/syscalls/times.S | 2 ++ libc/arch-x86/syscalls/truncate.S | 2 ++ libc/arch-x86/syscalls/truncate64.S | 2 ++ libc/arch-x86/syscalls/umask.S | 2 ++ libc/arch-x86/syscalls/umount2.S | 2 ++ libc/arch-x86/syscalls/uname.S | 2 ++ libc/arch-x86/syscalls/unlinkat.S | 2 ++ libc/arch-x86/syscalls/unshare.S | 2 ++ libc/arch-x86/syscalls/utimensat.S | 2 ++ libc/arch-x86/syscalls/vmsplice.S | 2 ++ libc/arch-x86/syscalls/wait4.S | 2 ++ libc/arch-x86/syscalls/write.S | 2 ++ libc/arch-x86/syscalls/writev.S | 2 ++ libc/arch-x86_64/syscalls/__accept4.S | 2 ++ libc/arch-x86_64/syscalls/__arch_prctl.S | 2 ++ libc/arch-x86_64/syscalls/__brk.S | 2 ++ libc/arch-x86_64/syscalls/__clock_gettime.S | 2 ++ libc/arch-x86_64/syscalls/__connect.S | 2 ++ libc/arch-x86_64/syscalls/__epoll_pwait.S | 2 ++ libc/arch-x86_64/syscalls/__exit.S | 2 ++ libc/arch-x86_64/syscalls/__getcpu.S | 2 ++ libc/arch-x86_64/syscalls/__getcwd.S | 2 ++ libc/arch-x86_64/syscalls/__getdents64.S | 2 ++ libc/arch-x86_64/syscalls/__getpid.S | 2 ++ libc/arch-x86_64/syscalls/__getpriority.S | 2 ++ libc/arch-x86_64/syscalls/__gettimeofday.S | 2 ++ libc/arch-x86_64/syscalls/__ioctl.S | 2 ++ libc/arch-x86_64/syscalls/__openat.S | 2 ++ libc/arch-x86_64/syscalls/__ppoll.S | 2 ++ libc/arch-x86_64/syscalls/__pselect6.S | 2 ++ libc/arch-x86_64/syscalls/__ptrace.S | 2 ++ libc/arch-x86_64/syscalls/__reboot.S | 2 ++ libc/arch-x86_64/syscalls/__rt_sigaction.S | 2 ++ libc/arch-x86_64/syscalls/__rt_sigpending.S | 2 ++ libc/arch-x86_64/syscalls/__rt_sigprocmask.S | 2 ++ libc/arch-x86_64/syscalls/__rt_sigsuspend.S | 2 ++ libc/arch-x86_64/syscalls/__rt_sigtimedwait.S | 2 ++ libc/arch-x86_64/syscalls/__sched_getaffinity.S | 2 ++ libc/arch-x86_64/syscalls/__set_tid_address.S | 2 ++ libc/arch-x86_64/syscalls/__signalfd4.S | 2 ++ libc/arch-x86_64/syscalls/__socket.S | 2 ++ libc/arch-x86_64/syscalls/__timer_create.S | 2 ++ libc/arch-x86_64/syscalls/__timer_delete.S | 2 ++ libc/arch-x86_64/syscalls/__timer_getoverrun.S | 2 ++ libc/arch-x86_64/syscalls/__timer_gettime.S | 2 ++ libc/arch-x86_64/syscalls/__timer_settime.S | 2 ++ libc/arch-x86_64/syscalls/__waitid.S | 2 ++ libc/arch-x86_64/syscalls/_exit.S | 2 ++ libc/arch-x86_64/syscalls/acct.S | 2 ++ libc/arch-x86_64/syscalls/bind.S | 2 ++ libc/arch-x86_64/syscalls/capget.S | 2 ++ libc/arch-x86_64/syscalls/capset.S | 2 ++ libc/arch-x86_64/syscalls/chdir.S | 2 ++ libc/arch-x86_64/syscalls/chroot.S | 2 ++ libc/arch-x86_64/syscalls/clock_getres.S | 2 ++ libc/arch-x86_64/syscalls/clock_nanosleep.S | 2 ++ libc/arch-x86_64/syscalls/clock_settime.S | 2 ++ libc/arch-x86_64/syscalls/close.S | 2 ++ libc/arch-x86_64/syscalls/delete_module.S | 2 ++ libc/arch-x86_64/syscalls/dup.S | 2 ++ libc/arch-x86_64/syscalls/dup3.S | 2 ++ libc/arch-x86_64/syscalls/epoll_create1.S | 2 ++ libc/arch-x86_64/syscalls/epoll_ctl.S | 2 ++ libc/arch-x86_64/syscalls/eventfd.S | 2 ++ libc/arch-x86_64/syscalls/execve.S | 2 ++ libc/arch-x86_64/syscalls/faccessat.S | 2 ++ libc/arch-x86_64/syscalls/fallocate.S | 2 ++ libc/arch-x86_64/syscalls/fchdir.S | 2 ++ libc/arch-x86_64/syscalls/fchmod.S | 2 ++ libc/arch-x86_64/syscalls/fchmodat.S | 2 ++ libc/arch-x86_64/syscalls/fchown.S | 2 ++ libc/arch-x86_64/syscalls/fchownat.S | 2 ++ libc/arch-x86_64/syscalls/fcntl.S | 2 ++ libc/arch-x86_64/syscalls/fdatasync.S | 2 ++ libc/arch-x86_64/syscalls/fgetxattr.S | 2 ++ libc/arch-x86_64/syscalls/flistxattr.S | 2 ++ libc/arch-x86_64/syscalls/flock.S | 2 ++ libc/arch-x86_64/syscalls/fremovexattr.S | 2 ++ libc/arch-x86_64/syscalls/fsetxattr.S | 2 ++ libc/arch-x86_64/syscalls/fstat64.S | 2 ++ libc/arch-x86_64/syscalls/fstatat64.S | 2 ++ libc/arch-x86_64/syscalls/fstatfs64.S | 2 ++ libc/arch-x86_64/syscalls/fsync.S | 2 ++ libc/arch-x86_64/syscalls/ftruncate.S | 2 ++ libc/arch-x86_64/syscalls/getegid.S | 2 ++ libc/arch-x86_64/syscalls/geteuid.S | 2 ++ libc/arch-x86_64/syscalls/getgid.S | 2 ++ libc/arch-x86_64/syscalls/getgroups.S | 2 ++ libc/arch-x86_64/syscalls/getitimer.S | 2 ++ libc/arch-x86_64/syscalls/getpeername.S | 2 ++ libc/arch-x86_64/syscalls/getpgid.S | 2 ++ libc/arch-x86_64/syscalls/getppid.S | 2 ++ libc/arch-x86_64/syscalls/getresgid.S | 2 ++ libc/arch-x86_64/syscalls/getresuid.S | 2 ++ libc/arch-x86_64/syscalls/getrlimit.S | 2 ++ libc/arch-x86_64/syscalls/getrusage.S | 2 ++ libc/arch-x86_64/syscalls/getsid.S | 2 ++ libc/arch-x86_64/syscalls/getsockname.S | 2 ++ libc/arch-x86_64/syscalls/getsockopt.S | 2 ++ libc/arch-x86_64/syscalls/getuid.S | 2 ++ libc/arch-x86_64/syscalls/getxattr.S | 2 ++ libc/arch-x86_64/syscalls/init_module.S | 2 ++ libc/arch-x86_64/syscalls/inotify_add_watch.S | 2 ++ libc/arch-x86_64/syscalls/inotify_init1.S | 2 ++ libc/arch-x86_64/syscalls/inotify_rm_watch.S | 2 ++ libc/arch-x86_64/syscalls/kill.S | 2 ++ libc/arch-x86_64/syscalls/klogctl.S | 2 ++ libc/arch-x86_64/syscalls/lgetxattr.S | 2 ++ libc/arch-x86_64/syscalls/linkat.S | 2 ++ libc/arch-x86_64/syscalls/listen.S | 2 ++ libc/arch-x86_64/syscalls/listxattr.S | 2 ++ libc/arch-x86_64/syscalls/llistxattr.S | 2 ++ libc/arch-x86_64/syscalls/lremovexattr.S | 2 ++ libc/arch-x86_64/syscalls/lseek.S | 2 ++ libc/arch-x86_64/syscalls/lsetxattr.S | 2 ++ libc/arch-x86_64/syscalls/madvise.S | 2 ++ libc/arch-x86_64/syscalls/mincore.S | 2 ++ libc/arch-x86_64/syscalls/mkdirat.S | 2 ++ libc/arch-x86_64/syscalls/mknodat.S | 2 ++ libc/arch-x86_64/syscalls/mlock.S | 2 ++ libc/arch-x86_64/syscalls/mlockall.S | 2 ++ libc/arch-x86_64/syscalls/mmap.S | 2 ++ libc/arch-x86_64/syscalls/mount.S | 2 ++ libc/arch-x86_64/syscalls/mprotect.S | 2 ++ libc/arch-x86_64/syscalls/mremap.S | 2 ++ libc/arch-x86_64/syscalls/msync.S | 2 ++ libc/arch-x86_64/syscalls/munlock.S | 2 ++ libc/arch-x86_64/syscalls/munlockall.S | 2 ++ libc/arch-x86_64/syscalls/munmap.S | 2 ++ libc/arch-x86_64/syscalls/nanosleep.S | 2 ++ libc/arch-x86_64/syscalls/personality.S | 2 ++ libc/arch-x86_64/syscalls/pipe2.S | 2 ++ libc/arch-x86_64/syscalls/prctl.S | 2 ++ libc/arch-x86_64/syscalls/pread64.S | 2 ++ libc/arch-x86_64/syscalls/prlimit64.S | 2 ++ libc/arch-x86_64/syscalls/pwrite64.S | 2 ++ libc/arch-x86_64/syscalls/read.S | 2 ++ libc/arch-x86_64/syscalls/readahead.S | 2 ++ libc/arch-x86_64/syscalls/readlinkat.S | 2 ++ libc/arch-x86_64/syscalls/readv.S | 2 ++ libc/arch-x86_64/syscalls/recvfrom.S | 2 ++ libc/arch-x86_64/syscalls/recvmmsg.S | 2 ++ libc/arch-x86_64/syscalls/recvmsg.S | 2 ++ libc/arch-x86_64/syscalls/removexattr.S | 2 ++ libc/arch-x86_64/syscalls/renameat.S | 2 ++ libc/arch-x86_64/syscalls/sched_get_priority_max.S | 2 ++ libc/arch-x86_64/syscalls/sched_get_priority_min.S | 2 ++ libc/arch-x86_64/syscalls/sched_getparam.S | 2 ++ libc/arch-x86_64/syscalls/sched_getscheduler.S | 2 ++ libc/arch-x86_64/syscalls/sched_rr_get_interval.S | 2 ++ libc/arch-x86_64/syscalls/sched_setaffinity.S | 2 ++ libc/arch-x86_64/syscalls/sched_setparam.S | 2 ++ libc/arch-x86_64/syscalls/sched_setscheduler.S | 2 ++ libc/arch-x86_64/syscalls/sched_yield.S | 2 ++ libc/arch-x86_64/syscalls/sendfile.S | 2 ++ libc/arch-x86_64/syscalls/sendmmsg.S | 2 ++ libc/arch-x86_64/syscalls/sendmsg.S | 2 ++ libc/arch-x86_64/syscalls/sendto.S | 2 ++ libc/arch-x86_64/syscalls/setfsgid.S | 2 ++ libc/arch-x86_64/syscalls/setfsuid.S | 2 ++ libc/arch-x86_64/syscalls/setgid.S | 2 ++ libc/arch-x86_64/syscalls/setgroups.S | 2 ++ libc/arch-x86_64/syscalls/setitimer.S | 2 ++ libc/arch-x86_64/syscalls/setns.S | 2 ++ libc/arch-x86_64/syscalls/setpgid.S | 2 ++ libc/arch-x86_64/syscalls/setpriority.S | 2 ++ libc/arch-x86_64/syscalls/setregid.S | 2 ++ libc/arch-x86_64/syscalls/setresgid.S | 2 ++ libc/arch-x86_64/syscalls/setresuid.S | 2 ++ libc/arch-x86_64/syscalls/setreuid.S | 2 ++ libc/arch-x86_64/syscalls/setrlimit.S | 2 ++ libc/arch-x86_64/syscalls/setsid.S | 2 ++ libc/arch-x86_64/syscalls/setsockopt.S | 2 ++ libc/arch-x86_64/syscalls/settimeofday.S | 2 ++ libc/arch-x86_64/syscalls/setuid.S | 2 ++ libc/arch-x86_64/syscalls/setxattr.S | 2 ++ libc/arch-x86_64/syscalls/shutdown.S | 2 ++ libc/arch-x86_64/syscalls/sigaltstack.S | 2 ++ libc/arch-x86_64/syscalls/socketpair.S | 2 ++ libc/arch-x86_64/syscalls/splice.S | 2 ++ libc/arch-x86_64/syscalls/statfs64.S | 2 ++ libc/arch-x86_64/syscalls/swapoff.S | 2 ++ libc/arch-x86_64/syscalls/swapon.S | 2 ++ libc/arch-x86_64/syscalls/symlinkat.S | 2 ++ libc/arch-x86_64/syscalls/sync.S | 2 ++ libc/arch-x86_64/syscalls/sysinfo.S | 2 ++ libc/arch-x86_64/syscalls/tee.S | 2 ++ libc/arch-x86_64/syscalls/tgkill.S | 2 ++ libc/arch-x86_64/syscalls/timerfd_create.S | 2 ++ libc/arch-x86_64/syscalls/timerfd_gettime.S | 2 ++ libc/arch-x86_64/syscalls/timerfd_settime.S | 2 ++ libc/arch-x86_64/syscalls/times.S | 2 ++ libc/arch-x86_64/syscalls/truncate.S | 2 ++ libc/arch-x86_64/syscalls/umask.S | 2 ++ libc/arch-x86_64/syscalls/umount2.S | 2 ++ libc/arch-x86_64/syscalls/uname.S | 2 ++ libc/arch-x86_64/syscalls/unlinkat.S | 2 ++ libc/arch-x86_64/syscalls/unshare.S | 2 ++ libc/arch-x86_64/syscalls/utimensat.S | 2 ++ libc/arch-x86_64/syscalls/vmsplice.S | 2 ++ libc/arch-x86_64/syscalls/wait4.S | 2 ++ libc/arch-x86_64/syscalls/write.S | 2 ++ libc/arch-x86_64/syscalls/writev.S | 2 ++ libc/tools/gensyscalls.py | 2 ++ 1159 files changed, 2318 insertions(+) diff --git a/libc/arch-arm/syscalls/__accept4.S b/libc/arch-arm/syscalls/__accept4.S index 9a6874bab..2b1eb285f 100644 --- a/libc/arch-arm/syscalls/__accept4.S +++ b/libc/arch-arm/syscalls/__accept4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__accept4) mov ip, r7 ldr r7, =__NR_accept4 diff --git a/libc/arch-arm/syscalls/__brk.S b/libc/arch-arm/syscalls/__brk.S index 31de0d237..0987f0e28 100644 --- a/libc/arch-arm/syscalls/__brk.S +++ b/libc/arch-arm/syscalls/__brk.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__brk) mov ip, r7 ldr r7, =__NR_brk diff --git a/libc/arch-arm/syscalls/__connect.S b/libc/arch-arm/syscalls/__connect.S index 8cb026cba..510af9591 100644 --- a/libc/arch-arm/syscalls/__connect.S +++ b/libc/arch-arm/syscalls/__connect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__connect) mov ip, r7 ldr r7, =__NR_connect diff --git a/libc/arch-arm/syscalls/__epoll_pwait.S b/libc/arch-arm/syscalls/__epoll_pwait.S index b2d8d48f0..bbba2e12a 100644 --- a/libc/arch-arm/syscalls/__epoll_pwait.S +++ b/libc/arch-arm/syscalls/__epoll_pwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__epoll_pwait) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/__exit.S b/libc/arch-arm/syscalls/__exit.S index c534bb05d..ceef94ed4 100644 --- a/libc/arch-arm/syscalls/__exit.S +++ b/libc/arch-arm/syscalls/__exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__exit) mov ip, r7 ldr r7, =__NR_exit diff --git a/libc/arch-arm/syscalls/__fcntl64.S b/libc/arch-arm/syscalls/__fcntl64.S index 2132cb736..bb2068d11 100644 --- a/libc/arch-arm/syscalls/__fcntl64.S +++ b/libc/arch-arm/syscalls/__fcntl64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__fcntl64) mov ip, r7 ldr r7, =__NR_fcntl64 diff --git a/libc/arch-arm/syscalls/__fstatfs64.S b/libc/arch-arm/syscalls/__fstatfs64.S index 18942bc8a..b493aa047 100644 --- a/libc/arch-arm/syscalls/__fstatfs64.S +++ b/libc/arch-arm/syscalls/__fstatfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__fstatfs64) mov ip, r7 ldr r7, =__NR_fstatfs64 diff --git a/libc/arch-arm/syscalls/__getcpu.S b/libc/arch-arm/syscalls/__getcpu.S index 1aea50a6a..1b3fc4612 100644 --- a/libc/arch-arm/syscalls/__getcpu.S +++ b/libc/arch-arm/syscalls/__getcpu.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcpu) mov ip, r7 ldr r7, =__NR_getcpu diff --git a/libc/arch-arm/syscalls/__getcwd.S b/libc/arch-arm/syscalls/__getcwd.S index 1c2ac6c53..d91b3ca19 100644 --- a/libc/arch-arm/syscalls/__getcwd.S +++ b/libc/arch-arm/syscalls/__getcwd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcwd) mov ip, r7 ldr r7, =__NR_getcwd diff --git a/libc/arch-arm/syscalls/__getdents64.S b/libc/arch-arm/syscalls/__getdents64.S index c3d5e5b6d..7d3d81c43 100644 --- a/libc/arch-arm/syscalls/__getdents64.S +++ b/libc/arch-arm/syscalls/__getdents64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getdents64) mov ip, r7 ldr r7, =__NR_getdents64 diff --git a/libc/arch-arm/syscalls/__getpid.S b/libc/arch-arm/syscalls/__getpid.S index eedc33a5f..ede0865bd 100644 --- a/libc/arch-arm/syscalls/__getpid.S +++ b/libc/arch-arm/syscalls/__getpid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpid) mov ip, r7 ldr r7, =__NR_getpid diff --git a/libc/arch-arm/syscalls/__getpriority.S b/libc/arch-arm/syscalls/__getpriority.S index 90ccaea80..d3a646885 100644 --- a/libc/arch-arm/syscalls/__getpriority.S +++ b/libc/arch-arm/syscalls/__getpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpriority) mov ip, r7 ldr r7, =__NR_getpriority diff --git a/libc/arch-arm/syscalls/__ioctl.S b/libc/arch-arm/syscalls/__ioctl.S index 3f816db8c..b3ac82fac 100644 --- a/libc/arch-arm/syscalls/__ioctl.S +++ b/libc/arch-arm/syscalls/__ioctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ioctl) mov ip, r7 ldr r7, =__NR_ioctl diff --git a/libc/arch-arm/syscalls/__llseek.S b/libc/arch-arm/syscalls/__llseek.S index ec307d291..b36164ca2 100644 --- a/libc/arch-arm/syscalls/__llseek.S +++ b/libc/arch-arm/syscalls/__llseek.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__llseek) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/__mmap2.S b/libc/arch-arm/syscalls/__mmap2.S index 8a179977d..ba7471699 100644 --- a/libc/arch-arm/syscalls/__mmap2.S +++ b/libc/arch-arm/syscalls/__mmap2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__mmap2) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/__openat.S b/libc/arch-arm/syscalls/__openat.S index 7a38dc3b1..6b119e162 100644 --- a/libc/arch-arm/syscalls/__openat.S +++ b/libc/arch-arm/syscalls/__openat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__openat) mov ip, r7 ldr r7, =__NR_openat diff --git a/libc/arch-arm/syscalls/__ppoll.S b/libc/arch-arm/syscalls/__ppoll.S index d9fb3d9fb..3a0e80ceb 100644 --- a/libc/arch-arm/syscalls/__ppoll.S +++ b/libc/arch-arm/syscalls/__ppoll.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ppoll) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/__pselect6.S b/libc/arch-arm/syscalls/__pselect6.S index 05fea543e..1417be879 100644 --- a/libc/arch-arm/syscalls/__pselect6.S +++ b/libc/arch-arm/syscalls/__pselect6.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__pselect6) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/__ptrace.S b/libc/arch-arm/syscalls/__ptrace.S index 4e41d9d15..bc0323261 100644 --- a/libc/arch-arm/syscalls/__ptrace.S +++ b/libc/arch-arm/syscalls/__ptrace.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ptrace) mov ip, r7 ldr r7, =__NR_ptrace diff --git a/libc/arch-arm/syscalls/__reboot.S b/libc/arch-arm/syscalls/__reboot.S index 18e29a763..91bbf7c4e 100644 --- a/libc/arch-arm/syscalls/__reboot.S +++ b/libc/arch-arm/syscalls/__reboot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__reboot) mov ip, r7 ldr r7, =__NR_reboot diff --git a/libc/arch-arm/syscalls/__rt_sigaction.S b/libc/arch-arm/syscalls/__rt_sigaction.S index 974c0e205..6a5e05864 100644 --- a/libc/arch-arm/syscalls/__rt_sigaction.S +++ b/libc/arch-arm/syscalls/__rt_sigaction.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigaction) mov ip, r7 ldr r7, =__NR_rt_sigaction diff --git a/libc/arch-arm/syscalls/__rt_sigpending.S b/libc/arch-arm/syscalls/__rt_sigpending.S index 4a0f5d7f7..44da9b2d1 100644 --- a/libc/arch-arm/syscalls/__rt_sigpending.S +++ b/libc/arch-arm/syscalls/__rt_sigpending.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigpending) mov ip, r7 ldr r7, =__NR_rt_sigpending diff --git a/libc/arch-arm/syscalls/__rt_sigprocmask.S b/libc/arch-arm/syscalls/__rt_sigprocmask.S index 19abdc196..81cdb8546 100644 --- a/libc/arch-arm/syscalls/__rt_sigprocmask.S +++ b/libc/arch-arm/syscalls/__rt_sigprocmask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigprocmask) mov ip, r7 ldr r7, =__NR_rt_sigprocmask diff --git a/libc/arch-arm/syscalls/__rt_sigsuspend.S b/libc/arch-arm/syscalls/__rt_sigsuspend.S index a0af905bc..a9a39032a 100644 --- a/libc/arch-arm/syscalls/__rt_sigsuspend.S +++ b/libc/arch-arm/syscalls/__rt_sigsuspend.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigsuspend) mov ip, r7 ldr r7, =__NR_rt_sigsuspend diff --git a/libc/arch-arm/syscalls/__rt_sigtimedwait.S b/libc/arch-arm/syscalls/__rt_sigtimedwait.S index 0ba7ce290..7b78a43b8 100644 --- a/libc/arch-arm/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-arm/syscalls/__rt_sigtimedwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigtimedwait) mov ip, r7 ldr r7, =__NR_rt_sigtimedwait diff --git a/libc/arch-arm/syscalls/__sched_getaffinity.S b/libc/arch-arm/syscalls/__sched_getaffinity.S index e977cfb1c..a22c55e33 100644 --- a/libc/arch-arm/syscalls/__sched_getaffinity.S +++ b/libc/arch-arm/syscalls/__sched_getaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__sched_getaffinity) mov ip, r7 ldr r7, =__NR_sched_getaffinity diff --git a/libc/arch-arm/syscalls/__set_tid_address.S b/libc/arch-arm/syscalls/__set_tid_address.S index b4b42e712..0838c8b3c 100644 --- a/libc/arch-arm/syscalls/__set_tid_address.S +++ b/libc/arch-arm/syscalls/__set_tid_address.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__set_tid_address) mov ip, r7 ldr r7, =__NR_set_tid_address diff --git a/libc/arch-arm/syscalls/__set_tls.S b/libc/arch-arm/syscalls/__set_tls.S index 94c7cf4aa..c4c2eb7cd 100644 --- a/libc/arch-arm/syscalls/__set_tls.S +++ b/libc/arch-arm/syscalls/__set_tls.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__set_tls) mov ip, r7 ldr r7, =__ARM_NR_set_tls diff --git a/libc/arch-arm/syscalls/__sigaction.S b/libc/arch-arm/syscalls/__sigaction.S index 7e2e07eea..869b4c8bd 100644 --- a/libc/arch-arm/syscalls/__sigaction.S +++ b/libc/arch-arm/syscalls/__sigaction.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__sigaction) mov ip, r7 ldr r7, =__NR_sigaction diff --git a/libc/arch-arm/syscalls/__signalfd4.S b/libc/arch-arm/syscalls/__signalfd4.S index 712f975d2..3bcf0319a 100644 --- a/libc/arch-arm/syscalls/__signalfd4.S +++ b/libc/arch-arm/syscalls/__signalfd4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__signalfd4) mov ip, r7 ldr r7, =__NR_signalfd4 diff --git a/libc/arch-arm/syscalls/__socket.S b/libc/arch-arm/syscalls/__socket.S index d63028bdd..a655b5b2c 100644 --- a/libc/arch-arm/syscalls/__socket.S +++ b/libc/arch-arm/syscalls/__socket.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__socket) mov ip, r7 ldr r7, =__NR_socket diff --git a/libc/arch-arm/syscalls/__statfs64.S b/libc/arch-arm/syscalls/__statfs64.S index 256356226..80ea6ce1d 100644 --- a/libc/arch-arm/syscalls/__statfs64.S +++ b/libc/arch-arm/syscalls/__statfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__statfs64) mov ip, r7 ldr r7, =__NR_statfs64 diff --git a/libc/arch-arm/syscalls/__timer_create.S b/libc/arch-arm/syscalls/__timer_create.S index 9b75749e5..75fc34781 100644 --- a/libc/arch-arm/syscalls/__timer_create.S +++ b/libc/arch-arm/syscalls/__timer_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_create) mov ip, r7 ldr r7, =__NR_timer_create diff --git a/libc/arch-arm/syscalls/__timer_delete.S b/libc/arch-arm/syscalls/__timer_delete.S index db32b3bb7..ad5ec361b 100644 --- a/libc/arch-arm/syscalls/__timer_delete.S +++ b/libc/arch-arm/syscalls/__timer_delete.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_delete) mov ip, r7 ldr r7, =__NR_timer_delete diff --git a/libc/arch-arm/syscalls/__timer_getoverrun.S b/libc/arch-arm/syscalls/__timer_getoverrun.S index 5701b12e0..529712cd4 100644 --- a/libc/arch-arm/syscalls/__timer_getoverrun.S +++ b/libc/arch-arm/syscalls/__timer_getoverrun.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_getoverrun) mov ip, r7 ldr r7, =__NR_timer_getoverrun diff --git a/libc/arch-arm/syscalls/__timer_gettime.S b/libc/arch-arm/syscalls/__timer_gettime.S index e9a4ff9b1..180da3905 100644 --- a/libc/arch-arm/syscalls/__timer_gettime.S +++ b/libc/arch-arm/syscalls/__timer_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_gettime) mov ip, r7 ldr r7, =__NR_timer_gettime diff --git a/libc/arch-arm/syscalls/__timer_settime.S b/libc/arch-arm/syscalls/__timer_settime.S index 2f1ab190f..e2950dd01 100644 --- a/libc/arch-arm/syscalls/__timer_settime.S +++ b/libc/arch-arm/syscalls/__timer_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_settime) mov ip, r7 ldr r7, =__NR_timer_settime diff --git a/libc/arch-arm/syscalls/__waitid.S b/libc/arch-arm/syscalls/__waitid.S index e5e1f54dc..8c6ba6625 100644 --- a/libc/arch-arm/syscalls/__waitid.S +++ b/libc/arch-arm/syscalls/__waitid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__waitid) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/_exit.S b/libc/arch-arm/syscalls/_exit.S index 581b340e3..fd072c3f6 100644 --- a/libc/arch-arm/syscalls/_exit.S +++ b/libc/arch-arm/syscalls/_exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(_exit) mov ip, r7 ldr r7, =__NR_exit_group diff --git a/libc/arch-arm/syscalls/acct.S b/libc/arch-arm/syscalls/acct.S index e360c5ac1..156db4850 100644 --- a/libc/arch-arm/syscalls/acct.S +++ b/libc/arch-arm/syscalls/acct.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(acct) mov ip, r7 ldr r7, =__NR_acct diff --git a/libc/arch-arm/syscalls/bind.S b/libc/arch-arm/syscalls/bind.S index e07dd7732..892c77fcb 100644 --- a/libc/arch-arm/syscalls/bind.S +++ b/libc/arch-arm/syscalls/bind.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(bind) mov ip, r7 ldr r7, =__NR_bind diff --git a/libc/arch-arm/syscalls/cacheflush.S b/libc/arch-arm/syscalls/cacheflush.S index ac2a218a6..0739c32e8 100644 --- a/libc/arch-arm/syscalls/cacheflush.S +++ b/libc/arch-arm/syscalls/cacheflush.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(cacheflush) mov ip, r7 ldr r7, =__ARM_NR_cacheflush diff --git a/libc/arch-arm/syscalls/capget.S b/libc/arch-arm/syscalls/capget.S index b912830ae..6fd0f7cad 100644 --- a/libc/arch-arm/syscalls/capget.S +++ b/libc/arch-arm/syscalls/capget.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capget) mov ip, r7 ldr r7, =__NR_capget diff --git a/libc/arch-arm/syscalls/capset.S b/libc/arch-arm/syscalls/capset.S index cef68c5e0..2708ff6b9 100644 --- a/libc/arch-arm/syscalls/capset.S +++ b/libc/arch-arm/syscalls/capset.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capset) mov ip, r7 ldr r7, =__NR_capset diff --git a/libc/arch-arm/syscalls/chdir.S b/libc/arch-arm/syscalls/chdir.S index ea93fd6e6..0b86a0f14 100644 --- a/libc/arch-arm/syscalls/chdir.S +++ b/libc/arch-arm/syscalls/chdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chdir) mov ip, r7 ldr r7, =__NR_chdir diff --git a/libc/arch-arm/syscalls/chroot.S b/libc/arch-arm/syscalls/chroot.S index b1199e6e8..15aa392aa 100644 --- a/libc/arch-arm/syscalls/chroot.S +++ b/libc/arch-arm/syscalls/chroot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chroot) mov ip, r7 ldr r7, =__NR_chroot diff --git a/libc/arch-arm/syscalls/clock_getres.S b/libc/arch-arm/syscalls/clock_getres.S index f1e7fa294..b92289a12 100644 --- a/libc/arch-arm/syscalls/clock_getres.S +++ b/libc/arch-arm/syscalls/clock_getres.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_getres) mov ip, r7 ldr r7, =__NR_clock_getres diff --git a/libc/arch-arm/syscalls/clock_gettime.S b/libc/arch-arm/syscalls/clock_gettime.S index 9b3e132e2..203db8fbd 100644 --- a/libc/arch-arm/syscalls/clock_gettime.S +++ b/libc/arch-arm/syscalls/clock_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_gettime) mov ip, r7 ldr r7, =__NR_clock_gettime diff --git a/libc/arch-arm/syscalls/clock_nanosleep.S b/libc/arch-arm/syscalls/clock_nanosleep.S index fda7394b8..5de2267cf 100644 --- a/libc/arch-arm/syscalls/clock_nanosleep.S +++ b/libc/arch-arm/syscalls/clock_nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_nanosleep) mov ip, r7 ldr r7, =__NR_clock_nanosleep diff --git a/libc/arch-arm/syscalls/clock_settime.S b/libc/arch-arm/syscalls/clock_settime.S index 5a0059e54..71e61f8cc 100644 --- a/libc/arch-arm/syscalls/clock_settime.S +++ b/libc/arch-arm/syscalls/clock_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_settime) mov ip, r7 ldr r7, =__NR_clock_settime diff --git a/libc/arch-arm/syscalls/close.S b/libc/arch-arm/syscalls/close.S index 00c8f85dc..3e0fd3268 100644 --- a/libc/arch-arm/syscalls/close.S +++ b/libc/arch-arm/syscalls/close.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(close) mov ip, r7 ldr r7, =__NR_close diff --git a/libc/arch-arm/syscalls/delete_module.S b/libc/arch-arm/syscalls/delete_module.S index a26b47857..0af25208a 100644 --- a/libc/arch-arm/syscalls/delete_module.S +++ b/libc/arch-arm/syscalls/delete_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(delete_module) mov ip, r7 ldr r7, =__NR_delete_module diff --git a/libc/arch-arm/syscalls/dup.S b/libc/arch-arm/syscalls/dup.S index b1859d9e5..4105438fa 100644 --- a/libc/arch-arm/syscalls/dup.S +++ b/libc/arch-arm/syscalls/dup.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup) mov ip, r7 ldr r7, =__NR_dup diff --git a/libc/arch-arm/syscalls/dup3.S b/libc/arch-arm/syscalls/dup3.S index 3e47c10a2..409e8f976 100644 --- a/libc/arch-arm/syscalls/dup3.S +++ b/libc/arch-arm/syscalls/dup3.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup3) mov ip, r7 ldr r7, =__NR_dup3 diff --git a/libc/arch-arm/syscalls/epoll_create1.S b/libc/arch-arm/syscalls/epoll_create1.S index 2eebc0cd1..631afab3d 100644 --- a/libc/arch-arm/syscalls/epoll_create1.S +++ b/libc/arch-arm/syscalls/epoll_create1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_create1) mov ip, r7 ldr r7, =__NR_epoll_create1 diff --git a/libc/arch-arm/syscalls/epoll_ctl.S b/libc/arch-arm/syscalls/epoll_ctl.S index 7a1cc41da..187fe0a0b 100644 --- a/libc/arch-arm/syscalls/epoll_ctl.S +++ b/libc/arch-arm/syscalls/epoll_ctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_ctl) mov ip, r7 ldr r7, =__NR_epoll_ctl diff --git a/libc/arch-arm/syscalls/eventfd.S b/libc/arch-arm/syscalls/eventfd.S index 08272d38a..c35f537e8 100644 --- a/libc/arch-arm/syscalls/eventfd.S +++ b/libc/arch-arm/syscalls/eventfd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(eventfd) mov ip, r7 ldr r7, =__NR_eventfd2 diff --git a/libc/arch-arm/syscalls/execve.S b/libc/arch-arm/syscalls/execve.S index 361ec6382..1b24f765f 100644 --- a/libc/arch-arm/syscalls/execve.S +++ b/libc/arch-arm/syscalls/execve.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(execve) mov ip, r7 ldr r7, =__NR_execve diff --git a/libc/arch-arm/syscalls/faccessat.S b/libc/arch-arm/syscalls/faccessat.S index c82b2ce4e..3f663e3ab 100644 --- a/libc/arch-arm/syscalls/faccessat.S +++ b/libc/arch-arm/syscalls/faccessat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(faccessat) mov ip, r7 ldr r7, =__NR_faccessat diff --git a/libc/arch-arm/syscalls/fallocate64.S b/libc/arch-arm/syscalls/fallocate64.S index c6992b01a..fd9063754 100644 --- a/libc/arch-arm/syscalls/fallocate64.S +++ b/libc/arch-arm/syscalls/fallocate64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fallocate64) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/fchdir.S b/libc/arch-arm/syscalls/fchdir.S index 1a7eb5181..c10971878 100644 --- a/libc/arch-arm/syscalls/fchdir.S +++ b/libc/arch-arm/syscalls/fchdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchdir) mov ip, r7 ldr r7, =__NR_fchdir diff --git a/libc/arch-arm/syscalls/fchmod.S b/libc/arch-arm/syscalls/fchmod.S index 42dc5b832..4b598a29d 100644 --- a/libc/arch-arm/syscalls/fchmod.S +++ b/libc/arch-arm/syscalls/fchmod.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmod) mov ip, r7 ldr r7, =__NR_fchmod diff --git a/libc/arch-arm/syscalls/fchmodat.S b/libc/arch-arm/syscalls/fchmodat.S index e03da8cd2..8e4311810 100644 --- a/libc/arch-arm/syscalls/fchmodat.S +++ b/libc/arch-arm/syscalls/fchmodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmodat) mov ip, r7 ldr r7, =__NR_fchmodat diff --git a/libc/arch-arm/syscalls/fchown.S b/libc/arch-arm/syscalls/fchown.S index c2c398299..24a38f65f 100644 --- a/libc/arch-arm/syscalls/fchown.S +++ b/libc/arch-arm/syscalls/fchown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchown) mov ip, r7 ldr r7, =__NR_fchown32 diff --git a/libc/arch-arm/syscalls/fchownat.S b/libc/arch-arm/syscalls/fchownat.S index ea8193f43..8fd76a3b8 100644 --- a/libc/arch-arm/syscalls/fchownat.S +++ b/libc/arch-arm/syscalls/fchownat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchownat) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/fdatasync.S b/libc/arch-arm/syscalls/fdatasync.S index 9c8317d81..955666524 100644 --- a/libc/arch-arm/syscalls/fdatasync.S +++ b/libc/arch-arm/syscalls/fdatasync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fdatasync) mov ip, r7 ldr r7, =__NR_fdatasync diff --git a/libc/arch-arm/syscalls/fgetxattr.S b/libc/arch-arm/syscalls/fgetxattr.S index bef536b2c..95e2809bc 100644 --- a/libc/arch-arm/syscalls/fgetxattr.S +++ b/libc/arch-arm/syscalls/fgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fgetxattr) mov ip, r7 ldr r7, =__NR_fgetxattr diff --git a/libc/arch-arm/syscalls/flistxattr.S b/libc/arch-arm/syscalls/flistxattr.S index d9a30bb80..0d411b17b 100644 --- a/libc/arch-arm/syscalls/flistxattr.S +++ b/libc/arch-arm/syscalls/flistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flistxattr) mov ip, r7 ldr r7, =__NR_flistxattr diff --git a/libc/arch-arm/syscalls/flock.S b/libc/arch-arm/syscalls/flock.S index 016e8240b..e59d4f682 100644 --- a/libc/arch-arm/syscalls/flock.S +++ b/libc/arch-arm/syscalls/flock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flock) mov ip, r7 ldr r7, =__NR_flock diff --git a/libc/arch-arm/syscalls/fremovexattr.S b/libc/arch-arm/syscalls/fremovexattr.S index c7ff034ff..3ec647fa2 100644 --- a/libc/arch-arm/syscalls/fremovexattr.S +++ b/libc/arch-arm/syscalls/fremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fremovexattr) mov ip, r7 ldr r7, =__NR_fremovexattr diff --git a/libc/arch-arm/syscalls/fsetxattr.S b/libc/arch-arm/syscalls/fsetxattr.S index 64b8d031e..225e64b9f 100644 --- a/libc/arch-arm/syscalls/fsetxattr.S +++ b/libc/arch-arm/syscalls/fsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsetxattr) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/fstat64.S b/libc/arch-arm/syscalls/fstat64.S index 7517a6587..560bb94cc 100644 --- a/libc/arch-arm/syscalls/fstat64.S +++ b/libc/arch-arm/syscalls/fstat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstat64) mov ip, r7 ldr r7, =__NR_fstat64 diff --git a/libc/arch-arm/syscalls/fstatat64.S b/libc/arch-arm/syscalls/fstatat64.S index 752ee2f74..cda584580 100644 --- a/libc/arch-arm/syscalls/fstatat64.S +++ b/libc/arch-arm/syscalls/fstatat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstatat64) mov ip, r7 ldr r7, =__NR_fstatat64 diff --git a/libc/arch-arm/syscalls/fsync.S b/libc/arch-arm/syscalls/fsync.S index 6b7c4a8ad..c6ba47bca 100644 --- a/libc/arch-arm/syscalls/fsync.S +++ b/libc/arch-arm/syscalls/fsync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsync) mov ip, r7 ldr r7, =__NR_fsync diff --git a/libc/arch-arm/syscalls/ftruncate.S b/libc/arch-arm/syscalls/ftruncate.S index 4a3d56c11..168d72296 100644 --- a/libc/arch-arm/syscalls/ftruncate.S +++ b/libc/arch-arm/syscalls/ftruncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(ftruncate) mov ip, r7 ldr r7, =__NR_ftruncate diff --git a/libc/arch-arm/syscalls/ftruncate64.S b/libc/arch-arm/syscalls/ftruncate64.S index 910ca68d3..a2b73b838 100644 --- a/libc/arch-arm/syscalls/ftruncate64.S +++ b/libc/arch-arm/syscalls/ftruncate64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(ftruncate64) mov ip, r7 ldr r7, =__NR_ftruncate64 diff --git a/libc/arch-arm/syscalls/getegid.S b/libc/arch-arm/syscalls/getegid.S index 6afca909d..e2f9fe976 100644 --- a/libc/arch-arm/syscalls/getegid.S +++ b/libc/arch-arm/syscalls/getegid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getegid) mov ip, r7 ldr r7, =__NR_getegid32 diff --git a/libc/arch-arm/syscalls/geteuid.S b/libc/arch-arm/syscalls/geteuid.S index 78e5cf419..1d5532049 100644 --- a/libc/arch-arm/syscalls/geteuid.S +++ b/libc/arch-arm/syscalls/geteuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(geteuid) mov ip, r7 ldr r7, =__NR_geteuid32 diff --git a/libc/arch-arm/syscalls/getgid.S b/libc/arch-arm/syscalls/getgid.S index c2d353810..9d81d73ef 100644 --- a/libc/arch-arm/syscalls/getgid.S +++ b/libc/arch-arm/syscalls/getgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgid) mov ip, r7 ldr r7, =__NR_getgid32 diff --git a/libc/arch-arm/syscalls/getgroups.S b/libc/arch-arm/syscalls/getgroups.S index e6b8e105d..23aafaf7b 100644 --- a/libc/arch-arm/syscalls/getgroups.S +++ b/libc/arch-arm/syscalls/getgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgroups) mov ip, r7 ldr r7, =__NR_getgroups32 diff --git a/libc/arch-arm/syscalls/getitimer.S b/libc/arch-arm/syscalls/getitimer.S index 3dce70767..095cf8fcb 100644 --- a/libc/arch-arm/syscalls/getitimer.S +++ b/libc/arch-arm/syscalls/getitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getitimer) mov ip, r7 ldr r7, =__NR_getitimer diff --git a/libc/arch-arm/syscalls/getpeername.S b/libc/arch-arm/syscalls/getpeername.S index 0613231cb..760f6fb3c 100644 --- a/libc/arch-arm/syscalls/getpeername.S +++ b/libc/arch-arm/syscalls/getpeername.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpeername) mov ip, r7 ldr r7, =__NR_getpeername diff --git a/libc/arch-arm/syscalls/getpgid.S b/libc/arch-arm/syscalls/getpgid.S index 1992afc24..d07b05824 100644 --- a/libc/arch-arm/syscalls/getpgid.S +++ b/libc/arch-arm/syscalls/getpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpgid) mov ip, r7 ldr r7, =__NR_getpgid diff --git a/libc/arch-arm/syscalls/getppid.S b/libc/arch-arm/syscalls/getppid.S index 594fca5d1..bcc13a8a6 100644 --- a/libc/arch-arm/syscalls/getppid.S +++ b/libc/arch-arm/syscalls/getppid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getppid) mov ip, r7 ldr r7, =__NR_getppid diff --git a/libc/arch-arm/syscalls/getresgid.S b/libc/arch-arm/syscalls/getresgid.S index 9dcdb33db..9a87eaa3a 100644 --- a/libc/arch-arm/syscalls/getresgid.S +++ b/libc/arch-arm/syscalls/getresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresgid) mov ip, r7 ldr r7, =__NR_getresgid32 diff --git a/libc/arch-arm/syscalls/getresuid.S b/libc/arch-arm/syscalls/getresuid.S index 387bd7c2d..a332928fb 100644 --- a/libc/arch-arm/syscalls/getresuid.S +++ b/libc/arch-arm/syscalls/getresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresuid) mov ip, r7 ldr r7, =__NR_getresuid32 diff --git a/libc/arch-arm/syscalls/getrlimit.S b/libc/arch-arm/syscalls/getrlimit.S index 879b66689..4a9c62aaa 100644 --- a/libc/arch-arm/syscalls/getrlimit.S +++ b/libc/arch-arm/syscalls/getrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrlimit) mov ip, r7 ldr r7, =__NR_ugetrlimit diff --git a/libc/arch-arm/syscalls/getrusage.S b/libc/arch-arm/syscalls/getrusage.S index ee84f490d..4799b6931 100644 --- a/libc/arch-arm/syscalls/getrusage.S +++ b/libc/arch-arm/syscalls/getrusage.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrusage) mov ip, r7 ldr r7, =__NR_getrusage diff --git a/libc/arch-arm/syscalls/getsid.S b/libc/arch-arm/syscalls/getsid.S index 715f217e9..5a26e94a1 100644 --- a/libc/arch-arm/syscalls/getsid.S +++ b/libc/arch-arm/syscalls/getsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsid) mov ip, r7 ldr r7, =__NR_getsid diff --git a/libc/arch-arm/syscalls/getsockname.S b/libc/arch-arm/syscalls/getsockname.S index 2ee68f38b..78e07524a 100644 --- a/libc/arch-arm/syscalls/getsockname.S +++ b/libc/arch-arm/syscalls/getsockname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockname) mov ip, r7 ldr r7, =__NR_getsockname diff --git a/libc/arch-arm/syscalls/getsockopt.S b/libc/arch-arm/syscalls/getsockopt.S index 2ded34fd3..e1badfb45 100644 --- a/libc/arch-arm/syscalls/getsockopt.S +++ b/libc/arch-arm/syscalls/getsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockopt) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/gettimeofday.S b/libc/arch-arm/syscalls/gettimeofday.S index 4d33b5dbc..611c0d4ef 100644 --- a/libc/arch-arm/syscalls/gettimeofday.S +++ b/libc/arch-arm/syscalls/gettimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(gettimeofday) mov ip, r7 ldr r7, =__NR_gettimeofday diff --git a/libc/arch-arm/syscalls/getuid.S b/libc/arch-arm/syscalls/getuid.S index 66f570f3b..2e97c5509 100644 --- a/libc/arch-arm/syscalls/getuid.S +++ b/libc/arch-arm/syscalls/getuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getuid) mov ip, r7 ldr r7, =__NR_getuid32 diff --git a/libc/arch-arm/syscalls/getxattr.S b/libc/arch-arm/syscalls/getxattr.S index 71d003545..da0e86d4f 100644 --- a/libc/arch-arm/syscalls/getxattr.S +++ b/libc/arch-arm/syscalls/getxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getxattr) mov ip, r7 ldr r7, =__NR_getxattr diff --git a/libc/arch-arm/syscalls/init_module.S b/libc/arch-arm/syscalls/init_module.S index 6850ddf0a..bf30b03a2 100644 --- a/libc/arch-arm/syscalls/init_module.S +++ b/libc/arch-arm/syscalls/init_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(init_module) mov ip, r7 ldr r7, =__NR_init_module diff --git a/libc/arch-arm/syscalls/inotify_add_watch.S b/libc/arch-arm/syscalls/inotify_add_watch.S index 367a49fe1..982d33857 100644 --- a/libc/arch-arm/syscalls/inotify_add_watch.S +++ b/libc/arch-arm/syscalls/inotify_add_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_add_watch) mov ip, r7 ldr r7, =__NR_inotify_add_watch diff --git a/libc/arch-arm/syscalls/inotify_init1.S b/libc/arch-arm/syscalls/inotify_init1.S index 13e175fed..2253ec846 100644 --- a/libc/arch-arm/syscalls/inotify_init1.S +++ b/libc/arch-arm/syscalls/inotify_init1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_init1) mov ip, r7 ldr r7, =__NR_inotify_init1 diff --git a/libc/arch-arm/syscalls/inotify_rm_watch.S b/libc/arch-arm/syscalls/inotify_rm_watch.S index b80e0f8f8..9d7e6aefb 100644 --- a/libc/arch-arm/syscalls/inotify_rm_watch.S +++ b/libc/arch-arm/syscalls/inotify_rm_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_rm_watch) mov ip, r7 ldr r7, =__NR_inotify_rm_watch diff --git a/libc/arch-arm/syscalls/kill.S b/libc/arch-arm/syscalls/kill.S index 9a4420842..7e4d6c45f 100644 --- a/libc/arch-arm/syscalls/kill.S +++ b/libc/arch-arm/syscalls/kill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(kill) mov ip, r7 ldr r7, =__NR_kill diff --git a/libc/arch-arm/syscalls/klogctl.S b/libc/arch-arm/syscalls/klogctl.S index 84ce7f631..f5fe27fe2 100644 --- a/libc/arch-arm/syscalls/klogctl.S +++ b/libc/arch-arm/syscalls/klogctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(klogctl) mov ip, r7 ldr r7, =__NR_syslog diff --git a/libc/arch-arm/syscalls/lgetxattr.S b/libc/arch-arm/syscalls/lgetxattr.S index 9eed67f92..70b7235aa 100644 --- a/libc/arch-arm/syscalls/lgetxattr.S +++ b/libc/arch-arm/syscalls/lgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lgetxattr) mov ip, r7 ldr r7, =__NR_lgetxattr diff --git a/libc/arch-arm/syscalls/linkat.S b/libc/arch-arm/syscalls/linkat.S index 27f1e0098..7a578f8ed 100644 --- a/libc/arch-arm/syscalls/linkat.S +++ b/libc/arch-arm/syscalls/linkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(linkat) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/listen.S b/libc/arch-arm/syscalls/listen.S index 330ea56ad..5c33912ea 100644 --- a/libc/arch-arm/syscalls/listen.S +++ b/libc/arch-arm/syscalls/listen.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listen) mov ip, r7 ldr r7, =__NR_listen diff --git a/libc/arch-arm/syscalls/listxattr.S b/libc/arch-arm/syscalls/listxattr.S index c64e484cf..ea8f5d832 100644 --- a/libc/arch-arm/syscalls/listxattr.S +++ b/libc/arch-arm/syscalls/listxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listxattr) mov ip, r7 ldr r7, =__NR_listxattr diff --git a/libc/arch-arm/syscalls/llistxattr.S b/libc/arch-arm/syscalls/llistxattr.S index cea926b05..b7f337522 100644 --- a/libc/arch-arm/syscalls/llistxattr.S +++ b/libc/arch-arm/syscalls/llistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(llistxattr) mov ip, r7 ldr r7, =__NR_llistxattr diff --git a/libc/arch-arm/syscalls/lremovexattr.S b/libc/arch-arm/syscalls/lremovexattr.S index c7a6458f9..a8d0d2d3b 100644 --- a/libc/arch-arm/syscalls/lremovexattr.S +++ b/libc/arch-arm/syscalls/lremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lremovexattr) mov ip, r7 ldr r7, =__NR_lremovexattr diff --git a/libc/arch-arm/syscalls/lseek.S b/libc/arch-arm/syscalls/lseek.S index 9edae376c..17697d486 100644 --- a/libc/arch-arm/syscalls/lseek.S +++ b/libc/arch-arm/syscalls/lseek.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lseek) mov ip, r7 ldr r7, =__NR_lseek diff --git a/libc/arch-arm/syscalls/lsetxattr.S b/libc/arch-arm/syscalls/lsetxattr.S index fb3f75fdc..166ef7f1d 100644 --- a/libc/arch-arm/syscalls/lsetxattr.S +++ b/libc/arch-arm/syscalls/lsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lsetxattr) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/madvise.S b/libc/arch-arm/syscalls/madvise.S index ee2c2a50d..ffa71c463 100644 --- a/libc/arch-arm/syscalls/madvise.S +++ b/libc/arch-arm/syscalls/madvise.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(madvise) mov ip, r7 ldr r7, =__NR_madvise diff --git a/libc/arch-arm/syscalls/mincore.S b/libc/arch-arm/syscalls/mincore.S index 9ef923725..5eb5f1010 100644 --- a/libc/arch-arm/syscalls/mincore.S +++ b/libc/arch-arm/syscalls/mincore.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mincore) mov ip, r7 ldr r7, =__NR_mincore diff --git a/libc/arch-arm/syscalls/mkdirat.S b/libc/arch-arm/syscalls/mkdirat.S index 9e77ef01d..d9c58ad08 100644 --- a/libc/arch-arm/syscalls/mkdirat.S +++ b/libc/arch-arm/syscalls/mkdirat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mkdirat) mov ip, r7 ldr r7, =__NR_mkdirat diff --git a/libc/arch-arm/syscalls/mknodat.S b/libc/arch-arm/syscalls/mknodat.S index de492da90..d6296f1fd 100644 --- a/libc/arch-arm/syscalls/mknodat.S +++ b/libc/arch-arm/syscalls/mknodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mknodat) mov ip, r7 ldr r7, =__NR_mknodat diff --git a/libc/arch-arm/syscalls/mlock.S b/libc/arch-arm/syscalls/mlock.S index 043b21b56..21fd5f9f3 100644 --- a/libc/arch-arm/syscalls/mlock.S +++ b/libc/arch-arm/syscalls/mlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlock) mov ip, r7 ldr r7, =__NR_mlock diff --git a/libc/arch-arm/syscalls/mlockall.S b/libc/arch-arm/syscalls/mlockall.S index 9c6c4e451..750b7ece5 100644 --- a/libc/arch-arm/syscalls/mlockall.S +++ b/libc/arch-arm/syscalls/mlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlockall) mov ip, r7 ldr r7, =__NR_mlockall diff --git a/libc/arch-arm/syscalls/mount.S b/libc/arch-arm/syscalls/mount.S index d56682c63..d2fa20e38 100644 --- a/libc/arch-arm/syscalls/mount.S +++ b/libc/arch-arm/syscalls/mount.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mount) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/mprotect.S b/libc/arch-arm/syscalls/mprotect.S index 9461d9b05..dfc6f0891 100644 --- a/libc/arch-arm/syscalls/mprotect.S +++ b/libc/arch-arm/syscalls/mprotect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mprotect) mov ip, r7 ldr r7, =__NR_mprotect diff --git a/libc/arch-arm/syscalls/mremap.S b/libc/arch-arm/syscalls/mremap.S index 2486fc9d2..a67457156 100644 --- a/libc/arch-arm/syscalls/mremap.S +++ b/libc/arch-arm/syscalls/mremap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mremap) mov ip, r7 ldr r7, =__NR_mremap diff --git a/libc/arch-arm/syscalls/msync.S b/libc/arch-arm/syscalls/msync.S index 3fc411809..e062a5ee7 100644 --- a/libc/arch-arm/syscalls/msync.S +++ b/libc/arch-arm/syscalls/msync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(msync) mov ip, r7 ldr r7, =__NR_msync diff --git a/libc/arch-arm/syscalls/munlock.S b/libc/arch-arm/syscalls/munlock.S index c89fd3c3a..c44d14750 100644 --- a/libc/arch-arm/syscalls/munlock.S +++ b/libc/arch-arm/syscalls/munlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlock) mov ip, r7 ldr r7, =__NR_munlock diff --git a/libc/arch-arm/syscalls/munlockall.S b/libc/arch-arm/syscalls/munlockall.S index 3ac9f32bc..3a36b7e90 100644 --- a/libc/arch-arm/syscalls/munlockall.S +++ b/libc/arch-arm/syscalls/munlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlockall) mov ip, r7 ldr r7, =__NR_munlockall diff --git a/libc/arch-arm/syscalls/munmap.S b/libc/arch-arm/syscalls/munmap.S index ed3bb1e4f..a94e4e5b2 100644 --- a/libc/arch-arm/syscalls/munmap.S +++ b/libc/arch-arm/syscalls/munmap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munmap) mov ip, r7 ldr r7, =__NR_munmap diff --git a/libc/arch-arm/syscalls/nanosleep.S b/libc/arch-arm/syscalls/nanosleep.S index 695c1260c..743adc218 100644 --- a/libc/arch-arm/syscalls/nanosleep.S +++ b/libc/arch-arm/syscalls/nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(nanosleep) mov ip, r7 ldr r7, =__NR_nanosleep diff --git a/libc/arch-arm/syscalls/personality.S b/libc/arch-arm/syscalls/personality.S index e3f7371da..90dfe224e 100644 --- a/libc/arch-arm/syscalls/personality.S +++ b/libc/arch-arm/syscalls/personality.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(personality) mov ip, r7 ldr r7, =__NR_personality diff --git a/libc/arch-arm/syscalls/pipe2.S b/libc/arch-arm/syscalls/pipe2.S index 420dee9a3..b295df57b 100644 --- a/libc/arch-arm/syscalls/pipe2.S +++ b/libc/arch-arm/syscalls/pipe2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pipe2) mov ip, r7 ldr r7, =__NR_pipe2 diff --git a/libc/arch-arm/syscalls/prctl.S b/libc/arch-arm/syscalls/prctl.S index 615a2fa2e..c8f68d36c 100644 --- a/libc/arch-arm/syscalls/prctl.S +++ b/libc/arch-arm/syscalls/prctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prctl) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/pread64.S b/libc/arch-arm/syscalls/pread64.S index 0bfb6d051..3eeae3db3 100644 --- a/libc/arch-arm/syscalls/pread64.S +++ b/libc/arch-arm/syscalls/pread64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pread64) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/prlimit64.S b/libc/arch-arm/syscalls/prlimit64.S index 8d9c4ff64..87c53d582 100644 --- a/libc/arch-arm/syscalls/prlimit64.S +++ b/libc/arch-arm/syscalls/prlimit64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prlimit64) mov ip, r7 ldr r7, =__NR_prlimit64 diff --git a/libc/arch-arm/syscalls/pwrite64.S b/libc/arch-arm/syscalls/pwrite64.S index 03247b100..c63b835d2 100644 --- a/libc/arch-arm/syscalls/pwrite64.S +++ b/libc/arch-arm/syscalls/pwrite64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pwrite64) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/read.S b/libc/arch-arm/syscalls/read.S index b01daf56a..9de525c92 100644 --- a/libc/arch-arm/syscalls/read.S +++ b/libc/arch-arm/syscalls/read.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(read) mov ip, r7 ldr r7, =__NR_read diff --git a/libc/arch-arm/syscalls/readahead.S b/libc/arch-arm/syscalls/readahead.S index 83d84424f..995f00eb4 100644 --- a/libc/arch-arm/syscalls/readahead.S +++ b/libc/arch-arm/syscalls/readahead.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readahead) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/readlinkat.S b/libc/arch-arm/syscalls/readlinkat.S index 28926abc9..f865de52a 100644 --- a/libc/arch-arm/syscalls/readlinkat.S +++ b/libc/arch-arm/syscalls/readlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readlinkat) mov ip, r7 ldr r7, =__NR_readlinkat diff --git a/libc/arch-arm/syscalls/readv.S b/libc/arch-arm/syscalls/readv.S index 433d33d65..9401687c8 100644 --- a/libc/arch-arm/syscalls/readv.S +++ b/libc/arch-arm/syscalls/readv.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readv) mov ip, r7 ldr r7, =__NR_readv diff --git a/libc/arch-arm/syscalls/recvfrom.S b/libc/arch-arm/syscalls/recvfrom.S index cb89f7230..6390a82ca 100644 --- a/libc/arch-arm/syscalls/recvfrom.S +++ b/libc/arch-arm/syscalls/recvfrom.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvfrom) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/recvmmsg.S b/libc/arch-arm/syscalls/recvmmsg.S index dd8cd8c65..067ed1e15 100644 --- a/libc/arch-arm/syscalls/recvmmsg.S +++ b/libc/arch-arm/syscalls/recvmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmmsg) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/recvmsg.S b/libc/arch-arm/syscalls/recvmsg.S index 47e82a78d..f6884818d 100644 --- a/libc/arch-arm/syscalls/recvmsg.S +++ b/libc/arch-arm/syscalls/recvmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmsg) mov ip, r7 ldr r7, =__NR_recvmsg diff --git a/libc/arch-arm/syscalls/removexattr.S b/libc/arch-arm/syscalls/removexattr.S index a3fcdfa2f..59d0e2fa2 100644 --- a/libc/arch-arm/syscalls/removexattr.S +++ b/libc/arch-arm/syscalls/removexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(removexattr) mov ip, r7 ldr r7, =__NR_removexattr diff --git a/libc/arch-arm/syscalls/renameat.S b/libc/arch-arm/syscalls/renameat.S index cea6286dd..7a4d26882 100644 --- a/libc/arch-arm/syscalls/renameat.S +++ b/libc/arch-arm/syscalls/renameat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(renameat) mov ip, r7 ldr r7, =__NR_renameat diff --git a/libc/arch-arm/syscalls/sched_get_priority_max.S b/libc/arch-arm/syscalls/sched_get_priority_max.S index c940adc5a..2aafafc61 100644 --- a/libc/arch-arm/syscalls/sched_get_priority_max.S +++ b/libc/arch-arm/syscalls/sched_get_priority_max.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_max) mov ip, r7 ldr r7, =__NR_sched_get_priority_max diff --git a/libc/arch-arm/syscalls/sched_get_priority_min.S b/libc/arch-arm/syscalls/sched_get_priority_min.S index 39faedec8..40e14ef66 100644 --- a/libc/arch-arm/syscalls/sched_get_priority_min.S +++ b/libc/arch-arm/syscalls/sched_get_priority_min.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_min) mov ip, r7 ldr r7, =__NR_sched_get_priority_min diff --git a/libc/arch-arm/syscalls/sched_getparam.S b/libc/arch-arm/syscalls/sched_getparam.S index 59df104d7..3d58651c8 100644 --- a/libc/arch-arm/syscalls/sched_getparam.S +++ b/libc/arch-arm/syscalls/sched_getparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getparam) mov ip, r7 ldr r7, =__NR_sched_getparam diff --git a/libc/arch-arm/syscalls/sched_getscheduler.S b/libc/arch-arm/syscalls/sched_getscheduler.S index 953368df6..e9478ca2c 100644 --- a/libc/arch-arm/syscalls/sched_getscheduler.S +++ b/libc/arch-arm/syscalls/sched_getscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getscheduler) mov ip, r7 ldr r7, =__NR_sched_getscheduler diff --git a/libc/arch-arm/syscalls/sched_rr_get_interval.S b/libc/arch-arm/syscalls/sched_rr_get_interval.S index 1fa7d1577..ed90b73db 100644 --- a/libc/arch-arm/syscalls/sched_rr_get_interval.S +++ b/libc/arch-arm/syscalls/sched_rr_get_interval.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_rr_get_interval) mov ip, r7 ldr r7, =__NR_sched_rr_get_interval diff --git a/libc/arch-arm/syscalls/sched_setaffinity.S b/libc/arch-arm/syscalls/sched_setaffinity.S index 63bfe4da8..d5f72a94c 100644 --- a/libc/arch-arm/syscalls/sched_setaffinity.S +++ b/libc/arch-arm/syscalls/sched_setaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setaffinity) mov ip, r7 ldr r7, =__NR_sched_setaffinity diff --git a/libc/arch-arm/syscalls/sched_setparam.S b/libc/arch-arm/syscalls/sched_setparam.S index 324f0bbfa..3ec06c006 100644 --- a/libc/arch-arm/syscalls/sched_setparam.S +++ b/libc/arch-arm/syscalls/sched_setparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setparam) mov ip, r7 ldr r7, =__NR_sched_setparam diff --git a/libc/arch-arm/syscalls/sched_setscheduler.S b/libc/arch-arm/syscalls/sched_setscheduler.S index 0ce6b1567..0e61ffb37 100644 --- a/libc/arch-arm/syscalls/sched_setscheduler.S +++ b/libc/arch-arm/syscalls/sched_setscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setscheduler) mov ip, r7 ldr r7, =__NR_sched_setscheduler diff --git a/libc/arch-arm/syscalls/sched_yield.S b/libc/arch-arm/syscalls/sched_yield.S index 8e6d65aec..f26297ef6 100644 --- a/libc/arch-arm/syscalls/sched_yield.S +++ b/libc/arch-arm/syscalls/sched_yield.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_yield) mov ip, r7 ldr r7, =__NR_sched_yield diff --git a/libc/arch-arm/syscalls/sendfile.S b/libc/arch-arm/syscalls/sendfile.S index 28b25a357..e4df8fff6 100644 --- a/libc/arch-arm/syscalls/sendfile.S +++ b/libc/arch-arm/syscalls/sendfile.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendfile) mov ip, r7 ldr r7, =__NR_sendfile diff --git a/libc/arch-arm/syscalls/sendfile64.S b/libc/arch-arm/syscalls/sendfile64.S index 4a9f24563..ab489632b 100644 --- a/libc/arch-arm/syscalls/sendfile64.S +++ b/libc/arch-arm/syscalls/sendfile64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendfile64) mov ip, r7 ldr r7, =__NR_sendfile64 diff --git a/libc/arch-arm/syscalls/sendmmsg.S b/libc/arch-arm/syscalls/sendmmsg.S index 04c3fe312..998e6c7c9 100644 --- a/libc/arch-arm/syscalls/sendmmsg.S +++ b/libc/arch-arm/syscalls/sendmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmmsg) mov ip, r7 ldr r7, =__NR_sendmmsg diff --git a/libc/arch-arm/syscalls/sendmsg.S b/libc/arch-arm/syscalls/sendmsg.S index 554f30739..d25d6b42e 100644 --- a/libc/arch-arm/syscalls/sendmsg.S +++ b/libc/arch-arm/syscalls/sendmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmsg) mov ip, r7 ldr r7, =__NR_sendmsg diff --git a/libc/arch-arm/syscalls/sendto.S b/libc/arch-arm/syscalls/sendto.S index bd0ec1d4c..b5e8de98a 100644 --- a/libc/arch-arm/syscalls/sendto.S +++ b/libc/arch-arm/syscalls/sendto.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendto) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/setfsgid.S b/libc/arch-arm/syscalls/setfsgid.S index e36e6eac8..7cdb6103b 100644 --- a/libc/arch-arm/syscalls/setfsgid.S +++ b/libc/arch-arm/syscalls/setfsgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsgid) mov ip, r7 ldr r7, =__NR_setfsgid diff --git a/libc/arch-arm/syscalls/setfsuid.S b/libc/arch-arm/syscalls/setfsuid.S index e3c9c009f..ae65298b1 100644 --- a/libc/arch-arm/syscalls/setfsuid.S +++ b/libc/arch-arm/syscalls/setfsuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsuid) mov ip, r7 ldr r7, =__NR_setfsuid diff --git a/libc/arch-arm/syscalls/setgid.S b/libc/arch-arm/syscalls/setgid.S index fb38148b2..15583ac0c 100644 --- a/libc/arch-arm/syscalls/setgid.S +++ b/libc/arch-arm/syscalls/setgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgid) mov ip, r7 ldr r7, =__NR_setgid32 diff --git a/libc/arch-arm/syscalls/setgroups.S b/libc/arch-arm/syscalls/setgroups.S index 5420a5368..eb610b1da 100644 --- a/libc/arch-arm/syscalls/setgroups.S +++ b/libc/arch-arm/syscalls/setgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgroups) mov ip, r7 ldr r7, =__NR_setgroups32 diff --git a/libc/arch-arm/syscalls/setitimer.S b/libc/arch-arm/syscalls/setitimer.S index 2345e5b87..4da2b4085 100644 --- a/libc/arch-arm/syscalls/setitimer.S +++ b/libc/arch-arm/syscalls/setitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setitimer) mov ip, r7 ldr r7, =__NR_setitimer diff --git a/libc/arch-arm/syscalls/setns.S b/libc/arch-arm/syscalls/setns.S index 7afbff065..891a0ac4f 100644 --- a/libc/arch-arm/syscalls/setns.S +++ b/libc/arch-arm/syscalls/setns.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setns) mov ip, r7 ldr r7, =__NR_setns diff --git a/libc/arch-arm/syscalls/setpgid.S b/libc/arch-arm/syscalls/setpgid.S index 1470a9dbd..e4edcdf31 100644 --- a/libc/arch-arm/syscalls/setpgid.S +++ b/libc/arch-arm/syscalls/setpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpgid) mov ip, r7 ldr r7, =__NR_setpgid diff --git a/libc/arch-arm/syscalls/setpriority.S b/libc/arch-arm/syscalls/setpriority.S index b7f47bea3..80d0d82c9 100644 --- a/libc/arch-arm/syscalls/setpriority.S +++ b/libc/arch-arm/syscalls/setpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpriority) mov ip, r7 ldr r7, =__NR_setpriority diff --git a/libc/arch-arm/syscalls/setregid.S b/libc/arch-arm/syscalls/setregid.S index a4323d472..b2cd345ea 100644 --- a/libc/arch-arm/syscalls/setregid.S +++ b/libc/arch-arm/syscalls/setregid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setregid) mov ip, r7 ldr r7, =__NR_setregid32 diff --git a/libc/arch-arm/syscalls/setresgid.S b/libc/arch-arm/syscalls/setresgid.S index a578440c8..75a9f7511 100644 --- a/libc/arch-arm/syscalls/setresgid.S +++ b/libc/arch-arm/syscalls/setresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresgid) mov ip, r7 ldr r7, =__NR_setresgid32 diff --git a/libc/arch-arm/syscalls/setresuid.S b/libc/arch-arm/syscalls/setresuid.S index 9798bc592..f3382f246 100644 --- a/libc/arch-arm/syscalls/setresuid.S +++ b/libc/arch-arm/syscalls/setresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresuid) mov ip, r7 ldr r7, =__NR_setresuid32 diff --git a/libc/arch-arm/syscalls/setreuid.S b/libc/arch-arm/syscalls/setreuid.S index fa83dc65d..1d866e995 100644 --- a/libc/arch-arm/syscalls/setreuid.S +++ b/libc/arch-arm/syscalls/setreuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setreuid) mov ip, r7 ldr r7, =__NR_setreuid32 diff --git a/libc/arch-arm/syscalls/setrlimit.S b/libc/arch-arm/syscalls/setrlimit.S index 0711aca20..0ddd7118f 100644 --- a/libc/arch-arm/syscalls/setrlimit.S +++ b/libc/arch-arm/syscalls/setrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setrlimit) mov ip, r7 ldr r7, =__NR_setrlimit diff --git a/libc/arch-arm/syscalls/setsid.S b/libc/arch-arm/syscalls/setsid.S index df6196b99..69b351fd4 100644 --- a/libc/arch-arm/syscalls/setsid.S +++ b/libc/arch-arm/syscalls/setsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsid) mov ip, r7 ldr r7, =__NR_setsid diff --git a/libc/arch-arm/syscalls/setsockopt.S b/libc/arch-arm/syscalls/setsockopt.S index b2d759790..87df622e8 100644 --- a/libc/arch-arm/syscalls/setsockopt.S +++ b/libc/arch-arm/syscalls/setsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsockopt) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/settimeofday.S b/libc/arch-arm/syscalls/settimeofday.S index af397616c..76697fc22 100644 --- a/libc/arch-arm/syscalls/settimeofday.S +++ b/libc/arch-arm/syscalls/settimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(settimeofday) mov ip, r7 ldr r7, =__NR_settimeofday diff --git a/libc/arch-arm/syscalls/setuid.S b/libc/arch-arm/syscalls/setuid.S index 1999c2b18..26d3ed184 100644 --- a/libc/arch-arm/syscalls/setuid.S +++ b/libc/arch-arm/syscalls/setuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setuid) mov ip, r7 ldr r7, =__NR_setuid32 diff --git a/libc/arch-arm/syscalls/setxattr.S b/libc/arch-arm/syscalls/setxattr.S index 022195d01..ec948ce18 100644 --- a/libc/arch-arm/syscalls/setxattr.S +++ b/libc/arch-arm/syscalls/setxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setxattr) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/shutdown.S b/libc/arch-arm/syscalls/shutdown.S index 744f38479..e9a27d42d 100644 --- a/libc/arch-arm/syscalls/shutdown.S +++ b/libc/arch-arm/syscalls/shutdown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(shutdown) mov ip, r7 ldr r7, =__NR_shutdown diff --git a/libc/arch-arm/syscalls/sigaltstack.S b/libc/arch-arm/syscalls/sigaltstack.S index d8777b411..18a1ffe2d 100644 --- a/libc/arch-arm/syscalls/sigaltstack.S +++ b/libc/arch-arm/syscalls/sigaltstack.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sigaltstack) mov ip, r7 ldr r7, =__NR_sigaltstack diff --git a/libc/arch-arm/syscalls/socketpair.S b/libc/arch-arm/syscalls/socketpair.S index f8963139b..66f0c3208 100644 --- a/libc/arch-arm/syscalls/socketpair.S +++ b/libc/arch-arm/syscalls/socketpair.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(socketpair) mov ip, r7 ldr r7, =__NR_socketpair diff --git a/libc/arch-arm/syscalls/splice.S b/libc/arch-arm/syscalls/splice.S index 782ba6c6f..6273138a2 100644 --- a/libc/arch-arm/syscalls/splice.S +++ b/libc/arch-arm/syscalls/splice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(splice) mov ip, sp stmfd sp!, {r4, r5, r6, r7} diff --git a/libc/arch-arm/syscalls/swapoff.S b/libc/arch-arm/syscalls/swapoff.S index f78bc7ffe..a497aad8a 100644 --- a/libc/arch-arm/syscalls/swapoff.S +++ b/libc/arch-arm/syscalls/swapoff.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapoff) mov ip, r7 ldr r7, =__NR_swapoff diff --git a/libc/arch-arm/syscalls/swapon.S b/libc/arch-arm/syscalls/swapon.S index d28216ad3..ded2abc87 100644 --- a/libc/arch-arm/syscalls/swapon.S +++ b/libc/arch-arm/syscalls/swapon.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapon) mov ip, r7 ldr r7, =__NR_swapon diff --git a/libc/arch-arm/syscalls/symlinkat.S b/libc/arch-arm/syscalls/symlinkat.S index d81e43bad..cc91b8804 100644 --- a/libc/arch-arm/syscalls/symlinkat.S +++ b/libc/arch-arm/syscalls/symlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(symlinkat) mov ip, r7 ldr r7, =__NR_symlinkat diff --git a/libc/arch-arm/syscalls/sync.S b/libc/arch-arm/syscalls/sync.S index 279a19250..ab228553b 100644 --- a/libc/arch-arm/syscalls/sync.S +++ b/libc/arch-arm/syscalls/sync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sync) mov ip, r7 ldr r7, =__NR_sync diff --git a/libc/arch-arm/syscalls/sysinfo.S b/libc/arch-arm/syscalls/sysinfo.S index 6bee58334..f5fb4e666 100644 --- a/libc/arch-arm/syscalls/sysinfo.S +++ b/libc/arch-arm/syscalls/sysinfo.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sysinfo) mov ip, r7 ldr r7, =__NR_sysinfo diff --git a/libc/arch-arm/syscalls/tee.S b/libc/arch-arm/syscalls/tee.S index 91746176b..7e155dfe0 100644 --- a/libc/arch-arm/syscalls/tee.S +++ b/libc/arch-arm/syscalls/tee.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tee) mov ip, r7 ldr r7, =__NR_tee diff --git a/libc/arch-arm/syscalls/tgkill.S b/libc/arch-arm/syscalls/tgkill.S index 4ea04f590..98440b1ed 100644 --- a/libc/arch-arm/syscalls/tgkill.S +++ b/libc/arch-arm/syscalls/tgkill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tgkill) mov ip, r7 ldr r7, =__NR_tgkill diff --git a/libc/arch-arm/syscalls/timerfd_create.S b/libc/arch-arm/syscalls/timerfd_create.S index f5842e90e..9211b54b2 100644 --- a/libc/arch-arm/syscalls/timerfd_create.S +++ b/libc/arch-arm/syscalls/timerfd_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_create) mov ip, r7 ldr r7, =__NR_timerfd_create diff --git a/libc/arch-arm/syscalls/timerfd_gettime.S b/libc/arch-arm/syscalls/timerfd_gettime.S index 6f254e5c4..c27e008e7 100644 --- a/libc/arch-arm/syscalls/timerfd_gettime.S +++ b/libc/arch-arm/syscalls/timerfd_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_gettime) mov ip, r7 ldr r7, =__NR_timerfd_gettime diff --git a/libc/arch-arm/syscalls/timerfd_settime.S b/libc/arch-arm/syscalls/timerfd_settime.S index 75d175cca..7acd40832 100644 --- a/libc/arch-arm/syscalls/timerfd_settime.S +++ b/libc/arch-arm/syscalls/timerfd_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_settime) mov ip, r7 ldr r7, =__NR_timerfd_settime diff --git a/libc/arch-arm/syscalls/times.S b/libc/arch-arm/syscalls/times.S index 4792ad115..b5695c455 100644 --- a/libc/arch-arm/syscalls/times.S +++ b/libc/arch-arm/syscalls/times.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(times) mov ip, r7 ldr r7, =__NR_times diff --git a/libc/arch-arm/syscalls/truncate.S b/libc/arch-arm/syscalls/truncate.S index ff8fd19f2..791572282 100644 --- a/libc/arch-arm/syscalls/truncate.S +++ b/libc/arch-arm/syscalls/truncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(truncate) mov ip, r7 ldr r7, =__NR_truncate diff --git a/libc/arch-arm/syscalls/truncate64.S b/libc/arch-arm/syscalls/truncate64.S index 8fd08552b..d59374a80 100644 --- a/libc/arch-arm/syscalls/truncate64.S +++ b/libc/arch-arm/syscalls/truncate64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(truncate64) mov ip, r7 ldr r7, =__NR_truncate64 diff --git a/libc/arch-arm/syscalls/umask.S b/libc/arch-arm/syscalls/umask.S index 830af21eb..5b03fb35c 100644 --- a/libc/arch-arm/syscalls/umask.S +++ b/libc/arch-arm/syscalls/umask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umask) mov ip, r7 ldr r7, =__NR_umask diff --git a/libc/arch-arm/syscalls/umount2.S b/libc/arch-arm/syscalls/umount2.S index 4c0ce4d5b..841eb9748 100644 --- a/libc/arch-arm/syscalls/umount2.S +++ b/libc/arch-arm/syscalls/umount2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umount2) mov ip, r7 ldr r7, =__NR_umount2 diff --git a/libc/arch-arm/syscalls/uname.S b/libc/arch-arm/syscalls/uname.S index 20a6d7dac..76480b429 100644 --- a/libc/arch-arm/syscalls/uname.S +++ b/libc/arch-arm/syscalls/uname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(uname) mov ip, r7 ldr r7, =__NR_uname diff --git a/libc/arch-arm/syscalls/unlinkat.S b/libc/arch-arm/syscalls/unlinkat.S index 1c2741676..675976815 100644 --- a/libc/arch-arm/syscalls/unlinkat.S +++ b/libc/arch-arm/syscalls/unlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unlinkat) mov ip, r7 ldr r7, =__NR_unlinkat diff --git a/libc/arch-arm/syscalls/unshare.S b/libc/arch-arm/syscalls/unshare.S index 5ec104974..19a5b6a2e 100644 --- a/libc/arch-arm/syscalls/unshare.S +++ b/libc/arch-arm/syscalls/unshare.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unshare) mov ip, r7 ldr r7, =__NR_unshare diff --git a/libc/arch-arm/syscalls/utimensat.S b/libc/arch-arm/syscalls/utimensat.S index f0f834fc3..6d506880e 100644 --- a/libc/arch-arm/syscalls/utimensat.S +++ b/libc/arch-arm/syscalls/utimensat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(utimensat) mov ip, r7 ldr r7, =__NR_utimensat diff --git a/libc/arch-arm/syscalls/vfork.S b/libc/arch-arm/syscalls/vfork.S index e12fba55a..8543986c1 100644 --- a/libc/arch-arm/syscalls/vfork.S +++ b/libc/arch-arm/syscalls/vfork.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(vfork) mov ip, r7 ldr r7, =__NR_vfork diff --git a/libc/arch-arm/syscalls/vmsplice.S b/libc/arch-arm/syscalls/vmsplice.S index 3b8962310..8239158bf 100644 --- a/libc/arch-arm/syscalls/vmsplice.S +++ b/libc/arch-arm/syscalls/vmsplice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(vmsplice) mov ip, r7 ldr r7, =__NR_vmsplice diff --git a/libc/arch-arm/syscalls/wait4.S b/libc/arch-arm/syscalls/wait4.S index a197c2e5d..ffb2587ab 100644 --- a/libc/arch-arm/syscalls/wait4.S +++ b/libc/arch-arm/syscalls/wait4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(wait4) mov ip, r7 ldr r7, =__NR_wait4 diff --git a/libc/arch-arm/syscalls/write.S b/libc/arch-arm/syscalls/write.S index ed7cfa2e4..8da1176ca 100644 --- a/libc/arch-arm/syscalls/write.S +++ b/libc/arch-arm/syscalls/write.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(write) mov ip, r7 ldr r7, =__NR_write diff --git a/libc/arch-arm/syscalls/writev.S b/libc/arch-arm/syscalls/writev.S index 8cc506f60..f17ad9429 100644 --- a/libc/arch-arm/syscalls/writev.S +++ b/libc/arch-arm/syscalls/writev.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(writev) mov ip, r7 ldr r7, =__NR_writev diff --git a/libc/arch-arm64/syscalls/__accept4.S b/libc/arch-arm64/syscalls/__accept4.S index 1c2a674c2..bee9fdaab 100644 --- a/libc/arch-arm64/syscalls/__accept4.S +++ b/libc/arch-arm64/syscalls/__accept4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__accept4) mov x8, __NR_accept4 svc #0 diff --git a/libc/arch-arm64/syscalls/__brk.S b/libc/arch-arm64/syscalls/__brk.S index 85ed76721..e91e76232 100644 --- a/libc/arch-arm64/syscalls/__brk.S +++ b/libc/arch-arm64/syscalls/__brk.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__brk) mov x8, __NR_brk svc #0 diff --git a/libc/arch-arm64/syscalls/__clock_gettime.S b/libc/arch-arm64/syscalls/__clock_gettime.S index f3466488a..d4a65e8a1 100644 --- a/libc/arch-arm64/syscalls/__clock_gettime.S +++ b/libc/arch-arm64/syscalls/__clock_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__clock_gettime) mov x8, __NR_clock_gettime svc #0 diff --git a/libc/arch-arm64/syscalls/__connect.S b/libc/arch-arm64/syscalls/__connect.S index 0d664f003..4f19dc756 100644 --- a/libc/arch-arm64/syscalls/__connect.S +++ b/libc/arch-arm64/syscalls/__connect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__connect) mov x8, __NR_connect svc #0 diff --git a/libc/arch-arm64/syscalls/__epoll_pwait.S b/libc/arch-arm64/syscalls/__epoll_pwait.S index 45275c0d6..7f40fbc98 100644 --- a/libc/arch-arm64/syscalls/__epoll_pwait.S +++ b/libc/arch-arm64/syscalls/__epoll_pwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__epoll_pwait) mov x8, __NR_epoll_pwait svc #0 diff --git a/libc/arch-arm64/syscalls/__exit.S b/libc/arch-arm64/syscalls/__exit.S index e3585132f..30849ce01 100644 --- a/libc/arch-arm64/syscalls/__exit.S +++ b/libc/arch-arm64/syscalls/__exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__exit) mov x8, __NR_exit svc #0 diff --git a/libc/arch-arm64/syscalls/__getcpu.S b/libc/arch-arm64/syscalls/__getcpu.S index 5e4368fb8..482191708 100644 --- a/libc/arch-arm64/syscalls/__getcpu.S +++ b/libc/arch-arm64/syscalls/__getcpu.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcpu) mov x8, __NR_getcpu svc #0 diff --git a/libc/arch-arm64/syscalls/__getcwd.S b/libc/arch-arm64/syscalls/__getcwd.S index bd4fbaaa3..f0212a288 100644 --- a/libc/arch-arm64/syscalls/__getcwd.S +++ b/libc/arch-arm64/syscalls/__getcwd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcwd) mov x8, __NR_getcwd svc #0 diff --git a/libc/arch-arm64/syscalls/__getdents64.S b/libc/arch-arm64/syscalls/__getdents64.S index bf0f9a4ce..0061cd69f 100644 --- a/libc/arch-arm64/syscalls/__getdents64.S +++ b/libc/arch-arm64/syscalls/__getdents64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getdents64) mov x8, __NR_getdents64 svc #0 diff --git a/libc/arch-arm64/syscalls/__getpid.S b/libc/arch-arm64/syscalls/__getpid.S index c3003c302..011d82d47 100644 --- a/libc/arch-arm64/syscalls/__getpid.S +++ b/libc/arch-arm64/syscalls/__getpid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpid) mov x8, __NR_getpid svc #0 diff --git a/libc/arch-arm64/syscalls/__getpriority.S b/libc/arch-arm64/syscalls/__getpriority.S index 57ceabf08..80188b301 100644 --- a/libc/arch-arm64/syscalls/__getpriority.S +++ b/libc/arch-arm64/syscalls/__getpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpriority) mov x8, __NR_getpriority svc #0 diff --git a/libc/arch-arm64/syscalls/__gettimeofday.S b/libc/arch-arm64/syscalls/__gettimeofday.S index 6582c49a2..7d1b5d3cb 100644 --- a/libc/arch-arm64/syscalls/__gettimeofday.S +++ b/libc/arch-arm64/syscalls/__gettimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__gettimeofday) mov x8, __NR_gettimeofday svc #0 diff --git a/libc/arch-arm64/syscalls/__ioctl.S b/libc/arch-arm64/syscalls/__ioctl.S index f63255525..3d42f1a5b 100644 --- a/libc/arch-arm64/syscalls/__ioctl.S +++ b/libc/arch-arm64/syscalls/__ioctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ioctl) mov x8, __NR_ioctl svc #0 diff --git a/libc/arch-arm64/syscalls/__openat.S b/libc/arch-arm64/syscalls/__openat.S index e1b0da3c6..1ff0b4871 100644 --- a/libc/arch-arm64/syscalls/__openat.S +++ b/libc/arch-arm64/syscalls/__openat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__openat) mov x8, __NR_openat svc #0 diff --git a/libc/arch-arm64/syscalls/__ppoll.S b/libc/arch-arm64/syscalls/__ppoll.S index 31e5578f8..9517ce3fd 100644 --- a/libc/arch-arm64/syscalls/__ppoll.S +++ b/libc/arch-arm64/syscalls/__ppoll.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ppoll) mov x8, __NR_ppoll svc #0 diff --git a/libc/arch-arm64/syscalls/__pselect6.S b/libc/arch-arm64/syscalls/__pselect6.S index b0e4770fe..7e14e02df 100644 --- a/libc/arch-arm64/syscalls/__pselect6.S +++ b/libc/arch-arm64/syscalls/__pselect6.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__pselect6) mov x8, __NR_pselect6 svc #0 diff --git a/libc/arch-arm64/syscalls/__ptrace.S b/libc/arch-arm64/syscalls/__ptrace.S index 054bb6f01..b325e291d 100644 --- a/libc/arch-arm64/syscalls/__ptrace.S +++ b/libc/arch-arm64/syscalls/__ptrace.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ptrace) mov x8, __NR_ptrace svc #0 diff --git a/libc/arch-arm64/syscalls/__reboot.S b/libc/arch-arm64/syscalls/__reboot.S index e24553c98..04b18c9b9 100644 --- a/libc/arch-arm64/syscalls/__reboot.S +++ b/libc/arch-arm64/syscalls/__reboot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__reboot) mov x8, __NR_reboot svc #0 diff --git a/libc/arch-arm64/syscalls/__rt_sigaction.S b/libc/arch-arm64/syscalls/__rt_sigaction.S index 3d84544cf..3def55839 100644 --- a/libc/arch-arm64/syscalls/__rt_sigaction.S +++ b/libc/arch-arm64/syscalls/__rt_sigaction.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigaction) mov x8, __NR_rt_sigaction svc #0 diff --git a/libc/arch-arm64/syscalls/__rt_sigpending.S b/libc/arch-arm64/syscalls/__rt_sigpending.S index 60f0a1040..3ac0cb890 100644 --- a/libc/arch-arm64/syscalls/__rt_sigpending.S +++ b/libc/arch-arm64/syscalls/__rt_sigpending.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigpending) mov x8, __NR_rt_sigpending svc #0 diff --git a/libc/arch-arm64/syscalls/__rt_sigprocmask.S b/libc/arch-arm64/syscalls/__rt_sigprocmask.S index 7f5b3ac56..72c7ea6fb 100644 --- a/libc/arch-arm64/syscalls/__rt_sigprocmask.S +++ b/libc/arch-arm64/syscalls/__rt_sigprocmask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigprocmask) mov x8, __NR_rt_sigprocmask svc #0 diff --git a/libc/arch-arm64/syscalls/__rt_sigsuspend.S b/libc/arch-arm64/syscalls/__rt_sigsuspend.S index 08b1197ee..a289713f5 100644 --- a/libc/arch-arm64/syscalls/__rt_sigsuspend.S +++ b/libc/arch-arm64/syscalls/__rt_sigsuspend.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigsuspend) mov x8, __NR_rt_sigsuspend svc #0 diff --git a/libc/arch-arm64/syscalls/__rt_sigtimedwait.S b/libc/arch-arm64/syscalls/__rt_sigtimedwait.S index 8bc9a7a66..c61e4ac99 100644 --- a/libc/arch-arm64/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-arm64/syscalls/__rt_sigtimedwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigtimedwait) mov x8, __NR_rt_sigtimedwait svc #0 diff --git a/libc/arch-arm64/syscalls/__sched_getaffinity.S b/libc/arch-arm64/syscalls/__sched_getaffinity.S index c0d392c3a..5bee77e70 100644 --- a/libc/arch-arm64/syscalls/__sched_getaffinity.S +++ b/libc/arch-arm64/syscalls/__sched_getaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__sched_getaffinity) mov x8, __NR_sched_getaffinity svc #0 diff --git a/libc/arch-arm64/syscalls/__set_tid_address.S b/libc/arch-arm64/syscalls/__set_tid_address.S index 296c907bb..e4790bf65 100644 --- a/libc/arch-arm64/syscalls/__set_tid_address.S +++ b/libc/arch-arm64/syscalls/__set_tid_address.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__set_tid_address) mov x8, __NR_set_tid_address svc #0 diff --git a/libc/arch-arm64/syscalls/__signalfd4.S b/libc/arch-arm64/syscalls/__signalfd4.S index 393200370..a977a6cb6 100644 --- a/libc/arch-arm64/syscalls/__signalfd4.S +++ b/libc/arch-arm64/syscalls/__signalfd4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__signalfd4) mov x8, __NR_signalfd4 svc #0 diff --git a/libc/arch-arm64/syscalls/__socket.S b/libc/arch-arm64/syscalls/__socket.S index db7f2aab1..f8bb2ac2e 100644 --- a/libc/arch-arm64/syscalls/__socket.S +++ b/libc/arch-arm64/syscalls/__socket.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__socket) mov x8, __NR_socket svc #0 diff --git a/libc/arch-arm64/syscalls/__timer_create.S b/libc/arch-arm64/syscalls/__timer_create.S index a5e69e35f..bb54952d6 100644 --- a/libc/arch-arm64/syscalls/__timer_create.S +++ b/libc/arch-arm64/syscalls/__timer_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_create) mov x8, __NR_timer_create svc #0 diff --git a/libc/arch-arm64/syscalls/__timer_delete.S b/libc/arch-arm64/syscalls/__timer_delete.S index 44a7481cf..47d82f253 100644 --- a/libc/arch-arm64/syscalls/__timer_delete.S +++ b/libc/arch-arm64/syscalls/__timer_delete.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_delete) mov x8, __NR_timer_delete svc #0 diff --git a/libc/arch-arm64/syscalls/__timer_getoverrun.S b/libc/arch-arm64/syscalls/__timer_getoverrun.S index e1d959a19..9c0611284 100644 --- a/libc/arch-arm64/syscalls/__timer_getoverrun.S +++ b/libc/arch-arm64/syscalls/__timer_getoverrun.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_getoverrun) mov x8, __NR_timer_getoverrun svc #0 diff --git a/libc/arch-arm64/syscalls/__timer_gettime.S b/libc/arch-arm64/syscalls/__timer_gettime.S index 763229059..e7c7cfe40 100644 --- a/libc/arch-arm64/syscalls/__timer_gettime.S +++ b/libc/arch-arm64/syscalls/__timer_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_gettime) mov x8, __NR_timer_gettime svc #0 diff --git a/libc/arch-arm64/syscalls/__timer_settime.S b/libc/arch-arm64/syscalls/__timer_settime.S index 92e4a7625..d4a4996f8 100644 --- a/libc/arch-arm64/syscalls/__timer_settime.S +++ b/libc/arch-arm64/syscalls/__timer_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_settime) mov x8, __NR_timer_settime svc #0 diff --git a/libc/arch-arm64/syscalls/__waitid.S b/libc/arch-arm64/syscalls/__waitid.S index 9267239c2..5bff48804 100644 --- a/libc/arch-arm64/syscalls/__waitid.S +++ b/libc/arch-arm64/syscalls/__waitid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__waitid) mov x8, __NR_waitid svc #0 diff --git a/libc/arch-arm64/syscalls/_exit.S b/libc/arch-arm64/syscalls/_exit.S index 38b073bbc..e88e77acd 100644 --- a/libc/arch-arm64/syscalls/_exit.S +++ b/libc/arch-arm64/syscalls/_exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(_exit) mov x8, __NR_exit_group svc #0 diff --git a/libc/arch-arm64/syscalls/acct.S b/libc/arch-arm64/syscalls/acct.S index 15e30861c..97a8a0c85 100644 --- a/libc/arch-arm64/syscalls/acct.S +++ b/libc/arch-arm64/syscalls/acct.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(acct) mov x8, __NR_acct svc #0 diff --git a/libc/arch-arm64/syscalls/bind.S b/libc/arch-arm64/syscalls/bind.S index b3925db90..1d6d90189 100644 --- a/libc/arch-arm64/syscalls/bind.S +++ b/libc/arch-arm64/syscalls/bind.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(bind) mov x8, __NR_bind svc #0 diff --git a/libc/arch-arm64/syscalls/capget.S b/libc/arch-arm64/syscalls/capget.S index b897e5dc6..de849297a 100644 --- a/libc/arch-arm64/syscalls/capget.S +++ b/libc/arch-arm64/syscalls/capget.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capget) mov x8, __NR_capget svc #0 diff --git a/libc/arch-arm64/syscalls/capset.S b/libc/arch-arm64/syscalls/capset.S index 1d94aa3e0..1616f8f07 100644 --- a/libc/arch-arm64/syscalls/capset.S +++ b/libc/arch-arm64/syscalls/capset.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capset) mov x8, __NR_capset svc #0 diff --git a/libc/arch-arm64/syscalls/chdir.S b/libc/arch-arm64/syscalls/chdir.S index a7bf6c279..ccaa2e283 100644 --- a/libc/arch-arm64/syscalls/chdir.S +++ b/libc/arch-arm64/syscalls/chdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chdir) mov x8, __NR_chdir svc #0 diff --git a/libc/arch-arm64/syscalls/chroot.S b/libc/arch-arm64/syscalls/chroot.S index 98bd5d1bf..bede17204 100644 --- a/libc/arch-arm64/syscalls/chroot.S +++ b/libc/arch-arm64/syscalls/chroot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chroot) mov x8, __NR_chroot svc #0 diff --git a/libc/arch-arm64/syscalls/clock_getres.S b/libc/arch-arm64/syscalls/clock_getres.S index b6e7e5618..3944a155b 100644 --- a/libc/arch-arm64/syscalls/clock_getres.S +++ b/libc/arch-arm64/syscalls/clock_getres.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_getres) mov x8, __NR_clock_getres svc #0 diff --git a/libc/arch-arm64/syscalls/clock_nanosleep.S b/libc/arch-arm64/syscalls/clock_nanosleep.S index b64ff6824..2182f6713 100644 --- a/libc/arch-arm64/syscalls/clock_nanosleep.S +++ b/libc/arch-arm64/syscalls/clock_nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_nanosleep) mov x8, __NR_clock_nanosleep svc #0 diff --git a/libc/arch-arm64/syscalls/clock_settime.S b/libc/arch-arm64/syscalls/clock_settime.S index adc168020..14a662b29 100644 --- a/libc/arch-arm64/syscalls/clock_settime.S +++ b/libc/arch-arm64/syscalls/clock_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_settime) mov x8, __NR_clock_settime svc #0 diff --git a/libc/arch-arm64/syscalls/close.S b/libc/arch-arm64/syscalls/close.S index b4b72d9ea..da9a151af 100644 --- a/libc/arch-arm64/syscalls/close.S +++ b/libc/arch-arm64/syscalls/close.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(close) mov x8, __NR_close svc #0 diff --git a/libc/arch-arm64/syscalls/delete_module.S b/libc/arch-arm64/syscalls/delete_module.S index ed51847de..5dcd07f5c 100644 --- a/libc/arch-arm64/syscalls/delete_module.S +++ b/libc/arch-arm64/syscalls/delete_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(delete_module) mov x8, __NR_delete_module svc #0 diff --git a/libc/arch-arm64/syscalls/dup.S b/libc/arch-arm64/syscalls/dup.S index 9584c513a..33a1b6597 100644 --- a/libc/arch-arm64/syscalls/dup.S +++ b/libc/arch-arm64/syscalls/dup.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup) mov x8, __NR_dup svc #0 diff --git a/libc/arch-arm64/syscalls/dup3.S b/libc/arch-arm64/syscalls/dup3.S index e303fbad2..441fec9f1 100644 --- a/libc/arch-arm64/syscalls/dup3.S +++ b/libc/arch-arm64/syscalls/dup3.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup3) mov x8, __NR_dup3 svc #0 diff --git a/libc/arch-arm64/syscalls/epoll_create1.S b/libc/arch-arm64/syscalls/epoll_create1.S index 4ca8bfa87..d314f5557 100644 --- a/libc/arch-arm64/syscalls/epoll_create1.S +++ b/libc/arch-arm64/syscalls/epoll_create1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_create1) mov x8, __NR_epoll_create1 svc #0 diff --git a/libc/arch-arm64/syscalls/epoll_ctl.S b/libc/arch-arm64/syscalls/epoll_ctl.S index c1c0dbaad..004c0666e 100644 --- a/libc/arch-arm64/syscalls/epoll_ctl.S +++ b/libc/arch-arm64/syscalls/epoll_ctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_ctl) mov x8, __NR_epoll_ctl svc #0 diff --git a/libc/arch-arm64/syscalls/eventfd.S b/libc/arch-arm64/syscalls/eventfd.S index ace608e68..11e97d01f 100644 --- a/libc/arch-arm64/syscalls/eventfd.S +++ b/libc/arch-arm64/syscalls/eventfd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(eventfd) mov x8, __NR_eventfd2 svc #0 diff --git a/libc/arch-arm64/syscalls/execve.S b/libc/arch-arm64/syscalls/execve.S index ab0cb5707..7b6d943f4 100644 --- a/libc/arch-arm64/syscalls/execve.S +++ b/libc/arch-arm64/syscalls/execve.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(execve) mov x8, __NR_execve svc #0 diff --git a/libc/arch-arm64/syscalls/faccessat.S b/libc/arch-arm64/syscalls/faccessat.S index 30a385238..7bd866546 100644 --- a/libc/arch-arm64/syscalls/faccessat.S +++ b/libc/arch-arm64/syscalls/faccessat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(faccessat) mov x8, __NR_faccessat svc #0 diff --git a/libc/arch-arm64/syscalls/fallocate.S b/libc/arch-arm64/syscalls/fallocate.S index 3092b3414..d8795ae1e 100644 --- a/libc/arch-arm64/syscalls/fallocate.S +++ b/libc/arch-arm64/syscalls/fallocate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fallocate) mov x8, __NR_fallocate svc #0 diff --git a/libc/arch-arm64/syscalls/fchdir.S b/libc/arch-arm64/syscalls/fchdir.S index f7687f8b2..7739fedef 100644 --- a/libc/arch-arm64/syscalls/fchdir.S +++ b/libc/arch-arm64/syscalls/fchdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchdir) mov x8, __NR_fchdir svc #0 diff --git a/libc/arch-arm64/syscalls/fchmod.S b/libc/arch-arm64/syscalls/fchmod.S index acc671881..3eec6cbb5 100644 --- a/libc/arch-arm64/syscalls/fchmod.S +++ b/libc/arch-arm64/syscalls/fchmod.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmod) mov x8, __NR_fchmod svc #0 diff --git a/libc/arch-arm64/syscalls/fchmodat.S b/libc/arch-arm64/syscalls/fchmodat.S index 23c2fd5f0..f2f285eda 100644 --- a/libc/arch-arm64/syscalls/fchmodat.S +++ b/libc/arch-arm64/syscalls/fchmodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmodat) mov x8, __NR_fchmodat svc #0 diff --git a/libc/arch-arm64/syscalls/fchown.S b/libc/arch-arm64/syscalls/fchown.S index 8e9db6215..a689ba0c1 100644 --- a/libc/arch-arm64/syscalls/fchown.S +++ b/libc/arch-arm64/syscalls/fchown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchown) mov x8, __NR_fchown svc #0 diff --git a/libc/arch-arm64/syscalls/fchownat.S b/libc/arch-arm64/syscalls/fchownat.S index 3cf2c3dba..7ede083d7 100644 --- a/libc/arch-arm64/syscalls/fchownat.S +++ b/libc/arch-arm64/syscalls/fchownat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchownat) mov x8, __NR_fchownat svc #0 diff --git a/libc/arch-arm64/syscalls/fcntl.S b/libc/arch-arm64/syscalls/fcntl.S index 45eff74fb..257c765b5 100644 --- a/libc/arch-arm64/syscalls/fcntl.S +++ b/libc/arch-arm64/syscalls/fcntl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fcntl) mov x8, __NR_fcntl svc #0 diff --git a/libc/arch-arm64/syscalls/fdatasync.S b/libc/arch-arm64/syscalls/fdatasync.S index 77b76c49d..233abda7b 100644 --- a/libc/arch-arm64/syscalls/fdatasync.S +++ b/libc/arch-arm64/syscalls/fdatasync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fdatasync) mov x8, __NR_fdatasync svc #0 diff --git a/libc/arch-arm64/syscalls/fgetxattr.S b/libc/arch-arm64/syscalls/fgetxattr.S index 1f8edb69c..bd579ff45 100644 --- a/libc/arch-arm64/syscalls/fgetxattr.S +++ b/libc/arch-arm64/syscalls/fgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fgetxattr) mov x8, __NR_fgetxattr svc #0 diff --git a/libc/arch-arm64/syscalls/flistxattr.S b/libc/arch-arm64/syscalls/flistxattr.S index 997529eb3..95ccbe269 100644 --- a/libc/arch-arm64/syscalls/flistxattr.S +++ b/libc/arch-arm64/syscalls/flistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flistxattr) mov x8, __NR_flistxattr svc #0 diff --git a/libc/arch-arm64/syscalls/flock.S b/libc/arch-arm64/syscalls/flock.S index 0e1c3f5e7..2151d6cca 100644 --- a/libc/arch-arm64/syscalls/flock.S +++ b/libc/arch-arm64/syscalls/flock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flock) mov x8, __NR_flock svc #0 diff --git a/libc/arch-arm64/syscalls/fremovexattr.S b/libc/arch-arm64/syscalls/fremovexattr.S index d43430fd6..8dd107d06 100644 --- a/libc/arch-arm64/syscalls/fremovexattr.S +++ b/libc/arch-arm64/syscalls/fremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fremovexattr) mov x8, __NR_fremovexattr svc #0 diff --git a/libc/arch-arm64/syscalls/fsetxattr.S b/libc/arch-arm64/syscalls/fsetxattr.S index f40f87502..9e546869a 100644 --- a/libc/arch-arm64/syscalls/fsetxattr.S +++ b/libc/arch-arm64/syscalls/fsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsetxattr) mov x8, __NR_fsetxattr svc #0 diff --git a/libc/arch-arm64/syscalls/fstat64.S b/libc/arch-arm64/syscalls/fstat64.S index 9afe95bab..f354e1335 100644 --- a/libc/arch-arm64/syscalls/fstat64.S +++ b/libc/arch-arm64/syscalls/fstat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstat64) mov x8, __NR_fstat svc #0 diff --git a/libc/arch-arm64/syscalls/fstatat64.S b/libc/arch-arm64/syscalls/fstatat64.S index 30efd3bd8..2fe056e43 100644 --- a/libc/arch-arm64/syscalls/fstatat64.S +++ b/libc/arch-arm64/syscalls/fstatat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstatat64) mov x8, __NR_newfstatat svc #0 diff --git a/libc/arch-arm64/syscalls/fstatfs64.S b/libc/arch-arm64/syscalls/fstatfs64.S index 67ae67e40..c67ffd691 100644 --- a/libc/arch-arm64/syscalls/fstatfs64.S +++ b/libc/arch-arm64/syscalls/fstatfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstatfs64) mov x8, __NR_fstatfs svc #0 diff --git a/libc/arch-arm64/syscalls/fsync.S b/libc/arch-arm64/syscalls/fsync.S index e22589ec2..ae2fc61df 100644 --- a/libc/arch-arm64/syscalls/fsync.S +++ b/libc/arch-arm64/syscalls/fsync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsync) mov x8, __NR_fsync svc #0 diff --git a/libc/arch-arm64/syscalls/ftruncate.S b/libc/arch-arm64/syscalls/ftruncate.S index b45a17086..adf87fe4e 100644 --- a/libc/arch-arm64/syscalls/ftruncate.S +++ b/libc/arch-arm64/syscalls/ftruncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(ftruncate) mov x8, __NR_ftruncate svc #0 diff --git a/libc/arch-arm64/syscalls/getegid.S b/libc/arch-arm64/syscalls/getegid.S index 675731c69..5066cae47 100644 --- a/libc/arch-arm64/syscalls/getegid.S +++ b/libc/arch-arm64/syscalls/getegid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getegid) mov x8, __NR_getegid svc #0 diff --git a/libc/arch-arm64/syscalls/geteuid.S b/libc/arch-arm64/syscalls/geteuid.S index 8d9461ee9..25b1ea9fd 100644 --- a/libc/arch-arm64/syscalls/geteuid.S +++ b/libc/arch-arm64/syscalls/geteuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(geteuid) mov x8, __NR_geteuid svc #0 diff --git a/libc/arch-arm64/syscalls/getgid.S b/libc/arch-arm64/syscalls/getgid.S index 4653fd8fb..3f49cb44c 100644 --- a/libc/arch-arm64/syscalls/getgid.S +++ b/libc/arch-arm64/syscalls/getgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgid) mov x8, __NR_getgid svc #0 diff --git a/libc/arch-arm64/syscalls/getgroups.S b/libc/arch-arm64/syscalls/getgroups.S index f22f1e91c..3df4974cc 100644 --- a/libc/arch-arm64/syscalls/getgroups.S +++ b/libc/arch-arm64/syscalls/getgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgroups) mov x8, __NR_getgroups svc #0 diff --git a/libc/arch-arm64/syscalls/getitimer.S b/libc/arch-arm64/syscalls/getitimer.S index 25d0b381e..70cb73150 100644 --- a/libc/arch-arm64/syscalls/getitimer.S +++ b/libc/arch-arm64/syscalls/getitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getitimer) mov x8, __NR_getitimer svc #0 diff --git a/libc/arch-arm64/syscalls/getpeername.S b/libc/arch-arm64/syscalls/getpeername.S index aefd0c507..eefb24af5 100644 --- a/libc/arch-arm64/syscalls/getpeername.S +++ b/libc/arch-arm64/syscalls/getpeername.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpeername) mov x8, __NR_getpeername svc #0 diff --git a/libc/arch-arm64/syscalls/getpgid.S b/libc/arch-arm64/syscalls/getpgid.S index 4c750fbe0..d12ac5270 100644 --- a/libc/arch-arm64/syscalls/getpgid.S +++ b/libc/arch-arm64/syscalls/getpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpgid) mov x8, __NR_getpgid svc #0 diff --git a/libc/arch-arm64/syscalls/getppid.S b/libc/arch-arm64/syscalls/getppid.S index 540ecc411..af8965beb 100644 --- a/libc/arch-arm64/syscalls/getppid.S +++ b/libc/arch-arm64/syscalls/getppid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getppid) mov x8, __NR_getppid svc #0 diff --git a/libc/arch-arm64/syscalls/getresgid.S b/libc/arch-arm64/syscalls/getresgid.S index 3ce5799f6..3c1c0c098 100644 --- a/libc/arch-arm64/syscalls/getresgid.S +++ b/libc/arch-arm64/syscalls/getresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresgid) mov x8, __NR_getresgid svc #0 diff --git a/libc/arch-arm64/syscalls/getresuid.S b/libc/arch-arm64/syscalls/getresuid.S index 56851cc27..f50e060fa 100644 --- a/libc/arch-arm64/syscalls/getresuid.S +++ b/libc/arch-arm64/syscalls/getresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresuid) mov x8, __NR_getresuid svc #0 diff --git a/libc/arch-arm64/syscalls/getrlimit.S b/libc/arch-arm64/syscalls/getrlimit.S index 1f7477361..b759912b7 100644 --- a/libc/arch-arm64/syscalls/getrlimit.S +++ b/libc/arch-arm64/syscalls/getrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrlimit) mov x8, __NR_getrlimit svc #0 diff --git a/libc/arch-arm64/syscalls/getrusage.S b/libc/arch-arm64/syscalls/getrusage.S index 8154e4a0d..1a0d30f16 100644 --- a/libc/arch-arm64/syscalls/getrusage.S +++ b/libc/arch-arm64/syscalls/getrusage.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrusage) mov x8, __NR_getrusage svc #0 diff --git a/libc/arch-arm64/syscalls/getsid.S b/libc/arch-arm64/syscalls/getsid.S index f99623fe7..3c3d7530b 100644 --- a/libc/arch-arm64/syscalls/getsid.S +++ b/libc/arch-arm64/syscalls/getsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsid) mov x8, __NR_getsid svc #0 diff --git a/libc/arch-arm64/syscalls/getsockname.S b/libc/arch-arm64/syscalls/getsockname.S index e8bc00668..a337986d6 100644 --- a/libc/arch-arm64/syscalls/getsockname.S +++ b/libc/arch-arm64/syscalls/getsockname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockname) mov x8, __NR_getsockname svc #0 diff --git a/libc/arch-arm64/syscalls/getsockopt.S b/libc/arch-arm64/syscalls/getsockopt.S index 4559d1de9..4b3abd5c9 100644 --- a/libc/arch-arm64/syscalls/getsockopt.S +++ b/libc/arch-arm64/syscalls/getsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockopt) mov x8, __NR_getsockopt svc #0 diff --git a/libc/arch-arm64/syscalls/getuid.S b/libc/arch-arm64/syscalls/getuid.S index 4e37d47c2..a9193c5cc 100644 --- a/libc/arch-arm64/syscalls/getuid.S +++ b/libc/arch-arm64/syscalls/getuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getuid) mov x8, __NR_getuid svc #0 diff --git a/libc/arch-arm64/syscalls/getxattr.S b/libc/arch-arm64/syscalls/getxattr.S index 3f6995683..afa81ef85 100644 --- a/libc/arch-arm64/syscalls/getxattr.S +++ b/libc/arch-arm64/syscalls/getxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getxattr) mov x8, __NR_getxattr svc #0 diff --git a/libc/arch-arm64/syscalls/init_module.S b/libc/arch-arm64/syscalls/init_module.S index cc1a0da20..bf0f7d330 100644 --- a/libc/arch-arm64/syscalls/init_module.S +++ b/libc/arch-arm64/syscalls/init_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(init_module) mov x8, __NR_init_module svc #0 diff --git a/libc/arch-arm64/syscalls/inotify_add_watch.S b/libc/arch-arm64/syscalls/inotify_add_watch.S index fbc8dd4ef..dc30ae57d 100644 --- a/libc/arch-arm64/syscalls/inotify_add_watch.S +++ b/libc/arch-arm64/syscalls/inotify_add_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_add_watch) mov x8, __NR_inotify_add_watch svc #0 diff --git a/libc/arch-arm64/syscalls/inotify_init1.S b/libc/arch-arm64/syscalls/inotify_init1.S index 5726d0c4b..1b40ef2cb 100644 --- a/libc/arch-arm64/syscalls/inotify_init1.S +++ b/libc/arch-arm64/syscalls/inotify_init1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_init1) mov x8, __NR_inotify_init1 svc #0 diff --git a/libc/arch-arm64/syscalls/inotify_rm_watch.S b/libc/arch-arm64/syscalls/inotify_rm_watch.S index 37eabcf26..7c99e866d 100644 --- a/libc/arch-arm64/syscalls/inotify_rm_watch.S +++ b/libc/arch-arm64/syscalls/inotify_rm_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_rm_watch) mov x8, __NR_inotify_rm_watch svc #0 diff --git a/libc/arch-arm64/syscalls/kill.S b/libc/arch-arm64/syscalls/kill.S index 7fc2c5a74..e86e3a4d8 100644 --- a/libc/arch-arm64/syscalls/kill.S +++ b/libc/arch-arm64/syscalls/kill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(kill) mov x8, __NR_kill svc #0 diff --git a/libc/arch-arm64/syscalls/klogctl.S b/libc/arch-arm64/syscalls/klogctl.S index abbee5510..567db27fb 100644 --- a/libc/arch-arm64/syscalls/klogctl.S +++ b/libc/arch-arm64/syscalls/klogctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(klogctl) mov x8, __NR_syslog svc #0 diff --git a/libc/arch-arm64/syscalls/lgetxattr.S b/libc/arch-arm64/syscalls/lgetxattr.S index e1a760cb3..187462a7b 100644 --- a/libc/arch-arm64/syscalls/lgetxattr.S +++ b/libc/arch-arm64/syscalls/lgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lgetxattr) mov x8, __NR_lgetxattr svc #0 diff --git a/libc/arch-arm64/syscalls/linkat.S b/libc/arch-arm64/syscalls/linkat.S index c3e2cd894..7cfc2e036 100644 --- a/libc/arch-arm64/syscalls/linkat.S +++ b/libc/arch-arm64/syscalls/linkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(linkat) mov x8, __NR_linkat svc #0 diff --git a/libc/arch-arm64/syscalls/listen.S b/libc/arch-arm64/syscalls/listen.S index 9b7be2883..028b9bd42 100644 --- a/libc/arch-arm64/syscalls/listen.S +++ b/libc/arch-arm64/syscalls/listen.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listen) mov x8, __NR_listen svc #0 diff --git a/libc/arch-arm64/syscalls/listxattr.S b/libc/arch-arm64/syscalls/listxattr.S index a5e55c71a..335fafe82 100644 --- a/libc/arch-arm64/syscalls/listxattr.S +++ b/libc/arch-arm64/syscalls/listxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listxattr) mov x8, __NR_listxattr svc #0 diff --git a/libc/arch-arm64/syscalls/llistxattr.S b/libc/arch-arm64/syscalls/llistxattr.S index 447e2081f..e79674118 100644 --- a/libc/arch-arm64/syscalls/llistxattr.S +++ b/libc/arch-arm64/syscalls/llistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(llistxattr) mov x8, __NR_llistxattr svc #0 diff --git a/libc/arch-arm64/syscalls/lremovexattr.S b/libc/arch-arm64/syscalls/lremovexattr.S index 1f620dbee..9f4c02755 100644 --- a/libc/arch-arm64/syscalls/lremovexattr.S +++ b/libc/arch-arm64/syscalls/lremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lremovexattr) mov x8, __NR_lremovexattr svc #0 diff --git a/libc/arch-arm64/syscalls/lseek.S b/libc/arch-arm64/syscalls/lseek.S index 1b858b2aa..aa717687b 100644 --- a/libc/arch-arm64/syscalls/lseek.S +++ b/libc/arch-arm64/syscalls/lseek.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lseek) mov x8, __NR_lseek svc #0 diff --git a/libc/arch-arm64/syscalls/lsetxattr.S b/libc/arch-arm64/syscalls/lsetxattr.S index 8315bba6c..babf02d37 100644 --- a/libc/arch-arm64/syscalls/lsetxattr.S +++ b/libc/arch-arm64/syscalls/lsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lsetxattr) mov x8, __NR_lsetxattr svc #0 diff --git a/libc/arch-arm64/syscalls/madvise.S b/libc/arch-arm64/syscalls/madvise.S index 17282c008..3d393f1d8 100644 --- a/libc/arch-arm64/syscalls/madvise.S +++ b/libc/arch-arm64/syscalls/madvise.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(madvise) mov x8, __NR_madvise svc #0 diff --git a/libc/arch-arm64/syscalls/mincore.S b/libc/arch-arm64/syscalls/mincore.S index abdcf6c20..443257486 100644 --- a/libc/arch-arm64/syscalls/mincore.S +++ b/libc/arch-arm64/syscalls/mincore.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mincore) mov x8, __NR_mincore svc #0 diff --git a/libc/arch-arm64/syscalls/mkdirat.S b/libc/arch-arm64/syscalls/mkdirat.S index d6bafca8c..36c876d87 100644 --- a/libc/arch-arm64/syscalls/mkdirat.S +++ b/libc/arch-arm64/syscalls/mkdirat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mkdirat) mov x8, __NR_mkdirat svc #0 diff --git a/libc/arch-arm64/syscalls/mknodat.S b/libc/arch-arm64/syscalls/mknodat.S index 598e789ed..e0584dba3 100644 --- a/libc/arch-arm64/syscalls/mknodat.S +++ b/libc/arch-arm64/syscalls/mknodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mknodat) mov x8, __NR_mknodat svc #0 diff --git a/libc/arch-arm64/syscalls/mlock.S b/libc/arch-arm64/syscalls/mlock.S index 631ce02a6..10ddb077b 100644 --- a/libc/arch-arm64/syscalls/mlock.S +++ b/libc/arch-arm64/syscalls/mlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlock) mov x8, __NR_mlock svc #0 diff --git a/libc/arch-arm64/syscalls/mlockall.S b/libc/arch-arm64/syscalls/mlockall.S index 42dac9e47..3602d7170 100644 --- a/libc/arch-arm64/syscalls/mlockall.S +++ b/libc/arch-arm64/syscalls/mlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlockall) mov x8, __NR_mlockall svc #0 diff --git a/libc/arch-arm64/syscalls/mmap.S b/libc/arch-arm64/syscalls/mmap.S index da18e1006..e4e39ca69 100644 --- a/libc/arch-arm64/syscalls/mmap.S +++ b/libc/arch-arm64/syscalls/mmap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mmap) mov x8, __NR_mmap svc #0 diff --git a/libc/arch-arm64/syscalls/mount.S b/libc/arch-arm64/syscalls/mount.S index c43a71f1f..9b53754dc 100644 --- a/libc/arch-arm64/syscalls/mount.S +++ b/libc/arch-arm64/syscalls/mount.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mount) mov x8, __NR_mount svc #0 diff --git a/libc/arch-arm64/syscalls/mprotect.S b/libc/arch-arm64/syscalls/mprotect.S index a7d26dd01..788d46e87 100644 --- a/libc/arch-arm64/syscalls/mprotect.S +++ b/libc/arch-arm64/syscalls/mprotect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mprotect) mov x8, __NR_mprotect svc #0 diff --git a/libc/arch-arm64/syscalls/mremap.S b/libc/arch-arm64/syscalls/mremap.S index 337bbae59..861d52a04 100644 --- a/libc/arch-arm64/syscalls/mremap.S +++ b/libc/arch-arm64/syscalls/mremap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mremap) mov x8, __NR_mremap svc #0 diff --git a/libc/arch-arm64/syscalls/msync.S b/libc/arch-arm64/syscalls/msync.S index c54797eab..009ce18e4 100644 --- a/libc/arch-arm64/syscalls/msync.S +++ b/libc/arch-arm64/syscalls/msync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(msync) mov x8, __NR_msync svc #0 diff --git a/libc/arch-arm64/syscalls/munlock.S b/libc/arch-arm64/syscalls/munlock.S index b1ec0165d..45d6d17f8 100644 --- a/libc/arch-arm64/syscalls/munlock.S +++ b/libc/arch-arm64/syscalls/munlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlock) mov x8, __NR_munlock svc #0 diff --git a/libc/arch-arm64/syscalls/munlockall.S b/libc/arch-arm64/syscalls/munlockall.S index f9162a8ba..624062254 100644 --- a/libc/arch-arm64/syscalls/munlockall.S +++ b/libc/arch-arm64/syscalls/munlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlockall) mov x8, __NR_munlockall svc #0 diff --git a/libc/arch-arm64/syscalls/munmap.S b/libc/arch-arm64/syscalls/munmap.S index 6bd5afe67..029126858 100644 --- a/libc/arch-arm64/syscalls/munmap.S +++ b/libc/arch-arm64/syscalls/munmap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munmap) mov x8, __NR_munmap svc #0 diff --git a/libc/arch-arm64/syscalls/nanosleep.S b/libc/arch-arm64/syscalls/nanosleep.S index c84accc26..7496530de 100644 --- a/libc/arch-arm64/syscalls/nanosleep.S +++ b/libc/arch-arm64/syscalls/nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(nanosleep) mov x8, __NR_nanosleep svc #0 diff --git a/libc/arch-arm64/syscalls/personality.S b/libc/arch-arm64/syscalls/personality.S index 02bcf9ba8..1c6530c68 100644 --- a/libc/arch-arm64/syscalls/personality.S +++ b/libc/arch-arm64/syscalls/personality.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(personality) mov x8, __NR_personality svc #0 diff --git a/libc/arch-arm64/syscalls/pipe2.S b/libc/arch-arm64/syscalls/pipe2.S index f4da37d88..45538d35b 100644 --- a/libc/arch-arm64/syscalls/pipe2.S +++ b/libc/arch-arm64/syscalls/pipe2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pipe2) mov x8, __NR_pipe2 svc #0 diff --git a/libc/arch-arm64/syscalls/prctl.S b/libc/arch-arm64/syscalls/prctl.S index 2e6dca77d..ddfe5a61f 100644 --- a/libc/arch-arm64/syscalls/prctl.S +++ b/libc/arch-arm64/syscalls/prctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prctl) mov x8, __NR_prctl svc #0 diff --git a/libc/arch-arm64/syscalls/pread64.S b/libc/arch-arm64/syscalls/pread64.S index 2aba5966a..9c2fb3416 100644 --- a/libc/arch-arm64/syscalls/pread64.S +++ b/libc/arch-arm64/syscalls/pread64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pread64) mov x8, __NR_pread64 svc #0 diff --git a/libc/arch-arm64/syscalls/prlimit64.S b/libc/arch-arm64/syscalls/prlimit64.S index a2173d9c5..d3e07b9a4 100644 --- a/libc/arch-arm64/syscalls/prlimit64.S +++ b/libc/arch-arm64/syscalls/prlimit64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prlimit64) mov x8, __NR_prlimit64 svc #0 diff --git a/libc/arch-arm64/syscalls/pwrite64.S b/libc/arch-arm64/syscalls/pwrite64.S index 5674a7ce1..33ae24b4f 100644 --- a/libc/arch-arm64/syscalls/pwrite64.S +++ b/libc/arch-arm64/syscalls/pwrite64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pwrite64) mov x8, __NR_pwrite64 svc #0 diff --git a/libc/arch-arm64/syscalls/read.S b/libc/arch-arm64/syscalls/read.S index 906fb9826..344039187 100644 --- a/libc/arch-arm64/syscalls/read.S +++ b/libc/arch-arm64/syscalls/read.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(read) mov x8, __NR_read svc #0 diff --git a/libc/arch-arm64/syscalls/readahead.S b/libc/arch-arm64/syscalls/readahead.S index 2994b8334..73683f22f 100644 --- a/libc/arch-arm64/syscalls/readahead.S +++ b/libc/arch-arm64/syscalls/readahead.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readahead) mov x8, __NR_readahead svc #0 diff --git a/libc/arch-arm64/syscalls/readlinkat.S b/libc/arch-arm64/syscalls/readlinkat.S index 1782c9402..1a89d21c3 100644 --- a/libc/arch-arm64/syscalls/readlinkat.S +++ b/libc/arch-arm64/syscalls/readlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readlinkat) mov x8, __NR_readlinkat svc #0 diff --git a/libc/arch-arm64/syscalls/readv.S b/libc/arch-arm64/syscalls/readv.S index bc988d412..b5d154a87 100644 --- a/libc/arch-arm64/syscalls/readv.S +++ b/libc/arch-arm64/syscalls/readv.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readv) mov x8, __NR_readv svc #0 diff --git a/libc/arch-arm64/syscalls/recvfrom.S b/libc/arch-arm64/syscalls/recvfrom.S index 16f97d571..80bc1aa66 100644 --- a/libc/arch-arm64/syscalls/recvfrom.S +++ b/libc/arch-arm64/syscalls/recvfrom.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvfrom) mov x8, __NR_recvfrom svc #0 diff --git a/libc/arch-arm64/syscalls/recvmmsg.S b/libc/arch-arm64/syscalls/recvmmsg.S index bd1495a18..aa69442b5 100644 --- a/libc/arch-arm64/syscalls/recvmmsg.S +++ b/libc/arch-arm64/syscalls/recvmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmmsg) mov x8, __NR_recvmmsg svc #0 diff --git a/libc/arch-arm64/syscalls/recvmsg.S b/libc/arch-arm64/syscalls/recvmsg.S index c9b78c472..095e2aaac 100644 --- a/libc/arch-arm64/syscalls/recvmsg.S +++ b/libc/arch-arm64/syscalls/recvmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmsg) mov x8, __NR_recvmsg svc #0 diff --git a/libc/arch-arm64/syscalls/removexattr.S b/libc/arch-arm64/syscalls/removexattr.S index c12cc84ea..f279f01f5 100644 --- a/libc/arch-arm64/syscalls/removexattr.S +++ b/libc/arch-arm64/syscalls/removexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(removexattr) mov x8, __NR_removexattr svc #0 diff --git a/libc/arch-arm64/syscalls/renameat.S b/libc/arch-arm64/syscalls/renameat.S index cf794728b..7c308cd06 100644 --- a/libc/arch-arm64/syscalls/renameat.S +++ b/libc/arch-arm64/syscalls/renameat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(renameat) mov x8, __NR_renameat svc #0 diff --git a/libc/arch-arm64/syscalls/sched_get_priority_max.S b/libc/arch-arm64/syscalls/sched_get_priority_max.S index 672d0ea8e..e80ce3585 100644 --- a/libc/arch-arm64/syscalls/sched_get_priority_max.S +++ b/libc/arch-arm64/syscalls/sched_get_priority_max.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_max) mov x8, __NR_sched_get_priority_max svc #0 diff --git a/libc/arch-arm64/syscalls/sched_get_priority_min.S b/libc/arch-arm64/syscalls/sched_get_priority_min.S index f5cf1f332..3f5f4870a 100644 --- a/libc/arch-arm64/syscalls/sched_get_priority_min.S +++ b/libc/arch-arm64/syscalls/sched_get_priority_min.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_min) mov x8, __NR_sched_get_priority_min svc #0 diff --git a/libc/arch-arm64/syscalls/sched_getparam.S b/libc/arch-arm64/syscalls/sched_getparam.S index 7ffe8fb30..17568671e 100644 --- a/libc/arch-arm64/syscalls/sched_getparam.S +++ b/libc/arch-arm64/syscalls/sched_getparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getparam) mov x8, __NR_sched_getparam svc #0 diff --git a/libc/arch-arm64/syscalls/sched_getscheduler.S b/libc/arch-arm64/syscalls/sched_getscheduler.S index b69b8c0c3..8fa145f16 100644 --- a/libc/arch-arm64/syscalls/sched_getscheduler.S +++ b/libc/arch-arm64/syscalls/sched_getscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getscheduler) mov x8, __NR_sched_getscheduler svc #0 diff --git a/libc/arch-arm64/syscalls/sched_rr_get_interval.S b/libc/arch-arm64/syscalls/sched_rr_get_interval.S index 0be14ba32..7ff393c10 100644 --- a/libc/arch-arm64/syscalls/sched_rr_get_interval.S +++ b/libc/arch-arm64/syscalls/sched_rr_get_interval.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_rr_get_interval) mov x8, __NR_sched_rr_get_interval svc #0 diff --git a/libc/arch-arm64/syscalls/sched_setaffinity.S b/libc/arch-arm64/syscalls/sched_setaffinity.S index f5cbc7734..287845956 100644 --- a/libc/arch-arm64/syscalls/sched_setaffinity.S +++ b/libc/arch-arm64/syscalls/sched_setaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setaffinity) mov x8, __NR_sched_setaffinity svc #0 diff --git a/libc/arch-arm64/syscalls/sched_setparam.S b/libc/arch-arm64/syscalls/sched_setparam.S index cff64f5c6..413560655 100644 --- a/libc/arch-arm64/syscalls/sched_setparam.S +++ b/libc/arch-arm64/syscalls/sched_setparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setparam) mov x8, __NR_sched_setparam svc #0 diff --git a/libc/arch-arm64/syscalls/sched_setscheduler.S b/libc/arch-arm64/syscalls/sched_setscheduler.S index 31600a05c..e8f991ce9 100644 --- a/libc/arch-arm64/syscalls/sched_setscheduler.S +++ b/libc/arch-arm64/syscalls/sched_setscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setscheduler) mov x8, __NR_sched_setscheduler svc #0 diff --git a/libc/arch-arm64/syscalls/sched_yield.S b/libc/arch-arm64/syscalls/sched_yield.S index 21ad601ab..cd6a97871 100644 --- a/libc/arch-arm64/syscalls/sched_yield.S +++ b/libc/arch-arm64/syscalls/sched_yield.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_yield) mov x8, __NR_sched_yield svc #0 diff --git a/libc/arch-arm64/syscalls/sendfile.S b/libc/arch-arm64/syscalls/sendfile.S index db90caaa5..c5792247a 100644 --- a/libc/arch-arm64/syscalls/sendfile.S +++ b/libc/arch-arm64/syscalls/sendfile.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendfile) mov x8, __NR_sendfile svc #0 diff --git a/libc/arch-arm64/syscalls/sendmmsg.S b/libc/arch-arm64/syscalls/sendmmsg.S index e85798a1b..e9ce811be 100644 --- a/libc/arch-arm64/syscalls/sendmmsg.S +++ b/libc/arch-arm64/syscalls/sendmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmmsg) mov x8, __NR_sendmmsg svc #0 diff --git a/libc/arch-arm64/syscalls/sendmsg.S b/libc/arch-arm64/syscalls/sendmsg.S index 25eff846c..78c5e6837 100644 --- a/libc/arch-arm64/syscalls/sendmsg.S +++ b/libc/arch-arm64/syscalls/sendmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmsg) mov x8, __NR_sendmsg svc #0 diff --git a/libc/arch-arm64/syscalls/sendto.S b/libc/arch-arm64/syscalls/sendto.S index 39e4e4e2d..a3ef95deb 100644 --- a/libc/arch-arm64/syscalls/sendto.S +++ b/libc/arch-arm64/syscalls/sendto.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendto) mov x8, __NR_sendto svc #0 diff --git a/libc/arch-arm64/syscalls/setfsgid.S b/libc/arch-arm64/syscalls/setfsgid.S index d2f29ab76..4d28536e0 100644 --- a/libc/arch-arm64/syscalls/setfsgid.S +++ b/libc/arch-arm64/syscalls/setfsgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsgid) mov x8, __NR_setfsgid svc #0 diff --git a/libc/arch-arm64/syscalls/setfsuid.S b/libc/arch-arm64/syscalls/setfsuid.S index 852f97cbe..238bbf87b 100644 --- a/libc/arch-arm64/syscalls/setfsuid.S +++ b/libc/arch-arm64/syscalls/setfsuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsuid) mov x8, __NR_setfsuid svc #0 diff --git a/libc/arch-arm64/syscalls/setgid.S b/libc/arch-arm64/syscalls/setgid.S index a9789f7c2..182ce1faa 100644 --- a/libc/arch-arm64/syscalls/setgid.S +++ b/libc/arch-arm64/syscalls/setgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgid) mov x8, __NR_setgid svc #0 diff --git a/libc/arch-arm64/syscalls/setgroups.S b/libc/arch-arm64/syscalls/setgroups.S index ce9bf0143..2bc5c7fb5 100644 --- a/libc/arch-arm64/syscalls/setgroups.S +++ b/libc/arch-arm64/syscalls/setgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgroups) mov x8, __NR_setgroups svc #0 diff --git a/libc/arch-arm64/syscalls/setitimer.S b/libc/arch-arm64/syscalls/setitimer.S index d8e3d7e5e..1a5bbb353 100644 --- a/libc/arch-arm64/syscalls/setitimer.S +++ b/libc/arch-arm64/syscalls/setitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setitimer) mov x8, __NR_setitimer svc #0 diff --git a/libc/arch-arm64/syscalls/setns.S b/libc/arch-arm64/syscalls/setns.S index 615f8889c..68c32dad2 100644 --- a/libc/arch-arm64/syscalls/setns.S +++ b/libc/arch-arm64/syscalls/setns.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setns) mov x8, __NR_setns svc #0 diff --git a/libc/arch-arm64/syscalls/setpgid.S b/libc/arch-arm64/syscalls/setpgid.S index 601526467..890d35420 100644 --- a/libc/arch-arm64/syscalls/setpgid.S +++ b/libc/arch-arm64/syscalls/setpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpgid) mov x8, __NR_setpgid svc #0 diff --git a/libc/arch-arm64/syscalls/setpriority.S b/libc/arch-arm64/syscalls/setpriority.S index d2f517eb0..17550ea7e 100644 --- a/libc/arch-arm64/syscalls/setpriority.S +++ b/libc/arch-arm64/syscalls/setpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpriority) mov x8, __NR_setpriority svc #0 diff --git a/libc/arch-arm64/syscalls/setregid.S b/libc/arch-arm64/syscalls/setregid.S index 7b333bfaf..aa351a887 100644 --- a/libc/arch-arm64/syscalls/setregid.S +++ b/libc/arch-arm64/syscalls/setregid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setregid) mov x8, __NR_setregid svc #0 diff --git a/libc/arch-arm64/syscalls/setresgid.S b/libc/arch-arm64/syscalls/setresgid.S index 39504bd64..517e59eba 100644 --- a/libc/arch-arm64/syscalls/setresgid.S +++ b/libc/arch-arm64/syscalls/setresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresgid) mov x8, __NR_setresgid svc #0 diff --git a/libc/arch-arm64/syscalls/setresuid.S b/libc/arch-arm64/syscalls/setresuid.S index 5acbffda1..6829cef33 100644 --- a/libc/arch-arm64/syscalls/setresuid.S +++ b/libc/arch-arm64/syscalls/setresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresuid) mov x8, __NR_setresuid svc #0 diff --git a/libc/arch-arm64/syscalls/setreuid.S b/libc/arch-arm64/syscalls/setreuid.S index 63630d6a8..af342efad 100644 --- a/libc/arch-arm64/syscalls/setreuid.S +++ b/libc/arch-arm64/syscalls/setreuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setreuid) mov x8, __NR_setreuid svc #0 diff --git a/libc/arch-arm64/syscalls/setrlimit.S b/libc/arch-arm64/syscalls/setrlimit.S index f9f56a695..4401984fa 100644 --- a/libc/arch-arm64/syscalls/setrlimit.S +++ b/libc/arch-arm64/syscalls/setrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setrlimit) mov x8, __NR_setrlimit svc #0 diff --git a/libc/arch-arm64/syscalls/setsid.S b/libc/arch-arm64/syscalls/setsid.S index 04c28e310..64c76f221 100644 --- a/libc/arch-arm64/syscalls/setsid.S +++ b/libc/arch-arm64/syscalls/setsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsid) mov x8, __NR_setsid svc #0 diff --git a/libc/arch-arm64/syscalls/setsockopt.S b/libc/arch-arm64/syscalls/setsockopt.S index 0ebc6d0d4..51af8474b 100644 --- a/libc/arch-arm64/syscalls/setsockopt.S +++ b/libc/arch-arm64/syscalls/setsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsockopt) mov x8, __NR_setsockopt svc #0 diff --git a/libc/arch-arm64/syscalls/settimeofday.S b/libc/arch-arm64/syscalls/settimeofday.S index 474e40d7b..357998cd4 100644 --- a/libc/arch-arm64/syscalls/settimeofday.S +++ b/libc/arch-arm64/syscalls/settimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(settimeofday) mov x8, __NR_settimeofday svc #0 diff --git a/libc/arch-arm64/syscalls/setuid.S b/libc/arch-arm64/syscalls/setuid.S index fe52921fb..ad4243487 100644 --- a/libc/arch-arm64/syscalls/setuid.S +++ b/libc/arch-arm64/syscalls/setuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setuid) mov x8, __NR_setuid svc #0 diff --git a/libc/arch-arm64/syscalls/setxattr.S b/libc/arch-arm64/syscalls/setxattr.S index 8d0b4156a..cde2d5f3b 100644 --- a/libc/arch-arm64/syscalls/setxattr.S +++ b/libc/arch-arm64/syscalls/setxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setxattr) mov x8, __NR_setxattr svc #0 diff --git a/libc/arch-arm64/syscalls/shutdown.S b/libc/arch-arm64/syscalls/shutdown.S index e35cdea2d..48136471a 100644 --- a/libc/arch-arm64/syscalls/shutdown.S +++ b/libc/arch-arm64/syscalls/shutdown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(shutdown) mov x8, __NR_shutdown svc #0 diff --git a/libc/arch-arm64/syscalls/sigaltstack.S b/libc/arch-arm64/syscalls/sigaltstack.S index 6a3820306..74f7e50a9 100644 --- a/libc/arch-arm64/syscalls/sigaltstack.S +++ b/libc/arch-arm64/syscalls/sigaltstack.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sigaltstack) mov x8, __NR_sigaltstack svc #0 diff --git a/libc/arch-arm64/syscalls/socketpair.S b/libc/arch-arm64/syscalls/socketpair.S index dcd7223c7..ec2a3d257 100644 --- a/libc/arch-arm64/syscalls/socketpair.S +++ b/libc/arch-arm64/syscalls/socketpair.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(socketpair) mov x8, __NR_socketpair svc #0 diff --git a/libc/arch-arm64/syscalls/splice.S b/libc/arch-arm64/syscalls/splice.S index 103805ac6..30443a861 100644 --- a/libc/arch-arm64/syscalls/splice.S +++ b/libc/arch-arm64/syscalls/splice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(splice) mov x8, __NR_splice svc #0 diff --git a/libc/arch-arm64/syscalls/statfs64.S b/libc/arch-arm64/syscalls/statfs64.S index 55633c193..00b32e79a 100644 --- a/libc/arch-arm64/syscalls/statfs64.S +++ b/libc/arch-arm64/syscalls/statfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(statfs64) mov x8, __NR_statfs svc #0 diff --git a/libc/arch-arm64/syscalls/swapoff.S b/libc/arch-arm64/syscalls/swapoff.S index dcef4afe7..54dabb5a6 100644 --- a/libc/arch-arm64/syscalls/swapoff.S +++ b/libc/arch-arm64/syscalls/swapoff.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapoff) mov x8, __NR_swapoff svc #0 diff --git a/libc/arch-arm64/syscalls/swapon.S b/libc/arch-arm64/syscalls/swapon.S index aef7627a0..952252f4e 100644 --- a/libc/arch-arm64/syscalls/swapon.S +++ b/libc/arch-arm64/syscalls/swapon.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapon) mov x8, __NR_swapon svc #0 diff --git a/libc/arch-arm64/syscalls/symlinkat.S b/libc/arch-arm64/syscalls/symlinkat.S index 9830865cf..27f9334f6 100644 --- a/libc/arch-arm64/syscalls/symlinkat.S +++ b/libc/arch-arm64/syscalls/symlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(symlinkat) mov x8, __NR_symlinkat svc #0 diff --git a/libc/arch-arm64/syscalls/sync.S b/libc/arch-arm64/syscalls/sync.S index 3ef04607d..622b028e4 100644 --- a/libc/arch-arm64/syscalls/sync.S +++ b/libc/arch-arm64/syscalls/sync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sync) mov x8, __NR_sync svc #0 diff --git a/libc/arch-arm64/syscalls/sysinfo.S b/libc/arch-arm64/syscalls/sysinfo.S index 7dbe152ae..81d8a944a 100644 --- a/libc/arch-arm64/syscalls/sysinfo.S +++ b/libc/arch-arm64/syscalls/sysinfo.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sysinfo) mov x8, __NR_sysinfo svc #0 diff --git a/libc/arch-arm64/syscalls/tee.S b/libc/arch-arm64/syscalls/tee.S index d730076f6..cb317aad3 100644 --- a/libc/arch-arm64/syscalls/tee.S +++ b/libc/arch-arm64/syscalls/tee.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tee) mov x8, __NR_tee svc #0 diff --git a/libc/arch-arm64/syscalls/tgkill.S b/libc/arch-arm64/syscalls/tgkill.S index 477c47793..908811db6 100644 --- a/libc/arch-arm64/syscalls/tgkill.S +++ b/libc/arch-arm64/syscalls/tgkill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tgkill) mov x8, __NR_tgkill svc #0 diff --git a/libc/arch-arm64/syscalls/timerfd_create.S b/libc/arch-arm64/syscalls/timerfd_create.S index 83b5910d0..5487492f9 100644 --- a/libc/arch-arm64/syscalls/timerfd_create.S +++ b/libc/arch-arm64/syscalls/timerfd_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_create) mov x8, __NR_timerfd_create svc #0 diff --git a/libc/arch-arm64/syscalls/timerfd_gettime.S b/libc/arch-arm64/syscalls/timerfd_gettime.S index 253cb79b9..1c5151f8a 100644 --- a/libc/arch-arm64/syscalls/timerfd_gettime.S +++ b/libc/arch-arm64/syscalls/timerfd_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_gettime) mov x8, __NR_timerfd_gettime svc #0 diff --git a/libc/arch-arm64/syscalls/timerfd_settime.S b/libc/arch-arm64/syscalls/timerfd_settime.S index 887248177..edd81facd 100644 --- a/libc/arch-arm64/syscalls/timerfd_settime.S +++ b/libc/arch-arm64/syscalls/timerfd_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_settime) mov x8, __NR_timerfd_settime svc #0 diff --git a/libc/arch-arm64/syscalls/times.S b/libc/arch-arm64/syscalls/times.S index 33c7d55c4..554173288 100644 --- a/libc/arch-arm64/syscalls/times.S +++ b/libc/arch-arm64/syscalls/times.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(times) mov x8, __NR_times svc #0 diff --git a/libc/arch-arm64/syscalls/truncate.S b/libc/arch-arm64/syscalls/truncate.S index f15253b97..be5765c43 100644 --- a/libc/arch-arm64/syscalls/truncate.S +++ b/libc/arch-arm64/syscalls/truncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(truncate) mov x8, __NR_truncate svc #0 diff --git a/libc/arch-arm64/syscalls/umask.S b/libc/arch-arm64/syscalls/umask.S index 8b907b4e8..c605b8f3f 100644 --- a/libc/arch-arm64/syscalls/umask.S +++ b/libc/arch-arm64/syscalls/umask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umask) mov x8, __NR_umask svc #0 diff --git a/libc/arch-arm64/syscalls/umount2.S b/libc/arch-arm64/syscalls/umount2.S index 5646dbaa3..73ed3307d 100644 --- a/libc/arch-arm64/syscalls/umount2.S +++ b/libc/arch-arm64/syscalls/umount2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umount2) mov x8, __NR_umount2 svc #0 diff --git a/libc/arch-arm64/syscalls/uname.S b/libc/arch-arm64/syscalls/uname.S index 09ec096ef..4d5219006 100644 --- a/libc/arch-arm64/syscalls/uname.S +++ b/libc/arch-arm64/syscalls/uname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(uname) mov x8, __NR_uname svc #0 diff --git a/libc/arch-arm64/syscalls/unlinkat.S b/libc/arch-arm64/syscalls/unlinkat.S index 992f67557..8fde96e49 100644 --- a/libc/arch-arm64/syscalls/unlinkat.S +++ b/libc/arch-arm64/syscalls/unlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unlinkat) mov x8, __NR_unlinkat svc #0 diff --git a/libc/arch-arm64/syscalls/unshare.S b/libc/arch-arm64/syscalls/unshare.S index 1062dcd58..ba960e228 100644 --- a/libc/arch-arm64/syscalls/unshare.S +++ b/libc/arch-arm64/syscalls/unshare.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unshare) mov x8, __NR_unshare svc #0 diff --git a/libc/arch-arm64/syscalls/utimensat.S b/libc/arch-arm64/syscalls/utimensat.S index 8a25ed630..9e4b1ca43 100644 --- a/libc/arch-arm64/syscalls/utimensat.S +++ b/libc/arch-arm64/syscalls/utimensat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(utimensat) mov x8, __NR_utimensat svc #0 diff --git a/libc/arch-arm64/syscalls/vmsplice.S b/libc/arch-arm64/syscalls/vmsplice.S index b4bec3f1e..6a13c5b64 100644 --- a/libc/arch-arm64/syscalls/vmsplice.S +++ b/libc/arch-arm64/syscalls/vmsplice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(vmsplice) mov x8, __NR_vmsplice svc #0 diff --git a/libc/arch-arm64/syscalls/wait4.S b/libc/arch-arm64/syscalls/wait4.S index a0d5d6270..f2bcd34ec 100644 --- a/libc/arch-arm64/syscalls/wait4.S +++ b/libc/arch-arm64/syscalls/wait4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(wait4) mov x8, __NR_wait4 svc #0 diff --git a/libc/arch-arm64/syscalls/write.S b/libc/arch-arm64/syscalls/write.S index d64552ecf..1fedabe72 100644 --- a/libc/arch-arm64/syscalls/write.S +++ b/libc/arch-arm64/syscalls/write.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(write) mov x8, __NR_write svc #0 diff --git a/libc/arch-arm64/syscalls/writev.S b/libc/arch-arm64/syscalls/writev.S index 45d5c8db3..9942ddb3b 100644 --- a/libc/arch-arm64/syscalls/writev.S +++ b/libc/arch-arm64/syscalls/writev.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(writev) mov x8, __NR_writev svc #0 diff --git a/libc/arch-mips/syscalls/__accept4.S b/libc/arch-mips/syscalls/__accept4.S index 8634a3564..2fc8b2af4 100644 --- a/libc/arch-mips/syscalls/__accept4.S +++ b/libc/arch-mips/syscalls/__accept4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__accept4) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__brk.S b/libc/arch-mips/syscalls/__brk.S index 9325c2608..0593b4fc1 100644 --- a/libc/arch-mips/syscalls/__brk.S +++ b/libc/arch-mips/syscalls/__brk.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__brk) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__connect.S b/libc/arch-mips/syscalls/__connect.S index f7ac916cb..20f60e4a3 100644 --- a/libc/arch-mips/syscalls/__connect.S +++ b/libc/arch-mips/syscalls/__connect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__connect) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__epoll_pwait.S b/libc/arch-mips/syscalls/__epoll_pwait.S index a417cdd6b..3e735f18e 100644 --- a/libc/arch-mips/syscalls/__epoll_pwait.S +++ b/libc/arch-mips/syscalls/__epoll_pwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__epoll_pwait) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__exit.S b/libc/arch-mips/syscalls/__exit.S index 1515b41da..40c2f87d4 100644 --- a/libc/arch-mips/syscalls/__exit.S +++ b/libc/arch-mips/syscalls/__exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__exit) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__fcntl64.S b/libc/arch-mips/syscalls/__fcntl64.S index b9815a1f0..b541edd37 100644 --- a/libc/arch-mips/syscalls/__fcntl64.S +++ b/libc/arch-mips/syscalls/__fcntl64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__fcntl64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__fstatfs64.S b/libc/arch-mips/syscalls/__fstatfs64.S index 8774a530c..d1d68abd0 100644 --- a/libc/arch-mips/syscalls/__fstatfs64.S +++ b/libc/arch-mips/syscalls/__fstatfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__fstatfs64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__getcpu.S b/libc/arch-mips/syscalls/__getcpu.S index 2352e0174..ab3acca36 100644 --- a/libc/arch-mips/syscalls/__getcpu.S +++ b/libc/arch-mips/syscalls/__getcpu.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcpu) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__getcwd.S b/libc/arch-mips/syscalls/__getcwd.S index e844f9a7d..af1c494b7 100644 --- a/libc/arch-mips/syscalls/__getcwd.S +++ b/libc/arch-mips/syscalls/__getcwd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcwd) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__getdents64.S b/libc/arch-mips/syscalls/__getdents64.S index 136b4080e..e88c6df76 100644 --- a/libc/arch-mips/syscalls/__getdents64.S +++ b/libc/arch-mips/syscalls/__getdents64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getdents64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__getpid.S b/libc/arch-mips/syscalls/__getpid.S index 52cf6f426..d20188b94 100644 --- a/libc/arch-mips/syscalls/__getpid.S +++ b/libc/arch-mips/syscalls/__getpid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__getpriority.S b/libc/arch-mips/syscalls/__getpriority.S index 882386b12..bc1efb345 100644 --- a/libc/arch-mips/syscalls/__getpriority.S +++ b/libc/arch-mips/syscalls/__getpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpriority) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__ioctl.S b/libc/arch-mips/syscalls/__ioctl.S index ddf532325..28af834ae 100644 --- a/libc/arch-mips/syscalls/__ioctl.S +++ b/libc/arch-mips/syscalls/__ioctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ioctl) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__llseek.S b/libc/arch-mips/syscalls/__llseek.S index 10819f7a3..81cf45994 100644 --- a/libc/arch-mips/syscalls/__llseek.S +++ b/libc/arch-mips/syscalls/__llseek.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__llseek) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__mmap2.S b/libc/arch-mips/syscalls/__mmap2.S index 53728178f..e6022c382 100644 --- a/libc/arch-mips/syscalls/__mmap2.S +++ b/libc/arch-mips/syscalls/__mmap2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__mmap2) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__openat.S b/libc/arch-mips/syscalls/__openat.S index f833dd878..0482b5abe 100644 --- a/libc/arch-mips/syscalls/__openat.S +++ b/libc/arch-mips/syscalls/__openat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__openat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__ppoll.S b/libc/arch-mips/syscalls/__ppoll.S index a5711d9af..7cd29f68c 100644 --- a/libc/arch-mips/syscalls/__ppoll.S +++ b/libc/arch-mips/syscalls/__ppoll.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ppoll) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__pselect6.S b/libc/arch-mips/syscalls/__pselect6.S index 4c0a0a53e..b4279b86f 100644 --- a/libc/arch-mips/syscalls/__pselect6.S +++ b/libc/arch-mips/syscalls/__pselect6.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__pselect6) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__ptrace.S b/libc/arch-mips/syscalls/__ptrace.S index fcbe5293f..07dcd8fff 100644 --- a/libc/arch-mips/syscalls/__ptrace.S +++ b/libc/arch-mips/syscalls/__ptrace.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ptrace) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__reboot.S b/libc/arch-mips/syscalls/__reboot.S index 4aa0e7a76..3a0a70b70 100644 --- a/libc/arch-mips/syscalls/__reboot.S +++ b/libc/arch-mips/syscalls/__reboot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__reboot) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__rt_sigaction.S b/libc/arch-mips/syscalls/__rt_sigaction.S index 6c5bc37f2..858a241df 100644 --- a/libc/arch-mips/syscalls/__rt_sigaction.S +++ b/libc/arch-mips/syscalls/__rt_sigaction.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigaction) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__rt_sigpending.S b/libc/arch-mips/syscalls/__rt_sigpending.S index e62f07954..484da4fe3 100644 --- a/libc/arch-mips/syscalls/__rt_sigpending.S +++ b/libc/arch-mips/syscalls/__rt_sigpending.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigpending) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__rt_sigprocmask.S b/libc/arch-mips/syscalls/__rt_sigprocmask.S index 94ef493fb..5e61f5273 100644 --- a/libc/arch-mips/syscalls/__rt_sigprocmask.S +++ b/libc/arch-mips/syscalls/__rt_sigprocmask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigprocmask) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__rt_sigsuspend.S b/libc/arch-mips/syscalls/__rt_sigsuspend.S index 077746f7a..d128caa88 100644 --- a/libc/arch-mips/syscalls/__rt_sigsuspend.S +++ b/libc/arch-mips/syscalls/__rt_sigsuspend.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigsuspend) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__rt_sigtimedwait.S b/libc/arch-mips/syscalls/__rt_sigtimedwait.S index 404eab72b..7e70660cb 100644 --- a/libc/arch-mips/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-mips/syscalls/__rt_sigtimedwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigtimedwait) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__sched_getaffinity.S b/libc/arch-mips/syscalls/__sched_getaffinity.S index da7170954..f83b7baf6 100644 --- a/libc/arch-mips/syscalls/__sched_getaffinity.S +++ b/libc/arch-mips/syscalls/__sched_getaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__sched_getaffinity) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__set_tid_address.S b/libc/arch-mips/syscalls/__set_tid_address.S index 146cd0d80..7ec0f635b 100644 --- a/libc/arch-mips/syscalls/__set_tid_address.S +++ b/libc/arch-mips/syscalls/__set_tid_address.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__set_tid_address) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__set_tls.S b/libc/arch-mips/syscalls/__set_tls.S index e5b0ca2e4..bb2fa6dfc 100644 --- a/libc/arch-mips/syscalls/__set_tls.S +++ b/libc/arch-mips/syscalls/__set_tls.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__set_tls) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__sigaction.S b/libc/arch-mips/syscalls/__sigaction.S index 03dd9da0c..03eb58215 100644 --- a/libc/arch-mips/syscalls/__sigaction.S +++ b/libc/arch-mips/syscalls/__sigaction.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__sigaction) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__signalfd4.S b/libc/arch-mips/syscalls/__signalfd4.S index cc9b21259..9b191c2a9 100644 --- a/libc/arch-mips/syscalls/__signalfd4.S +++ b/libc/arch-mips/syscalls/__signalfd4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__signalfd4) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__socket.S b/libc/arch-mips/syscalls/__socket.S index 6508911d2..9e9a926df 100644 --- a/libc/arch-mips/syscalls/__socket.S +++ b/libc/arch-mips/syscalls/__socket.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__socket) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__statfs64.S b/libc/arch-mips/syscalls/__statfs64.S index 9f94e6a28..5017e96a6 100644 --- a/libc/arch-mips/syscalls/__statfs64.S +++ b/libc/arch-mips/syscalls/__statfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__statfs64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__timer_create.S b/libc/arch-mips/syscalls/__timer_create.S index 449bd2837..81cc8c4e5 100644 --- a/libc/arch-mips/syscalls/__timer_create.S +++ b/libc/arch-mips/syscalls/__timer_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_create) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__timer_delete.S b/libc/arch-mips/syscalls/__timer_delete.S index 7bc5e0598..fddb703f6 100644 --- a/libc/arch-mips/syscalls/__timer_delete.S +++ b/libc/arch-mips/syscalls/__timer_delete.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_delete) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__timer_getoverrun.S b/libc/arch-mips/syscalls/__timer_getoverrun.S index 7382c9150..3a7313dcc 100644 --- a/libc/arch-mips/syscalls/__timer_getoverrun.S +++ b/libc/arch-mips/syscalls/__timer_getoverrun.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_getoverrun) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__timer_gettime.S b/libc/arch-mips/syscalls/__timer_gettime.S index d6195b9ba..7b9bed746 100644 --- a/libc/arch-mips/syscalls/__timer_gettime.S +++ b/libc/arch-mips/syscalls/__timer_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_gettime) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__timer_settime.S b/libc/arch-mips/syscalls/__timer_settime.S index 9fbab8625..b1198de03 100644 --- a/libc/arch-mips/syscalls/__timer_settime.S +++ b/libc/arch-mips/syscalls/__timer_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_settime) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/__waitid.S b/libc/arch-mips/syscalls/__waitid.S index 4c9142e84..e60da7f95 100644 --- a/libc/arch-mips/syscalls/__waitid.S +++ b/libc/arch-mips/syscalls/__waitid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__waitid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/_exit.S b/libc/arch-mips/syscalls/_exit.S index f546b66f6..ae1d61f7b 100644 --- a/libc/arch-mips/syscalls/_exit.S +++ b/libc/arch-mips/syscalls/_exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(_exit) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/_flush_cache.S b/libc/arch-mips/syscalls/_flush_cache.S index 64967fe1a..0074578fd 100644 --- a/libc/arch-mips/syscalls/_flush_cache.S +++ b/libc/arch-mips/syscalls/_flush_cache.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(_flush_cache) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/acct.S b/libc/arch-mips/syscalls/acct.S index 6e4a4f21b..29a71198e 100644 --- a/libc/arch-mips/syscalls/acct.S +++ b/libc/arch-mips/syscalls/acct.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(acct) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/bind.S b/libc/arch-mips/syscalls/bind.S index 9119aa852..6d92fd0f3 100644 --- a/libc/arch-mips/syscalls/bind.S +++ b/libc/arch-mips/syscalls/bind.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(bind) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/capget.S b/libc/arch-mips/syscalls/capget.S index 549dc7679..de76fa33f 100644 --- a/libc/arch-mips/syscalls/capget.S +++ b/libc/arch-mips/syscalls/capget.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capget) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/capset.S b/libc/arch-mips/syscalls/capset.S index 637ac374c..77fb3a703 100644 --- a/libc/arch-mips/syscalls/capset.S +++ b/libc/arch-mips/syscalls/capset.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capset) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/chdir.S b/libc/arch-mips/syscalls/chdir.S index 752e4e7de..2668d6994 100644 --- a/libc/arch-mips/syscalls/chdir.S +++ b/libc/arch-mips/syscalls/chdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chdir) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/chroot.S b/libc/arch-mips/syscalls/chroot.S index d1ffc97fe..d804c4f0c 100644 --- a/libc/arch-mips/syscalls/chroot.S +++ b/libc/arch-mips/syscalls/chroot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chroot) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/clock_getres.S b/libc/arch-mips/syscalls/clock_getres.S index 49d9bba7e..5219b32f9 100644 --- a/libc/arch-mips/syscalls/clock_getres.S +++ b/libc/arch-mips/syscalls/clock_getres.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_getres) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/clock_gettime.S b/libc/arch-mips/syscalls/clock_gettime.S index 42929e810..32120b1ab 100644 --- a/libc/arch-mips/syscalls/clock_gettime.S +++ b/libc/arch-mips/syscalls/clock_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_gettime) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/clock_nanosleep.S b/libc/arch-mips/syscalls/clock_nanosleep.S index e7c25cef3..01bab5aa8 100644 --- a/libc/arch-mips/syscalls/clock_nanosleep.S +++ b/libc/arch-mips/syscalls/clock_nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_nanosleep) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/clock_settime.S b/libc/arch-mips/syscalls/clock_settime.S index e7dda913c..6b642a1c1 100644 --- a/libc/arch-mips/syscalls/clock_settime.S +++ b/libc/arch-mips/syscalls/clock_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_settime) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/close.S b/libc/arch-mips/syscalls/close.S index bc2c32588..4e3ab6758 100644 --- a/libc/arch-mips/syscalls/close.S +++ b/libc/arch-mips/syscalls/close.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(close) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/delete_module.S b/libc/arch-mips/syscalls/delete_module.S index 9247f5af6..5c849305d 100644 --- a/libc/arch-mips/syscalls/delete_module.S +++ b/libc/arch-mips/syscalls/delete_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(delete_module) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/dup.S b/libc/arch-mips/syscalls/dup.S index 61b1c03fe..696955365 100644 --- a/libc/arch-mips/syscalls/dup.S +++ b/libc/arch-mips/syscalls/dup.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/dup3.S b/libc/arch-mips/syscalls/dup3.S index d0694e8e6..39e403d5c 100644 --- a/libc/arch-mips/syscalls/dup3.S +++ b/libc/arch-mips/syscalls/dup3.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup3) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/epoll_create1.S b/libc/arch-mips/syscalls/epoll_create1.S index 2043f3982..6feb71597 100644 --- a/libc/arch-mips/syscalls/epoll_create1.S +++ b/libc/arch-mips/syscalls/epoll_create1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_create1) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/epoll_ctl.S b/libc/arch-mips/syscalls/epoll_ctl.S index 9474d3ad4..4517ea18b 100644 --- a/libc/arch-mips/syscalls/epoll_ctl.S +++ b/libc/arch-mips/syscalls/epoll_ctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_ctl) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/eventfd.S b/libc/arch-mips/syscalls/eventfd.S index 5282a914d..167a851b2 100644 --- a/libc/arch-mips/syscalls/eventfd.S +++ b/libc/arch-mips/syscalls/eventfd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(eventfd) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/execve.S b/libc/arch-mips/syscalls/execve.S index fcaec0a9b..e6f3af64e 100644 --- a/libc/arch-mips/syscalls/execve.S +++ b/libc/arch-mips/syscalls/execve.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(execve) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/faccessat.S b/libc/arch-mips/syscalls/faccessat.S index e7afe2ada..3bf7717ce 100644 --- a/libc/arch-mips/syscalls/faccessat.S +++ b/libc/arch-mips/syscalls/faccessat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(faccessat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fallocate64.S b/libc/arch-mips/syscalls/fallocate64.S index d81460695..5395c6fff 100644 --- a/libc/arch-mips/syscalls/fallocate64.S +++ b/libc/arch-mips/syscalls/fallocate64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fallocate64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fchdir.S b/libc/arch-mips/syscalls/fchdir.S index daac0f5d8..4a5c1e3c5 100644 --- a/libc/arch-mips/syscalls/fchdir.S +++ b/libc/arch-mips/syscalls/fchdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchdir) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fchmod.S b/libc/arch-mips/syscalls/fchmod.S index e947e41a1..78dc3f70a 100644 --- a/libc/arch-mips/syscalls/fchmod.S +++ b/libc/arch-mips/syscalls/fchmod.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmod) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fchmodat.S b/libc/arch-mips/syscalls/fchmodat.S index 4d2a7d3a6..ebc3a7449 100644 --- a/libc/arch-mips/syscalls/fchmodat.S +++ b/libc/arch-mips/syscalls/fchmodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmodat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fchown.S b/libc/arch-mips/syscalls/fchown.S index f59c0f4e0..74956e052 100644 --- a/libc/arch-mips/syscalls/fchown.S +++ b/libc/arch-mips/syscalls/fchown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchown) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fchownat.S b/libc/arch-mips/syscalls/fchownat.S index af44cbc3d..54d1fde8c 100644 --- a/libc/arch-mips/syscalls/fchownat.S +++ b/libc/arch-mips/syscalls/fchownat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchownat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fdatasync.S b/libc/arch-mips/syscalls/fdatasync.S index 07e3592b6..f2d1b1fe4 100644 --- a/libc/arch-mips/syscalls/fdatasync.S +++ b/libc/arch-mips/syscalls/fdatasync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fdatasync) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fgetxattr.S b/libc/arch-mips/syscalls/fgetxattr.S index 035e71ca5..096cd9744 100644 --- a/libc/arch-mips/syscalls/fgetxattr.S +++ b/libc/arch-mips/syscalls/fgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fgetxattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/flistxattr.S b/libc/arch-mips/syscalls/flistxattr.S index 500cd9792..b577e5790 100644 --- a/libc/arch-mips/syscalls/flistxattr.S +++ b/libc/arch-mips/syscalls/flistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flistxattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/flock.S b/libc/arch-mips/syscalls/flock.S index 7d843ab39..87e9e0409 100644 --- a/libc/arch-mips/syscalls/flock.S +++ b/libc/arch-mips/syscalls/flock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flock) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fremovexattr.S b/libc/arch-mips/syscalls/fremovexattr.S index 9f161866f..8f7e74efc 100644 --- a/libc/arch-mips/syscalls/fremovexattr.S +++ b/libc/arch-mips/syscalls/fremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fremovexattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fsetxattr.S b/libc/arch-mips/syscalls/fsetxattr.S index 03471288b..e9a3490ea 100644 --- a/libc/arch-mips/syscalls/fsetxattr.S +++ b/libc/arch-mips/syscalls/fsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsetxattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fstat64.S b/libc/arch-mips/syscalls/fstat64.S index 722854115..c6d2a32ae 100644 --- a/libc/arch-mips/syscalls/fstat64.S +++ b/libc/arch-mips/syscalls/fstat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstat64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fstatat64.S b/libc/arch-mips/syscalls/fstatat64.S index b2903f25a..2418b0218 100644 --- a/libc/arch-mips/syscalls/fstatat64.S +++ b/libc/arch-mips/syscalls/fstatat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstatat64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/fsync.S b/libc/arch-mips/syscalls/fsync.S index 96b417df3..c5528dc50 100644 --- a/libc/arch-mips/syscalls/fsync.S +++ b/libc/arch-mips/syscalls/fsync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsync) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/ftruncate.S b/libc/arch-mips/syscalls/ftruncate.S index bd428fb1a..dfd57a9b4 100644 --- a/libc/arch-mips/syscalls/ftruncate.S +++ b/libc/arch-mips/syscalls/ftruncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(ftruncate) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/ftruncate64.S b/libc/arch-mips/syscalls/ftruncate64.S index 357e9a583..a1df9e8a8 100644 --- a/libc/arch-mips/syscalls/ftruncate64.S +++ b/libc/arch-mips/syscalls/ftruncate64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(ftruncate64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getegid.S b/libc/arch-mips/syscalls/getegid.S index c3a3ac0e4..10f102c9a 100644 --- a/libc/arch-mips/syscalls/getegid.S +++ b/libc/arch-mips/syscalls/getegid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getegid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/geteuid.S b/libc/arch-mips/syscalls/geteuid.S index 66e6d4f00..bac3b74d4 100644 --- a/libc/arch-mips/syscalls/geteuid.S +++ b/libc/arch-mips/syscalls/geteuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(geteuid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getgid.S b/libc/arch-mips/syscalls/getgid.S index 674d5271e..a1814bbb5 100644 --- a/libc/arch-mips/syscalls/getgid.S +++ b/libc/arch-mips/syscalls/getgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getgroups.S b/libc/arch-mips/syscalls/getgroups.S index caa031bdf..51ed5234c 100644 --- a/libc/arch-mips/syscalls/getgroups.S +++ b/libc/arch-mips/syscalls/getgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgroups) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getitimer.S b/libc/arch-mips/syscalls/getitimer.S index e7a655a97..1afeee48e 100644 --- a/libc/arch-mips/syscalls/getitimer.S +++ b/libc/arch-mips/syscalls/getitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getitimer) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getpeername.S b/libc/arch-mips/syscalls/getpeername.S index 31df8adbd..b6e5f0797 100644 --- a/libc/arch-mips/syscalls/getpeername.S +++ b/libc/arch-mips/syscalls/getpeername.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpeername) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getpgid.S b/libc/arch-mips/syscalls/getpgid.S index 7e3e4398f..01c6ec593 100644 --- a/libc/arch-mips/syscalls/getpgid.S +++ b/libc/arch-mips/syscalls/getpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpgid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getppid.S b/libc/arch-mips/syscalls/getppid.S index 3d76fc2b1..9ed04c047 100644 --- a/libc/arch-mips/syscalls/getppid.S +++ b/libc/arch-mips/syscalls/getppid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getppid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getresgid.S b/libc/arch-mips/syscalls/getresgid.S index 235902af0..a2e16d4b9 100644 --- a/libc/arch-mips/syscalls/getresgid.S +++ b/libc/arch-mips/syscalls/getresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresgid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getresuid.S b/libc/arch-mips/syscalls/getresuid.S index c6c4c135b..ff162e0fc 100644 --- a/libc/arch-mips/syscalls/getresuid.S +++ b/libc/arch-mips/syscalls/getresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresuid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getrlimit.S b/libc/arch-mips/syscalls/getrlimit.S index ef4ae89ac..1632f4d9e 100644 --- a/libc/arch-mips/syscalls/getrlimit.S +++ b/libc/arch-mips/syscalls/getrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrlimit) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getrusage.S b/libc/arch-mips/syscalls/getrusage.S index 21cabfa34..b9c4207d3 100644 --- a/libc/arch-mips/syscalls/getrusage.S +++ b/libc/arch-mips/syscalls/getrusage.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrusage) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getsid.S b/libc/arch-mips/syscalls/getsid.S index b0b21a0bc..cb56f54da 100644 --- a/libc/arch-mips/syscalls/getsid.S +++ b/libc/arch-mips/syscalls/getsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getsockname.S b/libc/arch-mips/syscalls/getsockname.S index 82d0b831e..f7bff60e2 100644 --- a/libc/arch-mips/syscalls/getsockname.S +++ b/libc/arch-mips/syscalls/getsockname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockname) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getsockopt.S b/libc/arch-mips/syscalls/getsockopt.S index ad360e3df..1490aa325 100644 --- a/libc/arch-mips/syscalls/getsockopt.S +++ b/libc/arch-mips/syscalls/getsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockopt) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/gettimeofday.S b/libc/arch-mips/syscalls/gettimeofday.S index e66fd77d1..a72ced64c 100644 --- a/libc/arch-mips/syscalls/gettimeofday.S +++ b/libc/arch-mips/syscalls/gettimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(gettimeofday) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getuid.S b/libc/arch-mips/syscalls/getuid.S index 345af7181..290a7014f 100644 --- a/libc/arch-mips/syscalls/getuid.S +++ b/libc/arch-mips/syscalls/getuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getuid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/getxattr.S b/libc/arch-mips/syscalls/getxattr.S index c7e215e3f..6ed431651 100644 --- a/libc/arch-mips/syscalls/getxattr.S +++ b/libc/arch-mips/syscalls/getxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getxattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/init_module.S b/libc/arch-mips/syscalls/init_module.S index 21ba5b169..6caf450e5 100644 --- a/libc/arch-mips/syscalls/init_module.S +++ b/libc/arch-mips/syscalls/init_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(init_module) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/inotify_add_watch.S b/libc/arch-mips/syscalls/inotify_add_watch.S index beb70ec5c..8464f8f3a 100644 --- a/libc/arch-mips/syscalls/inotify_add_watch.S +++ b/libc/arch-mips/syscalls/inotify_add_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_add_watch) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/inotify_init1.S b/libc/arch-mips/syscalls/inotify_init1.S index 6c825c60d..b6cb6bc03 100644 --- a/libc/arch-mips/syscalls/inotify_init1.S +++ b/libc/arch-mips/syscalls/inotify_init1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_init1) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/inotify_rm_watch.S b/libc/arch-mips/syscalls/inotify_rm_watch.S index 280f2b43a..87a396a6f 100644 --- a/libc/arch-mips/syscalls/inotify_rm_watch.S +++ b/libc/arch-mips/syscalls/inotify_rm_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_rm_watch) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/kill.S b/libc/arch-mips/syscalls/kill.S index 0941717db..3dda006fb 100644 --- a/libc/arch-mips/syscalls/kill.S +++ b/libc/arch-mips/syscalls/kill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(kill) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/klogctl.S b/libc/arch-mips/syscalls/klogctl.S index ebc88371f..ae9a445d0 100644 --- a/libc/arch-mips/syscalls/klogctl.S +++ b/libc/arch-mips/syscalls/klogctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(klogctl) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/lgetxattr.S b/libc/arch-mips/syscalls/lgetxattr.S index 8c4a25273..63c5add51 100644 --- a/libc/arch-mips/syscalls/lgetxattr.S +++ b/libc/arch-mips/syscalls/lgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lgetxattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/linkat.S b/libc/arch-mips/syscalls/linkat.S index cc7278de0..5bea417f2 100644 --- a/libc/arch-mips/syscalls/linkat.S +++ b/libc/arch-mips/syscalls/linkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(linkat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/listen.S b/libc/arch-mips/syscalls/listen.S index 68eba523a..8d945f5ef 100644 --- a/libc/arch-mips/syscalls/listen.S +++ b/libc/arch-mips/syscalls/listen.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listen) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/listxattr.S b/libc/arch-mips/syscalls/listxattr.S index 006bfcebe..260d0899a 100644 --- a/libc/arch-mips/syscalls/listxattr.S +++ b/libc/arch-mips/syscalls/listxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listxattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/llistxattr.S b/libc/arch-mips/syscalls/llistxattr.S index 7f833ade0..69474d82d 100644 --- a/libc/arch-mips/syscalls/llistxattr.S +++ b/libc/arch-mips/syscalls/llistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(llistxattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/lremovexattr.S b/libc/arch-mips/syscalls/lremovexattr.S index 21d00ea4b..e33f31fd9 100644 --- a/libc/arch-mips/syscalls/lremovexattr.S +++ b/libc/arch-mips/syscalls/lremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lremovexattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/lseek.S b/libc/arch-mips/syscalls/lseek.S index 82c2776dd..21abe1c58 100644 --- a/libc/arch-mips/syscalls/lseek.S +++ b/libc/arch-mips/syscalls/lseek.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lseek) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/lsetxattr.S b/libc/arch-mips/syscalls/lsetxattr.S index d54ec6928..dcd510abe 100644 --- a/libc/arch-mips/syscalls/lsetxattr.S +++ b/libc/arch-mips/syscalls/lsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lsetxattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/madvise.S b/libc/arch-mips/syscalls/madvise.S index 9aa28152d..49c007ade 100644 --- a/libc/arch-mips/syscalls/madvise.S +++ b/libc/arch-mips/syscalls/madvise.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(madvise) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/mincore.S b/libc/arch-mips/syscalls/mincore.S index 0db4313ff..07102a67b 100644 --- a/libc/arch-mips/syscalls/mincore.S +++ b/libc/arch-mips/syscalls/mincore.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mincore) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/mkdirat.S b/libc/arch-mips/syscalls/mkdirat.S index 0ac98d460..96a2d08a8 100644 --- a/libc/arch-mips/syscalls/mkdirat.S +++ b/libc/arch-mips/syscalls/mkdirat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mkdirat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/mknodat.S b/libc/arch-mips/syscalls/mknodat.S index b85d8bfad..a88b9061d 100644 --- a/libc/arch-mips/syscalls/mknodat.S +++ b/libc/arch-mips/syscalls/mknodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mknodat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/mlock.S b/libc/arch-mips/syscalls/mlock.S index 0ba2bca8c..eff66b8f9 100644 --- a/libc/arch-mips/syscalls/mlock.S +++ b/libc/arch-mips/syscalls/mlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlock) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/mlockall.S b/libc/arch-mips/syscalls/mlockall.S index 642c6e296..c31eeafe1 100644 --- a/libc/arch-mips/syscalls/mlockall.S +++ b/libc/arch-mips/syscalls/mlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlockall) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/mount.S b/libc/arch-mips/syscalls/mount.S index f0c5f6bf5..cb1f1d164 100644 --- a/libc/arch-mips/syscalls/mount.S +++ b/libc/arch-mips/syscalls/mount.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mount) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/mprotect.S b/libc/arch-mips/syscalls/mprotect.S index c0ce98869..4e390eb82 100644 --- a/libc/arch-mips/syscalls/mprotect.S +++ b/libc/arch-mips/syscalls/mprotect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mprotect) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/mremap.S b/libc/arch-mips/syscalls/mremap.S index bd4c385ca..7b9a68a48 100644 --- a/libc/arch-mips/syscalls/mremap.S +++ b/libc/arch-mips/syscalls/mremap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mremap) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/msync.S b/libc/arch-mips/syscalls/msync.S index e8ecb2ab5..7b19a830b 100644 --- a/libc/arch-mips/syscalls/msync.S +++ b/libc/arch-mips/syscalls/msync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(msync) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/munlock.S b/libc/arch-mips/syscalls/munlock.S index f8ddc3a6a..17dc7199b 100644 --- a/libc/arch-mips/syscalls/munlock.S +++ b/libc/arch-mips/syscalls/munlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlock) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/munlockall.S b/libc/arch-mips/syscalls/munlockall.S index 5ced5c650..f0dc2d4c4 100644 --- a/libc/arch-mips/syscalls/munlockall.S +++ b/libc/arch-mips/syscalls/munlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlockall) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/munmap.S b/libc/arch-mips/syscalls/munmap.S index 527825c31..dc3a52459 100644 --- a/libc/arch-mips/syscalls/munmap.S +++ b/libc/arch-mips/syscalls/munmap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munmap) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/nanosleep.S b/libc/arch-mips/syscalls/nanosleep.S index 8dc816a9d..fa74288b1 100644 --- a/libc/arch-mips/syscalls/nanosleep.S +++ b/libc/arch-mips/syscalls/nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(nanosleep) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/personality.S b/libc/arch-mips/syscalls/personality.S index e8449a71a..467f2ec70 100644 --- a/libc/arch-mips/syscalls/personality.S +++ b/libc/arch-mips/syscalls/personality.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(personality) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/pipe2.S b/libc/arch-mips/syscalls/pipe2.S index 478d364ba..c50595686 100644 --- a/libc/arch-mips/syscalls/pipe2.S +++ b/libc/arch-mips/syscalls/pipe2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pipe2) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/prctl.S b/libc/arch-mips/syscalls/prctl.S index e9aff3c11..60c18be69 100644 --- a/libc/arch-mips/syscalls/prctl.S +++ b/libc/arch-mips/syscalls/prctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prctl) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/pread64.S b/libc/arch-mips/syscalls/pread64.S index 55a54c6b0..debc55880 100644 --- a/libc/arch-mips/syscalls/pread64.S +++ b/libc/arch-mips/syscalls/pread64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pread64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/prlimit64.S b/libc/arch-mips/syscalls/prlimit64.S index c695d18e8..ce1686f26 100644 --- a/libc/arch-mips/syscalls/prlimit64.S +++ b/libc/arch-mips/syscalls/prlimit64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prlimit64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/pwrite64.S b/libc/arch-mips/syscalls/pwrite64.S index 64d3ee157..b1ff89b4b 100644 --- a/libc/arch-mips/syscalls/pwrite64.S +++ b/libc/arch-mips/syscalls/pwrite64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pwrite64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/read.S b/libc/arch-mips/syscalls/read.S index ff548ab7f..d98c9a691 100644 --- a/libc/arch-mips/syscalls/read.S +++ b/libc/arch-mips/syscalls/read.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(read) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/readahead.S b/libc/arch-mips/syscalls/readahead.S index 674286afa..7dd44730d 100644 --- a/libc/arch-mips/syscalls/readahead.S +++ b/libc/arch-mips/syscalls/readahead.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readahead) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/readlinkat.S b/libc/arch-mips/syscalls/readlinkat.S index a1c7d6b1f..99f07a4c3 100644 --- a/libc/arch-mips/syscalls/readlinkat.S +++ b/libc/arch-mips/syscalls/readlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readlinkat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/readv.S b/libc/arch-mips/syscalls/readv.S index af5a4cb4e..3985c9c6a 100644 --- a/libc/arch-mips/syscalls/readv.S +++ b/libc/arch-mips/syscalls/readv.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readv) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/recvfrom.S b/libc/arch-mips/syscalls/recvfrom.S index 04b04f6da..afda11e4d 100644 --- a/libc/arch-mips/syscalls/recvfrom.S +++ b/libc/arch-mips/syscalls/recvfrom.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvfrom) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/recvmmsg.S b/libc/arch-mips/syscalls/recvmmsg.S index 23e511b0a..1122c014d 100644 --- a/libc/arch-mips/syscalls/recvmmsg.S +++ b/libc/arch-mips/syscalls/recvmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmmsg) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/recvmsg.S b/libc/arch-mips/syscalls/recvmsg.S index a0a3a3ff7..a64606b32 100644 --- a/libc/arch-mips/syscalls/recvmsg.S +++ b/libc/arch-mips/syscalls/recvmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmsg) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/removexattr.S b/libc/arch-mips/syscalls/removexattr.S index 0f72ebf0e..a35616069 100644 --- a/libc/arch-mips/syscalls/removexattr.S +++ b/libc/arch-mips/syscalls/removexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(removexattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/renameat.S b/libc/arch-mips/syscalls/renameat.S index 210b439f6..63de839c6 100644 --- a/libc/arch-mips/syscalls/renameat.S +++ b/libc/arch-mips/syscalls/renameat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(renameat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sched_get_priority_max.S b/libc/arch-mips/syscalls/sched_get_priority_max.S index d15a86830..ea88c0f27 100644 --- a/libc/arch-mips/syscalls/sched_get_priority_max.S +++ b/libc/arch-mips/syscalls/sched_get_priority_max.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_max) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sched_get_priority_min.S b/libc/arch-mips/syscalls/sched_get_priority_min.S index 5ff21c657..032084770 100644 --- a/libc/arch-mips/syscalls/sched_get_priority_min.S +++ b/libc/arch-mips/syscalls/sched_get_priority_min.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_min) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sched_getparam.S b/libc/arch-mips/syscalls/sched_getparam.S index 1cbe72093..4be69b331 100644 --- a/libc/arch-mips/syscalls/sched_getparam.S +++ b/libc/arch-mips/syscalls/sched_getparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getparam) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sched_getscheduler.S b/libc/arch-mips/syscalls/sched_getscheduler.S index 88b16e042..aaf0e9147 100644 --- a/libc/arch-mips/syscalls/sched_getscheduler.S +++ b/libc/arch-mips/syscalls/sched_getscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getscheduler) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sched_rr_get_interval.S b/libc/arch-mips/syscalls/sched_rr_get_interval.S index 647ee3ccf..fcf2bcbb8 100644 --- a/libc/arch-mips/syscalls/sched_rr_get_interval.S +++ b/libc/arch-mips/syscalls/sched_rr_get_interval.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_rr_get_interval) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sched_setaffinity.S b/libc/arch-mips/syscalls/sched_setaffinity.S index 118476693..b9394c53d 100644 --- a/libc/arch-mips/syscalls/sched_setaffinity.S +++ b/libc/arch-mips/syscalls/sched_setaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setaffinity) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sched_setparam.S b/libc/arch-mips/syscalls/sched_setparam.S index 1811c7403..90c82fe69 100644 --- a/libc/arch-mips/syscalls/sched_setparam.S +++ b/libc/arch-mips/syscalls/sched_setparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setparam) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sched_setscheduler.S b/libc/arch-mips/syscalls/sched_setscheduler.S index 8921d3073..05e4e8b05 100644 --- a/libc/arch-mips/syscalls/sched_setscheduler.S +++ b/libc/arch-mips/syscalls/sched_setscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setscheduler) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sched_yield.S b/libc/arch-mips/syscalls/sched_yield.S index 37f09be8a..15565802f 100644 --- a/libc/arch-mips/syscalls/sched_yield.S +++ b/libc/arch-mips/syscalls/sched_yield.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_yield) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sendfile.S b/libc/arch-mips/syscalls/sendfile.S index 84466b95a..eb99d0941 100644 --- a/libc/arch-mips/syscalls/sendfile.S +++ b/libc/arch-mips/syscalls/sendfile.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendfile) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sendfile64.S b/libc/arch-mips/syscalls/sendfile64.S index d9733f60a..1d5c5f095 100644 --- a/libc/arch-mips/syscalls/sendfile64.S +++ b/libc/arch-mips/syscalls/sendfile64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendfile64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sendmmsg.S b/libc/arch-mips/syscalls/sendmmsg.S index d99ba9335..16f37a1eb 100644 --- a/libc/arch-mips/syscalls/sendmmsg.S +++ b/libc/arch-mips/syscalls/sendmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmmsg) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sendmsg.S b/libc/arch-mips/syscalls/sendmsg.S index 5c37c6225..31bb56300 100644 --- a/libc/arch-mips/syscalls/sendmsg.S +++ b/libc/arch-mips/syscalls/sendmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmsg) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sendto.S b/libc/arch-mips/syscalls/sendto.S index 580d14250..2ba696da2 100644 --- a/libc/arch-mips/syscalls/sendto.S +++ b/libc/arch-mips/syscalls/sendto.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendto) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setfsgid.S b/libc/arch-mips/syscalls/setfsgid.S index 6a5956581..81d33d0d3 100644 --- a/libc/arch-mips/syscalls/setfsgid.S +++ b/libc/arch-mips/syscalls/setfsgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsgid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setfsuid.S b/libc/arch-mips/syscalls/setfsuid.S index 1c2317a7b..68890777b 100644 --- a/libc/arch-mips/syscalls/setfsuid.S +++ b/libc/arch-mips/syscalls/setfsuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsuid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setgid.S b/libc/arch-mips/syscalls/setgid.S index 8fa188e22..83649da37 100644 --- a/libc/arch-mips/syscalls/setgid.S +++ b/libc/arch-mips/syscalls/setgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setgroups.S b/libc/arch-mips/syscalls/setgroups.S index f2d271cd0..b98608c48 100644 --- a/libc/arch-mips/syscalls/setgroups.S +++ b/libc/arch-mips/syscalls/setgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgroups) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setitimer.S b/libc/arch-mips/syscalls/setitimer.S index a2eea84cd..dc9a8f389 100644 --- a/libc/arch-mips/syscalls/setitimer.S +++ b/libc/arch-mips/syscalls/setitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setitimer) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setns.S b/libc/arch-mips/syscalls/setns.S index 8a4f6742b..9a4939d03 100644 --- a/libc/arch-mips/syscalls/setns.S +++ b/libc/arch-mips/syscalls/setns.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setns) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setpgid.S b/libc/arch-mips/syscalls/setpgid.S index c68f9a6e2..cbc1ff3d0 100644 --- a/libc/arch-mips/syscalls/setpgid.S +++ b/libc/arch-mips/syscalls/setpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpgid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setpriority.S b/libc/arch-mips/syscalls/setpriority.S index 2bf9f47b3..6b8a504da 100644 --- a/libc/arch-mips/syscalls/setpriority.S +++ b/libc/arch-mips/syscalls/setpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpriority) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setregid.S b/libc/arch-mips/syscalls/setregid.S index de77e3979..6388784de 100644 --- a/libc/arch-mips/syscalls/setregid.S +++ b/libc/arch-mips/syscalls/setregid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setregid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setresgid.S b/libc/arch-mips/syscalls/setresgid.S index b2fd85f97..76968a8c9 100644 --- a/libc/arch-mips/syscalls/setresgid.S +++ b/libc/arch-mips/syscalls/setresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresgid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setresuid.S b/libc/arch-mips/syscalls/setresuid.S index ad9ea9b53..fae15f802 100644 --- a/libc/arch-mips/syscalls/setresuid.S +++ b/libc/arch-mips/syscalls/setresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresuid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setreuid.S b/libc/arch-mips/syscalls/setreuid.S index 888d21913..8350cb718 100644 --- a/libc/arch-mips/syscalls/setreuid.S +++ b/libc/arch-mips/syscalls/setreuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setreuid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setrlimit.S b/libc/arch-mips/syscalls/setrlimit.S index 71b49ac48..d708c2d60 100644 --- a/libc/arch-mips/syscalls/setrlimit.S +++ b/libc/arch-mips/syscalls/setrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setrlimit) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setsid.S b/libc/arch-mips/syscalls/setsid.S index 9467a080c..cb5838d30 100644 --- a/libc/arch-mips/syscalls/setsid.S +++ b/libc/arch-mips/syscalls/setsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setsockopt.S b/libc/arch-mips/syscalls/setsockopt.S index e8dd3f674..da348f112 100644 --- a/libc/arch-mips/syscalls/setsockopt.S +++ b/libc/arch-mips/syscalls/setsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsockopt) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/settimeofday.S b/libc/arch-mips/syscalls/settimeofday.S index b9b588fd0..cd52b406c 100644 --- a/libc/arch-mips/syscalls/settimeofday.S +++ b/libc/arch-mips/syscalls/settimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(settimeofday) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setuid.S b/libc/arch-mips/syscalls/setuid.S index 55c75c1c8..a80ec5cf0 100644 --- a/libc/arch-mips/syscalls/setuid.S +++ b/libc/arch-mips/syscalls/setuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setuid) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/setxattr.S b/libc/arch-mips/syscalls/setxattr.S index 0cca64c17..df7bcdb9d 100644 --- a/libc/arch-mips/syscalls/setxattr.S +++ b/libc/arch-mips/syscalls/setxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setxattr) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/shutdown.S b/libc/arch-mips/syscalls/shutdown.S index f6e997951..71e636661 100644 --- a/libc/arch-mips/syscalls/shutdown.S +++ b/libc/arch-mips/syscalls/shutdown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(shutdown) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sigaltstack.S b/libc/arch-mips/syscalls/sigaltstack.S index 6632164c2..b52c60aa8 100644 --- a/libc/arch-mips/syscalls/sigaltstack.S +++ b/libc/arch-mips/syscalls/sigaltstack.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sigaltstack) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/socketpair.S b/libc/arch-mips/syscalls/socketpair.S index 625732744..47223e14e 100644 --- a/libc/arch-mips/syscalls/socketpair.S +++ b/libc/arch-mips/syscalls/socketpair.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(socketpair) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/splice.S b/libc/arch-mips/syscalls/splice.S index d344a6c9e..611a06292 100644 --- a/libc/arch-mips/syscalls/splice.S +++ b/libc/arch-mips/syscalls/splice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(splice) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/swapoff.S b/libc/arch-mips/syscalls/swapoff.S index 04b5b7095..8b570688d 100644 --- a/libc/arch-mips/syscalls/swapoff.S +++ b/libc/arch-mips/syscalls/swapoff.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapoff) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/swapon.S b/libc/arch-mips/syscalls/swapon.S index 1fe369826..ef3a53754 100644 --- a/libc/arch-mips/syscalls/swapon.S +++ b/libc/arch-mips/syscalls/swapon.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapon) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/symlinkat.S b/libc/arch-mips/syscalls/symlinkat.S index 5bd6e6c2c..65971a973 100644 --- a/libc/arch-mips/syscalls/symlinkat.S +++ b/libc/arch-mips/syscalls/symlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(symlinkat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sync.S b/libc/arch-mips/syscalls/sync.S index eb788f0c9..d62ae768b 100644 --- a/libc/arch-mips/syscalls/sync.S +++ b/libc/arch-mips/syscalls/sync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sync) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/sysinfo.S b/libc/arch-mips/syscalls/sysinfo.S index 7cdccb907..600e086ce 100644 --- a/libc/arch-mips/syscalls/sysinfo.S +++ b/libc/arch-mips/syscalls/sysinfo.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sysinfo) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/tee.S b/libc/arch-mips/syscalls/tee.S index e51732dcf..90ec91180 100644 --- a/libc/arch-mips/syscalls/tee.S +++ b/libc/arch-mips/syscalls/tee.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tee) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/tgkill.S b/libc/arch-mips/syscalls/tgkill.S index 99388433d..39a148b4f 100644 --- a/libc/arch-mips/syscalls/tgkill.S +++ b/libc/arch-mips/syscalls/tgkill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tgkill) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/timerfd_create.S b/libc/arch-mips/syscalls/timerfd_create.S index c42f4e172..b50903a4d 100644 --- a/libc/arch-mips/syscalls/timerfd_create.S +++ b/libc/arch-mips/syscalls/timerfd_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_create) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/timerfd_gettime.S b/libc/arch-mips/syscalls/timerfd_gettime.S index 469d174e2..97d304544 100644 --- a/libc/arch-mips/syscalls/timerfd_gettime.S +++ b/libc/arch-mips/syscalls/timerfd_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_gettime) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/timerfd_settime.S b/libc/arch-mips/syscalls/timerfd_settime.S index c7c6f47fc..1e56f86fb 100644 --- a/libc/arch-mips/syscalls/timerfd_settime.S +++ b/libc/arch-mips/syscalls/timerfd_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_settime) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/times.S b/libc/arch-mips/syscalls/times.S index 157b34cb0..60904d1cd 100644 --- a/libc/arch-mips/syscalls/times.S +++ b/libc/arch-mips/syscalls/times.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(times) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/truncate.S b/libc/arch-mips/syscalls/truncate.S index 7fe4a0fad..ec7bc4989 100644 --- a/libc/arch-mips/syscalls/truncate.S +++ b/libc/arch-mips/syscalls/truncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(truncate) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/truncate64.S b/libc/arch-mips/syscalls/truncate64.S index 0911f5f64..b6a0234ce 100644 --- a/libc/arch-mips/syscalls/truncate64.S +++ b/libc/arch-mips/syscalls/truncate64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(truncate64) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/umask.S b/libc/arch-mips/syscalls/umask.S index 57a6aed9c..8f66e7703 100644 --- a/libc/arch-mips/syscalls/umask.S +++ b/libc/arch-mips/syscalls/umask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umask) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/umount2.S b/libc/arch-mips/syscalls/umount2.S index bf8267dd9..58e31f3ab 100644 --- a/libc/arch-mips/syscalls/umount2.S +++ b/libc/arch-mips/syscalls/umount2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umount2) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/uname.S b/libc/arch-mips/syscalls/uname.S index ce77bd523..401d139e8 100644 --- a/libc/arch-mips/syscalls/uname.S +++ b/libc/arch-mips/syscalls/uname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(uname) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/unlinkat.S b/libc/arch-mips/syscalls/unlinkat.S index 82e584b2b..b6e849d45 100644 --- a/libc/arch-mips/syscalls/unlinkat.S +++ b/libc/arch-mips/syscalls/unlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unlinkat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/unshare.S b/libc/arch-mips/syscalls/unshare.S index 0521f305d..526283208 100644 --- a/libc/arch-mips/syscalls/unshare.S +++ b/libc/arch-mips/syscalls/unshare.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unshare) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/utimensat.S b/libc/arch-mips/syscalls/utimensat.S index 208ef58fd..9ecb5c018 100644 --- a/libc/arch-mips/syscalls/utimensat.S +++ b/libc/arch-mips/syscalls/utimensat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(utimensat) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/vmsplice.S b/libc/arch-mips/syscalls/vmsplice.S index 24da5159e..5ad23a6e9 100644 --- a/libc/arch-mips/syscalls/vmsplice.S +++ b/libc/arch-mips/syscalls/vmsplice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(vmsplice) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/wait4.S b/libc/arch-mips/syscalls/wait4.S index ec6bd84f2..8f8d8795d 100644 --- a/libc/arch-mips/syscalls/wait4.S +++ b/libc/arch-mips/syscalls/wait4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(wait4) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/write.S b/libc/arch-mips/syscalls/write.S index d10e55ae9..3e37919e5 100644 --- a/libc/arch-mips/syscalls/write.S +++ b/libc/arch-mips/syscalls/write.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(write) .set noreorder .cpload t9 diff --git a/libc/arch-mips/syscalls/writev.S b/libc/arch-mips/syscalls/writev.S index 0a2c033fc..72ea2f2c2 100644 --- a/libc/arch-mips/syscalls/writev.S +++ b/libc/arch-mips/syscalls/writev.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(writev) .set noreorder .cpload t9 diff --git a/libc/arch-mips64/syscalls/__accept4.S b/libc/arch-mips64/syscalls/__accept4.S index e68bdb63a..0891d7f11 100644 --- a/libc/arch-mips64/syscalls/__accept4.S +++ b/libc/arch-mips64/syscalls/__accept4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__accept4) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__brk.S b/libc/arch-mips64/syscalls/__brk.S index 99a108ac9..86f390c54 100644 --- a/libc/arch-mips64/syscalls/__brk.S +++ b/libc/arch-mips64/syscalls/__brk.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__brk) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__connect.S b/libc/arch-mips64/syscalls/__connect.S index b1475fb5a..2efbb2a88 100644 --- a/libc/arch-mips64/syscalls/__connect.S +++ b/libc/arch-mips64/syscalls/__connect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__connect) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__epoll_pwait.S b/libc/arch-mips64/syscalls/__epoll_pwait.S index fc3867afb..430d9bbb0 100644 --- a/libc/arch-mips64/syscalls/__epoll_pwait.S +++ b/libc/arch-mips64/syscalls/__epoll_pwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__epoll_pwait) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__exit.S b/libc/arch-mips64/syscalls/__exit.S index dac53b9f5..ebee0d158 100644 --- a/libc/arch-mips64/syscalls/__exit.S +++ b/libc/arch-mips64/syscalls/__exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__exit) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__getcpu.S b/libc/arch-mips64/syscalls/__getcpu.S index 9c08710be..34a8acb5c 100644 --- a/libc/arch-mips64/syscalls/__getcpu.S +++ b/libc/arch-mips64/syscalls/__getcpu.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcpu) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__getcwd.S b/libc/arch-mips64/syscalls/__getcwd.S index 79fbca35f..e7a09a6b2 100644 --- a/libc/arch-mips64/syscalls/__getcwd.S +++ b/libc/arch-mips64/syscalls/__getcwd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcwd) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__getdents64.S b/libc/arch-mips64/syscalls/__getdents64.S index 6df556a21..dc51e7282 100644 --- a/libc/arch-mips64/syscalls/__getdents64.S +++ b/libc/arch-mips64/syscalls/__getdents64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getdents64) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__getpid.S b/libc/arch-mips64/syscalls/__getpid.S index 0977ff023..86b407180 100644 --- a/libc/arch-mips64/syscalls/__getpid.S +++ b/libc/arch-mips64/syscalls/__getpid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__getpriority.S b/libc/arch-mips64/syscalls/__getpriority.S index 6ca2e1f3a..f0c7267bb 100644 --- a/libc/arch-mips64/syscalls/__getpriority.S +++ b/libc/arch-mips64/syscalls/__getpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpriority) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__ioctl.S b/libc/arch-mips64/syscalls/__ioctl.S index 013ce1836..1f94075db 100644 --- a/libc/arch-mips64/syscalls/__ioctl.S +++ b/libc/arch-mips64/syscalls/__ioctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ioctl) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__openat.S b/libc/arch-mips64/syscalls/__openat.S index 1d46ef68a..6cc56daeb 100644 --- a/libc/arch-mips64/syscalls/__openat.S +++ b/libc/arch-mips64/syscalls/__openat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__openat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__ppoll.S b/libc/arch-mips64/syscalls/__ppoll.S index fb0e19a99..ce3a5513e 100644 --- a/libc/arch-mips64/syscalls/__ppoll.S +++ b/libc/arch-mips64/syscalls/__ppoll.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ppoll) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__pselect6.S b/libc/arch-mips64/syscalls/__pselect6.S index 3055b31a0..dbfe79f04 100644 --- a/libc/arch-mips64/syscalls/__pselect6.S +++ b/libc/arch-mips64/syscalls/__pselect6.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__pselect6) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__ptrace.S b/libc/arch-mips64/syscalls/__ptrace.S index bae77334d..e26217fc1 100644 --- a/libc/arch-mips64/syscalls/__ptrace.S +++ b/libc/arch-mips64/syscalls/__ptrace.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ptrace) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__reboot.S b/libc/arch-mips64/syscalls/__reboot.S index 31a97e36a..a4f4e71ff 100644 --- a/libc/arch-mips64/syscalls/__reboot.S +++ b/libc/arch-mips64/syscalls/__reboot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__reboot) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__rt_sigaction.S b/libc/arch-mips64/syscalls/__rt_sigaction.S index 3728c5870..10f359860 100644 --- a/libc/arch-mips64/syscalls/__rt_sigaction.S +++ b/libc/arch-mips64/syscalls/__rt_sigaction.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigaction) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__rt_sigpending.S b/libc/arch-mips64/syscalls/__rt_sigpending.S index e0d40ccaf..7855cca09 100644 --- a/libc/arch-mips64/syscalls/__rt_sigpending.S +++ b/libc/arch-mips64/syscalls/__rt_sigpending.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigpending) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__rt_sigprocmask.S b/libc/arch-mips64/syscalls/__rt_sigprocmask.S index d34a34b61..f1ba2e934 100644 --- a/libc/arch-mips64/syscalls/__rt_sigprocmask.S +++ b/libc/arch-mips64/syscalls/__rt_sigprocmask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigprocmask) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__rt_sigsuspend.S b/libc/arch-mips64/syscalls/__rt_sigsuspend.S index f36e1c339..50ebf5e22 100644 --- a/libc/arch-mips64/syscalls/__rt_sigsuspend.S +++ b/libc/arch-mips64/syscalls/__rt_sigsuspend.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigsuspend) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__rt_sigtimedwait.S b/libc/arch-mips64/syscalls/__rt_sigtimedwait.S index 798d6f85e..304d049d8 100644 --- a/libc/arch-mips64/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-mips64/syscalls/__rt_sigtimedwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigtimedwait) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__sched_getaffinity.S b/libc/arch-mips64/syscalls/__sched_getaffinity.S index a28781575..cf590c37f 100644 --- a/libc/arch-mips64/syscalls/__sched_getaffinity.S +++ b/libc/arch-mips64/syscalls/__sched_getaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__sched_getaffinity) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__set_tid_address.S b/libc/arch-mips64/syscalls/__set_tid_address.S index 8757001e1..d08aa7b7e 100644 --- a/libc/arch-mips64/syscalls/__set_tid_address.S +++ b/libc/arch-mips64/syscalls/__set_tid_address.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__set_tid_address) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__set_tls.S b/libc/arch-mips64/syscalls/__set_tls.S index f1c31b440..430c5fbf2 100644 --- a/libc/arch-mips64/syscalls/__set_tls.S +++ b/libc/arch-mips64/syscalls/__set_tls.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__set_tls) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__signalfd4.S b/libc/arch-mips64/syscalls/__signalfd4.S index c4fe77b53..020013896 100644 --- a/libc/arch-mips64/syscalls/__signalfd4.S +++ b/libc/arch-mips64/syscalls/__signalfd4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__signalfd4) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__socket.S b/libc/arch-mips64/syscalls/__socket.S index d1e0058b2..ac7586ab8 100644 --- a/libc/arch-mips64/syscalls/__socket.S +++ b/libc/arch-mips64/syscalls/__socket.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__socket) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__timer_create.S b/libc/arch-mips64/syscalls/__timer_create.S index 5a4daac14..518207dbe 100644 --- a/libc/arch-mips64/syscalls/__timer_create.S +++ b/libc/arch-mips64/syscalls/__timer_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_create) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__timer_delete.S b/libc/arch-mips64/syscalls/__timer_delete.S index 8bbbdb78a..4db1c8526 100644 --- a/libc/arch-mips64/syscalls/__timer_delete.S +++ b/libc/arch-mips64/syscalls/__timer_delete.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_delete) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__timer_getoverrun.S b/libc/arch-mips64/syscalls/__timer_getoverrun.S index 3bf06ccb4..c5aa40f60 100644 --- a/libc/arch-mips64/syscalls/__timer_getoverrun.S +++ b/libc/arch-mips64/syscalls/__timer_getoverrun.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_getoverrun) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__timer_gettime.S b/libc/arch-mips64/syscalls/__timer_gettime.S index a15ec1770..8bebdd82d 100644 --- a/libc/arch-mips64/syscalls/__timer_gettime.S +++ b/libc/arch-mips64/syscalls/__timer_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_gettime) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__timer_settime.S b/libc/arch-mips64/syscalls/__timer_settime.S index 10e2ca8c4..536c816d9 100644 --- a/libc/arch-mips64/syscalls/__timer_settime.S +++ b/libc/arch-mips64/syscalls/__timer_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_settime) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/__waitid.S b/libc/arch-mips64/syscalls/__waitid.S index 4d971e617..28b99bca1 100644 --- a/libc/arch-mips64/syscalls/__waitid.S +++ b/libc/arch-mips64/syscalls/__waitid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__waitid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/_exit.S b/libc/arch-mips64/syscalls/_exit.S index eb84def8c..370960e82 100644 --- a/libc/arch-mips64/syscalls/_exit.S +++ b/libc/arch-mips64/syscalls/_exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(_exit) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/_flush_cache.S b/libc/arch-mips64/syscalls/_flush_cache.S index 132fd4e40..997ccecb0 100644 --- a/libc/arch-mips64/syscalls/_flush_cache.S +++ b/libc/arch-mips64/syscalls/_flush_cache.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(_flush_cache) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/acct.S b/libc/arch-mips64/syscalls/acct.S index 718587756..70bdd3ec0 100644 --- a/libc/arch-mips64/syscalls/acct.S +++ b/libc/arch-mips64/syscalls/acct.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(acct) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/bind.S b/libc/arch-mips64/syscalls/bind.S index cb28bb45d..fab9b4243 100644 --- a/libc/arch-mips64/syscalls/bind.S +++ b/libc/arch-mips64/syscalls/bind.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(bind) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/capget.S b/libc/arch-mips64/syscalls/capget.S index 068e076eb..6c1a13cc2 100644 --- a/libc/arch-mips64/syscalls/capget.S +++ b/libc/arch-mips64/syscalls/capget.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capget) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/capset.S b/libc/arch-mips64/syscalls/capset.S index f29501bbd..da8e9e6dc 100644 --- a/libc/arch-mips64/syscalls/capset.S +++ b/libc/arch-mips64/syscalls/capset.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capset) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/chdir.S b/libc/arch-mips64/syscalls/chdir.S index c2753bd32..37f8f6923 100644 --- a/libc/arch-mips64/syscalls/chdir.S +++ b/libc/arch-mips64/syscalls/chdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chdir) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/chroot.S b/libc/arch-mips64/syscalls/chroot.S index ca1d4a8dd..7dced37e5 100644 --- a/libc/arch-mips64/syscalls/chroot.S +++ b/libc/arch-mips64/syscalls/chroot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chroot) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/clock_getres.S b/libc/arch-mips64/syscalls/clock_getres.S index e7a8dd3f0..72ad1461a 100644 --- a/libc/arch-mips64/syscalls/clock_getres.S +++ b/libc/arch-mips64/syscalls/clock_getres.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_getres) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/clock_gettime.S b/libc/arch-mips64/syscalls/clock_gettime.S index 4c92a38dc..431e6671f 100644 --- a/libc/arch-mips64/syscalls/clock_gettime.S +++ b/libc/arch-mips64/syscalls/clock_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_gettime) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/clock_nanosleep.S b/libc/arch-mips64/syscalls/clock_nanosleep.S index 29345911c..c0db78118 100644 --- a/libc/arch-mips64/syscalls/clock_nanosleep.S +++ b/libc/arch-mips64/syscalls/clock_nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_nanosleep) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/clock_settime.S b/libc/arch-mips64/syscalls/clock_settime.S index 1969cb69a..c9a4a7950 100644 --- a/libc/arch-mips64/syscalls/clock_settime.S +++ b/libc/arch-mips64/syscalls/clock_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_settime) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/close.S b/libc/arch-mips64/syscalls/close.S index f44600060..ff093e449 100644 --- a/libc/arch-mips64/syscalls/close.S +++ b/libc/arch-mips64/syscalls/close.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(close) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/delete_module.S b/libc/arch-mips64/syscalls/delete_module.S index d24adf875..86c64d614 100644 --- a/libc/arch-mips64/syscalls/delete_module.S +++ b/libc/arch-mips64/syscalls/delete_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(delete_module) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/dup.S b/libc/arch-mips64/syscalls/dup.S index 5d2d7defa..23aa5c01f 100644 --- a/libc/arch-mips64/syscalls/dup.S +++ b/libc/arch-mips64/syscalls/dup.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/dup3.S b/libc/arch-mips64/syscalls/dup3.S index 90f0f89c6..a5392dcb1 100644 --- a/libc/arch-mips64/syscalls/dup3.S +++ b/libc/arch-mips64/syscalls/dup3.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup3) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/epoll_create1.S b/libc/arch-mips64/syscalls/epoll_create1.S index 312887f61..c3219d4bd 100644 --- a/libc/arch-mips64/syscalls/epoll_create1.S +++ b/libc/arch-mips64/syscalls/epoll_create1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_create1) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/epoll_ctl.S b/libc/arch-mips64/syscalls/epoll_ctl.S index 461ad7be3..9b740d02a 100644 --- a/libc/arch-mips64/syscalls/epoll_ctl.S +++ b/libc/arch-mips64/syscalls/epoll_ctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_ctl) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/eventfd.S b/libc/arch-mips64/syscalls/eventfd.S index da8866ee5..ea3a2c687 100644 --- a/libc/arch-mips64/syscalls/eventfd.S +++ b/libc/arch-mips64/syscalls/eventfd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(eventfd) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/execve.S b/libc/arch-mips64/syscalls/execve.S index 3cb49b68e..af2c6d045 100644 --- a/libc/arch-mips64/syscalls/execve.S +++ b/libc/arch-mips64/syscalls/execve.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(execve) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/faccessat.S b/libc/arch-mips64/syscalls/faccessat.S index d06f42046..c8ee9e5bc 100644 --- a/libc/arch-mips64/syscalls/faccessat.S +++ b/libc/arch-mips64/syscalls/faccessat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(faccessat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fallocate.S b/libc/arch-mips64/syscalls/fallocate.S index d1e64b53f..9e7c89e04 100644 --- a/libc/arch-mips64/syscalls/fallocate.S +++ b/libc/arch-mips64/syscalls/fallocate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fallocate) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fchdir.S b/libc/arch-mips64/syscalls/fchdir.S index 0c8ab73d0..780a8a245 100644 --- a/libc/arch-mips64/syscalls/fchdir.S +++ b/libc/arch-mips64/syscalls/fchdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchdir) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fchmod.S b/libc/arch-mips64/syscalls/fchmod.S index 4ebb796ac..b9e7cab54 100644 --- a/libc/arch-mips64/syscalls/fchmod.S +++ b/libc/arch-mips64/syscalls/fchmod.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmod) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fchmodat.S b/libc/arch-mips64/syscalls/fchmodat.S index 48873241a..ff04c8c3c 100644 --- a/libc/arch-mips64/syscalls/fchmodat.S +++ b/libc/arch-mips64/syscalls/fchmodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmodat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fchown.S b/libc/arch-mips64/syscalls/fchown.S index c21c83131..97bd20883 100644 --- a/libc/arch-mips64/syscalls/fchown.S +++ b/libc/arch-mips64/syscalls/fchown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchown) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fchownat.S b/libc/arch-mips64/syscalls/fchownat.S index eba230cfc..0e5635a07 100644 --- a/libc/arch-mips64/syscalls/fchownat.S +++ b/libc/arch-mips64/syscalls/fchownat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchownat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fcntl.S b/libc/arch-mips64/syscalls/fcntl.S index 1f54b0e33..325d9fd6a 100644 --- a/libc/arch-mips64/syscalls/fcntl.S +++ b/libc/arch-mips64/syscalls/fcntl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fcntl) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fdatasync.S b/libc/arch-mips64/syscalls/fdatasync.S index ba1eccc47..8a714c31d 100644 --- a/libc/arch-mips64/syscalls/fdatasync.S +++ b/libc/arch-mips64/syscalls/fdatasync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fdatasync) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fgetxattr.S b/libc/arch-mips64/syscalls/fgetxattr.S index 5b9c8edc4..87a21ce01 100644 --- a/libc/arch-mips64/syscalls/fgetxattr.S +++ b/libc/arch-mips64/syscalls/fgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fgetxattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/flistxattr.S b/libc/arch-mips64/syscalls/flistxattr.S index c0bf93cae..b430931c3 100644 --- a/libc/arch-mips64/syscalls/flistxattr.S +++ b/libc/arch-mips64/syscalls/flistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flistxattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/flock.S b/libc/arch-mips64/syscalls/flock.S index b63f6fcec..bc4c83589 100644 --- a/libc/arch-mips64/syscalls/flock.S +++ b/libc/arch-mips64/syscalls/flock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flock) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fremovexattr.S b/libc/arch-mips64/syscalls/fremovexattr.S index be20d000c..412122385 100644 --- a/libc/arch-mips64/syscalls/fremovexattr.S +++ b/libc/arch-mips64/syscalls/fremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fremovexattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fsetxattr.S b/libc/arch-mips64/syscalls/fsetxattr.S index 92198ceb4..4180bd098 100644 --- a/libc/arch-mips64/syscalls/fsetxattr.S +++ b/libc/arch-mips64/syscalls/fsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsetxattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fstat64.S b/libc/arch-mips64/syscalls/fstat64.S index 078e3dd26..03cbf6922 100644 --- a/libc/arch-mips64/syscalls/fstat64.S +++ b/libc/arch-mips64/syscalls/fstat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstat64) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fstatat64.S b/libc/arch-mips64/syscalls/fstatat64.S index cc38de1f9..55ae243b7 100644 --- a/libc/arch-mips64/syscalls/fstatat64.S +++ b/libc/arch-mips64/syscalls/fstatat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstatat64) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fstatfs64.S b/libc/arch-mips64/syscalls/fstatfs64.S index 3474bc28a..5fb5d95a7 100644 --- a/libc/arch-mips64/syscalls/fstatfs64.S +++ b/libc/arch-mips64/syscalls/fstatfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstatfs64) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/fsync.S b/libc/arch-mips64/syscalls/fsync.S index 3543fef2a..fa5de8752 100644 --- a/libc/arch-mips64/syscalls/fsync.S +++ b/libc/arch-mips64/syscalls/fsync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsync) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/ftruncate.S b/libc/arch-mips64/syscalls/ftruncate.S index cd97b87ca..b605a3725 100644 --- a/libc/arch-mips64/syscalls/ftruncate.S +++ b/libc/arch-mips64/syscalls/ftruncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(ftruncate) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getegid.S b/libc/arch-mips64/syscalls/getegid.S index d6b3d7f93..7ef8fe35c 100644 --- a/libc/arch-mips64/syscalls/getegid.S +++ b/libc/arch-mips64/syscalls/getegid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getegid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/geteuid.S b/libc/arch-mips64/syscalls/geteuid.S index a1d971331..c21f0efd5 100644 --- a/libc/arch-mips64/syscalls/geteuid.S +++ b/libc/arch-mips64/syscalls/geteuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(geteuid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getgid.S b/libc/arch-mips64/syscalls/getgid.S index c89d70905..bd690dcb6 100644 --- a/libc/arch-mips64/syscalls/getgid.S +++ b/libc/arch-mips64/syscalls/getgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getgroups.S b/libc/arch-mips64/syscalls/getgroups.S index 8d9cddb5e..d7aded76b 100644 --- a/libc/arch-mips64/syscalls/getgroups.S +++ b/libc/arch-mips64/syscalls/getgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgroups) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getitimer.S b/libc/arch-mips64/syscalls/getitimer.S index 12dad0314..a438faafd 100644 --- a/libc/arch-mips64/syscalls/getitimer.S +++ b/libc/arch-mips64/syscalls/getitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getitimer) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getpeername.S b/libc/arch-mips64/syscalls/getpeername.S index 278428af9..bf40141fe 100644 --- a/libc/arch-mips64/syscalls/getpeername.S +++ b/libc/arch-mips64/syscalls/getpeername.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpeername) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getpgid.S b/libc/arch-mips64/syscalls/getpgid.S index 56551efab..739a6e2d8 100644 --- a/libc/arch-mips64/syscalls/getpgid.S +++ b/libc/arch-mips64/syscalls/getpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpgid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getppid.S b/libc/arch-mips64/syscalls/getppid.S index 97066f824..e642a7984 100644 --- a/libc/arch-mips64/syscalls/getppid.S +++ b/libc/arch-mips64/syscalls/getppid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getppid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getresgid.S b/libc/arch-mips64/syscalls/getresgid.S index f07fc11a2..d88516f1a 100644 --- a/libc/arch-mips64/syscalls/getresgid.S +++ b/libc/arch-mips64/syscalls/getresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresgid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getresuid.S b/libc/arch-mips64/syscalls/getresuid.S index 4f1ba8652..b43921151 100644 --- a/libc/arch-mips64/syscalls/getresuid.S +++ b/libc/arch-mips64/syscalls/getresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresuid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getrlimit.S b/libc/arch-mips64/syscalls/getrlimit.S index f825db94c..423bc0fa0 100644 --- a/libc/arch-mips64/syscalls/getrlimit.S +++ b/libc/arch-mips64/syscalls/getrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrlimit) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getrusage.S b/libc/arch-mips64/syscalls/getrusage.S index 49f3c4227..9f57b8424 100644 --- a/libc/arch-mips64/syscalls/getrusage.S +++ b/libc/arch-mips64/syscalls/getrusage.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrusage) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getsid.S b/libc/arch-mips64/syscalls/getsid.S index 6fa362c91..125da4ed5 100644 --- a/libc/arch-mips64/syscalls/getsid.S +++ b/libc/arch-mips64/syscalls/getsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getsockname.S b/libc/arch-mips64/syscalls/getsockname.S index 5e16aff25..3481d652c 100644 --- a/libc/arch-mips64/syscalls/getsockname.S +++ b/libc/arch-mips64/syscalls/getsockname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockname) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getsockopt.S b/libc/arch-mips64/syscalls/getsockopt.S index fab05b130..2e9b6d706 100644 --- a/libc/arch-mips64/syscalls/getsockopt.S +++ b/libc/arch-mips64/syscalls/getsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockopt) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/gettimeofday.S b/libc/arch-mips64/syscalls/gettimeofday.S index 07407a49c..9bbbd288e 100644 --- a/libc/arch-mips64/syscalls/gettimeofday.S +++ b/libc/arch-mips64/syscalls/gettimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(gettimeofday) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getuid.S b/libc/arch-mips64/syscalls/getuid.S index 87c16e187..4809a5a55 100644 --- a/libc/arch-mips64/syscalls/getuid.S +++ b/libc/arch-mips64/syscalls/getuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getuid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/getxattr.S b/libc/arch-mips64/syscalls/getxattr.S index b42ca1ea5..7a7a4d4e7 100644 --- a/libc/arch-mips64/syscalls/getxattr.S +++ b/libc/arch-mips64/syscalls/getxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getxattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/init_module.S b/libc/arch-mips64/syscalls/init_module.S index 90fb6b1f1..e46dedceb 100644 --- a/libc/arch-mips64/syscalls/init_module.S +++ b/libc/arch-mips64/syscalls/init_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(init_module) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/inotify_add_watch.S b/libc/arch-mips64/syscalls/inotify_add_watch.S index 17db414e1..4a4fe5f11 100644 --- a/libc/arch-mips64/syscalls/inotify_add_watch.S +++ b/libc/arch-mips64/syscalls/inotify_add_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_add_watch) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/inotify_init1.S b/libc/arch-mips64/syscalls/inotify_init1.S index 356dd2d3d..6ef6021a5 100644 --- a/libc/arch-mips64/syscalls/inotify_init1.S +++ b/libc/arch-mips64/syscalls/inotify_init1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_init1) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/inotify_rm_watch.S b/libc/arch-mips64/syscalls/inotify_rm_watch.S index 4096ca383..10e239a0a 100644 --- a/libc/arch-mips64/syscalls/inotify_rm_watch.S +++ b/libc/arch-mips64/syscalls/inotify_rm_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_rm_watch) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/kill.S b/libc/arch-mips64/syscalls/kill.S index 2d8b45210..f85a3ef8c 100644 --- a/libc/arch-mips64/syscalls/kill.S +++ b/libc/arch-mips64/syscalls/kill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(kill) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/klogctl.S b/libc/arch-mips64/syscalls/klogctl.S index 2f9ca6a8f..8e94b62f3 100644 --- a/libc/arch-mips64/syscalls/klogctl.S +++ b/libc/arch-mips64/syscalls/klogctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(klogctl) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/lgetxattr.S b/libc/arch-mips64/syscalls/lgetxattr.S index f8e57b3e8..c5990ab67 100644 --- a/libc/arch-mips64/syscalls/lgetxattr.S +++ b/libc/arch-mips64/syscalls/lgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lgetxattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/linkat.S b/libc/arch-mips64/syscalls/linkat.S index a866fa6b5..88db867ea 100644 --- a/libc/arch-mips64/syscalls/linkat.S +++ b/libc/arch-mips64/syscalls/linkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(linkat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/listen.S b/libc/arch-mips64/syscalls/listen.S index 0768c72c3..4db878946 100644 --- a/libc/arch-mips64/syscalls/listen.S +++ b/libc/arch-mips64/syscalls/listen.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listen) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/listxattr.S b/libc/arch-mips64/syscalls/listxattr.S index f2c00f6e5..56b13f637 100644 --- a/libc/arch-mips64/syscalls/listxattr.S +++ b/libc/arch-mips64/syscalls/listxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listxattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/llistxattr.S b/libc/arch-mips64/syscalls/llistxattr.S index f324e2c1a..d800f7f46 100644 --- a/libc/arch-mips64/syscalls/llistxattr.S +++ b/libc/arch-mips64/syscalls/llistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(llistxattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/lremovexattr.S b/libc/arch-mips64/syscalls/lremovexattr.S index e44c9d0d9..e05733f2e 100644 --- a/libc/arch-mips64/syscalls/lremovexattr.S +++ b/libc/arch-mips64/syscalls/lremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lremovexattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/lseek.S b/libc/arch-mips64/syscalls/lseek.S index 2858aa857..34533cfe1 100644 --- a/libc/arch-mips64/syscalls/lseek.S +++ b/libc/arch-mips64/syscalls/lseek.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lseek) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/lsetxattr.S b/libc/arch-mips64/syscalls/lsetxattr.S index ed1b4df03..dea6add71 100644 --- a/libc/arch-mips64/syscalls/lsetxattr.S +++ b/libc/arch-mips64/syscalls/lsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lsetxattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/madvise.S b/libc/arch-mips64/syscalls/madvise.S index fe6a828d9..ab174e9ed 100644 --- a/libc/arch-mips64/syscalls/madvise.S +++ b/libc/arch-mips64/syscalls/madvise.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(madvise) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/mincore.S b/libc/arch-mips64/syscalls/mincore.S index 1e0b54455..349d2f6dc 100644 --- a/libc/arch-mips64/syscalls/mincore.S +++ b/libc/arch-mips64/syscalls/mincore.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mincore) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/mkdirat.S b/libc/arch-mips64/syscalls/mkdirat.S index b1c94e1e4..b395ba4ea 100644 --- a/libc/arch-mips64/syscalls/mkdirat.S +++ b/libc/arch-mips64/syscalls/mkdirat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mkdirat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/mknodat.S b/libc/arch-mips64/syscalls/mknodat.S index edbd3b6b4..c13d97942 100644 --- a/libc/arch-mips64/syscalls/mknodat.S +++ b/libc/arch-mips64/syscalls/mknodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mknodat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/mlock.S b/libc/arch-mips64/syscalls/mlock.S index ae599cdc4..82338f3a9 100644 --- a/libc/arch-mips64/syscalls/mlock.S +++ b/libc/arch-mips64/syscalls/mlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlock) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/mlockall.S b/libc/arch-mips64/syscalls/mlockall.S index b214758e5..b34cf81df 100644 --- a/libc/arch-mips64/syscalls/mlockall.S +++ b/libc/arch-mips64/syscalls/mlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlockall) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/mmap.S b/libc/arch-mips64/syscalls/mmap.S index ba6d4fac1..814b745e2 100644 --- a/libc/arch-mips64/syscalls/mmap.S +++ b/libc/arch-mips64/syscalls/mmap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mmap) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/mount.S b/libc/arch-mips64/syscalls/mount.S index 71e08a768..3f42df5fb 100644 --- a/libc/arch-mips64/syscalls/mount.S +++ b/libc/arch-mips64/syscalls/mount.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mount) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/mprotect.S b/libc/arch-mips64/syscalls/mprotect.S index 66ffa1aba..adf9a67c0 100644 --- a/libc/arch-mips64/syscalls/mprotect.S +++ b/libc/arch-mips64/syscalls/mprotect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mprotect) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/mremap.S b/libc/arch-mips64/syscalls/mremap.S index c73320fcd..70c8a8c3c 100644 --- a/libc/arch-mips64/syscalls/mremap.S +++ b/libc/arch-mips64/syscalls/mremap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mremap) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/msync.S b/libc/arch-mips64/syscalls/msync.S index a97cba8ef..dced6e709 100644 --- a/libc/arch-mips64/syscalls/msync.S +++ b/libc/arch-mips64/syscalls/msync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(msync) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/munlock.S b/libc/arch-mips64/syscalls/munlock.S index f5919ae8f..075c0615c 100644 --- a/libc/arch-mips64/syscalls/munlock.S +++ b/libc/arch-mips64/syscalls/munlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlock) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/munlockall.S b/libc/arch-mips64/syscalls/munlockall.S index 39e717c2d..10ff2748e 100644 --- a/libc/arch-mips64/syscalls/munlockall.S +++ b/libc/arch-mips64/syscalls/munlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlockall) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/munmap.S b/libc/arch-mips64/syscalls/munmap.S index c1c9b0146..5d0b0b0d4 100644 --- a/libc/arch-mips64/syscalls/munmap.S +++ b/libc/arch-mips64/syscalls/munmap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munmap) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/nanosleep.S b/libc/arch-mips64/syscalls/nanosleep.S index 6bfd73e8b..a0c7d36ca 100644 --- a/libc/arch-mips64/syscalls/nanosleep.S +++ b/libc/arch-mips64/syscalls/nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(nanosleep) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/personality.S b/libc/arch-mips64/syscalls/personality.S index e2346367a..326cf243f 100644 --- a/libc/arch-mips64/syscalls/personality.S +++ b/libc/arch-mips64/syscalls/personality.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(personality) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/pipe2.S b/libc/arch-mips64/syscalls/pipe2.S index 52d5baaea..8e207acd3 100644 --- a/libc/arch-mips64/syscalls/pipe2.S +++ b/libc/arch-mips64/syscalls/pipe2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pipe2) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/prctl.S b/libc/arch-mips64/syscalls/prctl.S index 01d422eb4..9e805f456 100644 --- a/libc/arch-mips64/syscalls/prctl.S +++ b/libc/arch-mips64/syscalls/prctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prctl) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/pread64.S b/libc/arch-mips64/syscalls/pread64.S index 5ab8389c5..3aa06203d 100644 --- a/libc/arch-mips64/syscalls/pread64.S +++ b/libc/arch-mips64/syscalls/pread64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pread64) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/prlimit64.S b/libc/arch-mips64/syscalls/prlimit64.S index e52ca9254..f767ac17d 100644 --- a/libc/arch-mips64/syscalls/prlimit64.S +++ b/libc/arch-mips64/syscalls/prlimit64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prlimit64) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/pwrite64.S b/libc/arch-mips64/syscalls/pwrite64.S index 8d7a8b5d0..8b3bcc0be 100644 --- a/libc/arch-mips64/syscalls/pwrite64.S +++ b/libc/arch-mips64/syscalls/pwrite64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pwrite64) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/read.S b/libc/arch-mips64/syscalls/read.S index 3f805caf1..ab687d161 100644 --- a/libc/arch-mips64/syscalls/read.S +++ b/libc/arch-mips64/syscalls/read.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(read) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/readahead.S b/libc/arch-mips64/syscalls/readahead.S index 8f5c8c6a2..1d9b15b5e 100644 --- a/libc/arch-mips64/syscalls/readahead.S +++ b/libc/arch-mips64/syscalls/readahead.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readahead) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/readlinkat.S b/libc/arch-mips64/syscalls/readlinkat.S index 1381c229a..24da46bc3 100644 --- a/libc/arch-mips64/syscalls/readlinkat.S +++ b/libc/arch-mips64/syscalls/readlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readlinkat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/readv.S b/libc/arch-mips64/syscalls/readv.S index 9c7afd5e3..6aca131bd 100644 --- a/libc/arch-mips64/syscalls/readv.S +++ b/libc/arch-mips64/syscalls/readv.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readv) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/recvfrom.S b/libc/arch-mips64/syscalls/recvfrom.S index d3911c689..b9fb03779 100644 --- a/libc/arch-mips64/syscalls/recvfrom.S +++ b/libc/arch-mips64/syscalls/recvfrom.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvfrom) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/recvmmsg.S b/libc/arch-mips64/syscalls/recvmmsg.S index fa9fbb296..b187cf097 100644 --- a/libc/arch-mips64/syscalls/recvmmsg.S +++ b/libc/arch-mips64/syscalls/recvmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmmsg) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/recvmsg.S b/libc/arch-mips64/syscalls/recvmsg.S index 21ec51d91..49dbb4845 100644 --- a/libc/arch-mips64/syscalls/recvmsg.S +++ b/libc/arch-mips64/syscalls/recvmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmsg) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/removexattr.S b/libc/arch-mips64/syscalls/removexattr.S index ea3177101..61d6da166 100644 --- a/libc/arch-mips64/syscalls/removexattr.S +++ b/libc/arch-mips64/syscalls/removexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(removexattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/renameat.S b/libc/arch-mips64/syscalls/renameat.S index 074a6a453..f012fadaa 100644 --- a/libc/arch-mips64/syscalls/renameat.S +++ b/libc/arch-mips64/syscalls/renameat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(renameat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sched_get_priority_max.S b/libc/arch-mips64/syscalls/sched_get_priority_max.S index 1b67bbfbe..264545b7e 100644 --- a/libc/arch-mips64/syscalls/sched_get_priority_max.S +++ b/libc/arch-mips64/syscalls/sched_get_priority_max.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_max) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sched_get_priority_min.S b/libc/arch-mips64/syscalls/sched_get_priority_min.S index 2d6875260..4984abf3c 100644 --- a/libc/arch-mips64/syscalls/sched_get_priority_min.S +++ b/libc/arch-mips64/syscalls/sched_get_priority_min.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_min) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sched_getparam.S b/libc/arch-mips64/syscalls/sched_getparam.S index d0b206902..2837fc8d9 100644 --- a/libc/arch-mips64/syscalls/sched_getparam.S +++ b/libc/arch-mips64/syscalls/sched_getparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getparam) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sched_getscheduler.S b/libc/arch-mips64/syscalls/sched_getscheduler.S index f25bde5bf..3f8dbe3a2 100644 --- a/libc/arch-mips64/syscalls/sched_getscheduler.S +++ b/libc/arch-mips64/syscalls/sched_getscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getscheduler) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sched_rr_get_interval.S b/libc/arch-mips64/syscalls/sched_rr_get_interval.S index 48233f857..80ea18e5a 100644 --- a/libc/arch-mips64/syscalls/sched_rr_get_interval.S +++ b/libc/arch-mips64/syscalls/sched_rr_get_interval.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_rr_get_interval) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sched_setaffinity.S b/libc/arch-mips64/syscalls/sched_setaffinity.S index e60486354..843e06f23 100644 --- a/libc/arch-mips64/syscalls/sched_setaffinity.S +++ b/libc/arch-mips64/syscalls/sched_setaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setaffinity) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sched_setparam.S b/libc/arch-mips64/syscalls/sched_setparam.S index b02439f44..78435b199 100644 --- a/libc/arch-mips64/syscalls/sched_setparam.S +++ b/libc/arch-mips64/syscalls/sched_setparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setparam) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sched_setscheduler.S b/libc/arch-mips64/syscalls/sched_setscheduler.S index dda1ce51a..7f78cc737 100644 --- a/libc/arch-mips64/syscalls/sched_setscheduler.S +++ b/libc/arch-mips64/syscalls/sched_setscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setscheduler) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sched_yield.S b/libc/arch-mips64/syscalls/sched_yield.S index 509b029a6..f81b7ef67 100644 --- a/libc/arch-mips64/syscalls/sched_yield.S +++ b/libc/arch-mips64/syscalls/sched_yield.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_yield) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sendfile.S b/libc/arch-mips64/syscalls/sendfile.S index 684a83a47..c3e80de0c 100644 --- a/libc/arch-mips64/syscalls/sendfile.S +++ b/libc/arch-mips64/syscalls/sendfile.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendfile) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sendmmsg.S b/libc/arch-mips64/syscalls/sendmmsg.S index e4d80198f..40efcb671 100644 --- a/libc/arch-mips64/syscalls/sendmmsg.S +++ b/libc/arch-mips64/syscalls/sendmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmmsg) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sendmsg.S b/libc/arch-mips64/syscalls/sendmsg.S index 6983f9a0f..9f9071754 100644 --- a/libc/arch-mips64/syscalls/sendmsg.S +++ b/libc/arch-mips64/syscalls/sendmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmsg) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sendto.S b/libc/arch-mips64/syscalls/sendto.S index cfe774dde..3ebfbae4c 100644 --- a/libc/arch-mips64/syscalls/sendto.S +++ b/libc/arch-mips64/syscalls/sendto.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendto) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setfsgid.S b/libc/arch-mips64/syscalls/setfsgid.S index 7f75ed923..9b360382c 100644 --- a/libc/arch-mips64/syscalls/setfsgid.S +++ b/libc/arch-mips64/syscalls/setfsgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsgid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setfsuid.S b/libc/arch-mips64/syscalls/setfsuid.S index 4cab9d4cb..e42601f39 100644 --- a/libc/arch-mips64/syscalls/setfsuid.S +++ b/libc/arch-mips64/syscalls/setfsuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsuid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setgid.S b/libc/arch-mips64/syscalls/setgid.S index cc8d3abae..7ce85994d 100644 --- a/libc/arch-mips64/syscalls/setgid.S +++ b/libc/arch-mips64/syscalls/setgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setgroups.S b/libc/arch-mips64/syscalls/setgroups.S index 63f2329c7..2724068f4 100644 --- a/libc/arch-mips64/syscalls/setgroups.S +++ b/libc/arch-mips64/syscalls/setgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgroups) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setitimer.S b/libc/arch-mips64/syscalls/setitimer.S index 9ee02dcbc..f5dcff0c6 100644 --- a/libc/arch-mips64/syscalls/setitimer.S +++ b/libc/arch-mips64/syscalls/setitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setitimer) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setns.S b/libc/arch-mips64/syscalls/setns.S index 191a1a031..cbe2e061a 100644 --- a/libc/arch-mips64/syscalls/setns.S +++ b/libc/arch-mips64/syscalls/setns.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setns) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setpgid.S b/libc/arch-mips64/syscalls/setpgid.S index 89721600b..da4453215 100644 --- a/libc/arch-mips64/syscalls/setpgid.S +++ b/libc/arch-mips64/syscalls/setpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpgid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setpriority.S b/libc/arch-mips64/syscalls/setpriority.S index dce3a7652..150a5d4b7 100644 --- a/libc/arch-mips64/syscalls/setpriority.S +++ b/libc/arch-mips64/syscalls/setpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpriority) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setregid.S b/libc/arch-mips64/syscalls/setregid.S index d677b322b..b80115cb4 100644 --- a/libc/arch-mips64/syscalls/setregid.S +++ b/libc/arch-mips64/syscalls/setregid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setregid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setresgid.S b/libc/arch-mips64/syscalls/setresgid.S index 312eb3a35..0fbf302d1 100644 --- a/libc/arch-mips64/syscalls/setresgid.S +++ b/libc/arch-mips64/syscalls/setresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresgid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setresuid.S b/libc/arch-mips64/syscalls/setresuid.S index 4da79d0b5..89af745c3 100644 --- a/libc/arch-mips64/syscalls/setresuid.S +++ b/libc/arch-mips64/syscalls/setresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresuid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setreuid.S b/libc/arch-mips64/syscalls/setreuid.S index 33f6fce5e..797091ff0 100644 --- a/libc/arch-mips64/syscalls/setreuid.S +++ b/libc/arch-mips64/syscalls/setreuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setreuid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setrlimit.S b/libc/arch-mips64/syscalls/setrlimit.S index 3060298d2..034f3dbfb 100644 --- a/libc/arch-mips64/syscalls/setrlimit.S +++ b/libc/arch-mips64/syscalls/setrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setrlimit) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setsid.S b/libc/arch-mips64/syscalls/setsid.S index c8d1ad5db..ef14ebaba 100644 --- a/libc/arch-mips64/syscalls/setsid.S +++ b/libc/arch-mips64/syscalls/setsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setsockopt.S b/libc/arch-mips64/syscalls/setsockopt.S index b40aad185..5c263bdf1 100644 --- a/libc/arch-mips64/syscalls/setsockopt.S +++ b/libc/arch-mips64/syscalls/setsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsockopt) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/settimeofday.S b/libc/arch-mips64/syscalls/settimeofday.S index 2e333f8e3..a73638ff7 100644 --- a/libc/arch-mips64/syscalls/settimeofday.S +++ b/libc/arch-mips64/syscalls/settimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(settimeofday) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setuid.S b/libc/arch-mips64/syscalls/setuid.S index fb8125e10..4321fae0c 100644 --- a/libc/arch-mips64/syscalls/setuid.S +++ b/libc/arch-mips64/syscalls/setuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setuid) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/setxattr.S b/libc/arch-mips64/syscalls/setxattr.S index 04e746d77..58ccb5fdd 100644 --- a/libc/arch-mips64/syscalls/setxattr.S +++ b/libc/arch-mips64/syscalls/setxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setxattr) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/shutdown.S b/libc/arch-mips64/syscalls/shutdown.S index 59f437a0b..cdd6c786f 100644 --- a/libc/arch-mips64/syscalls/shutdown.S +++ b/libc/arch-mips64/syscalls/shutdown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(shutdown) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sigaltstack.S b/libc/arch-mips64/syscalls/sigaltstack.S index 0fbd3a157..a2e663cc8 100644 --- a/libc/arch-mips64/syscalls/sigaltstack.S +++ b/libc/arch-mips64/syscalls/sigaltstack.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sigaltstack) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/socketpair.S b/libc/arch-mips64/syscalls/socketpair.S index fa684d1c8..7be781467 100644 --- a/libc/arch-mips64/syscalls/socketpair.S +++ b/libc/arch-mips64/syscalls/socketpair.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(socketpair) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/splice.S b/libc/arch-mips64/syscalls/splice.S index d6269040a..efee6cd7d 100644 --- a/libc/arch-mips64/syscalls/splice.S +++ b/libc/arch-mips64/syscalls/splice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(splice) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/statfs64.S b/libc/arch-mips64/syscalls/statfs64.S index e835e414d..d3775229d 100644 --- a/libc/arch-mips64/syscalls/statfs64.S +++ b/libc/arch-mips64/syscalls/statfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(statfs64) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/swapoff.S b/libc/arch-mips64/syscalls/swapoff.S index dfaf1854b..b257b1e06 100644 --- a/libc/arch-mips64/syscalls/swapoff.S +++ b/libc/arch-mips64/syscalls/swapoff.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapoff) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/swapon.S b/libc/arch-mips64/syscalls/swapon.S index 8e844c497..e18ff4c26 100644 --- a/libc/arch-mips64/syscalls/swapon.S +++ b/libc/arch-mips64/syscalls/swapon.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapon) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/symlinkat.S b/libc/arch-mips64/syscalls/symlinkat.S index e43d59736..560bf0db8 100644 --- a/libc/arch-mips64/syscalls/symlinkat.S +++ b/libc/arch-mips64/syscalls/symlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(symlinkat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sync.S b/libc/arch-mips64/syscalls/sync.S index ec342a31e..240a6d483 100644 --- a/libc/arch-mips64/syscalls/sync.S +++ b/libc/arch-mips64/syscalls/sync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sync) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/sysinfo.S b/libc/arch-mips64/syscalls/sysinfo.S index 16486fdec..6b07be3e5 100644 --- a/libc/arch-mips64/syscalls/sysinfo.S +++ b/libc/arch-mips64/syscalls/sysinfo.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sysinfo) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/tee.S b/libc/arch-mips64/syscalls/tee.S index 429700c62..0115f714e 100644 --- a/libc/arch-mips64/syscalls/tee.S +++ b/libc/arch-mips64/syscalls/tee.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tee) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/tgkill.S b/libc/arch-mips64/syscalls/tgkill.S index d98d9ae14..bf30a8d7d 100644 --- a/libc/arch-mips64/syscalls/tgkill.S +++ b/libc/arch-mips64/syscalls/tgkill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tgkill) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/timerfd_create.S b/libc/arch-mips64/syscalls/timerfd_create.S index ab8e9e0f9..e65874f60 100644 --- a/libc/arch-mips64/syscalls/timerfd_create.S +++ b/libc/arch-mips64/syscalls/timerfd_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_create) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/timerfd_gettime.S b/libc/arch-mips64/syscalls/timerfd_gettime.S index 2ec7b9c15..a8435986e 100644 --- a/libc/arch-mips64/syscalls/timerfd_gettime.S +++ b/libc/arch-mips64/syscalls/timerfd_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_gettime) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/timerfd_settime.S b/libc/arch-mips64/syscalls/timerfd_settime.S index 0aec09fb6..8c5994f72 100644 --- a/libc/arch-mips64/syscalls/timerfd_settime.S +++ b/libc/arch-mips64/syscalls/timerfd_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_settime) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/times.S b/libc/arch-mips64/syscalls/times.S index 2457e0c62..ff504e715 100644 --- a/libc/arch-mips64/syscalls/times.S +++ b/libc/arch-mips64/syscalls/times.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(times) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/truncate.S b/libc/arch-mips64/syscalls/truncate.S index a0cbe5141..3fc06a2a1 100644 --- a/libc/arch-mips64/syscalls/truncate.S +++ b/libc/arch-mips64/syscalls/truncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(truncate) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/umask.S b/libc/arch-mips64/syscalls/umask.S index 33624d212..9e6c910fe 100644 --- a/libc/arch-mips64/syscalls/umask.S +++ b/libc/arch-mips64/syscalls/umask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umask) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/umount2.S b/libc/arch-mips64/syscalls/umount2.S index 6193459fc..f8d19966f 100644 --- a/libc/arch-mips64/syscalls/umount2.S +++ b/libc/arch-mips64/syscalls/umount2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umount2) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/uname.S b/libc/arch-mips64/syscalls/uname.S index df50f4599..ce93f08ff 100644 --- a/libc/arch-mips64/syscalls/uname.S +++ b/libc/arch-mips64/syscalls/uname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(uname) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/unlinkat.S b/libc/arch-mips64/syscalls/unlinkat.S index 29d44427e..870e8d7a5 100644 --- a/libc/arch-mips64/syscalls/unlinkat.S +++ b/libc/arch-mips64/syscalls/unlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unlinkat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/unshare.S b/libc/arch-mips64/syscalls/unshare.S index 6d8fbf3d0..231c29adc 100644 --- a/libc/arch-mips64/syscalls/unshare.S +++ b/libc/arch-mips64/syscalls/unshare.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unshare) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/utimensat.S b/libc/arch-mips64/syscalls/utimensat.S index 654b8a454..4b4243e0e 100644 --- a/libc/arch-mips64/syscalls/utimensat.S +++ b/libc/arch-mips64/syscalls/utimensat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(utimensat) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/vmsplice.S b/libc/arch-mips64/syscalls/vmsplice.S index aa03585d0..f85400419 100644 --- a/libc/arch-mips64/syscalls/vmsplice.S +++ b/libc/arch-mips64/syscalls/vmsplice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(vmsplice) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/wait4.S b/libc/arch-mips64/syscalls/wait4.S index e3755b58e..2d2b4876f 100644 --- a/libc/arch-mips64/syscalls/wait4.S +++ b/libc/arch-mips64/syscalls/wait4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(wait4) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/write.S b/libc/arch-mips64/syscalls/write.S index ce7f70232..f603fb541 100644 --- a/libc/arch-mips64/syscalls/write.S +++ b/libc/arch-mips64/syscalls/write.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(write) .set push .set noreorder diff --git a/libc/arch-mips64/syscalls/writev.S b/libc/arch-mips64/syscalls/writev.S index e2c7875eb..032e749d3 100644 --- a/libc/arch-mips64/syscalls/writev.S +++ b/libc/arch-mips64/syscalls/writev.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(writev) .set push .set noreorder diff --git a/libc/arch-x86/syscalls/__accept4.S b/libc/arch-x86/syscalls/__accept4.S index 2d9cc423c..c28f211ff 100644 --- a/libc/arch-x86/syscalls/__accept4.S +++ b/libc/arch-x86/syscalls/__accept4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__accept4) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__brk.S b/libc/arch-x86/syscalls/__brk.S index 632dfcf7a..c5702cfec 100644 --- a/libc/arch-x86/syscalls/__brk.S +++ b/libc/arch-x86/syscalls/__brk.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__brk) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__connect.S b/libc/arch-x86/syscalls/__connect.S index 5ee4fbf7f..4f845b734 100644 --- a/libc/arch-x86/syscalls/__connect.S +++ b/libc/arch-x86/syscalls/__connect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__connect) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__epoll_pwait.S b/libc/arch-x86/syscalls/__epoll_pwait.S index 641ca6d63..c7acb2b83 100644 --- a/libc/arch-x86/syscalls/__epoll_pwait.S +++ b/libc/arch-x86/syscalls/__epoll_pwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__epoll_pwait) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__exit.S b/libc/arch-x86/syscalls/__exit.S index 8578f56c5..bf76e0479 100644 --- a/libc/arch-x86/syscalls/__exit.S +++ b/libc/arch-x86/syscalls/__exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__exit) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__fcntl64.S b/libc/arch-x86/syscalls/__fcntl64.S index ef58d15e7..7c41c8858 100644 --- a/libc/arch-x86/syscalls/__fcntl64.S +++ b/libc/arch-x86/syscalls/__fcntl64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__fcntl64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__fstatfs64.S b/libc/arch-x86/syscalls/__fstatfs64.S index 0ca33606a..b182ae368 100644 --- a/libc/arch-x86/syscalls/__fstatfs64.S +++ b/libc/arch-x86/syscalls/__fstatfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__fstatfs64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__getcpu.S b/libc/arch-x86/syscalls/__getcpu.S index b181877f8..4cdbafac6 100644 --- a/libc/arch-x86/syscalls/__getcpu.S +++ b/libc/arch-x86/syscalls/__getcpu.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcpu) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__getcwd.S b/libc/arch-x86/syscalls/__getcwd.S index b71ba0de1..f5b9b9c71 100644 --- a/libc/arch-x86/syscalls/__getcwd.S +++ b/libc/arch-x86/syscalls/__getcwd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcwd) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__getdents64.S b/libc/arch-x86/syscalls/__getdents64.S index 3fc8719eb..0ff217d17 100644 --- a/libc/arch-x86/syscalls/__getdents64.S +++ b/libc/arch-x86/syscalls/__getdents64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getdents64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__getpid.S b/libc/arch-x86/syscalls/__getpid.S index f138d2f88..6a3602ebd 100644 --- a/libc/arch-x86/syscalls/__getpid.S +++ b/libc/arch-x86/syscalls/__getpid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpid) movl $__NR_getpid, %eax int $0x80 diff --git a/libc/arch-x86/syscalls/__getpriority.S b/libc/arch-x86/syscalls/__getpriority.S index 103431d26..6a94f4381 100644 --- a/libc/arch-x86/syscalls/__getpriority.S +++ b/libc/arch-x86/syscalls/__getpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpriority) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__ioctl.S b/libc/arch-x86/syscalls/__ioctl.S index 99d2d2c76..edb990a04 100644 --- a/libc/arch-x86/syscalls/__ioctl.S +++ b/libc/arch-x86/syscalls/__ioctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ioctl) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__llseek.S b/libc/arch-x86/syscalls/__llseek.S index 0cdb98aa1..db3910643 100644 --- a/libc/arch-x86/syscalls/__llseek.S +++ b/libc/arch-x86/syscalls/__llseek.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__llseek) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__mmap2.S b/libc/arch-x86/syscalls/__mmap2.S index 47131efee..5c8f2a31d 100644 --- a/libc/arch-x86/syscalls/__mmap2.S +++ b/libc/arch-x86/syscalls/__mmap2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__mmap2) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__openat.S b/libc/arch-x86/syscalls/__openat.S index aec10e585..87687e569 100644 --- a/libc/arch-x86/syscalls/__openat.S +++ b/libc/arch-x86/syscalls/__openat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__openat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__ppoll.S b/libc/arch-x86/syscalls/__ppoll.S index 92197b73c..e48f84123 100644 --- a/libc/arch-x86/syscalls/__ppoll.S +++ b/libc/arch-x86/syscalls/__ppoll.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ppoll) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__pselect6.S b/libc/arch-x86/syscalls/__pselect6.S index 38402f02d..53edb8ca1 100644 --- a/libc/arch-x86/syscalls/__pselect6.S +++ b/libc/arch-x86/syscalls/__pselect6.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__pselect6) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__ptrace.S b/libc/arch-x86/syscalls/__ptrace.S index cea5847fe..9d1e460ed 100644 --- a/libc/arch-x86/syscalls/__ptrace.S +++ b/libc/arch-x86/syscalls/__ptrace.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ptrace) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__reboot.S b/libc/arch-x86/syscalls/__reboot.S index 454699421..3ef78bb08 100644 --- a/libc/arch-x86/syscalls/__reboot.S +++ b/libc/arch-x86/syscalls/__reboot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__reboot) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__rt_sigaction.S b/libc/arch-x86/syscalls/__rt_sigaction.S index bfbe5baa4..1ce7ef96b 100644 --- a/libc/arch-x86/syscalls/__rt_sigaction.S +++ b/libc/arch-x86/syscalls/__rt_sigaction.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigaction) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__rt_sigpending.S b/libc/arch-x86/syscalls/__rt_sigpending.S index dac478a64..a4cb3c1ec 100644 --- a/libc/arch-x86/syscalls/__rt_sigpending.S +++ b/libc/arch-x86/syscalls/__rt_sigpending.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigpending) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__rt_sigprocmask.S b/libc/arch-x86/syscalls/__rt_sigprocmask.S index f1123603b..9d8e90d0a 100644 --- a/libc/arch-x86/syscalls/__rt_sigprocmask.S +++ b/libc/arch-x86/syscalls/__rt_sigprocmask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigprocmask) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__rt_sigsuspend.S b/libc/arch-x86/syscalls/__rt_sigsuspend.S index ef505c097..e0d0c3dd1 100644 --- a/libc/arch-x86/syscalls/__rt_sigsuspend.S +++ b/libc/arch-x86/syscalls/__rt_sigsuspend.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigsuspend) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__rt_sigtimedwait.S b/libc/arch-x86/syscalls/__rt_sigtimedwait.S index d19c7dbdb..091c1a721 100644 --- a/libc/arch-x86/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-x86/syscalls/__rt_sigtimedwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigtimedwait) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__sched_getaffinity.S b/libc/arch-x86/syscalls/__sched_getaffinity.S index e7cb8f1c5..2c278db3d 100644 --- a/libc/arch-x86/syscalls/__sched_getaffinity.S +++ b/libc/arch-x86/syscalls/__sched_getaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__sched_getaffinity) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__set_thread_area.S b/libc/arch-x86/syscalls/__set_thread_area.S index dda23a0d0..29e12388d 100644 --- a/libc/arch-x86/syscalls/__set_thread_area.S +++ b/libc/arch-x86/syscalls/__set_thread_area.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__set_thread_area) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__set_tid_address.S b/libc/arch-x86/syscalls/__set_tid_address.S index 1566d9a3e..35174427f 100644 --- a/libc/arch-x86/syscalls/__set_tid_address.S +++ b/libc/arch-x86/syscalls/__set_tid_address.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__set_tid_address) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__sigaction.S b/libc/arch-x86/syscalls/__sigaction.S index f1a51d2eb..0a3e77e10 100644 --- a/libc/arch-x86/syscalls/__sigaction.S +++ b/libc/arch-x86/syscalls/__sigaction.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__sigaction) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__signalfd4.S b/libc/arch-x86/syscalls/__signalfd4.S index 335e20627..acfced5c9 100644 --- a/libc/arch-x86/syscalls/__signalfd4.S +++ b/libc/arch-x86/syscalls/__signalfd4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__signalfd4) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__socket.S b/libc/arch-x86/syscalls/__socket.S index 368680f36..59988f3d0 100644 --- a/libc/arch-x86/syscalls/__socket.S +++ b/libc/arch-x86/syscalls/__socket.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__socket) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__statfs64.S b/libc/arch-x86/syscalls/__statfs64.S index 6bb9d993c..63d866e87 100644 --- a/libc/arch-x86/syscalls/__statfs64.S +++ b/libc/arch-x86/syscalls/__statfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__statfs64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__timer_create.S b/libc/arch-x86/syscalls/__timer_create.S index 3d28ae90b..1265aa662 100644 --- a/libc/arch-x86/syscalls/__timer_create.S +++ b/libc/arch-x86/syscalls/__timer_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_create) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__timer_delete.S b/libc/arch-x86/syscalls/__timer_delete.S index 7d64d6d44..bc1fbc570 100644 --- a/libc/arch-x86/syscalls/__timer_delete.S +++ b/libc/arch-x86/syscalls/__timer_delete.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_delete) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__timer_getoverrun.S b/libc/arch-x86/syscalls/__timer_getoverrun.S index cb3776533..2a8de1e51 100644 --- a/libc/arch-x86/syscalls/__timer_getoverrun.S +++ b/libc/arch-x86/syscalls/__timer_getoverrun.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_getoverrun) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__timer_gettime.S b/libc/arch-x86/syscalls/__timer_gettime.S index 5c43f4a10..9edd15a13 100644 --- a/libc/arch-x86/syscalls/__timer_gettime.S +++ b/libc/arch-x86/syscalls/__timer_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_gettime) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__timer_settime.S b/libc/arch-x86/syscalls/__timer_settime.S index da7c58715..4bb0790b9 100644 --- a/libc/arch-x86/syscalls/__timer_settime.S +++ b/libc/arch-x86/syscalls/__timer_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_settime) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/__waitid.S b/libc/arch-x86/syscalls/__waitid.S index 7e3ecdd9f..331baf561 100644 --- a/libc/arch-x86/syscalls/__waitid.S +++ b/libc/arch-x86/syscalls/__waitid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__waitid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/_exit.S b/libc/arch-x86/syscalls/_exit.S index 36e884a6a..0da6e7986 100644 --- a/libc/arch-x86/syscalls/_exit.S +++ b/libc/arch-x86/syscalls/_exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(_exit) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/acct.S b/libc/arch-x86/syscalls/acct.S index a0361145b..34a23a46e 100644 --- a/libc/arch-x86/syscalls/acct.S +++ b/libc/arch-x86/syscalls/acct.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(acct) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/bind.S b/libc/arch-x86/syscalls/bind.S index ab5a29e7e..1d4531906 100644 --- a/libc/arch-x86/syscalls/bind.S +++ b/libc/arch-x86/syscalls/bind.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(bind) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/capget.S b/libc/arch-x86/syscalls/capget.S index 5441e4906..82b5b73df 100644 --- a/libc/arch-x86/syscalls/capget.S +++ b/libc/arch-x86/syscalls/capget.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capget) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/capset.S b/libc/arch-x86/syscalls/capset.S index d04e4119e..79e874796 100644 --- a/libc/arch-x86/syscalls/capset.S +++ b/libc/arch-x86/syscalls/capset.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capset) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/chdir.S b/libc/arch-x86/syscalls/chdir.S index d32a0bdef..98bdf37ea 100644 --- a/libc/arch-x86/syscalls/chdir.S +++ b/libc/arch-x86/syscalls/chdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chdir) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/chroot.S b/libc/arch-x86/syscalls/chroot.S index 63d7e00ab..978eec7d6 100644 --- a/libc/arch-x86/syscalls/chroot.S +++ b/libc/arch-x86/syscalls/chroot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chroot) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/clock_getres.S b/libc/arch-x86/syscalls/clock_getres.S index 321299c35..c93a27927 100644 --- a/libc/arch-x86/syscalls/clock_getres.S +++ b/libc/arch-x86/syscalls/clock_getres.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_getres) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/clock_gettime.S b/libc/arch-x86/syscalls/clock_gettime.S index 54f769aff..9c5c2407e 100644 --- a/libc/arch-x86/syscalls/clock_gettime.S +++ b/libc/arch-x86/syscalls/clock_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_gettime) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/clock_nanosleep.S b/libc/arch-x86/syscalls/clock_nanosleep.S index ca961c0ea..edadec219 100644 --- a/libc/arch-x86/syscalls/clock_nanosleep.S +++ b/libc/arch-x86/syscalls/clock_nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_nanosleep) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/clock_settime.S b/libc/arch-x86/syscalls/clock_settime.S index ab8c43e7a..41012d0af 100644 --- a/libc/arch-x86/syscalls/clock_settime.S +++ b/libc/arch-x86/syscalls/clock_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_settime) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/close.S b/libc/arch-x86/syscalls/close.S index 0b3e73ab7..b73c4b400 100644 --- a/libc/arch-x86/syscalls/close.S +++ b/libc/arch-x86/syscalls/close.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(close) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/delete_module.S b/libc/arch-x86/syscalls/delete_module.S index 757c8c1b9..73a51283d 100644 --- a/libc/arch-x86/syscalls/delete_module.S +++ b/libc/arch-x86/syscalls/delete_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(delete_module) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/dup.S b/libc/arch-x86/syscalls/dup.S index 64e1538e5..f8e8772b5 100644 --- a/libc/arch-x86/syscalls/dup.S +++ b/libc/arch-x86/syscalls/dup.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/dup3.S b/libc/arch-x86/syscalls/dup3.S index a0ecd1942..1203e6453 100644 --- a/libc/arch-x86/syscalls/dup3.S +++ b/libc/arch-x86/syscalls/dup3.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup3) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/epoll_create1.S b/libc/arch-x86/syscalls/epoll_create1.S index 5b6a1baa2..6384b926b 100644 --- a/libc/arch-x86/syscalls/epoll_create1.S +++ b/libc/arch-x86/syscalls/epoll_create1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_create1) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/epoll_ctl.S b/libc/arch-x86/syscalls/epoll_ctl.S index 3fd8acd3c..cdc880e75 100644 --- a/libc/arch-x86/syscalls/epoll_ctl.S +++ b/libc/arch-x86/syscalls/epoll_ctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_ctl) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/eventfd.S b/libc/arch-x86/syscalls/eventfd.S index 55c5e6a30..fe859672e 100644 --- a/libc/arch-x86/syscalls/eventfd.S +++ b/libc/arch-x86/syscalls/eventfd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(eventfd) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/execve.S b/libc/arch-x86/syscalls/execve.S index 7ad54f761..a897c42d0 100644 --- a/libc/arch-x86/syscalls/execve.S +++ b/libc/arch-x86/syscalls/execve.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(execve) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/faccessat.S b/libc/arch-x86/syscalls/faccessat.S index 115d64574..4ac3e2a59 100644 --- a/libc/arch-x86/syscalls/faccessat.S +++ b/libc/arch-x86/syscalls/faccessat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(faccessat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fallocate64.S b/libc/arch-x86/syscalls/fallocate64.S index f8bde62c7..e1dfa085a 100644 --- a/libc/arch-x86/syscalls/fallocate64.S +++ b/libc/arch-x86/syscalls/fallocate64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fallocate64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fchdir.S b/libc/arch-x86/syscalls/fchdir.S index 56e496c77..af43acb0d 100644 --- a/libc/arch-x86/syscalls/fchdir.S +++ b/libc/arch-x86/syscalls/fchdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchdir) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fchmod.S b/libc/arch-x86/syscalls/fchmod.S index 4badceaae..5c5835990 100644 --- a/libc/arch-x86/syscalls/fchmod.S +++ b/libc/arch-x86/syscalls/fchmod.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmod) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fchmodat.S b/libc/arch-x86/syscalls/fchmodat.S index 552e85c49..aed8d2910 100644 --- a/libc/arch-x86/syscalls/fchmodat.S +++ b/libc/arch-x86/syscalls/fchmodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmodat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fchown.S b/libc/arch-x86/syscalls/fchown.S index 7e826379e..da80251d1 100644 --- a/libc/arch-x86/syscalls/fchown.S +++ b/libc/arch-x86/syscalls/fchown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchown) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fchownat.S b/libc/arch-x86/syscalls/fchownat.S index de039d0d9..851424370 100644 --- a/libc/arch-x86/syscalls/fchownat.S +++ b/libc/arch-x86/syscalls/fchownat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchownat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fdatasync.S b/libc/arch-x86/syscalls/fdatasync.S index fdb55788c..fc2c16332 100644 --- a/libc/arch-x86/syscalls/fdatasync.S +++ b/libc/arch-x86/syscalls/fdatasync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fdatasync) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fgetxattr.S b/libc/arch-x86/syscalls/fgetxattr.S index 3ed63d3d5..767a675ab 100644 --- a/libc/arch-x86/syscalls/fgetxattr.S +++ b/libc/arch-x86/syscalls/fgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fgetxattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/flistxattr.S b/libc/arch-x86/syscalls/flistxattr.S index 2840114cd..dbb49779c 100644 --- a/libc/arch-x86/syscalls/flistxattr.S +++ b/libc/arch-x86/syscalls/flistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flistxattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/flock.S b/libc/arch-x86/syscalls/flock.S index dc9ef0200..b4b748e82 100644 --- a/libc/arch-x86/syscalls/flock.S +++ b/libc/arch-x86/syscalls/flock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flock) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fremovexattr.S b/libc/arch-x86/syscalls/fremovexattr.S index 1e77f828f..c34cbc4a8 100644 --- a/libc/arch-x86/syscalls/fremovexattr.S +++ b/libc/arch-x86/syscalls/fremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fremovexattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fsetxattr.S b/libc/arch-x86/syscalls/fsetxattr.S index 703a8d73c..5593dca70 100644 --- a/libc/arch-x86/syscalls/fsetxattr.S +++ b/libc/arch-x86/syscalls/fsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsetxattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fstat64.S b/libc/arch-x86/syscalls/fstat64.S index 970eeb11f..2e29ae5f8 100644 --- a/libc/arch-x86/syscalls/fstat64.S +++ b/libc/arch-x86/syscalls/fstat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstat64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fstatat64.S b/libc/arch-x86/syscalls/fstatat64.S index 476578d36..72922cbfe 100644 --- a/libc/arch-x86/syscalls/fstatat64.S +++ b/libc/arch-x86/syscalls/fstatat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstatat64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/fsync.S b/libc/arch-x86/syscalls/fsync.S index 9fc84b70c..af10e9ad2 100644 --- a/libc/arch-x86/syscalls/fsync.S +++ b/libc/arch-x86/syscalls/fsync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsync) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/ftruncate.S b/libc/arch-x86/syscalls/ftruncate.S index 6765d984c..734398559 100644 --- a/libc/arch-x86/syscalls/ftruncate.S +++ b/libc/arch-x86/syscalls/ftruncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(ftruncate) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/ftruncate64.S b/libc/arch-x86/syscalls/ftruncate64.S index 21e26ce00..47b925b84 100644 --- a/libc/arch-x86/syscalls/ftruncate64.S +++ b/libc/arch-x86/syscalls/ftruncate64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(ftruncate64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getegid.S b/libc/arch-x86/syscalls/getegid.S index 445cd97da..bc21b5a35 100644 --- a/libc/arch-x86/syscalls/getegid.S +++ b/libc/arch-x86/syscalls/getegid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getegid) movl $__NR_getegid32, %eax int $0x80 diff --git a/libc/arch-x86/syscalls/geteuid.S b/libc/arch-x86/syscalls/geteuid.S index 8290a939b..469f9c9ad 100644 --- a/libc/arch-x86/syscalls/geteuid.S +++ b/libc/arch-x86/syscalls/geteuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(geteuid) movl $__NR_geteuid32, %eax int $0x80 diff --git a/libc/arch-x86/syscalls/getgid.S b/libc/arch-x86/syscalls/getgid.S index d90767f6f..6b15674b7 100644 --- a/libc/arch-x86/syscalls/getgid.S +++ b/libc/arch-x86/syscalls/getgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgid) movl $__NR_getgid32, %eax int $0x80 diff --git a/libc/arch-x86/syscalls/getgroups.S b/libc/arch-x86/syscalls/getgroups.S index d36c09cc8..a7aa1b2af 100644 --- a/libc/arch-x86/syscalls/getgroups.S +++ b/libc/arch-x86/syscalls/getgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgroups) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getitimer.S b/libc/arch-x86/syscalls/getitimer.S index ebf12601d..1b424a33b 100644 --- a/libc/arch-x86/syscalls/getitimer.S +++ b/libc/arch-x86/syscalls/getitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getitimer) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getpeername.S b/libc/arch-x86/syscalls/getpeername.S index abecd4edb..94b43fbcc 100644 --- a/libc/arch-x86/syscalls/getpeername.S +++ b/libc/arch-x86/syscalls/getpeername.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpeername) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getpgid.S b/libc/arch-x86/syscalls/getpgid.S index e74ed3b78..7d7149e46 100644 --- a/libc/arch-x86/syscalls/getpgid.S +++ b/libc/arch-x86/syscalls/getpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpgid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getppid.S b/libc/arch-x86/syscalls/getppid.S index 025fa42e4..3103ed2d6 100644 --- a/libc/arch-x86/syscalls/getppid.S +++ b/libc/arch-x86/syscalls/getppid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getppid) movl $__NR_getppid, %eax int $0x80 diff --git a/libc/arch-x86/syscalls/getresgid.S b/libc/arch-x86/syscalls/getresgid.S index fe08cdfcb..2f03a03c9 100644 --- a/libc/arch-x86/syscalls/getresgid.S +++ b/libc/arch-x86/syscalls/getresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresgid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getresuid.S b/libc/arch-x86/syscalls/getresuid.S index 8e292fc5b..d6fe91560 100644 --- a/libc/arch-x86/syscalls/getresuid.S +++ b/libc/arch-x86/syscalls/getresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresuid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getrlimit.S b/libc/arch-x86/syscalls/getrlimit.S index fdb5a03fa..4587a2e35 100644 --- a/libc/arch-x86/syscalls/getrlimit.S +++ b/libc/arch-x86/syscalls/getrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrlimit) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getrusage.S b/libc/arch-x86/syscalls/getrusage.S index ae5f79629..4b2e38b3a 100644 --- a/libc/arch-x86/syscalls/getrusage.S +++ b/libc/arch-x86/syscalls/getrusage.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrusage) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getsid.S b/libc/arch-x86/syscalls/getsid.S index e1dc87fde..eac9f2c4b 100644 --- a/libc/arch-x86/syscalls/getsid.S +++ b/libc/arch-x86/syscalls/getsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getsockname.S b/libc/arch-x86/syscalls/getsockname.S index 254b755c8..738fa6d44 100644 --- a/libc/arch-x86/syscalls/getsockname.S +++ b/libc/arch-x86/syscalls/getsockname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockname) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getsockopt.S b/libc/arch-x86/syscalls/getsockopt.S index 2ef630c0d..f8338f503 100644 --- a/libc/arch-x86/syscalls/getsockopt.S +++ b/libc/arch-x86/syscalls/getsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockopt) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/gettimeofday.S b/libc/arch-x86/syscalls/gettimeofday.S index 709a17ba5..96c1e111d 100644 --- a/libc/arch-x86/syscalls/gettimeofday.S +++ b/libc/arch-x86/syscalls/gettimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(gettimeofday) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/getuid.S b/libc/arch-x86/syscalls/getuid.S index c375d309d..cde5da8b6 100644 --- a/libc/arch-x86/syscalls/getuid.S +++ b/libc/arch-x86/syscalls/getuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getuid) movl $__NR_getuid32, %eax int $0x80 diff --git a/libc/arch-x86/syscalls/getxattr.S b/libc/arch-x86/syscalls/getxattr.S index db9c9dd68..7679cbf1c 100644 --- a/libc/arch-x86/syscalls/getxattr.S +++ b/libc/arch-x86/syscalls/getxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getxattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/init_module.S b/libc/arch-x86/syscalls/init_module.S index 543b31eec..02e55f0e2 100644 --- a/libc/arch-x86/syscalls/init_module.S +++ b/libc/arch-x86/syscalls/init_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(init_module) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/inotify_add_watch.S b/libc/arch-x86/syscalls/inotify_add_watch.S index f58c6d181..74a59f358 100644 --- a/libc/arch-x86/syscalls/inotify_add_watch.S +++ b/libc/arch-x86/syscalls/inotify_add_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_add_watch) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/inotify_init1.S b/libc/arch-x86/syscalls/inotify_init1.S index 2c7b10013..de714c962 100644 --- a/libc/arch-x86/syscalls/inotify_init1.S +++ b/libc/arch-x86/syscalls/inotify_init1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_init1) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/inotify_rm_watch.S b/libc/arch-x86/syscalls/inotify_rm_watch.S index c453478ce..3edc152c4 100644 --- a/libc/arch-x86/syscalls/inotify_rm_watch.S +++ b/libc/arch-x86/syscalls/inotify_rm_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_rm_watch) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/kill.S b/libc/arch-x86/syscalls/kill.S index 0c1e24ae9..0cf38a9e7 100644 --- a/libc/arch-x86/syscalls/kill.S +++ b/libc/arch-x86/syscalls/kill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(kill) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/klogctl.S b/libc/arch-x86/syscalls/klogctl.S index 869324a44..52b04e132 100644 --- a/libc/arch-x86/syscalls/klogctl.S +++ b/libc/arch-x86/syscalls/klogctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(klogctl) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/lgetxattr.S b/libc/arch-x86/syscalls/lgetxattr.S index 3ed4f1127..8c2eb473c 100644 --- a/libc/arch-x86/syscalls/lgetxattr.S +++ b/libc/arch-x86/syscalls/lgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lgetxattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/linkat.S b/libc/arch-x86/syscalls/linkat.S index e0c7e5f75..56b8368ec 100644 --- a/libc/arch-x86/syscalls/linkat.S +++ b/libc/arch-x86/syscalls/linkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(linkat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/listen.S b/libc/arch-x86/syscalls/listen.S index c65f97045..2c8cc7685 100644 --- a/libc/arch-x86/syscalls/listen.S +++ b/libc/arch-x86/syscalls/listen.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listen) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/listxattr.S b/libc/arch-x86/syscalls/listxattr.S index 98a51143d..f43ab3cd5 100644 --- a/libc/arch-x86/syscalls/listxattr.S +++ b/libc/arch-x86/syscalls/listxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listxattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/llistxattr.S b/libc/arch-x86/syscalls/llistxattr.S index a5ab636a6..d32652678 100644 --- a/libc/arch-x86/syscalls/llistxattr.S +++ b/libc/arch-x86/syscalls/llistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(llistxattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/lremovexattr.S b/libc/arch-x86/syscalls/lremovexattr.S index 508abbacd..b4f4817bb 100644 --- a/libc/arch-x86/syscalls/lremovexattr.S +++ b/libc/arch-x86/syscalls/lremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lremovexattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/lseek.S b/libc/arch-x86/syscalls/lseek.S index 5f77831cd..1115be867 100644 --- a/libc/arch-x86/syscalls/lseek.S +++ b/libc/arch-x86/syscalls/lseek.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lseek) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/lsetxattr.S b/libc/arch-x86/syscalls/lsetxattr.S index d8786849b..fc62cdd20 100644 --- a/libc/arch-x86/syscalls/lsetxattr.S +++ b/libc/arch-x86/syscalls/lsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lsetxattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/madvise.S b/libc/arch-x86/syscalls/madvise.S index 3e8c7fdee..1de44560a 100644 --- a/libc/arch-x86/syscalls/madvise.S +++ b/libc/arch-x86/syscalls/madvise.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(madvise) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/mincore.S b/libc/arch-x86/syscalls/mincore.S index 7096f6c57..118063cb1 100644 --- a/libc/arch-x86/syscalls/mincore.S +++ b/libc/arch-x86/syscalls/mincore.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mincore) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/mkdirat.S b/libc/arch-x86/syscalls/mkdirat.S index 862a18cfc..6969d2a5f 100644 --- a/libc/arch-x86/syscalls/mkdirat.S +++ b/libc/arch-x86/syscalls/mkdirat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mkdirat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/mknodat.S b/libc/arch-x86/syscalls/mknodat.S index e03ba42a9..6c743d278 100644 --- a/libc/arch-x86/syscalls/mknodat.S +++ b/libc/arch-x86/syscalls/mknodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mknodat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/mlock.S b/libc/arch-x86/syscalls/mlock.S index f582f7729..5ec799e7a 100644 --- a/libc/arch-x86/syscalls/mlock.S +++ b/libc/arch-x86/syscalls/mlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlock) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/mlockall.S b/libc/arch-x86/syscalls/mlockall.S index becca812c..72a8da597 100644 --- a/libc/arch-x86/syscalls/mlockall.S +++ b/libc/arch-x86/syscalls/mlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlockall) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/mount.S b/libc/arch-x86/syscalls/mount.S index 7be28115e..1e06b8e30 100644 --- a/libc/arch-x86/syscalls/mount.S +++ b/libc/arch-x86/syscalls/mount.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mount) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/mprotect.S b/libc/arch-x86/syscalls/mprotect.S index 0516c45f3..11037c3ef 100644 --- a/libc/arch-x86/syscalls/mprotect.S +++ b/libc/arch-x86/syscalls/mprotect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mprotect) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/mremap.S b/libc/arch-x86/syscalls/mremap.S index 42e75ced9..b7f96ff84 100644 --- a/libc/arch-x86/syscalls/mremap.S +++ b/libc/arch-x86/syscalls/mremap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mremap) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/msync.S b/libc/arch-x86/syscalls/msync.S index 66722f2e5..e2549f768 100644 --- a/libc/arch-x86/syscalls/msync.S +++ b/libc/arch-x86/syscalls/msync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(msync) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/munlock.S b/libc/arch-x86/syscalls/munlock.S index 2fc3aa703..6b79e9910 100644 --- a/libc/arch-x86/syscalls/munlock.S +++ b/libc/arch-x86/syscalls/munlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlock) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/munlockall.S b/libc/arch-x86/syscalls/munlockall.S index 1bc99ea0a..96e238b1e 100644 --- a/libc/arch-x86/syscalls/munlockall.S +++ b/libc/arch-x86/syscalls/munlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlockall) movl $__NR_munlockall, %eax int $0x80 diff --git a/libc/arch-x86/syscalls/munmap.S b/libc/arch-x86/syscalls/munmap.S index 878aae7aa..a77a77746 100644 --- a/libc/arch-x86/syscalls/munmap.S +++ b/libc/arch-x86/syscalls/munmap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munmap) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/nanosleep.S b/libc/arch-x86/syscalls/nanosleep.S index fe8af908d..444aa7e94 100644 --- a/libc/arch-x86/syscalls/nanosleep.S +++ b/libc/arch-x86/syscalls/nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(nanosleep) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/personality.S b/libc/arch-x86/syscalls/personality.S index 8c8e0ffa4..5344e1cc1 100644 --- a/libc/arch-x86/syscalls/personality.S +++ b/libc/arch-x86/syscalls/personality.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(personality) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/pipe2.S b/libc/arch-x86/syscalls/pipe2.S index 99c4e8b61..62665a05a 100644 --- a/libc/arch-x86/syscalls/pipe2.S +++ b/libc/arch-x86/syscalls/pipe2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pipe2) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/prctl.S b/libc/arch-x86/syscalls/prctl.S index 63ec899e3..28e84d8e2 100644 --- a/libc/arch-x86/syscalls/prctl.S +++ b/libc/arch-x86/syscalls/prctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prctl) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/pread64.S b/libc/arch-x86/syscalls/pread64.S index 6b3c8ad16..e7502b94c 100644 --- a/libc/arch-x86/syscalls/pread64.S +++ b/libc/arch-x86/syscalls/pread64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pread64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/prlimit64.S b/libc/arch-x86/syscalls/prlimit64.S index 6aa875fa3..2ca8b233b 100644 --- a/libc/arch-x86/syscalls/prlimit64.S +++ b/libc/arch-x86/syscalls/prlimit64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prlimit64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/pwrite64.S b/libc/arch-x86/syscalls/pwrite64.S index 7d5309527..b798a8e22 100644 --- a/libc/arch-x86/syscalls/pwrite64.S +++ b/libc/arch-x86/syscalls/pwrite64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pwrite64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/read.S b/libc/arch-x86/syscalls/read.S index 9814c8ffc..483c5ef96 100644 --- a/libc/arch-x86/syscalls/read.S +++ b/libc/arch-x86/syscalls/read.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(read) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/readahead.S b/libc/arch-x86/syscalls/readahead.S index 49a17d043..b1e0870e9 100644 --- a/libc/arch-x86/syscalls/readahead.S +++ b/libc/arch-x86/syscalls/readahead.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readahead) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/readlinkat.S b/libc/arch-x86/syscalls/readlinkat.S index 1a161c01a..a06ae73a6 100644 --- a/libc/arch-x86/syscalls/readlinkat.S +++ b/libc/arch-x86/syscalls/readlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readlinkat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/readv.S b/libc/arch-x86/syscalls/readv.S index 8b5ff4186..a0b46b886 100644 --- a/libc/arch-x86/syscalls/readv.S +++ b/libc/arch-x86/syscalls/readv.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readv) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/recvfrom.S b/libc/arch-x86/syscalls/recvfrom.S index 53d08f638..86f12c0c5 100644 --- a/libc/arch-x86/syscalls/recvfrom.S +++ b/libc/arch-x86/syscalls/recvfrom.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvfrom) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/recvmmsg.S b/libc/arch-x86/syscalls/recvmmsg.S index 3ef874027..f77f7942b 100644 --- a/libc/arch-x86/syscalls/recvmmsg.S +++ b/libc/arch-x86/syscalls/recvmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmmsg) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/recvmsg.S b/libc/arch-x86/syscalls/recvmsg.S index 150672d0a..5d25d7a60 100644 --- a/libc/arch-x86/syscalls/recvmsg.S +++ b/libc/arch-x86/syscalls/recvmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmsg) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/removexattr.S b/libc/arch-x86/syscalls/removexattr.S index e7c55eb03..cbbdf4ee7 100644 --- a/libc/arch-x86/syscalls/removexattr.S +++ b/libc/arch-x86/syscalls/removexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(removexattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/renameat.S b/libc/arch-x86/syscalls/renameat.S index 5dfe65ffb..e424daff5 100644 --- a/libc/arch-x86/syscalls/renameat.S +++ b/libc/arch-x86/syscalls/renameat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(renameat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sched_get_priority_max.S b/libc/arch-x86/syscalls/sched_get_priority_max.S index d8debe281..eee6f922f 100644 --- a/libc/arch-x86/syscalls/sched_get_priority_max.S +++ b/libc/arch-x86/syscalls/sched_get_priority_max.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_max) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sched_get_priority_min.S b/libc/arch-x86/syscalls/sched_get_priority_min.S index e9689fab1..0edcab130 100644 --- a/libc/arch-x86/syscalls/sched_get_priority_min.S +++ b/libc/arch-x86/syscalls/sched_get_priority_min.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_min) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sched_getparam.S b/libc/arch-x86/syscalls/sched_getparam.S index 6b5e7c86b..9a4ebbd4f 100644 --- a/libc/arch-x86/syscalls/sched_getparam.S +++ b/libc/arch-x86/syscalls/sched_getparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getparam) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sched_getscheduler.S b/libc/arch-x86/syscalls/sched_getscheduler.S index a2c5746b6..19a925e77 100644 --- a/libc/arch-x86/syscalls/sched_getscheduler.S +++ b/libc/arch-x86/syscalls/sched_getscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getscheduler) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sched_rr_get_interval.S b/libc/arch-x86/syscalls/sched_rr_get_interval.S index f8012f317..c2592a9ae 100644 --- a/libc/arch-x86/syscalls/sched_rr_get_interval.S +++ b/libc/arch-x86/syscalls/sched_rr_get_interval.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_rr_get_interval) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sched_setaffinity.S b/libc/arch-x86/syscalls/sched_setaffinity.S index 76013f9ab..4a0ac86d1 100644 --- a/libc/arch-x86/syscalls/sched_setaffinity.S +++ b/libc/arch-x86/syscalls/sched_setaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setaffinity) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sched_setparam.S b/libc/arch-x86/syscalls/sched_setparam.S index aca4bd902..a99c0de0f 100644 --- a/libc/arch-x86/syscalls/sched_setparam.S +++ b/libc/arch-x86/syscalls/sched_setparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setparam) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sched_setscheduler.S b/libc/arch-x86/syscalls/sched_setscheduler.S index fad72c607..dbfd01e5f 100644 --- a/libc/arch-x86/syscalls/sched_setscheduler.S +++ b/libc/arch-x86/syscalls/sched_setscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setscheduler) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sched_yield.S b/libc/arch-x86/syscalls/sched_yield.S index 8b4a9beba..87ebaf9c6 100644 --- a/libc/arch-x86/syscalls/sched_yield.S +++ b/libc/arch-x86/syscalls/sched_yield.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_yield) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sendfile.S b/libc/arch-x86/syscalls/sendfile.S index 7bd86d0a5..58433fb32 100644 --- a/libc/arch-x86/syscalls/sendfile.S +++ b/libc/arch-x86/syscalls/sendfile.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendfile) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sendfile64.S b/libc/arch-x86/syscalls/sendfile64.S index bd76043f7..97c714614 100644 --- a/libc/arch-x86/syscalls/sendfile64.S +++ b/libc/arch-x86/syscalls/sendfile64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendfile64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sendmmsg.S b/libc/arch-x86/syscalls/sendmmsg.S index 4bc3c4076..3c359eeb7 100644 --- a/libc/arch-x86/syscalls/sendmmsg.S +++ b/libc/arch-x86/syscalls/sendmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmmsg) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sendmsg.S b/libc/arch-x86/syscalls/sendmsg.S index eb8fc63f5..51288cc4c 100644 --- a/libc/arch-x86/syscalls/sendmsg.S +++ b/libc/arch-x86/syscalls/sendmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmsg) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sendto.S b/libc/arch-x86/syscalls/sendto.S index 8cb72c87c..4b77f2479 100644 --- a/libc/arch-x86/syscalls/sendto.S +++ b/libc/arch-x86/syscalls/sendto.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendto) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setfsgid.S b/libc/arch-x86/syscalls/setfsgid.S index fa7a5c59f..a8160c3f1 100644 --- a/libc/arch-x86/syscalls/setfsgid.S +++ b/libc/arch-x86/syscalls/setfsgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsgid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setfsuid.S b/libc/arch-x86/syscalls/setfsuid.S index 5856a16e0..abcf0b3bd 100644 --- a/libc/arch-x86/syscalls/setfsuid.S +++ b/libc/arch-x86/syscalls/setfsuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsuid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setgid.S b/libc/arch-x86/syscalls/setgid.S index baa1b1a4b..47c011e4d 100644 --- a/libc/arch-x86/syscalls/setgid.S +++ b/libc/arch-x86/syscalls/setgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setgroups.S b/libc/arch-x86/syscalls/setgroups.S index 364aaad0f..7a5891083 100644 --- a/libc/arch-x86/syscalls/setgroups.S +++ b/libc/arch-x86/syscalls/setgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgroups) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setitimer.S b/libc/arch-x86/syscalls/setitimer.S index 409c4c660..e87a26e0d 100644 --- a/libc/arch-x86/syscalls/setitimer.S +++ b/libc/arch-x86/syscalls/setitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setitimer) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setns.S b/libc/arch-x86/syscalls/setns.S index ddbe758e8..75f23faf7 100644 --- a/libc/arch-x86/syscalls/setns.S +++ b/libc/arch-x86/syscalls/setns.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setns) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setpgid.S b/libc/arch-x86/syscalls/setpgid.S index ac1b12d67..c20b7897b 100644 --- a/libc/arch-x86/syscalls/setpgid.S +++ b/libc/arch-x86/syscalls/setpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpgid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setpriority.S b/libc/arch-x86/syscalls/setpriority.S index 93c1e07bc..4606c23fb 100644 --- a/libc/arch-x86/syscalls/setpriority.S +++ b/libc/arch-x86/syscalls/setpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpriority) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setregid.S b/libc/arch-x86/syscalls/setregid.S index 0ecfa9ae7..ff6cf36d6 100644 --- a/libc/arch-x86/syscalls/setregid.S +++ b/libc/arch-x86/syscalls/setregid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setregid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setresgid.S b/libc/arch-x86/syscalls/setresgid.S index a6914c492..a4846aef7 100644 --- a/libc/arch-x86/syscalls/setresgid.S +++ b/libc/arch-x86/syscalls/setresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresgid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setresuid.S b/libc/arch-x86/syscalls/setresuid.S index c33c1cabc..6ed0fadc8 100644 --- a/libc/arch-x86/syscalls/setresuid.S +++ b/libc/arch-x86/syscalls/setresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresuid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setreuid.S b/libc/arch-x86/syscalls/setreuid.S index 4244988d2..57d75409c 100644 --- a/libc/arch-x86/syscalls/setreuid.S +++ b/libc/arch-x86/syscalls/setreuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setreuid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setrlimit.S b/libc/arch-x86/syscalls/setrlimit.S index 3e8650434..9ca613417 100644 --- a/libc/arch-x86/syscalls/setrlimit.S +++ b/libc/arch-x86/syscalls/setrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setrlimit) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setsid.S b/libc/arch-x86/syscalls/setsid.S index 398c11056..5c933b3ce 100644 --- a/libc/arch-x86/syscalls/setsid.S +++ b/libc/arch-x86/syscalls/setsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsid) movl $__NR_setsid, %eax int $0x80 diff --git a/libc/arch-x86/syscalls/setsockopt.S b/libc/arch-x86/syscalls/setsockopt.S index 6ef168f81..f002344df 100644 --- a/libc/arch-x86/syscalls/setsockopt.S +++ b/libc/arch-x86/syscalls/setsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsockopt) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/settimeofday.S b/libc/arch-x86/syscalls/settimeofday.S index 37e11c53c..b35791d72 100644 --- a/libc/arch-x86/syscalls/settimeofday.S +++ b/libc/arch-x86/syscalls/settimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(settimeofday) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setuid.S b/libc/arch-x86/syscalls/setuid.S index fcea66d97..f5b83150e 100644 --- a/libc/arch-x86/syscalls/setuid.S +++ b/libc/arch-x86/syscalls/setuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setuid) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/setxattr.S b/libc/arch-x86/syscalls/setxattr.S index d6473cdc5..24eb2c419 100644 --- a/libc/arch-x86/syscalls/setxattr.S +++ b/libc/arch-x86/syscalls/setxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setxattr) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/shutdown.S b/libc/arch-x86/syscalls/shutdown.S index 32fa17a3b..e5497e6dc 100644 --- a/libc/arch-x86/syscalls/shutdown.S +++ b/libc/arch-x86/syscalls/shutdown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(shutdown) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sigaltstack.S b/libc/arch-x86/syscalls/sigaltstack.S index 6882a7837..150e3986d 100644 --- a/libc/arch-x86/syscalls/sigaltstack.S +++ b/libc/arch-x86/syscalls/sigaltstack.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sigaltstack) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/socketpair.S b/libc/arch-x86/syscalls/socketpair.S index 945faa019..f2188e3e6 100644 --- a/libc/arch-x86/syscalls/socketpair.S +++ b/libc/arch-x86/syscalls/socketpair.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(socketpair) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/splice.S b/libc/arch-x86/syscalls/splice.S index 46e231275..38d9ddf1d 100644 --- a/libc/arch-x86/syscalls/splice.S +++ b/libc/arch-x86/syscalls/splice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(splice) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/swapoff.S b/libc/arch-x86/syscalls/swapoff.S index 0e210335d..a0cbc0e27 100644 --- a/libc/arch-x86/syscalls/swapoff.S +++ b/libc/arch-x86/syscalls/swapoff.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapoff) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/swapon.S b/libc/arch-x86/syscalls/swapon.S index a4d5e0305..5a2bc9499 100644 --- a/libc/arch-x86/syscalls/swapon.S +++ b/libc/arch-x86/syscalls/swapon.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapon) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/symlinkat.S b/libc/arch-x86/syscalls/symlinkat.S index 618f5d827..7d7a9da9b 100644 --- a/libc/arch-x86/syscalls/symlinkat.S +++ b/libc/arch-x86/syscalls/symlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(symlinkat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sync.S b/libc/arch-x86/syscalls/sync.S index a1f178239..423c01dce 100644 --- a/libc/arch-x86/syscalls/sync.S +++ b/libc/arch-x86/syscalls/sync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sync) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/sysinfo.S b/libc/arch-x86/syscalls/sysinfo.S index c3eabb06f..08707616a 100644 --- a/libc/arch-x86/syscalls/sysinfo.S +++ b/libc/arch-x86/syscalls/sysinfo.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sysinfo) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/tee.S b/libc/arch-x86/syscalls/tee.S index 9422660a8..85ff3cc5c 100644 --- a/libc/arch-x86/syscalls/tee.S +++ b/libc/arch-x86/syscalls/tee.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tee) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/tgkill.S b/libc/arch-x86/syscalls/tgkill.S index 385827ba4..aab80e169 100644 --- a/libc/arch-x86/syscalls/tgkill.S +++ b/libc/arch-x86/syscalls/tgkill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tgkill) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/timerfd_create.S b/libc/arch-x86/syscalls/timerfd_create.S index 343195e19..f1bef4cb6 100644 --- a/libc/arch-x86/syscalls/timerfd_create.S +++ b/libc/arch-x86/syscalls/timerfd_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_create) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/timerfd_gettime.S b/libc/arch-x86/syscalls/timerfd_gettime.S index 9b3a31457..d7ec28f2e 100644 --- a/libc/arch-x86/syscalls/timerfd_gettime.S +++ b/libc/arch-x86/syscalls/timerfd_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_gettime) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/timerfd_settime.S b/libc/arch-x86/syscalls/timerfd_settime.S index 819b7234d..7e03edb9d 100644 --- a/libc/arch-x86/syscalls/timerfd_settime.S +++ b/libc/arch-x86/syscalls/timerfd_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_settime) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/times.S b/libc/arch-x86/syscalls/times.S index f5739d32c..6a14cff0e 100644 --- a/libc/arch-x86/syscalls/times.S +++ b/libc/arch-x86/syscalls/times.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(times) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/truncate.S b/libc/arch-x86/syscalls/truncate.S index 427f95f93..33ce47f92 100644 --- a/libc/arch-x86/syscalls/truncate.S +++ b/libc/arch-x86/syscalls/truncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(truncate) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/truncate64.S b/libc/arch-x86/syscalls/truncate64.S index 2c497511f..2168eb426 100644 --- a/libc/arch-x86/syscalls/truncate64.S +++ b/libc/arch-x86/syscalls/truncate64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(truncate64) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/umask.S b/libc/arch-x86/syscalls/umask.S index 3affc8de2..03bee20c9 100644 --- a/libc/arch-x86/syscalls/umask.S +++ b/libc/arch-x86/syscalls/umask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umask) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/umount2.S b/libc/arch-x86/syscalls/umount2.S index d2b3549e2..9701e0399 100644 --- a/libc/arch-x86/syscalls/umount2.S +++ b/libc/arch-x86/syscalls/umount2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umount2) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/uname.S b/libc/arch-x86/syscalls/uname.S index e99680543..6de3b413e 100644 --- a/libc/arch-x86/syscalls/uname.S +++ b/libc/arch-x86/syscalls/uname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(uname) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/unlinkat.S b/libc/arch-x86/syscalls/unlinkat.S index 6417d2bdb..93ea20183 100644 --- a/libc/arch-x86/syscalls/unlinkat.S +++ b/libc/arch-x86/syscalls/unlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unlinkat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/unshare.S b/libc/arch-x86/syscalls/unshare.S index a289d4d55..9d1146690 100644 --- a/libc/arch-x86/syscalls/unshare.S +++ b/libc/arch-x86/syscalls/unshare.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unshare) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/utimensat.S b/libc/arch-x86/syscalls/utimensat.S index d8c908040..62e15256c 100644 --- a/libc/arch-x86/syscalls/utimensat.S +++ b/libc/arch-x86/syscalls/utimensat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(utimensat) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/vmsplice.S b/libc/arch-x86/syscalls/vmsplice.S index 2afba6043..470763544 100644 --- a/libc/arch-x86/syscalls/vmsplice.S +++ b/libc/arch-x86/syscalls/vmsplice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(vmsplice) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/wait4.S b/libc/arch-x86/syscalls/wait4.S index fda75c05f..137b721e8 100644 --- a/libc/arch-x86/syscalls/wait4.S +++ b/libc/arch-x86/syscalls/wait4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(wait4) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/write.S b/libc/arch-x86/syscalls/write.S index 115974e4b..2f040b21f 100644 --- a/libc/arch-x86/syscalls/write.S +++ b/libc/arch-x86/syscalls/write.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(write) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86/syscalls/writev.S b/libc/arch-x86/syscalls/writev.S index 77e5cd129..2840eead9 100644 --- a/libc/arch-x86/syscalls/writev.S +++ b/libc/arch-x86/syscalls/writev.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(writev) pushl %ebx .cfi_def_cfa_offset 8 diff --git a/libc/arch-x86_64/syscalls/__accept4.S b/libc/arch-x86_64/syscalls/__accept4.S index 375a78b9d..774cdd584 100644 --- a/libc/arch-x86_64/syscalls/__accept4.S +++ b/libc/arch-x86_64/syscalls/__accept4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__accept4) movq %rcx, %r10 movl $__NR_accept4, %eax diff --git a/libc/arch-x86_64/syscalls/__arch_prctl.S b/libc/arch-x86_64/syscalls/__arch_prctl.S index 6c72a6c8d..c0dad45d9 100644 --- a/libc/arch-x86_64/syscalls/__arch_prctl.S +++ b/libc/arch-x86_64/syscalls/__arch_prctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__arch_prctl) movl $__NR_arch_prctl, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__brk.S b/libc/arch-x86_64/syscalls/__brk.S index 18ebc105e..df942a1d5 100644 --- a/libc/arch-x86_64/syscalls/__brk.S +++ b/libc/arch-x86_64/syscalls/__brk.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__brk) movl $__NR_brk, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__clock_gettime.S b/libc/arch-x86_64/syscalls/__clock_gettime.S index 7e553b80a..6c11fb634 100644 --- a/libc/arch-x86_64/syscalls/__clock_gettime.S +++ b/libc/arch-x86_64/syscalls/__clock_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__clock_gettime) movl $__NR_clock_gettime, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__connect.S b/libc/arch-x86_64/syscalls/__connect.S index a7d2e9308..05a82022f 100644 --- a/libc/arch-x86_64/syscalls/__connect.S +++ b/libc/arch-x86_64/syscalls/__connect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__connect) movl $__NR_connect, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__epoll_pwait.S b/libc/arch-x86_64/syscalls/__epoll_pwait.S index 4271b53ad..b0aee80ac 100644 --- a/libc/arch-x86_64/syscalls/__epoll_pwait.S +++ b/libc/arch-x86_64/syscalls/__epoll_pwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__epoll_pwait) movq %rcx, %r10 movl $__NR_epoll_pwait, %eax diff --git a/libc/arch-x86_64/syscalls/__exit.S b/libc/arch-x86_64/syscalls/__exit.S index bcbaffcfd..e552f0415 100644 --- a/libc/arch-x86_64/syscalls/__exit.S +++ b/libc/arch-x86_64/syscalls/__exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__exit) movl $__NR_exit, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__getcpu.S b/libc/arch-x86_64/syscalls/__getcpu.S index c25f294e9..c415fd7df 100644 --- a/libc/arch-x86_64/syscalls/__getcpu.S +++ b/libc/arch-x86_64/syscalls/__getcpu.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcpu) movl $__NR_getcpu, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__getcwd.S b/libc/arch-x86_64/syscalls/__getcwd.S index 1743838f7..1ea565161 100644 --- a/libc/arch-x86_64/syscalls/__getcwd.S +++ b/libc/arch-x86_64/syscalls/__getcwd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getcwd) movl $__NR_getcwd, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__getdents64.S b/libc/arch-x86_64/syscalls/__getdents64.S index 64f82fd03..42c130c16 100644 --- a/libc/arch-x86_64/syscalls/__getdents64.S +++ b/libc/arch-x86_64/syscalls/__getdents64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getdents64) movl $__NR_getdents64, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__getpid.S b/libc/arch-x86_64/syscalls/__getpid.S index bd1bf1ee1..ae6bb49db 100644 --- a/libc/arch-x86_64/syscalls/__getpid.S +++ b/libc/arch-x86_64/syscalls/__getpid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpid) movl $__NR_getpid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__getpriority.S b/libc/arch-x86_64/syscalls/__getpriority.S index 349f57466..c82b00887 100644 --- a/libc/arch-x86_64/syscalls/__getpriority.S +++ b/libc/arch-x86_64/syscalls/__getpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__getpriority) movl $__NR_getpriority, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__gettimeofday.S b/libc/arch-x86_64/syscalls/__gettimeofday.S index a38eb64c7..e4b240930 100644 --- a/libc/arch-x86_64/syscalls/__gettimeofday.S +++ b/libc/arch-x86_64/syscalls/__gettimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__gettimeofday) movl $__NR_gettimeofday, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__ioctl.S b/libc/arch-x86_64/syscalls/__ioctl.S index 277591107..aa2f53869 100644 --- a/libc/arch-x86_64/syscalls/__ioctl.S +++ b/libc/arch-x86_64/syscalls/__ioctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ioctl) movl $__NR_ioctl, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__openat.S b/libc/arch-x86_64/syscalls/__openat.S index dce4c7c75..e7f5dc4c3 100644 --- a/libc/arch-x86_64/syscalls/__openat.S +++ b/libc/arch-x86_64/syscalls/__openat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__openat) movq %rcx, %r10 movl $__NR_openat, %eax diff --git a/libc/arch-x86_64/syscalls/__ppoll.S b/libc/arch-x86_64/syscalls/__ppoll.S index 31ba7e958..eb741ce87 100644 --- a/libc/arch-x86_64/syscalls/__ppoll.S +++ b/libc/arch-x86_64/syscalls/__ppoll.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ppoll) movq %rcx, %r10 movl $__NR_ppoll, %eax diff --git a/libc/arch-x86_64/syscalls/__pselect6.S b/libc/arch-x86_64/syscalls/__pselect6.S index a212c4e02..75ea416dc 100644 --- a/libc/arch-x86_64/syscalls/__pselect6.S +++ b/libc/arch-x86_64/syscalls/__pselect6.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__pselect6) movq %rcx, %r10 movl $__NR_pselect6, %eax diff --git a/libc/arch-x86_64/syscalls/__ptrace.S b/libc/arch-x86_64/syscalls/__ptrace.S index 0a64fee73..45724e48d 100644 --- a/libc/arch-x86_64/syscalls/__ptrace.S +++ b/libc/arch-x86_64/syscalls/__ptrace.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__ptrace) movq %rcx, %r10 movl $__NR_ptrace, %eax diff --git a/libc/arch-x86_64/syscalls/__reboot.S b/libc/arch-x86_64/syscalls/__reboot.S index 398d078f1..bbff3f205 100644 --- a/libc/arch-x86_64/syscalls/__reboot.S +++ b/libc/arch-x86_64/syscalls/__reboot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__reboot) movq %rcx, %r10 movl $__NR_reboot, %eax diff --git a/libc/arch-x86_64/syscalls/__rt_sigaction.S b/libc/arch-x86_64/syscalls/__rt_sigaction.S index f146b02f1..7ce3d8c41 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigaction.S +++ b/libc/arch-x86_64/syscalls/__rt_sigaction.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigaction) movq %rcx, %r10 movl $__NR_rt_sigaction, %eax diff --git a/libc/arch-x86_64/syscalls/__rt_sigpending.S b/libc/arch-x86_64/syscalls/__rt_sigpending.S index 9d1698b76..78c10edab 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigpending.S +++ b/libc/arch-x86_64/syscalls/__rt_sigpending.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigpending) movl $__NR_rt_sigpending, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__rt_sigprocmask.S b/libc/arch-x86_64/syscalls/__rt_sigprocmask.S index 1ac9b81d8..bf2841c1a 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigprocmask.S +++ b/libc/arch-x86_64/syscalls/__rt_sigprocmask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigprocmask) movq %rcx, %r10 movl $__NR_rt_sigprocmask, %eax diff --git a/libc/arch-x86_64/syscalls/__rt_sigsuspend.S b/libc/arch-x86_64/syscalls/__rt_sigsuspend.S index 1059f0b72..a82b0528a 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigsuspend.S +++ b/libc/arch-x86_64/syscalls/__rt_sigsuspend.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigsuspend) movl $__NR_rt_sigsuspend, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S b/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S index de2e4cbe2..aceacb2dd 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__rt_sigtimedwait) movq %rcx, %r10 movl $__NR_rt_sigtimedwait, %eax diff --git a/libc/arch-x86_64/syscalls/__sched_getaffinity.S b/libc/arch-x86_64/syscalls/__sched_getaffinity.S index 410954cdf..fd1f6075b 100644 --- a/libc/arch-x86_64/syscalls/__sched_getaffinity.S +++ b/libc/arch-x86_64/syscalls/__sched_getaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__sched_getaffinity) movl $__NR_sched_getaffinity, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__set_tid_address.S b/libc/arch-x86_64/syscalls/__set_tid_address.S index c59c8b8c4..7e5226d75 100644 --- a/libc/arch-x86_64/syscalls/__set_tid_address.S +++ b/libc/arch-x86_64/syscalls/__set_tid_address.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__set_tid_address) movl $__NR_set_tid_address, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__signalfd4.S b/libc/arch-x86_64/syscalls/__signalfd4.S index 6ddcf5a20..d27f63c42 100644 --- a/libc/arch-x86_64/syscalls/__signalfd4.S +++ b/libc/arch-x86_64/syscalls/__signalfd4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__signalfd4) movq %rcx, %r10 movl $__NR_signalfd4, %eax diff --git a/libc/arch-x86_64/syscalls/__socket.S b/libc/arch-x86_64/syscalls/__socket.S index 209e329b4..3b573e857 100644 --- a/libc/arch-x86_64/syscalls/__socket.S +++ b/libc/arch-x86_64/syscalls/__socket.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__socket) movl $__NR_socket, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__timer_create.S b/libc/arch-x86_64/syscalls/__timer_create.S index 3450d2b82..920c9355f 100644 --- a/libc/arch-x86_64/syscalls/__timer_create.S +++ b/libc/arch-x86_64/syscalls/__timer_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_create) movl $__NR_timer_create, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__timer_delete.S b/libc/arch-x86_64/syscalls/__timer_delete.S index fd60a1608..c76830e89 100644 --- a/libc/arch-x86_64/syscalls/__timer_delete.S +++ b/libc/arch-x86_64/syscalls/__timer_delete.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_delete) movl $__NR_timer_delete, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__timer_getoverrun.S b/libc/arch-x86_64/syscalls/__timer_getoverrun.S index f5309a331..e35ee9375 100644 --- a/libc/arch-x86_64/syscalls/__timer_getoverrun.S +++ b/libc/arch-x86_64/syscalls/__timer_getoverrun.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_getoverrun) movl $__NR_timer_getoverrun, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__timer_gettime.S b/libc/arch-x86_64/syscalls/__timer_gettime.S index 7e2bc92e1..8bb41d9bc 100644 --- a/libc/arch-x86_64/syscalls/__timer_gettime.S +++ b/libc/arch-x86_64/syscalls/__timer_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_gettime) movl $__NR_timer_gettime, %eax syscall diff --git a/libc/arch-x86_64/syscalls/__timer_settime.S b/libc/arch-x86_64/syscalls/__timer_settime.S index f5401a048..0eace4b7e 100644 --- a/libc/arch-x86_64/syscalls/__timer_settime.S +++ b/libc/arch-x86_64/syscalls/__timer_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__timer_settime) movq %rcx, %r10 movl $__NR_timer_settime, %eax diff --git a/libc/arch-x86_64/syscalls/__waitid.S b/libc/arch-x86_64/syscalls/__waitid.S index 229f20c5f..47bf7b378 100644 --- a/libc/arch-x86_64/syscalls/__waitid.S +++ b/libc/arch-x86_64/syscalls/__waitid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(__waitid) movq %rcx, %r10 movl $__NR_waitid, %eax diff --git a/libc/arch-x86_64/syscalls/_exit.S b/libc/arch-x86_64/syscalls/_exit.S index 9c80f0031..06465c43d 100644 --- a/libc/arch-x86_64/syscalls/_exit.S +++ b/libc/arch-x86_64/syscalls/_exit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(_exit) movl $__NR_exit_group, %eax syscall diff --git a/libc/arch-x86_64/syscalls/acct.S b/libc/arch-x86_64/syscalls/acct.S index 91ecf5b78..6bf59e37b 100644 --- a/libc/arch-x86_64/syscalls/acct.S +++ b/libc/arch-x86_64/syscalls/acct.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(acct) movl $__NR_acct, %eax syscall diff --git a/libc/arch-x86_64/syscalls/bind.S b/libc/arch-x86_64/syscalls/bind.S index 5d426cbbc..4300c005f 100644 --- a/libc/arch-x86_64/syscalls/bind.S +++ b/libc/arch-x86_64/syscalls/bind.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(bind) movl $__NR_bind, %eax syscall diff --git a/libc/arch-x86_64/syscalls/capget.S b/libc/arch-x86_64/syscalls/capget.S index d3d151ef1..8ce1846ee 100644 --- a/libc/arch-x86_64/syscalls/capget.S +++ b/libc/arch-x86_64/syscalls/capget.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capget) movl $__NR_capget, %eax syscall diff --git a/libc/arch-x86_64/syscalls/capset.S b/libc/arch-x86_64/syscalls/capset.S index 421f15623..3aff07c1a 100644 --- a/libc/arch-x86_64/syscalls/capset.S +++ b/libc/arch-x86_64/syscalls/capset.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(capset) movl $__NR_capset, %eax syscall diff --git a/libc/arch-x86_64/syscalls/chdir.S b/libc/arch-x86_64/syscalls/chdir.S index 7a6f651e4..f22b40d4e 100644 --- a/libc/arch-x86_64/syscalls/chdir.S +++ b/libc/arch-x86_64/syscalls/chdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chdir) movl $__NR_chdir, %eax syscall diff --git a/libc/arch-x86_64/syscalls/chroot.S b/libc/arch-x86_64/syscalls/chroot.S index 0f53fd95a..eb8a4633b 100644 --- a/libc/arch-x86_64/syscalls/chroot.S +++ b/libc/arch-x86_64/syscalls/chroot.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(chroot) movl $__NR_chroot, %eax syscall diff --git a/libc/arch-x86_64/syscalls/clock_getres.S b/libc/arch-x86_64/syscalls/clock_getres.S index bad0d782e..00b4ed67d 100644 --- a/libc/arch-x86_64/syscalls/clock_getres.S +++ b/libc/arch-x86_64/syscalls/clock_getres.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_getres) movl $__NR_clock_getres, %eax syscall diff --git a/libc/arch-x86_64/syscalls/clock_nanosleep.S b/libc/arch-x86_64/syscalls/clock_nanosleep.S index 2ef0d05c6..8bc87ae44 100644 --- a/libc/arch-x86_64/syscalls/clock_nanosleep.S +++ b/libc/arch-x86_64/syscalls/clock_nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_nanosleep) movq %rcx, %r10 movl $__NR_clock_nanosleep, %eax diff --git a/libc/arch-x86_64/syscalls/clock_settime.S b/libc/arch-x86_64/syscalls/clock_settime.S index 6a3b75b54..522577031 100644 --- a/libc/arch-x86_64/syscalls/clock_settime.S +++ b/libc/arch-x86_64/syscalls/clock_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(clock_settime) movl $__NR_clock_settime, %eax syscall diff --git a/libc/arch-x86_64/syscalls/close.S b/libc/arch-x86_64/syscalls/close.S index 41c840374..029d09ad6 100644 --- a/libc/arch-x86_64/syscalls/close.S +++ b/libc/arch-x86_64/syscalls/close.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(close) movl $__NR_close, %eax syscall diff --git a/libc/arch-x86_64/syscalls/delete_module.S b/libc/arch-x86_64/syscalls/delete_module.S index d3f3862cb..fc146bb6c 100644 --- a/libc/arch-x86_64/syscalls/delete_module.S +++ b/libc/arch-x86_64/syscalls/delete_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(delete_module) movl $__NR_delete_module, %eax syscall diff --git a/libc/arch-x86_64/syscalls/dup.S b/libc/arch-x86_64/syscalls/dup.S index bf2ca517e..53f06b0ec 100644 --- a/libc/arch-x86_64/syscalls/dup.S +++ b/libc/arch-x86_64/syscalls/dup.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup) movl $__NR_dup, %eax syscall diff --git a/libc/arch-x86_64/syscalls/dup3.S b/libc/arch-x86_64/syscalls/dup3.S index f5c929c46..fb99941ed 100644 --- a/libc/arch-x86_64/syscalls/dup3.S +++ b/libc/arch-x86_64/syscalls/dup3.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(dup3) movl $__NR_dup3, %eax syscall diff --git a/libc/arch-x86_64/syscalls/epoll_create1.S b/libc/arch-x86_64/syscalls/epoll_create1.S index 196a3c7c8..6aa19157d 100644 --- a/libc/arch-x86_64/syscalls/epoll_create1.S +++ b/libc/arch-x86_64/syscalls/epoll_create1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_create1) movl $__NR_epoll_create1, %eax syscall diff --git a/libc/arch-x86_64/syscalls/epoll_ctl.S b/libc/arch-x86_64/syscalls/epoll_ctl.S index 2a3517cca..c9dda01b5 100644 --- a/libc/arch-x86_64/syscalls/epoll_ctl.S +++ b/libc/arch-x86_64/syscalls/epoll_ctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(epoll_ctl) movq %rcx, %r10 movl $__NR_epoll_ctl, %eax diff --git a/libc/arch-x86_64/syscalls/eventfd.S b/libc/arch-x86_64/syscalls/eventfd.S index 3ed4baff0..ac7537f99 100644 --- a/libc/arch-x86_64/syscalls/eventfd.S +++ b/libc/arch-x86_64/syscalls/eventfd.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(eventfd) movl $__NR_eventfd2, %eax syscall diff --git a/libc/arch-x86_64/syscalls/execve.S b/libc/arch-x86_64/syscalls/execve.S index 1fe29c73c..a699303fb 100644 --- a/libc/arch-x86_64/syscalls/execve.S +++ b/libc/arch-x86_64/syscalls/execve.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(execve) movl $__NR_execve, %eax syscall diff --git a/libc/arch-x86_64/syscalls/faccessat.S b/libc/arch-x86_64/syscalls/faccessat.S index 3ea905c42..9426dd5d1 100644 --- a/libc/arch-x86_64/syscalls/faccessat.S +++ b/libc/arch-x86_64/syscalls/faccessat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(faccessat) movq %rcx, %r10 movl $__NR_faccessat, %eax diff --git a/libc/arch-x86_64/syscalls/fallocate.S b/libc/arch-x86_64/syscalls/fallocate.S index abaa303c5..91a2e6544 100644 --- a/libc/arch-x86_64/syscalls/fallocate.S +++ b/libc/arch-x86_64/syscalls/fallocate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fallocate) movq %rcx, %r10 movl $__NR_fallocate, %eax diff --git a/libc/arch-x86_64/syscalls/fchdir.S b/libc/arch-x86_64/syscalls/fchdir.S index b01bb5702..01c503086 100644 --- a/libc/arch-x86_64/syscalls/fchdir.S +++ b/libc/arch-x86_64/syscalls/fchdir.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchdir) movl $__NR_fchdir, %eax syscall diff --git a/libc/arch-x86_64/syscalls/fchmod.S b/libc/arch-x86_64/syscalls/fchmod.S index 868638f05..1f4d02b70 100644 --- a/libc/arch-x86_64/syscalls/fchmod.S +++ b/libc/arch-x86_64/syscalls/fchmod.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmod) movl $__NR_fchmod, %eax syscall diff --git a/libc/arch-x86_64/syscalls/fchmodat.S b/libc/arch-x86_64/syscalls/fchmodat.S index e045a1311..cee05e3d1 100644 --- a/libc/arch-x86_64/syscalls/fchmodat.S +++ b/libc/arch-x86_64/syscalls/fchmodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchmodat) movq %rcx, %r10 movl $__NR_fchmodat, %eax diff --git a/libc/arch-x86_64/syscalls/fchown.S b/libc/arch-x86_64/syscalls/fchown.S index 9ba775b6e..1c439915c 100644 --- a/libc/arch-x86_64/syscalls/fchown.S +++ b/libc/arch-x86_64/syscalls/fchown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchown) movl $__NR_fchown, %eax syscall diff --git a/libc/arch-x86_64/syscalls/fchownat.S b/libc/arch-x86_64/syscalls/fchownat.S index 7789d2ddd..8f77888e1 100644 --- a/libc/arch-x86_64/syscalls/fchownat.S +++ b/libc/arch-x86_64/syscalls/fchownat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fchownat) movq %rcx, %r10 movl $__NR_fchownat, %eax diff --git a/libc/arch-x86_64/syscalls/fcntl.S b/libc/arch-x86_64/syscalls/fcntl.S index a20d9389c..d415467a0 100644 --- a/libc/arch-x86_64/syscalls/fcntl.S +++ b/libc/arch-x86_64/syscalls/fcntl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fcntl) movl $__NR_fcntl, %eax syscall diff --git a/libc/arch-x86_64/syscalls/fdatasync.S b/libc/arch-x86_64/syscalls/fdatasync.S index 5ea8ebd8c..8ec419304 100644 --- a/libc/arch-x86_64/syscalls/fdatasync.S +++ b/libc/arch-x86_64/syscalls/fdatasync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fdatasync) movl $__NR_fdatasync, %eax syscall diff --git a/libc/arch-x86_64/syscalls/fgetxattr.S b/libc/arch-x86_64/syscalls/fgetxattr.S index 096c30f05..9aacdbdb1 100644 --- a/libc/arch-x86_64/syscalls/fgetxattr.S +++ b/libc/arch-x86_64/syscalls/fgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fgetxattr) movq %rcx, %r10 movl $__NR_fgetxattr, %eax diff --git a/libc/arch-x86_64/syscalls/flistxattr.S b/libc/arch-x86_64/syscalls/flistxattr.S index e0e5b8bc8..53c58d07a 100644 --- a/libc/arch-x86_64/syscalls/flistxattr.S +++ b/libc/arch-x86_64/syscalls/flistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flistxattr) movl $__NR_flistxattr, %eax syscall diff --git a/libc/arch-x86_64/syscalls/flock.S b/libc/arch-x86_64/syscalls/flock.S index 981d86ed1..fe57b47d1 100644 --- a/libc/arch-x86_64/syscalls/flock.S +++ b/libc/arch-x86_64/syscalls/flock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(flock) movl $__NR_flock, %eax syscall diff --git a/libc/arch-x86_64/syscalls/fremovexattr.S b/libc/arch-x86_64/syscalls/fremovexattr.S index 655bdef85..c37cc9303 100644 --- a/libc/arch-x86_64/syscalls/fremovexattr.S +++ b/libc/arch-x86_64/syscalls/fremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fremovexattr) movl $__NR_fremovexattr, %eax syscall diff --git a/libc/arch-x86_64/syscalls/fsetxattr.S b/libc/arch-x86_64/syscalls/fsetxattr.S index fa2bddca7..cc3d7b7bf 100644 --- a/libc/arch-x86_64/syscalls/fsetxattr.S +++ b/libc/arch-x86_64/syscalls/fsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsetxattr) movq %rcx, %r10 movl $__NR_fsetxattr, %eax diff --git a/libc/arch-x86_64/syscalls/fstat64.S b/libc/arch-x86_64/syscalls/fstat64.S index 9e7aa2dd6..dbc676010 100644 --- a/libc/arch-x86_64/syscalls/fstat64.S +++ b/libc/arch-x86_64/syscalls/fstat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstat64) movl $__NR_fstat, %eax syscall diff --git a/libc/arch-x86_64/syscalls/fstatat64.S b/libc/arch-x86_64/syscalls/fstatat64.S index 5418cd0af..28b91fa13 100644 --- a/libc/arch-x86_64/syscalls/fstatat64.S +++ b/libc/arch-x86_64/syscalls/fstatat64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstatat64) movq %rcx, %r10 movl $__NR_newfstatat, %eax diff --git a/libc/arch-x86_64/syscalls/fstatfs64.S b/libc/arch-x86_64/syscalls/fstatfs64.S index ee2daa2df..4b12afb05 100644 --- a/libc/arch-x86_64/syscalls/fstatfs64.S +++ b/libc/arch-x86_64/syscalls/fstatfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fstatfs64) movl $__NR_fstatfs, %eax syscall diff --git a/libc/arch-x86_64/syscalls/fsync.S b/libc/arch-x86_64/syscalls/fsync.S index 12eabd325..820502e8c 100644 --- a/libc/arch-x86_64/syscalls/fsync.S +++ b/libc/arch-x86_64/syscalls/fsync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(fsync) movl $__NR_fsync, %eax syscall diff --git a/libc/arch-x86_64/syscalls/ftruncate.S b/libc/arch-x86_64/syscalls/ftruncate.S index 11161a7cd..0b1440301 100644 --- a/libc/arch-x86_64/syscalls/ftruncate.S +++ b/libc/arch-x86_64/syscalls/ftruncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(ftruncate) movl $__NR_ftruncate, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getegid.S b/libc/arch-x86_64/syscalls/getegid.S index 6f9c2a80f..155d37ba4 100644 --- a/libc/arch-x86_64/syscalls/getegid.S +++ b/libc/arch-x86_64/syscalls/getegid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getegid) movl $__NR_getegid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/geteuid.S b/libc/arch-x86_64/syscalls/geteuid.S index 88000ef05..9ffa3cd5d 100644 --- a/libc/arch-x86_64/syscalls/geteuid.S +++ b/libc/arch-x86_64/syscalls/geteuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(geteuid) movl $__NR_geteuid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getgid.S b/libc/arch-x86_64/syscalls/getgid.S index 8f8eaa6fe..d9c9da938 100644 --- a/libc/arch-x86_64/syscalls/getgid.S +++ b/libc/arch-x86_64/syscalls/getgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgid) movl $__NR_getgid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getgroups.S b/libc/arch-x86_64/syscalls/getgroups.S index 5358a3e6f..9f0701a64 100644 --- a/libc/arch-x86_64/syscalls/getgroups.S +++ b/libc/arch-x86_64/syscalls/getgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getgroups) movl $__NR_getgroups, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getitimer.S b/libc/arch-x86_64/syscalls/getitimer.S index b6a6e8e5c..2d764306b 100644 --- a/libc/arch-x86_64/syscalls/getitimer.S +++ b/libc/arch-x86_64/syscalls/getitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getitimer) movl $__NR_getitimer, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getpeername.S b/libc/arch-x86_64/syscalls/getpeername.S index 98e06fb89..b6de1833d 100644 --- a/libc/arch-x86_64/syscalls/getpeername.S +++ b/libc/arch-x86_64/syscalls/getpeername.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpeername) movl $__NR_getpeername, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getpgid.S b/libc/arch-x86_64/syscalls/getpgid.S index 158f14de6..e321b6619 100644 --- a/libc/arch-x86_64/syscalls/getpgid.S +++ b/libc/arch-x86_64/syscalls/getpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getpgid) movl $__NR_getpgid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getppid.S b/libc/arch-x86_64/syscalls/getppid.S index e4853e0d8..4a238ade6 100644 --- a/libc/arch-x86_64/syscalls/getppid.S +++ b/libc/arch-x86_64/syscalls/getppid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getppid) movl $__NR_getppid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getresgid.S b/libc/arch-x86_64/syscalls/getresgid.S index d65fb1392..4727d2972 100644 --- a/libc/arch-x86_64/syscalls/getresgid.S +++ b/libc/arch-x86_64/syscalls/getresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresgid) movl $__NR_getresgid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getresuid.S b/libc/arch-x86_64/syscalls/getresuid.S index 80d85c676..1098d5646 100644 --- a/libc/arch-x86_64/syscalls/getresuid.S +++ b/libc/arch-x86_64/syscalls/getresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getresuid) movl $__NR_getresuid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getrlimit.S b/libc/arch-x86_64/syscalls/getrlimit.S index ea0ca7da0..60e5881bf 100644 --- a/libc/arch-x86_64/syscalls/getrlimit.S +++ b/libc/arch-x86_64/syscalls/getrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrlimit) movl $__NR_getrlimit, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getrusage.S b/libc/arch-x86_64/syscalls/getrusage.S index 7a60738bd..0eb017663 100644 --- a/libc/arch-x86_64/syscalls/getrusage.S +++ b/libc/arch-x86_64/syscalls/getrusage.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getrusage) movl $__NR_getrusage, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getsid.S b/libc/arch-x86_64/syscalls/getsid.S index 75e3fad98..2543b1058 100644 --- a/libc/arch-x86_64/syscalls/getsid.S +++ b/libc/arch-x86_64/syscalls/getsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsid) movl $__NR_getsid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getsockname.S b/libc/arch-x86_64/syscalls/getsockname.S index 3c7c2f852..17cd5eaf6 100644 --- a/libc/arch-x86_64/syscalls/getsockname.S +++ b/libc/arch-x86_64/syscalls/getsockname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockname) movl $__NR_getsockname, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getsockopt.S b/libc/arch-x86_64/syscalls/getsockopt.S index 725757cd8..988a2cbcd 100644 --- a/libc/arch-x86_64/syscalls/getsockopt.S +++ b/libc/arch-x86_64/syscalls/getsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getsockopt) movq %rcx, %r10 movl $__NR_getsockopt, %eax diff --git a/libc/arch-x86_64/syscalls/getuid.S b/libc/arch-x86_64/syscalls/getuid.S index d7306e160..9b7a1d9d6 100644 --- a/libc/arch-x86_64/syscalls/getuid.S +++ b/libc/arch-x86_64/syscalls/getuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getuid) movl $__NR_getuid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/getxattr.S b/libc/arch-x86_64/syscalls/getxattr.S index 7c66b0e4b..4d6aecf7a 100644 --- a/libc/arch-x86_64/syscalls/getxattr.S +++ b/libc/arch-x86_64/syscalls/getxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(getxattr) movq %rcx, %r10 movl $__NR_getxattr, %eax diff --git a/libc/arch-x86_64/syscalls/init_module.S b/libc/arch-x86_64/syscalls/init_module.S index 187f5a277..2c5141458 100644 --- a/libc/arch-x86_64/syscalls/init_module.S +++ b/libc/arch-x86_64/syscalls/init_module.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(init_module) movl $__NR_init_module, %eax syscall diff --git a/libc/arch-x86_64/syscalls/inotify_add_watch.S b/libc/arch-x86_64/syscalls/inotify_add_watch.S index 47e15ab57..da5aa36ee 100644 --- a/libc/arch-x86_64/syscalls/inotify_add_watch.S +++ b/libc/arch-x86_64/syscalls/inotify_add_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_add_watch) movl $__NR_inotify_add_watch, %eax syscall diff --git a/libc/arch-x86_64/syscalls/inotify_init1.S b/libc/arch-x86_64/syscalls/inotify_init1.S index 160b0d59e..46e5014b9 100644 --- a/libc/arch-x86_64/syscalls/inotify_init1.S +++ b/libc/arch-x86_64/syscalls/inotify_init1.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_init1) movl $__NR_inotify_init1, %eax syscall diff --git a/libc/arch-x86_64/syscalls/inotify_rm_watch.S b/libc/arch-x86_64/syscalls/inotify_rm_watch.S index 4c5874ea4..5920c9df0 100644 --- a/libc/arch-x86_64/syscalls/inotify_rm_watch.S +++ b/libc/arch-x86_64/syscalls/inotify_rm_watch.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(inotify_rm_watch) movl $__NR_inotify_rm_watch, %eax syscall diff --git a/libc/arch-x86_64/syscalls/kill.S b/libc/arch-x86_64/syscalls/kill.S index f234585c8..dff2da60f 100644 --- a/libc/arch-x86_64/syscalls/kill.S +++ b/libc/arch-x86_64/syscalls/kill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(kill) movl $__NR_kill, %eax syscall diff --git a/libc/arch-x86_64/syscalls/klogctl.S b/libc/arch-x86_64/syscalls/klogctl.S index 057b066c7..8560d2819 100644 --- a/libc/arch-x86_64/syscalls/klogctl.S +++ b/libc/arch-x86_64/syscalls/klogctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(klogctl) movl $__NR_syslog, %eax syscall diff --git a/libc/arch-x86_64/syscalls/lgetxattr.S b/libc/arch-x86_64/syscalls/lgetxattr.S index 525ee3be8..b4bc204bb 100644 --- a/libc/arch-x86_64/syscalls/lgetxattr.S +++ b/libc/arch-x86_64/syscalls/lgetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lgetxattr) movq %rcx, %r10 movl $__NR_lgetxattr, %eax diff --git a/libc/arch-x86_64/syscalls/linkat.S b/libc/arch-x86_64/syscalls/linkat.S index 815af86ff..509b57949 100644 --- a/libc/arch-x86_64/syscalls/linkat.S +++ b/libc/arch-x86_64/syscalls/linkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(linkat) movq %rcx, %r10 movl $__NR_linkat, %eax diff --git a/libc/arch-x86_64/syscalls/listen.S b/libc/arch-x86_64/syscalls/listen.S index d3d7103fb..6bd46a551 100644 --- a/libc/arch-x86_64/syscalls/listen.S +++ b/libc/arch-x86_64/syscalls/listen.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listen) movl $__NR_listen, %eax syscall diff --git a/libc/arch-x86_64/syscalls/listxattr.S b/libc/arch-x86_64/syscalls/listxattr.S index 89fd63ce2..102518f11 100644 --- a/libc/arch-x86_64/syscalls/listxattr.S +++ b/libc/arch-x86_64/syscalls/listxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(listxattr) movl $__NR_listxattr, %eax syscall diff --git a/libc/arch-x86_64/syscalls/llistxattr.S b/libc/arch-x86_64/syscalls/llistxattr.S index cfff2e79b..74d58a851 100644 --- a/libc/arch-x86_64/syscalls/llistxattr.S +++ b/libc/arch-x86_64/syscalls/llistxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(llistxattr) movl $__NR_llistxattr, %eax syscall diff --git a/libc/arch-x86_64/syscalls/lremovexattr.S b/libc/arch-x86_64/syscalls/lremovexattr.S index 0b6994a52..2566e3397 100644 --- a/libc/arch-x86_64/syscalls/lremovexattr.S +++ b/libc/arch-x86_64/syscalls/lremovexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lremovexattr) movl $__NR_lremovexattr, %eax syscall diff --git a/libc/arch-x86_64/syscalls/lseek.S b/libc/arch-x86_64/syscalls/lseek.S index b2e8c16a5..93e5f0c58 100644 --- a/libc/arch-x86_64/syscalls/lseek.S +++ b/libc/arch-x86_64/syscalls/lseek.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lseek) movl $__NR_lseek, %eax syscall diff --git a/libc/arch-x86_64/syscalls/lsetxattr.S b/libc/arch-x86_64/syscalls/lsetxattr.S index fdaf98ae4..905bd3b85 100644 --- a/libc/arch-x86_64/syscalls/lsetxattr.S +++ b/libc/arch-x86_64/syscalls/lsetxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(lsetxattr) movq %rcx, %r10 movl $__NR_lsetxattr, %eax diff --git a/libc/arch-x86_64/syscalls/madvise.S b/libc/arch-x86_64/syscalls/madvise.S index 3f567fd03..c565ca3b1 100644 --- a/libc/arch-x86_64/syscalls/madvise.S +++ b/libc/arch-x86_64/syscalls/madvise.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(madvise) movl $__NR_madvise, %eax syscall diff --git a/libc/arch-x86_64/syscalls/mincore.S b/libc/arch-x86_64/syscalls/mincore.S index e6b252155..f8acdeb25 100644 --- a/libc/arch-x86_64/syscalls/mincore.S +++ b/libc/arch-x86_64/syscalls/mincore.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mincore) movl $__NR_mincore, %eax syscall diff --git a/libc/arch-x86_64/syscalls/mkdirat.S b/libc/arch-x86_64/syscalls/mkdirat.S index abba2d571..b554d125d 100644 --- a/libc/arch-x86_64/syscalls/mkdirat.S +++ b/libc/arch-x86_64/syscalls/mkdirat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mkdirat) movl $__NR_mkdirat, %eax syscall diff --git a/libc/arch-x86_64/syscalls/mknodat.S b/libc/arch-x86_64/syscalls/mknodat.S index d3d78c9c5..dd6496a14 100644 --- a/libc/arch-x86_64/syscalls/mknodat.S +++ b/libc/arch-x86_64/syscalls/mknodat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mknodat) movq %rcx, %r10 movl $__NR_mknodat, %eax diff --git a/libc/arch-x86_64/syscalls/mlock.S b/libc/arch-x86_64/syscalls/mlock.S index 0c69eb71b..78389e29b 100644 --- a/libc/arch-x86_64/syscalls/mlock.S +++ b/libc/arch-x86_64/syscalls/mlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlock) movl $__NR_mlock, %eax syscall diff --git a/libc/arch-x86_64/syscalls/mlockall.S b/libc/arch-x86_64/syscalls/mlockall.S index 89ba9b6e6..3ac878a7f 100644 --- a/libc/arch-x86_64/syscalls/mlockall.S +++ b/libc/arch-x86_64/syscalls/mlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mlockall) movl $__NR_mlockall, %eax syscall diff --git a/libc/arch-x86_64/syscalls/mmap.S b/libc/arch-x86_64/syscalls/mmap.S index 7b9f6e033..44189a993 100644 --- a/libc/arch-x86_64/syscalls/mmap.S +++ b/libc/arch-x86_64/syscalls/mmap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mmap) movq %rcx, %r10 movl $__NR_mmap, %eax diff --git a/libc/arch-x86_64/syscalls/mount.S b/libc/arch-x86_64/syscalls/mount.S index 04534c9d3..369e8df58 100644 --- a/libc/arch-x86_64/syscalls/mount.S +++ b/libc/arch-x86_64/syscalls/mount.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mount) movq %rcx, %r10 movl $__NR_mount, %eax diff --git a/libc/arch-x86_64/syscalls/mprotect.S b/libc/arch-x86_64/syscalls/mprotect.S index d849bb130..44888da2d 100644 --- a/libc/arch-x86_64/syscalls/mprotect.S +++ b/libc/arch-x86_64/syscalls/mprotect.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mprotect) movl $__NR_mprotect, %eax syscall diff --git a/libc/arch-x86_64/syscalls/mremap.S b/libc/arch-x86_64/syscalls/mremap.S index 8af367ed8..74a05e24a 100644 --- a/libc/arch-x86_64/syscalls/mremap.S +++ b/libc/arch-x86_64/syscalls/mremap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(mremap) movq %rcx, %r10 movl $__NR_mremap, %eax diff --git a/libc/arch-x86_64/syscalls/msync.S b/libc/arch-x86_64/syscalls/msync.S index c0ff0f9b7..1d0e785c2 100644 --- a/libc/arch-x86_64/syscalls/msync.S +++ b/libc/arch-x86_64/syscalls/msync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(msync) movl $__NR_msync, %eax syscall diff --git a/libc/arch-x86_64/syscalls/munlock.S b/libc/arch-x86_64/syscalls/munlock.S index d669f5400..17e368b89 100644 --- a/libc/arch-x86_64/syscalls/munlock.S +++ b/libc/arch-x86_64/syscalls/munlock.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlock) movl $__NR_munlock, %eax syscall diff --git a/libc/arch-x86_64/syscalls/munlockall.S b/libc/arch-x86_64/syscalls/munlockall.S index b7a9abcc7..6bb7aa648 100644 --- a/libc/arch-x86_64/syscalls/munlockall.S +++ b/libc/arch-x86_64/syscalls/munlockall.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munlockall) movl $__NR_munlockall, %eax syscall diff --git a/libc/arch-x86_64/syscalls/munmap.S b/libc/arch-x86_64/syscalls/munmap.S index 4360bd0b2..f423a6672 100644 --- a/libc/arch-x86_64/syscalls/munmap.S +++ b/libc/arch-x86_64/syscalls/munmap.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(munmap) movl $__NR_munmap, %eax syscall diff --git a/libc/arch-x86_64/syscalls/nanosleep.S b/libc/arch-x86_64/syscalls/nanosleep.S index 2eced5b2c..caa1ae685 100644 --- a/libc/arch-x86_64/syscalls/nanosleep.S +++ b/libc/arch-x86_64/syscalls/nanosleep.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(nanosleep) movl $__NR_nanosleep, %eax syscall diff --git a/libc/arch-x86_64/syscalls/personality.S b/libc/arch-x86_64/syscalls/personality.S index 17ad7eeac..a742dbf15 100644 --- a/libc/arch-x86_64/syscalls/personality.S +++ b/libc/arch-x86_64/syscalls/personality.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(personality) movl $__NR_personality, %eax syscall diff --git a/libc/arch-x86_64/syscalls/pipe2.S b/libc/arch-x86_64/syscalls/pipe2.S index 83eb0a61b..e34ca69be 100644 --- a/libc/arch-x86_64/syscalls/pipe2.S +++ b/libc/arch-x86_64/syscalls/pipe2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pipe2) movl $__NR_pipe2, %eax syscall diff --git a/libc/arch-x86_64/syscalls/prctl.S b/libc/arch-x86_64/syscalls/prctl.S index c79220d44..b4cdaa50a 100644 --- a/libc/arch-x86_64/syscalls/prctl.S +++ b/libc/arch-x86_64/syscalls/prctl.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prctl) movq %rcx, %r10 movl $__NR_prctl, %eax diff --git a/libc/arch-x86_64/syscalls/pread64.S b/libc/arch-x86_64/syscalls/pread64.S index 1c4dc68da..1d042efc2 100644 --- a/libc/arch-x86_64/syscalls/pread64.S +++ b/libc/arch-x86_64/syscalls/pread64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pread64) movq %rcx, %r10 movl $__NR_pread64, %eax diff --git a/libc/arch-x86_64/syscalls/prlimit64.S b/libc/arch-x86_64/syscalls/prlimit64.S index 823feba5c..52151a8f4 100644 --- a/libc/arch-x86_64/syscalls/prlimit64.S +++ b/libc/arch-x86_64/syscalls/prlimit64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(prlimit64) movq %rcx, %r10 movl $__NR_prlimit64, %eax diff --git a/libc/arch-x86_64/syscalls/pwrite64.S b/libc/arch-x86_64/syscalls/pwrite64.S index 13bcb58bf..2fb0f16af 100644 --- a/libc/arch-x86_64/syscalls/pwrite64.S +++ b/libc/arch-x86_64/syscalls/pwrite64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(pwrite64) movq %rcx, %r10 movl $__NR_pwrite64, %eax diff --git a/libc/arch-x86_64/syscalls/read.S b/libc/arch-x86_64/syscalls/read.S index 400c87ac8..3f2862e3b 100644 --- a/libc/arch-x86_64/syscalls/read.S +++ b/libc/arch-x86_64/syscalls/read.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(read) movl $__NR_read, %eax syscall diff --git a/libc/arch-x86_64/syscalls/readahead.S b/libc/arch-x86_64/syscalls/readahead.S index 2a2978ba3..df3aba168 100644 --- a/libc/arch-x86_64/syscalls/readahead.S +++ b/libc/arch-x86_64/syscalls/readahead.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readahead) movl $__NR_readahead, %eax syscall diff --git a/libc/arch-x86_64/syscalls/readlinkat.S b/libc/arch-x86_64/syscalls/readlinkat.S index 51d1f0c7e..554b8b6f2 100644 --- a/libc/arch-x86_64/syscalls/readlinkat.S +++ b/libc/arch-x86_64/syscalls/readlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readlinkat) movq %rcx, %r10 movl $__NR_readlinkat, %eax diff --git a/libc/arch-x86_64/syscalls/readv.S b/libc/arch-x86_64/syscalls/readv.S index 419975183..75d04e956 100644 --- a/libc/arch-x86_64/syscalls/readv.S +++ b/libc/arch-x86_64/syscalls/readv.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(readv) movl $__NR_readv, %eax syscall diff --git a/libc/arch-x86_64/syscalls/recvfrom.S b/libc/arch-x86_64/syscalls/recvfrom.S index 61ca1b219..4ee56318c 100644 --- a/libc/arch-x86_64/syscalls/recvfrom.S +++ b/libc/arch-x86_64/syscalls/recvfrom.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvfrom) movq %rcx, %r10 movl $__NR_recvfrom, %eax diff --git a/libc/arch-x86_64/syscalls/recvmmsg.S b/libc/arch-x86_64/syscalls/recvmmsg.S index ce14ba50c..327932547 100644 --- a/libc/arch-x86_64/syscalls/recvmmsg.S +++ b/libc/arch-x86_64/syscalls/recvmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmmsg) movq %rcx, %r10 movl $__NR_recvmmsg, %eax diff --git a/libc/arch-x86_64/syscalls/recvmsg.S b/libc/arch-x86_64/syscalls/recvmsg.S index 8655d072d..7c186fd5b 100644 --- a/libc/arch-x86_64/syscalls/recvmsg.S +++ b/libc/arch-x86_64/syscalls/recvmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(recvmsg) movl $__NR_recvmsg, %eax syscall diff --git a/libc/arch-x86_64/syscalls/removexattr.S b/libc/arch-x86_64/syscalls/removexattr.S index 97364633f..909164729 100644 --- a/libc/arch-x86_64/syscalls/removexattr.S +++ b/libc/arch-x86_64/syscalls/removexattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(removexattr) movl $__NR_removexattr, %eax syscall diff --git a/libc/arch-x86_64/syscalls/renameat.S b/libc/arch-x86_64/syscalls/renameat.S index 0be2ef909..7258712f7 100644 --- a/libc/arch-x86_64/syscalls/renameat.S +++ b/libc/arch-x86_64/syscalls/renameat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(renameat) movq %rcx, %r10 movl $__NR_renameat, %eax diff --git a/libc/arch-x86_64/syscalls/sched_get_priority_max.S b/libc/arch-x86_64/syscalls/sched_get_priority_max.S index 0f9273942..604d6c89e 100644 --- a/libc/arch-x86_64/syscalls/sched_get_priority_max.S +++ b/libc/arch-x86_64/syscalls/sched_get_priority_max.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_max) movl $__NR_sched_get_priority_max, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sched_get_priority_min.S b/libc/arch-x86_64/syscalls/sched_get_priority_min.S index 8450e9db3..eaeb7654f 100644 --- a/libc/arch-x86_64/syscalls/sched_get_priority_min.S +++ b/libc/arch-x86_64/syscalls/sched_get_priority_min.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_get_priority_min) movl $__NR_sched_get_priority_min, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sched_getparam.S b/libc/arch-x86_64/syscalls/sched_getparam.S index a784640a0..e269c7d0f 100644 --- a/libc/arch-x86_64/syscalls/sched_getparam.S +++ b/libc/arch-x86_64/syscalls/sched_getparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getparam) movl $__NR_sched_getparam, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sched_getscheduler.S b/libc/arch-x86_64/syscalls/sched_getscheduler.S index 090b32246..0cf3b5403 100644 --- a/libc/arch-x86_64/syscalls/sched_getscheduler.S +++ b/libc/arch-x86_64/syscalls/sched_getscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_getscheduler) movl $__NR_sched_getscheduler, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sched_rr_get_interval.S b/libc/arch-x86_64/syscalls/sched_rr_get_interval.S index 0977f2ed9..662a28c4a 100644 --- a/libc/arch-x86_64/syscalls/sched_rr_get_interval.S +++ b/libc/arch-x86_64/syscalls/sched_rr_get_interval.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_rr_get_interval) movl $__NR_sched_rr_get_interval, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sched_setaffinity.S b/libc/arch-x86_64/syscalls/sched_setaffinity.S index af8e7a2ae..79b43fd27 100644 --- a/libc/arch-x86_64/syscalls/sched_setaffinity.S +++ b/libc/arch-x86_64/syscalls/sched_setaffinity.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setaffinity) movl $__NR_sched_setaffinity, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sched_setparam.S b/libc/arch-x86_64/syscalls/sched_setparam.S index 2964607db..871b49262 100644 --- a/libc/arch-x86_64/syscalls/sched_setparam.S +++ b/libc/arch-x86_64/syscalls/sched_setparam.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setparam) movl $__NR_sched_setparam, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sched_setscheduler.S b/libc/arch-x86_64/syscalls/sched_setscheduler.S index 333d1b86c..0dcb47d33 100644 --- a/libc/arch-x86_64/syscalls/sched_setscheduler.S +++ b/libc/arch-x86_64/syscalls/sched_setscheduler.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_setscheduler) movl $__NR_sched_setscheduler, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sched_yield.S b/libc/arch-x86_64/syscalls/sched_yield.S index a97215462..12de511fb 100644 --- a/libc/arch-x86_64/syscalls/sched_yield.S +++ b/libc/arch-x86_64/syscalls/sched_yield.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sched_yield) movl $__NR_sched_yield, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sendfile.S b/libc/arch-x86_64/syscalls/sendfile.S index c1b6497b8..0255bf29f 100644 --- a/libc/arch-x86_64/syscalls/sendfile.S +++ b/libc/arch-x86_64/syscalls/sendfile.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendfile) movq %rcx, %r10 movl $__NR_sendfile, %eax diff --git a/libc/arch-x86_64/syscalls/sendmmsg.S b/libc/arch-x86_64/syscalls/sendmmsg.S index 940c0b6ee..47b2e3a75 100644 --- a/libc/arch-x86_64/syscalls/sendmmsg.S +++ b/libc/arch-x86_64/syscalls/sendmmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmmsg) movq %rcx, %r10 movl $__NR_sendmmsg, %eax diff --git a/libc/arch-x86_64/syscalls/sendmsg.S b/libc/arch-x86_64/syscalls/sendmsg.S index 6d94bb691..e9eecf6b6 100644 --- a/libc/arch-x86_64/syscalls/sendmsg.S +++ b/libc/arch-x86_64/syscalls/sendmsg.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendmsg) movl $__NR_sendmsg, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sendto.S b/libc/arch-x86_64/syscalls/sendto.S index bfe46361f..f8cc14935 100644 --- a/libc/arch-x86_64/syscalls/sendto.S +++ b/libc/arch-x86_64/syscalls/sendto.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sendto) movq %rcx, %r10 movl $__NR_sendto, %eax diff --git a/libc/arch-x86_64/syscalls/setfsgid.S b/libc/arch-x86_64/syscalls/setfsgid.S index e9f50b80d..bfc9c5dd1 100644 --- a/libc/arch-x86_64/syscalls/setfsgid.S +++ b/libc/arch-x86_64/syscalls/setfsgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsgid) movl $__NR_setfsgid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setfsuid.S b/libc/arch-x86_64/syscalls/setfsuid.S index cfdb86cc8..2540a36a1 100644 --- a/libc/arch-x86_64/syscalls/setfsuid.S +++ b/libc/arch-x86_64/syscalls/setfsuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setfsuid) movl $__NR_setfsuid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setgid.S b/libc/arch-x86_64/syscalls/setgid.S index ef4fb31b9..8f9ce5322 100644 --- a/libc/arch-x86_64/syscalls/setgid.S +++ b/libc/arch-x86_64/syscalls/setgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgid) movl $__NR_setgid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setgroups.S b/libc/arch-x86_64/syscalls/setgroups.S index 65e618072..81023ab4b 100644 --- a/libc/arch-x86_64/syscalls/setgroups.S +++ b/libc/arch-x86_64/syscalls/setgroups.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setgroups) movl $__NR_setgroups, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setitimer.S b/libc/arch-x86_64/syscalls/setitimer.S index bee4996c2..6882564b5 100644 --- a/libc/arch-x86_64/syscalls/setitimer.S +++ b/libc/arch-x86_64/syscalls/setitimer.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setitimer) movl $__NR_setitimer, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setns.S b/libc/arch-x86_64/syscalls/setns.S index 521769b91..15dc51c99 100644 --- a/libc/arch-x86_64/syscalls/setns.S +++ b/libc/arch-x86_64/syscalls/setns.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setns) movl $__NR_setns, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setpgid.S b/libc/arch-x86_64/syscalls/setpgid.S index 348612bd7..0cbb9a33a 100644 --- a/libc/arch-x86_64/syscalls/setpgid.S +++ b/libc/arch-x86_64/syscalls/setpgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpgid) movl $__NR_setpgid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setpriority.S b/libc/arch-x86_64/syscalls/setpriority.S index 094036816..e2ee77581 100644 --- a/libc/arch-x86_64/syscalls/setpriority.S +++ b/libc/arch-x86_64/syscalls/setpriority.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setpriority) movl $__NR_setpriority, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setregid.S b/libc/arch-x86_64/syscalls/setregid.S index 0338ecf90..1d53e4caa 100644 --- a/libc/arch-x86_64/syscalls/setregid.S +++ b/libc/arch-x86_64/syscalls/setregid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setregid) movl $__NR_setregid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setresgid.S b/libc/arch-x86_64/syscalls/setresgid.S index 10e12447e..7663cc68f 100644 --- a/libc/arch-x86_64/syscalls/setresgid.S +++ b/libc/arch-x86_64/syscalls/setresgid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresgid) movl $__NR_setresgid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setresuid.S b/libc/arch-x86_64/syscalls/setresuid.S index 229b11b33..96e691f52 100644 --- a/libc/arch-x86_64/syscalls/setresuid.S +++ b/libc/arch-x86_64/syscalls/setresuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setresuid) movl $__NR_setresuid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setreuid.S b/libc/arch-x86_64/syscalls/setreuid.S index e96e2d386..9ee7208d4 100644 --- a/libc/arch-x86_64/syscalls/setreuid.S +++ b/libc/arch-x86_64/syscalls/setreuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setreuid) movl $__NR_setreuid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setrlimit.S b/libc/arch-x86_64/syscalls/setrlimit.S index 662587d48..393a5c186 100644 --- a/libc/arch-x86_64/syscalls/setrlimit.S +++ b/libc/arch-x86_64/syscalls/setrlimit.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setrlimit) movl $__NR_setrlimit, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setsid.S b/libc/arch-x86_64/syscalls/setsid.S index 293ecf555..bed06c9e2 100644 --- a/libc/arch-x86_64/syscalls/setsid.S +++ b/libc/arch-x86_64/syscalls/setsid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsid) movl $__NR_setsid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setsockopt.S b/libc/arch-x86_64/syscalls/setsockopt.S index aee661391..3c12cd60e 100644 --- a/libc/arch-x86_64/syscalls/setsockopt.S +++ b/libc/arch-x86_64/syscalls/setsockopt.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setsockopt) movq %rcx, %r10 movl $__NR_setsockopt, %eax diff --git a/libc/arch-x86_64/syscalls/settimeofday.S b/libc/arch-x86_64/syscalls/settimeofday.S index 0d00c8947..317946a42 100644 --- a/libc/arch-x86_64/syscalls/settimeofday.S +++ b/libc/arch-x86_64/syscalls/settimeofday.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(settimeofday) movl $__NR_settimeofday, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setuid.S b/libc/arch-x86_64/syscalls/setuid.S index 19e2a1042..8da7d86fa 100644 --- a/libc/arch-x86_64/syscalls/setuid.S +++ b/libc/arch-x86_64/syscalls/setuid.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setuid) movl $__NR_setuid, %eax syscall diff --git a/libc/arch-x86_64/syscalls/setxattr.S b/libc/arch-x86_64/syscalls/setxattr.S index 3e4d50bf0..2abaa7675 100644 --- a/libc/arch-x86_64/syscalls/setxattr.S +++ b/libc/arch-x86_64/syscalls/setxattr.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(setxattr) movq %rcx, %r10 movl $__NR_setxattr, %eax diff --git a/libc/arch-x86_64/syscalls/shutdown.S b/libc/arch-x86_64/syscalls/shutdown.S index 346be331d..b5840d74b 100644 --- a/libc/arch-x86_64/syscalls/shutdown.S +++ b/libc/arch-x86_64/syscalls/shutdown.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(shutdown) movl $__NR_shutdown, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sigaltstack.S b/libc/arch-x86_64/syscalls/sigaltstack.S index 271fafc09..2dd6aa4bf 100644 --- a/libc/arch-x86_64/syscalls/sigaltstack.S +++ b/libc/arch-x86_64/syscalls/sigaltstack.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sigaltstack) movl $__NR_sigaltstack, %eax syscall diff --git a/libc/arch-x86_64/syscalls/socketpair.S b/libc/arch-x86_64/syscalls/socketpair.S index 5466dc9db..cb32a8aff 100644 --- a/libc/arch-x86_64/syscalls/socketpair.S +++ b/libc/arch-x86_64/syscalls/socketpair.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(socketpair) movq %rcx, %r10 movl $__NR_socketpair, %eax diff --git a/libc/arch-x86_64/syscalls/splice.S b/libc/arch-x86_64/syscalls/splice.S index 3c245a554..351e1c7f9 100644 --- a/libc/arch-x86_64/syscalls/splice.S +++ b/libc/arch-x86_64/syscalls/splice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(splice) movq %rcx, %r10 movl $__NR_splice, %eax diff --git a/libc/arch-x86_64/syscalls/statfs64.S b/libc/arch-x86_64/syscalls/statfs64.S index 6a2637ca3..26c3d535f 100644 --- a/libc/arch-x86_64/syscalls/statfs64.S +++ b/libc/arch-x86_64/syscalls/statfs64.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(statfs64) movl $__NR_statfs, %eax syscall diff --git a/libc/arch-x86_64/syscalls/swapoff.S b/libc/arch-x86_64/syscalls/swapoff.S index 7e55758ab..1bf331c2b 100644 --- a/libc/arch-x86_64/syscalls/swapoff.S +++ b/libc/arch-x86_64/syscalls/swapoff.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapoff) movl $__NR_swapoff, %eax syscall diff --git a/libc/arch-x86_64/syscalls/swapon.S b/libc/arch-x86_64/syscalls/swapon.S index d2f5f660b..7405ccb9f 100644 --- a/libc/arch-x86_64/syscalls/swapon.S +++ b/libc/arch-x86_64/syscalls/swapon.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(swapon) movl $__NR_swapon, %eax syscall diff --git a/libc/arch-x86_64/syscalls/symlinkat.S b/libc/arch-x86_64/syscalls/symlinkat.S index 5bbf1cbdb..bea2da886 100644 --- a/libc/arch-x86_64/syscalls/symlinkat.S +++ b/libc/arch-x86_64/syscalls/symlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(symlinkat) movl $__NR_symlinkat, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sync.S b/libc/arch-x86_64/syscalls/sync.S index 991171543..97aa427e7 100644 --- a/libc/arch-x86_64/syscalls/sync.S +++ b/libc/arch-x86_64/syscalls/sync.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sync) movl $__NR_sync, %eax syscall diff --git a/libc/arch-x86_64/syscalls/sysinfo.S b/libc/arch-x86_64/syscalls/sysinfo.S index 104bb2ced..de8fb8fb8 100644 --- a/libc/arch-x86_64/syscalls/sysinfo.S +++ b/libc/arch-x86_64/syscalls/sysinfo.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(sysinfo) movl $__NR_sysinfo, %eax syscall diff --git a/libc/arch-x86_64/syscalls/tee.S b/libc/arch-x86_64/syscalls/tee.S index ad5698c9d..41e2370c6 100644 --- a/libc/arch-x86_64/syscalls/tee.S +++ b/libc/arch-x86_64/syscalls/tee.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tee) movq %rcx, %r10 movl $__NR_tee, %eax diff --git a/libc/arch-x86_64/syscalls/tgkill.S b/libc/arch-x86_64/syscalls/tgkill.S index e3b9972c7..00b2b42ee 100644 --- a/libc/arch-x86_64/syscalls/tgkill.S +++ b/libc/arch-x86_64/syscalls/tgkill.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(tgkill) movl $__NR_tgkill, %eax syscall diff --git a/libc/arch-x86_64/syscalls/timerfd_create.S b/libc/arch-x86_64/syscalls/timerfd_create.S index 3f1b23afc..eef3208f6 100644 --- a/libc/arch-x86_64/syscalls/timerfd_create.S +++ b/libc/arch-x86_64/syscalls/timerfd_create.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_create) movl $__NR_timerfd_create, %eax syscall diff --git a/libc/arch-x86_64/syscalls/timerfd_gettime.S b/libc/arch-x86_64/syscalls/timerfd_gettime.S index b1017ad90..9f11c5af8 100644 --- a/libc/arch-x86_64/syscalls/timerfd_gettime.S +++ b/libc/arch-x86_64/syscalls/timerfd_gettime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_gettime) movl $__NR_timerfd_gettime, %eax syscall diff --git a/libc/arch-x86_64/syscalls/timerfd_settime.S b/libc/arch-x86_64/syscalls/timerfd_settime.S index 8610a1d4f..65a17e1ad 100644 --- a/libc/arch-x86_64/syscalls/timerfd_settime.S +++ b/libc/arch-x86_64/syscalls/timerfd_settime.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(timerfd_settime) movq %rcx, %r10 movl $__NR_timerfd_settime, %eax diff --git a/libc/arch-x86_64/syscalls/times.S b/libc/arch-x86_64/syscalls/times.S index 07590b9f3..5ee21be78 100644 --- a/libc/arch-x86_64/syscalls/times.S +++ b/libc/arch-x86_64/syscalls/times.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(times) movl $__NR_times, %eax syscall diff --git a/libc/arch-x86_64/syscalls/truncate.S b/libc/arch-x86_64/syscalls/truncate.S index db2121f86..2dc179306 100644 --- a/libc/arch-x86_64/syscalls/truncate.S +++ b/libc/arch-x86_64/syscalls/truncate.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(truncate) movl $__NR_truncate, %eax syscall diff --git a/libc/arch-x86_64/syscalls/umask.S b/libc/arch-x86_64/syscalls/umask.S index badea7608..ad102bd75 100644 --- a/libc/arch-x86_64/syscalls/umask.S +++ b/libc/arch-x86_64/syscalls/umask.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umask) movl $__NR_umask, %eax syscall diff --git a/libc/arch-x86_64/syscalls/umount2.S b/libc/arch-x86_64/syscalls/umount2.S index 93e6fa034..31588de89 100644 --- a/libc/arch-x86_64/syscalls/umount2.S +++ b/libc/arch-x86_64/syscalls/umount2.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(umount2) movl $__NR_umount2, %eax syscall diff --git a/libc/arch-x86_64/syscalls/uname.S b/libc/arch-x86_64/syscalls/uname.S index 4b0d1c5e2..ad2d8f456 100644 --- a/libc/arch-x86_64/syscalls/uname.S +++ b/libc/arch-x86_64/syscalls/uname.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(uname) movl $__NR_uname, %eax syscall diff --git a/libc/arch-x86_64/syscalls/unlinkat.S b/libc/arch-x86_64/syscalls/unlinkat.S index f322f7d2e..e6aac2e4a 100644 --- a/libc/arch-x86_64/syscalls/unlinkat.S +++ b/libc/arch-x86_64/syscalls/unlinkat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unlinkat) movl $__NR_unlinkat, %eax syscall diff --git a/libc/arch-x86_64/syscalls/unshare.S b/libc/arch-x86_64/syscalls/unshare.S index b5395c141..6594df025 100644 --- a/libc/arch-x86_64/syscalls/unshare.S +++ b/libc/arch-x86_64/syscalls/unshare.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(unshare) movl $__NR_unshare, %eax syscall diff --git a/libc/arch-x86_64/syscalls/utimensat.S b/libc/arch-x86_64/syscalls/utimensat.S index f90caf210..5eaac1b55 100644 --- a/libc/arch-x86_64/syscalls/utimensat.S +++ b/libc/arch-x86_64/syscalls/utimensat.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(utimensat) movq %rcx, %r10 movl $__NR_utimensat, %eax diff --git a/libc/arch-x86_64/syscalls/vmsplice.S b/libc/arch-x86_64/syscalls/vmsplice.S index cc94cc601..6f9e5d1b5 100644 --- a/libc/arch-x86_64/syscalls/vmsplice.S +++ b/libc/arch-x86_64/syscalls/vmsplice.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(vmsplice) movq %rcx, %r10 movl $__NR_vmsplice, %eax diff --git a/libc/arch-x86_64/syscalls/wait4.S b/libc/arch-x86_64/syscalls/wait4.S index 794833153..141fe19fc 100644 --- a/libc/arch-x86_64/syscalls/wait4.S +++ b/libc/arch-x86_64/syscalls/wait4.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(wait4) movq %rcx, %r10 movl $__NR_wait4, %eax diff --git a/libc/arch-x86_64/syscalls/write.S b/libc/arch-x86_64/syscalls/write.S index 7e3a56340..498fca71c 100644 --- a/libc/arch-x86_64/syscalls/write.S +++ b/libc/arch-x86_64/syscalls/write.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(write) movl $__NR_write, %eax syscall diff --git a/libc/arch-x86_64/syscalls/writev.S b/libc/arch-x86_64/syscalls/writev.S index 5fc040a04..ef80eb898 100644 --- a/libc/arch-x86_64/syscalls/writev.S +++ b/libc/arch-x86_64/syscalls/writev.S @@ -2,6 +2,8 @@ #include + .hidden __set_errno + ENTRY(writev) movl $__NR_writev, %eax syscall diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py index 96583d69d..316e05b03 100755 --- a/libc/tools/gensyscalls.py +++ b/libc/tools/gensyscalls.py @@ -43,6 +43,8 @@ syscall_stub_header = "/* " + warning + " */\n" + \ """ #include + .hidden __set_errno + ENTRY(%(func)s) """ From 72d7e667c7e926cb120c4edb53cbf74c652ab915 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sat, 9 Aug 2014 18:45:55 -0700 Subject: [PATCH 098/148] Fix our x86 PIC_PROLOGUE. The old definition only worked for functions that didn't use numbered local labels. Upstream uses '666' not only as some kind of BSD in-joke, but also because there's little likelihood of any function having labels that high. There's a wider question about whether we actually want to go via the PLT at all in this code, but that's a question for another day. Bug: 16906712 Change-Id: I3cd8ecc448b33f942bb6e783931808ef39091489 --- libc/arch-x86/include/machine/asm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/arch-x86/include/machine/asm.h b/libc/arch-x86/include/machine/asm.h index bf77525ee..672493d5d 100644 --- a/libc/arch-x86/include/machine/asm.h +++ b/libc/arch-x86/include/machine/asm.h @@ -39,10 +39,10 @@ #define PIC_PROLOGUE \ pushl %ebx; \ - call 1f; \ -1: \ + call 666f; \ +666: \ popl %ebx; \ - addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-666b], %ebx #define PIC_EPILOGUE \ popl %ebx #define PIC_PLT(x) x@PLT From d332bc68783b9bdef4ecb38bec4e45765a5e9a94 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 12 Aug 2014 16:21:26 -0700 Subject: [PATCH 099/148] Hide __libc_malloc_dispatch. Now that -Bsymbolic is fixed, we can hide __libc_malloc_dispatch without breaking ASAN. Bug: 11156955 Change-Id: Ia2fc9b046a74e666b33aa6c6c5435f70a63b8021 --- libc/bionic/malloc_debug_common.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libc/bionic/malloc_debug_common.cpp b/libc/bionic/malloc_debug_common.cpp index be16625b8..0b6a1421b 100644 --- a/libc/bionic/malloc_debug_common.cpp +++ b/libc/bionic/malloc_debug_common.cpp @@ -81,8 +81,7 @@ static const MallocDebug __libc_malloc_default_dispatch __attribute__((aligned(3 }; // Selector of dispatch table to use for dispatching malloc calls. -// TODO: fix http://b/15432753 and make this static again. -const MallocDebug* __libc_malloc_dispatch = &__libc_malloc_default_dispatch; +static const MallocDebug* __libc_malloc_dispatch = &__libc_malloc_default_dispatch; // Handle to shared library where actual memory allocation is implemented. // This library is loaded and memory allocation calls are redirected there From 8a84d383fb74135e928d341baa180c55854f2f42 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Tue, 12 Aug 2014 21:02:13 -0700 Subject: [PATCH 100/148] Optimize symbol lookup Do not run symbol lookup on already visited soinfos Not taking into account already visited libraries dramatically slows down dlsym in cases when there are multiple occurrences of a large library in dependency tree. Bug: 16977077 (cherry picked from commit 042426ba6375f5c145379e598486ec6d675533c9) Change-Id: I69d59e395e8112f119343e8a4d72fe31cd449f31 --- linker/linked_list.h | 9 +++++++++ linker/linker.cpp | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/linker/linked_list.h b/linker/linked_list.h index 7f8c90160..8096e623d 100644 --- a/linker/linked_list.h +++ b/linker/linked_list.h @@ -100,6 +100,15 @@ class LinkedList { } } + bool contains(const T* el) { + for (LinkedListEntry* e = head_; e != nullptr; e = e->next) { + if (e->element != nullptr && e->element == el) { + return true; + } + } + return false; + } + private: LinkedListEntry* head_; LinkedListEntry* tail_; diff --git a/linker/linker.cpp b/linker/linker.cpp index f8b35d7a8..77fb70c29 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -607,17 +607,24 @@ class SoinfoListAllocatorRW { // specified soinfo object and its dependencies in breadth first order. ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soinfo* caller) { LinkedList visit_list; + LinkedList visited; visit_list.push_back(si); soinfo* current_soinfo; while ((current_soinfo = visit_list.pop_front()) != nullptr) { + if (visited.contains(current_soinfo)) { + continue; + } + ElfW(Sym)* result = soinfo_elf_lookup(current_soinfo, elfhash(name), name, caller == current_soinfo ? SymbolLookupScope::kAllowLocal : SymbolLookupScope::kExcludeLocal); if (result != nullptr) { *found = current_soinfo; visit_list.clear(); + visited.clear(); return result; } + visited.push_back(current_soinfo); current_soinfo->get_children().for_each([&](soinfo* child) { visit_list.push_back(child); @@ -625,6 +632,7 @@ ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soi } visit_list.clear(); + visited.clear(); return nullptr; } From 4bea4c631f747cc6b570ecd42c744a9b1103bf28 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Fri, 8 Aug 2014 16:57:15 -0700 Subject: [PATCH 101/148] Label pages mapped by linker_allocator (cherry picked from commit 51a22a12ab370933a35463f5c81223132ec64dcb) Bug: 17013324 Change-Id: I345c9d0fecc29d3626c5be01cc3c0ed1583ac361 --- libc/bionic/dlmalloc.c | 6 +----- libc/private/bionic_prctl.h | 26 ++++++++++++++++++++++++++ linker/linker_allocator.cpp | 5 +++++ 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 libc/private/bionic_prctl.h diff --git a/libc/bionic/dlmalloc.c b/libc/bionic/dlmalloc.c index d582071a7..e89c5d1ff 100644 --- a/libc/bionic/dlmalloc.c +++ b/libc/bionic/dlmalloc.c @@ -16,6 +16,7 @@ #include "dlmalloc.h" +#include "private/bionic_prctl.h" #include "private/libc_logging.h" // Send dlmalloc errors to the log. @@ -30,11 +31,6 @@ static void* named_anonymous_mmap(size_t length); #define MMAP(s) named_anonymous_mmap(s) #define DIRECT_MMAP(s) named_anonymous_mmap(s) -// Local definitions of custom prctl arguments to set a vma name in Android kernels. -#include -#define PR_SET_VMA 0x53564d41 -#define PR_SET_VMA_ANON_NAME 0 - // Ugly inclusion of C file so that bionic specific #defines configure dlmalloc. #include "../upstream-dlmalloc/malloc.c" diff --git a/libc/private/bionic_prctl.h b/libc/private/bionic_prctl.h new file mode 100644 index 000000000..103cccb65 --- /dev/null +++ b/libc/private/bionic_prctl.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BIONIC_PRCTL_H +#define BIONIC_PRCTL_H + +#include + +// This is only supported by Android kernels, so it's not in the uapi headers. +#define PR_SET_VMA 0x53564d41 +#define PR_SET_VMA_ANON_NAME 0 + +#endif // BIONIC_PRCTL_H diff --git a/linker/linker_allocator.cpp b/linker/linker_allocator.cpp index f5d3745b4..92220e8c4 100644 --- a/linker/linker_allocator.cpp +++ b/linker/linker_allocator.cpp @@ -18,6 +18,8 @@ #include #include +#include "private/bionic_prctl.h" + struct LinkerAllocatorPage { LinkerAllocatorPage* next; uint8_t bytes[PAGE_SIZE-sizeof(LinkerAllocatorPage*)]; @@ -96,6 +98,9 @@ void LinkerBlockAllocator::create_new_page() { if (page == MAP_FAILED) { abort(); // oom } + + prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, page, PAGE_SIZE, "linker_alloc"); + memset(page, 0, PAGE_SIZE); FreeBlockInfo* first_block = reinterpret_cast(page->bytes); From 59c1ee44d0a560a754513fab12641c8a57a20d9e Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 14 Aug 2014 12:48:04 -0700 Subject: [PATCH 102/148] malloc_usable_size returns the original size. Bug: 16874447 Change-Id: Ie3ce683fd1f58b837b8ea91dc798e561b8593356 --- libc/bionic/malloc_debug_leak.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libc/bionic/malloc_debug_leak.cpp b/libc/bionic/malloc_debug_leak.cpp index 837dccc5a..27b671432 100644 --- a/libc/bionic/malloc_debug_leak.cpp +++ b/libc/bionic/malloc_debug_leak.cpp @@ -481,11 +481,15 @@ extern "C" size_t leak_malloc_usable_size(const void* mem) { return 0; } + // TODO: Temporary workaround to avoid a crash b/16874447. + return header->entry->size & ~SIZE_FLAG_MASK; +#if 0 size_t ret = g_malloc_dispatch->malloc_usable_size(header); if (ret != 0) { // The usable area starts at 'mem' and stops at 'header+ret'. return reinterpret_cast(header) + ret - reinterpret_cast(mem); } +#endif } return 0; } From 9f533972ae3be1a2faec74ddddbf136b20fd76d1 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 14 Aug 2014 15:43:25 -0700 Subject: [PATCH 103/148] Move mtctxres.c to libc_dns.a. Has the effect of making ___mtctxres hidden. Bug: 11156955 Change-Id: I5aa5f49344ad5ecb33f48737430561b329bcbb0d (cherry picked from commit 891ec7a6e46e60d7dfa1cf229e14a8e8634e272b) --- libc/Android.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/Android.mk b/libc/Android.mk index 2007965fa..727513cb7 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -278,7 +278,6 @@ libc_upstream_netbsd_src_files := \ upstream-netbsd/lib/libc/regex/regerror.c \ upstream-netbsd/lib/libc/regex/regexec.c \ upstream-netbsd/lib/libc/regex/regfree.c \ - upstream-netbsd/lib/libc/resolv/mtctxres.c \ upstream-netbsd/lib/libc/stdlib/bsearch.c \ upstream-netbsd/lib/libc/stdlib/div.c \ upstream-netbsd/lib/libc/stdlib/drand48.c \ @@ -634,6 +633,7 @@ LOCAL_SRC_FILES := \ $(call all-c-files-under,dns) \ upstream-netbsd/lib/libc/isc/ev_streams.c \ upstream-netbsd/lib/libc/isc/ev_timers.c \ + upstream-netbsd/lib/libc/resolv/mtctxres.c \ LOCAL_CFLAGS := \ $(libc_common_cflags) \ From bafee43161b9e38ca6c941eb3646df20ec6da759 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 14 Aug 2014 13:56:51 -0700 Subject: [PATCH 104/148] Change name of MB_CUR_MAX implementation function. Glibc calls theirs __ctype_get_mb_cur_max. Make ours match to cut down on differences between bionic and glibc. Bug: 11156955 Change-Id: Ib7231f01aa9676dff30aea0af25d597bfe07bc73 --- libc/bionic/locale.cpp | 2 +- libc/include/stdlib.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/bionic/locale.cpp b/libc/bionic/locale.cpp index 4c3fd7f31..ddb49ce6f 100644 --- a/libc/bionic/locale.cpp +++ b/libc/bionic/locale.cpp @@ -92,7 +92,7 @@ static void __locale_init() { g_locale.int_n_sign_posn = CHAR_MAX; } -size_t __mb_cur_max() { +size_t __ctype_get_mb_cur_max() { locale_t l = reinterpret_cast(pthread_getspecific(g_uselocale_key)); if (l == nullptr || l == LC_GLOBAL_LOCALE) { return __bionic_current_locale_is_utf8 ? 4 : 1; diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index a5eb3d15b..52f71dd47 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -161,8 +161,8 @@ extern int mbtowc(wchar_t *, const char *, size_t); extern int wctomb(char *, wchar_t); extern size_t wcstombs(char *, const wchar_t *, size_t); -extern size_t __mb_cur_max(void); -#define MB_CUR_MAX __mb_cur_max() +extern size_t __ctype_get_mb_cur_max(void); +#define MB_CUR_MAX __ctype_get_mb_cur_max() __END_DECLS From f0f66c0264eb4b6ee56072af34c91a78a9184f23 Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Thu, 14 Aug 2014 15:26:03 -0700 Subject: [PATCH 105/148] Have stdatomic.h punt to C++ atomic when possible This is an alternate, somewhat simpler, fix that makes it safe to include both and from C++ code in either order. It means that C code consistently uses one implementation of atomics and C++ another. We still have to make sure that those two implementations interoperate correctly at runtime; in particular, any flavor of atomic object needs to be represented exactly like the underlying type, with the proper alignment constraint. Bug:17007799 Change-Id: Iffcfc5220d8fa150f89dd083a121b24d23f268fc (cherry picked from commit 019d3958118b7dc3ec8444ad2accca50c268b737) --- libc/include/stdatomic.h | 93 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/libc/include/stdatomic.h b/libc/include/stdatomic.h index 669cefd66..2c0422138 100644 --- a/libc/include/stdatomic.h +++ b/libc/include/stdatomic.h @@ -31,9 +31,98 @@ #define _STDATOMIC_H_ #include + +#if defined(__cplusplus) && defined(_USING_LIBCXX) && \ + (__has_feature(cxx_atomic) || _GNUC_VER >= 407) + +/* We have a usable C++ ; use it instead. */ + +#include + +#define _Atomic(t) std::atomic + +using std::atomic_is_lock_free; +using std::atomic_init; +using std::atomic_store; +using std::atomic_store_explicit; +using std::atomic_load; +using std::atomic_load_explicit; +using std::atomic_exchange; +using std::atomic_exchange_explicit; +using std::atomic_compare_exchange_strong; +using std::atomic_compare_exchange_strong_explicit; +using std::atomic_compare_exchange_weak; +using std::atomic_compare_exchange_weak_explicit; +using std::atomic_fetch_add; +using std::atomic_fetch_add_explicit; +using std::atomic_fetch_sub; +using std::atomic_fetch_sub_explicit; +using std::atomic_fetch_or; +using std::atomic_fetch_or_explicit; +using std::atomic_fetch_xor; +using std::atomic_fetch_xor_explicit; +using std::atomic_fetch_and; +using std::atomic_fetch_and_explicit; +using std::atomic_thread_fence; +using std::atomic_signal_fence; + +using std::memory_order; +using std::memory_order_relaxed; +using std::memory_order_consume; +using std::memory_order_release; +using std::memory_order_acq_rel; +using std::memory_order_seq_cst; + +using std::atomic_bool; +using std::atomic_char; +using std::atomic_schar; +using std::atomic_uchar; +using std::atomic_short; +using std::atomic_ushort; +using std::atomic_int; +using std::atomic_uint; +using std::atomic_long; +using std::atomic_ulong; +using std::atomic_llong; +using std::atomic_ullong; +using std::atomic_char16_t; +using std::atomic_char32_t; +using std::atomic_wchar_t; +using std::atomic_int_least8_t; +using std::atomic_uint_least8_t; +using std::atomic_int_least16_t; +using std::atomic_uint_least16_t; +using std::atomic_int_least32_t; +using std::atomic_uint_least32_t; +using std::atomic_int_least64_t; +using std::atomic_uint_least64_t; +using std::atomic_int_fast8_t; +using std::atomic_uint_fast8_t; +using std::atomic_int_fast16_t; +using std::atomic_uint_fast16_t; +using std::atomic_int_fast32_t; +using std::atomic_uint_fast32_t; +using std::atomic_int_fast64_t; +using std::atomic_uint_fast64_t; +using std::atomic_intptr_t; +using std::atomic_uintptr_t; +using std::atomic_size_t; +using std::atomic_ptrdiff_t; +using std::atomic_intmax_t; +using std::atomic_uintmax_t; + +#else /* unavailable, possibly because this is C, not C++ */ + #include #include +/* + * C: Do it ourselves. + * Note that the runtime representation defined here should be compatible + * with the C++ one, i.e. an _Atomic(T) needs to contain the same + * bits as a T. + */ + #if __has_extension(c_atomic) || __has_extension(cxx_atomic) #define __CLANG_ATOMICS #elif __GNUC_PREREQ__(4, 7) @@ -121,6 +210,8 @@ * * The memory_order_* constants that denote the barrier behaviour of the * atomic operations. + * The enum values must be identical to those used by the + * C++ header. */ typedef enum { @@ -419,4 +510,6 @@ atomic_flag_clear(volatile atomic_flag *__object) } #endif /* !_KERNEL */ +#endif /* unavailable */ + #endif /* !_STDATOMIC_H_ */ From be4348e7c73841766208f4eb771dde1455b26449 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Thu, 14 Aug 2014 15:46:36 -0700 Subject: [PATCH 106/148] Keep symbols for linker Bug: 17011146 (cherry picked from commit ad5e8b50737144833233d47fe04deb3fa0284df2) Change-Id: Ib1d3f8d6d38af98586658e01ed1ec79d2c5b4d42 --- linker/Android.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linker/Android.mk b/linker/Android.mk index 68e801da2..5853c9070 100644 --- a/linker/Android.mk +++ b/linker/Android.mk @@ -57,6 +57,10 @@ LOCAL_MODULE_STEM_32 := linker LOCAL_MODULE_STEM_64 := linker64 LOCAL_MULTILIB := both +# Leave the symbols in the shared library so that stack unwinders can produce +# meaningful name resolution. +LOCAL_STRIP_MODULE := keep_symbols + include $(LOCAL_PATH)/linker_executable.mk ifdef TARGET_2ND_ARCH LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) From 5df0839cea98bd8c37d8dba5b94b98e99c681a94 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 15 Aug 2014 18:42:58 -0700 Subject: [PATCH 107/148] Fix leak_realloc, copy entire allocation. Bug: 16874447 Change-Id: Ie54a73fd75529961195fa5173d9116d0ae897b03 --- libc/bionic/malloc_debug_leak.cpp | 64 +++++++++++++++---------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/libc/bionic/malloc_debug_leak.cpp b/libc/bionic/malloc_debug_leak.cpp index 27b671432..df0f997e5 100644 --- a/libc/bionic/malloc_debug_leak.cpp +++ b/libc/bionic/malloc_debug_leak.cpp @@ -385,6 +385,36 @@ extern "C" void* leak_calloc(size_t n_elements, size_t elem_size) { return ptr; } +extern "C" size_t leak_malloc_usable_size(const void* mem) { + if (DebugCallsDisabled()) { + return g_malloc_dispatch->malloc_usable_size(mem); + } + + if (mem == NULL) { + return 0; + } + + // Check the guard to make sure it is valid. + const AllocationEntry* header = const_to_header(mem); + + if (header->guard == MEMALIGN_GUARD) { + // If this is a memalign'd pointer, then grab the header from + // entry. + header = const_to_header(header->entry); + } else if (header->guard != GUARD) { + debug_log("WARNING bad header guard: '0x%x'! and invalid entry: %p\n", + header->guard, header->entry); + return 0; + } + + size_t ret = g_malloc_dispatch->malloc_usable_size(header); + if (ret != 0) { + // The usable area starts at 'mem' and stops at 'header+ret'. + return reinterpret_cast(header) + ret - reinterpret_cast(mem); + } + return 0; +} + extern "C" void* leak_realloc(void* oldMem, size_t bytes) { if (DebugCallsDisabled()) { return g_malloc_dispatch->realloc(oldMem, bytes); @@ -408,7 +438,7 @@ extern "C" void* leak_realloc(void* oldMem, size_t bytes) { newMem = leak_malloc(bytes); if (newMem != NULL) { - size_t oldSize = header->entry->size & ~SIZE_FLAG_MASK; + size_t oldSize = leak_malloc_usable_size(oldMem); size_t copySize = (oldSize <= bytes) ? oldSize : bytes; memcpy(newMem, oldMem, copySize); leak_free(oldMem); @@ -462,38 +492,6 @@ extern "C" void* leak_memalign(size_t alignment, size_t bytes) { return base; } -extern "C" size_t leak_malloc_usable_size(const void* mem) { - if (DebugCallsDisabled()) { - return g_malloc_dispatch->malloc_usable_size(mem); - } - - if (mem != NULL) { - // Check the guard to make sure it is valid. - const AllocationEntry* header = const_to_header((void*)mem); - - if (header->guard == MEMALIGN_GUARD) { - // If this is a memalign'd pointer, then grab the header from - // entry. - header = const_to_header(header->entry); - } else if (header->guard != GUARD) { - debug_log("WARNING bad header guard: '0x%x'! and invalid entry: %p\n", - header->guard, header->entry); - return 0; - } - - // TODO: Temporary workaround to avoid a crash b/16874447. - return header->entry->size & ~SIZE_FLAG_MASK; -#if 0 - size_t ret = g_malloc_dispatch->malloc_usable_size(header); - if (ret != 0) { - // The usable area starts at 'mem' and stops at 'header+ret'. - return reinterpret_cast(header) + ret - reinterpret_cast(mem); - } -#endif - } - return 0; -} - extern "C" struct mallinfo leak_mallinfo() { return g_malloc_dispatch->mallinfo(); } From 6df7b609984479c894be81140730578896dbdd8f Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 15 Aug 2014 14:20:04 -0700 Subject: [PATCH 108/148] Hide C++ stuff in libc. Put it back in libstdc++. Bug: 17062445 Change-Id: I027b186719654c2865b08c3fa83f90fa00c1e838 (cherry picked from commit fd5ee9aebc0a43c7f36a0778c7f416b39ddb870e) --- libc/Android.mk | 61 +++++++++++++++++++++++++++++++++++-- libstdc++/Android.mk | 15 --------- libstdc++/src/libstdc++.cpp | 1 - 3 files changed, 58 insertions(+), 19 deletions(-) delete mode 100644 libstdc++/Android.mk delete mode 100644 libstdc++/src/libstdc++.cpp diff --git a/libc/Android.mk b/libc/Android.mk index 727513cb7..32c9fa6cb 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -102,8 +102,6 @@ libc_bionic_src_files := \ bionic/__cmsg_nxthdr.cpp \ bionic/connect.cpp \ bionic/ctype.cpp \ - bionic/__cxa_guard.cpp \ - bionic/__cxa_pure_virtual.cpp \ bionic/dirent.cpp \ bionic/dup2.cpp \ bionic/epoll_create.cpp \ @@ -142,7 +140,6 @@ libc_bionic_src_files := \ bionic/mknod.cpp \ bionic/mntent.cpp \ bionic/NetdClientDispatch.cpp \ - bionic/new.cpp \ bionic/open.cpp \ bionic/pause.cpp \ bionic/pipe.cpp \ @@ -230,6 +227,11 @@ libc_bionic_src_files := \ bionic/wchar.cpp \ bionic/wctype.cpp \ +libc_cxa_src_files := \ + bionic/__cxa_guard.cpp \ + bionic/__cxa_pure_virtual.cpp \ + bionic/new.cpp \ + libc_upstream_freebsd_src_files := \ upstream-freebsd/lib/libc/gen/ldexp.c \ upstream-freebsd/lib/libc/gen/sleep.c \ @@ -805,6 +807,28 @@ $(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_bionic_src_files include $(BUILD_STATIC_LIBRARY) +# ======================================================== +# libc_cxa.a - Things traditionally in libstdc++ +# ======================================================== + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(libc_cxa_src_files) +LOCAL_CFLAGS := $(libc_common_cflags) \ + -fvisibility=hidden \ + +LOCAL_CONLYFLAGS := $(libc_common_conlyflags) +LOCAL_CPPFLAGS := $(libc_common_cppflags) +LOCAL_C_INCLUDES := $(libc_common_c_includes) +LOCAL_MODULE := libc_cxa +# GCC refuses to hide new/delete +LOCAL_CLANG := true +LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) +LOCAL_SYSTEM_SHARED_LIBRARIES := + +include $(BUILD_STATIC_LIBRARY) + + # ======================================================== # libc_syscalls.a # ======================================================== @@ -857,6 +881,7 @@ LOCAL_CLANG := $(use_clang) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_WHOLE_STATIC_LIBRARIES := \ libc_bionic \ + libc_cxa \ libc_dns \ libc_freebsd \ libc_gdtoa \ @@ -1104,6 +1129,36 @@ include $(BUILD_SHARED_LIBRARY) endif #!user +# ======================================================== +# libstdc++.so +# ======================================================== +libstdcxx_common_src_files := \ + bionic/__cxa_guard.cpp \ + bionic/__cxa_pure_virtual.cpp \ + bionic/new.cpp \ + bionic/libc_logging.cpp \ + +include $(CLEAR_VARS) +LOCAL_C_INCLUDES := $(libc_common_c_includes) +LOCAL_CFLAGS := $(libc_common_cflags) +LOCAL_SRC_FILES := $(libstdcxx_common_src_files) +LOCAL_MODULE:= libstdc++ +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_SYSTEM_SHARED_LIBRARIES := libc +include $(BUILD_SHARED_LIBRARY) + +# ======================================================== +# libstdc++.a +# ======================================================== +include $(CLEAR_VARS) +LOCAL_C_INCLUDES := $(libc_common_c_includes) +LOCAL_CFLAGS := $(libc_common_cflags) +LOCAL_SRC_FILES := $(libstdcxx_common_src_files) +LOCAL_MODULE:= libstdc++ +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk +LOCAL_SYSTEM_SHARED_LIBRARIES := libc +include $(BUILD_STATIC_LIBRARY) + # ======================================================== include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/libstdc++/Android.mk b/libstdc++/Android.mk deleted file mode 100644 index ff9609aca..000000000 --- a/libstdc++/Android.mk +++ /dev/null @@ -1,15 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := src/libstdc++.cpp -LOCAL_MODULE:= libstdc++ -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk -LOCAL_SYSTEM_SHARED_LIBRARIES := libc -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_SRC_FILES:= src/libstdc++.cpp -LOCAL_MODULE:= libstdc++ -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk -LOCAL_SYSTEM_SHARED_LIBRARIES := libc -include $(BUILD_STATIC_LIBRARY) diff --git a/libstdc++/src/libstdc++.cpp b/libstdc++/src/libstdc++.cpp deleted file mode 100644 index 3676aa19f..000000000 --- a/libstdc++/src/libstdc++.cpp +++ /dev/null @@ -1 +0,0 @@ -extern "C" void __this_library_is_now_part_of_libc() {} From 9419420919ea846bbad5510850c7aaec95021648 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Mon, 18 Aug 2014 15:08:51 -0700 Subject: [PATCH 109/148] Revert "Add support for protected local symbol lookup." This reverts commit d97e9f546ea195686a78e539315b273393609b9e. Bug: 17107521 Change-Id: I2b81ce2b5a4a2d166133a2626e49d81b6aef3672 --- linker/dlfcn.cpp | 25 +++++++----- linker/linker.cpp | 38 +++++++----------- linker/linker.h | 4 +- tests/dlfcn_test.cpp | 19 --------- tests/libs/Android.mk | 15 -------- tests/libs/dlsym_local_symbol.map | 22 ----------- tests/libs/dlsym_local_symbol_private.cpp | 24 ------------ tests/libs/dlsym_local_symbol_public.cpp | 47 ----------------------- 8 files changed, 31 insertions(+), 163 deletions(-) delete mode 100644 tests/libs/dlsym_local_symbol.map delete mode 100644 tests/libs/dlsym_local_symbol_private.cpp delete mode 100644 tests/libs/dlsym_local_symbol_public.cpp diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp index 8ebf3576b..5d6db8e29 100644 --- a/linker/dlfcn.cpp +++ b/linker/dlfcn.cpp @@ -100,22 +100,29 @@ void* dlsym(void* handle, const char* symbol) { soinfo* found = NULL; ElfW(Sym)* sym = NULL; - void* caller_addr = __builtin_return_address(0); - soinfo* caller_si = find_containing_library(caller_addr); - if (handle == RTLD_DEFAULT) { - sym = dlsym_linear_lookup(symbol, &found, NULL, caller_si); + sym = dlsym_linear_lookup(symbol, &found, NULL); } else if (handle == RTLD_NEXT) { + void* caller_addr = __builtin_return_address(0); + soinfo* si = find_containing_library(caller_addr); + sym = NULL; - if (caller_si && caller_si->next) { - sym = dlsym_linear_lookup(symbol, &found, caller_si->next, caller_si); + if (si && si->next) { + sym = dlsym_linear_lookup(symbol, &found, si->next); } } else { - sym = dlsym_handle_lookup(reinterpret_cast(handle), &found, symbol, caller_si); + sym = dlsym_handle_lookup(reinterpret_cast(handle), &found, symbol); } - if (sym != NULL && sym->st_shndx != 0) { - return reinterpret_cast(sym->st_value + found->load_bias); + if (sym != NULL) { + unsigned bind = ELF_ST_BIND(sym->st_info); + + if ((bind == STB_GLOBAL || bind == STB_WEAK) && sym->st_shndx != 0) { + return reinterpret_cast(sym->st_value + found->load_bias); + } + + __bionic_format_dlerror("symbol found but not global", symbol); + return NULL; } else { __bionic_format_dlerror("undefined symbol", symbol); return NULL; diff --git a/linker/linker.cpp b/linker/linker.cpp index 77fb70c29..52eb56ab8 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -125,11 +125,6 @@ enum RelocationKind { kRelocMax }; -enum class SymbolLookupScope { - kAllowLocal, - kExcludeLocal, -}; - #if STATS struct linker_stats_t { int count[kRelocMax]; @@ -433,7 +428,7 @@ int dl_iterate_phdr(int (*cb)(dl_phdr_info* info, size_t size, void* data), void return rv; } -static ElfW(Sym)* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name, const SymbolLookupScope& lookup_scope) { +static ElfW(Sym)* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name) { ElfW(Sym)* symtab = si->symtab; const char* strtab = si->strtab; @@ -444,6 +439,7 @@ static ElfW(Sym)* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name, ElfW(Sym)* s = symtab + n; if (strcmp(strtab + s->st_name, name)) continue; + /* only concern ourselves with global and weak symbol definitions */ switch (ELF_ST_BIND(s->st_info)) { case STB_GLOBAL: case STB_WEAK: @@ -456,13 +452,7 @@ static ElfW(Sym)* soinfo_elf_lookup(soinfo* si, unsigned hash, const char* name, static_cast(s->st_size)); return s; case STB_LOCAL: - if (lookup_scope != SymbolLookupScope::kAllowLocal) { - continue; - } - TRACE_TYPE(LOOKUP, "FOUND LOCAL %s in %s (%p) %zd", - name, si->name, reinterpret_cast(s->st_value), - static_cast(s->st_size)); - return s; + continue; default: __libc_fatal("ERROR: Unexpected ST_BIND value: %d for '%s' in '%s'", ELF_ST_BIND(s->st_info), name, si->name); @@ -500,7 +490,7 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s */ if (si == somain) { - s = soinfo_elf_lookup(si, elf_hash, name, SymbolLookupScope::kAllowLocal); + s = soinfo_elf_lookup(si, elf_hash, name); if (s != NULL) { *lsi = si; goto done; @@ -517,7 +507,7 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s if (!si->has_DT_SYMBOLIC) { DEBUG("%s: looking up %s in executable %s", si->name, name, somain->name); - s = soinfo_elf_lookup(somain, elf_hash, name, SymbolLookupScope::kExcludeLocal); + s = soinfo_elf_lookup(somain, elf_hash, name); if (s != NULL) { *lsi = somain; goto done; @@ -534,7 +524,7 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s * and some the first non-weak definition. This is system dependent. * Here we return the first definition found for simplicity. */ - s = soinfo_elf_lookup(si, elf_hash, name, SymbolLookupScope::kAllowLocal); + s = soinfo_elf_lookup(si, elf_hash, name); if (s != NULL) { *lsi = si; goto done; @@ -548,7 +538,7 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s if (si->has_DT_SYMBOLIC) { DEBUG("%s: looking up %s in executable %s after local scope", si->name, name, somain->name); - s = soinfo_elf_lookup(somain, elf_hash, name, SymbolLookupScope::kExcludeLocal); + s = soinfo_elf_lookup(somain, elf_hash, name); if (s != NULL) { *lsi = somain; goto done; @@ -559,7 +549,7 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s /* Next, look for it in the preloads list */ for (int i = 0; g_ld_preloads[i] != NULL; i++) { - s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name, SymbolLookupScope::kExcludeLocal); + s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name); if (s != NULL) { *lsi = g_ld_preloads[i]; goto done; @@ -569,7 +559,7 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s for (int i = 0; needed[i] != NULL; i++) { DEBUG("%s: looking up %s in %s", si->name, name, needed[i]->name); - s = soinfo_elf_lookup(needed[i], elf_hash, name, SymbolLookupScope::kExcludeLocal); + s = soinfo_elf_lookup(needed[i], elf_hash, name); if (s != NULL) { *lsi = needed[i]; goto done; @@ -605,7 +595,7 @@ class SoinfoListAllocatorRW { // This is used by dlsym(3). It performs symbol lookup only within the // specified soinfo object and its dependencies in breadth first order. -ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soinfo* caller) { +ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name) { LinkedList visit_list; LinkedList visited; visit_list.push_back(si); @@ -615,8 +605,7 @@ ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soi continue; } - ElfW(Sym)* result = soinfo_elf_lookup(current_soinfo, elfhash(name), name, - caller == current_soinfo ? SymbolLookupScope::kAllowLocal : SymbolLookupScope::kExcludeLocal); + ElfW(Sym)* result = soinfo_elf_lookup(current_soinfo, elfhash(name), name); if (result != nullptr) { *found = current_soinfo; @@ -641,7 +630,7 @@ ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soi beginning of the global solist. Otherwise the search starts at the specified soinfo (for RTLD_NEXT). */ -ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start, soinfo* caller) { +ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start) { unsigned elf_hash = elfhash(name); if (start == NULL) { @@ -650,8 +639,7 @@ ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start, ElfW(Sym)* s = NULL; for (soinfo* si = start; (s == NULL) && (si != NULL); si = si->next) { - s = soinfo_elf_lookup(si, elf_hash, name, - caller == si ? SymbolLookupScope::kAllowLocal : SymbolLookupScope::kExcludeLocal); + s = soinfo_elf_lookup(si, elf_hash, name); if (s != NULL) { *found = si; break; diff --git a/linker/linker.h b/linker/linker.h index 03672b2c6..374652eb8 100644 --- a/linker/linker.h +++ b/linker/linker.h @@ -234,11 +234,11 @@ void do_android_update_LD_LIBRARY_PATH(const char* ld_library_path); soinfo* do_dlopen(const char* name, int flags, const android_dlextinfo* extinfo); void do_dlclose(soinfo* si); -ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start, soinfo* caller_si); +ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start); soinfo* find_containing_library(const void* addr); ElfW(Sym)* dladdr_find_symbol(soinfo* si, const void* addr); -ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name, soinfo* caller_si); +ElfW(Sym)* dlsym_handle_lookup(soinfo* si, soinfo** found, const char* name); void debuggerd_init(); extern "C" abort_msg_t* g_abort_message; diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp index 9bc25574b..c2c9286f6 100644 --- a/tests/dlfcn_test.cpp +++ b/tests/dlfcn_test.cpp @@ -62,25 +62,6 @@ TEST(dlfcn, dlsym_in_self) { ASSERT_EQ(0, dlclose(self)); } -#if defined(__arm__) -// This seems to be working only for arm. -// Others platforms optimize LOCAL PROTECTED symbols. -TEST(dlfcn, dlsym_local_symbol) { - void* handle = dlopen("libtest_local_symbol.so", RTLD_NOW); - ASSERT_TRUE(handle != NULL); - dlerror(); - void* sym = dlsym(handle, "private_taxicab_number"); - ASSERT_TRUE(sym == NULL); - ASSERT_STREQ("undefined symbol: private_taxicab_number", dlerror()); - - uint32_t (*f)(void); - f = reinterpret_cast(dlsym(handle, "dlsym_local_symbol_get_taxicab_number_using_dlsym")); - ASSERT_TRUE(f != NULL); - ASSERT_EQ(1729U, f()); - dlclose(handle); -} -#endif - TEST(dlfcn, dlsym_with_dependencies) { void* handle = dlopen("libtest_with_dependency.so", RTLD_NOW); ASSERT_TRUE(handle != NULL); diff --git a/tests/libs/Android.mk b/tests/libs/Android.mk index 7ed3e7b07..75df539b9 100644 --- a/tests/libs/Android.mk +++ b/tests/libs/Android.mk @@ -114,21 +114,6 @@ build_type := target build_target := SHARED_LIBRARY include $(TEST_PATH)/Android.build.mk -# ----------------------------------------------------------------------------- -# Library used to test local symbol lookup -# ----------------------------------------------------------------------------- -libtest_local_symbol_src_files := \ - dlsym_local_symbol_private.cpp \ - dlsym_local_symbol_public.cpp - -module := libtest_local_symbol -build_target := SHARED_LIBRARY -libtest_local_symbol_ldflags := -Wl,--version-script=$(LOCAL_PATH)/dlsym_local_symbol.map -libtest_local_symbol_cppflags := -std=gnu++11 -libtest_local_symbol_shared_libraries_target := libdl -build_type := target -include $(TEST_PATH)/Android.build.mk - # ----------------------------------------------------------------------------- # Library used by atexit tests # ----------------------------------------------------------------------------- diff --git a/tests/libs/dlsym_local_symbol.map b/tests/libs/dlsym_local_symbol.map deleted file mode 100644 index 58a2299a8..000000000 --- a/tests/libs/dlsym_local_symbol.map +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -LIBTEST_LOCAL_SYMBOL_1.0 { - global: - dlsym_local_symbol_get_taxicab_number; - dlsym_local_symbol_get_taxicab_number_using_dlsym; - local: - *; -}; diff --git a/tests/libs/dlsym_local_symbol_private.cpp b/tests/libs/dlsym_local_symbol_private.cpp deleted file mode 100644 index 2587508e9..000000000 --- a/tests/libs/dlsym_local_symbol_private.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -// This symbol is declared local in -// the linker version map: libdlsym_local_symbol.map. -// It should not be visible from the outside. -extern "C" const uint32_t __attribute__ ((visibility ("protected"))) private_taxicab_number = 1729; diff --git a/tests/libs/dlsym_local_symbol_public.cpp b/tests/libs/dlsym_local_symbol_public.cpp deleted file mode 100644 index d9da32a59..000000000 --- a/tests/libs/dlsym_local_symbol_public.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -extern const uint32_t private_taxicab_number; - -extern "C" { -uint32_t dlsym_local_symbol_get_taxicab_number(); -uint32_t dlsym_local_symbol_get_taxicab_number_using_dlsym(); -} - -uint32_t dlsym_local_symbol_get_taxicab_number() { - return private_taxicab_number; -} - -// Let's make sure that dlsym works correctly for local symbol -uint32_t dlsym_local_symbol_get_taxicab_number_using_dlsym() { - dlerror(); - uint32_t* ptr = reinterpret_cast(dlsym(RTLD_DEFAULT, "private_taxicab_number")); - if (ptr == nullptr) { - const char* dlerr = dlerror(); - if (dlerr != nullptr) { - fprintf(stderr, "dlsym error: %s\n", dlerr); - } else { - fprintf(stderr, "dlsym returned NULL with no dlerror.\n"); - } - return 0; - } - - return *ptr; -} From 1506fc178e9dcd873eaf95535ac7625ebb59388f Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Mon, 18 Aug 2014 14:37:42 -0700 Subject: [PATCH 110/148] Expose android_set_abort_message(). Removes the leading underscores from __android_set_abort_message() and moves its declaration into a public header file. Bug: 17059126 Change-Id: I470c79db47ec783ea7a54b800f8b78ecbe7479ab (cherry picked from commit ce6b1abbb1da797e716d8ec03da4e3b6304fd11d) (cherry picked from commit 3a25ab952befbe908f6df45805683ebe3bf65863) --- libc/bionic/libc_logging.cpp | 5 +-- libc/include/android/set_abort_message.h | 40 ++++++++++++++++++++++++ libc/private/libc_logging.h | 2 -- 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 libc/include/android/set_abort_message.h diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp index d0172edaa..565552665 100644 --- a/libc/bionic/libc_logging.cpp +++ b/libc/bionic/libc_logging.cpp @@ -29,6 +29,7 @@ #include "../private/libc_logging.h" // Relative path so we can #include this .cpp file for testing. #include "../private/ScopedPthreadMutexLocker.h" +#include #include #include #include @@ -629,7 +630,7 @@ static void __libc_fatal(const char* format, va_list args) { // Log to the log for the benefit of regular app developers (whose stdout and stderr are closed). __libc_write_log(ANDROID_LOG_FATAL, "libc", msg); - __android_set_abort_message(msg); + android_set_abort_message(msg); } void __libc_fatal_no_abort(const char* format, ...) { @@ -647,7 +648,7 @@ void __libc_fatal(const char* format, ...) { abort(); } -void __android_set_abort_message(const char* msg) { +void android_set_abort_message(const char* msg) { ScopedPthreadMutexLocker locker(&g_abort_msg_lock); if (__abort_message_ptr == NULL) { diff --git a/libc/include/android/set_abort_message.h b/libc/include/android/set_abort_message.h new file mode 100644 index 000000000..4b3d82b37 --- /dev/null +++ b/libc/include/android/set_abort_message.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SET_ABORT_MESSAGE_H +#define _SET_ABORT_MESSAGE_H + +#include + +__BEGIN_DECLS + +void android_set_abort_message(const char* msg); + +__END_DECLS + +#endif // _SET_ABORT_MESSAGE_H diff --git a/libc/private/libc_logging.h b/libc/private/libc_logging.h index 35c756bb9..da2192bba 100644 --- a/libc/private/libc_logging.h +++ b/libc/private/libc_logging.h @@ -69,8 +69,6 @@ struct abort_msg_t { char msg[0]; }; -void __android_set_abort_message(const char* msg); - // // Formats a message to the log (priority 'fatal'), then aborts. // From 2d80400a9e8454038a3ec29959436184be0c4c65 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 20 Aug 2014 12:14:21 -0700 Subject: [PATCH 111/148] Fix some 32-bit-isms in . Bug: 17157793 Change-Id: I8290e240b92e5617f4c12c0eacad6e622e677b6a --- libc/include/stdio.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 9c6bd3f94..43b0fbfe4 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -58,10 +58,17 @@ typedef off_t fpos_t; /* stdio file position type */ */ /* stdio buffers */ +#if defined(__LP64__) +struct __sbuf { + unsigned char* _base; + size_t _size; +}; +#else struct __sbuf { unsigned char *_base; int _size; }; +#endif /* * stdio state variables. @@ -94,8 +101,13 @@ typedef struct __sFILE { unsigned char *_p; /* current position in (some) buffer */ int _r; /* read space left for getc() */ int _w; /* write space left for putc() */ +#if defined(__LP64__) + int _flags; /* flags, below; this FILE is free if 0 */ + int _file; /* fileno, if Unix descriptor, else -1 */ +#else short _flags; /* flags, below; this FILE is free if 0 */ short _file; /* fileno, if Unix descriptor, else -1 */ +#endif struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ int _lbfsize; /* 0 or -_bf._size, for inline putc */ From 84d0683a824fa02dbaa6d1b56a79223804b54e80 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 21 Aug 2014 19:23:53 -0700 Subject: [PATCH 112/148] Fix unistd.getpid_caching_and_clone. This test only works if you're root (strictly: if you have permission to CLONE_NEWNS), so it's useful to us when we're doing ad hoc testing (since that's usually done as root), but it's not useful as part of CTS or when running the tests on the host. Bug: 16705621 Bug: 17170200 Change-Id: Ia92c871b15f7e45fc174bb59bc95540fd00ae745 --- tests/unistd_test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp index 2a656574c..8195ea8f4 100644 --- a/tests/unistd_test.cpp +++ b/tests/unistd_test.cpp @@ -431,6 +431,10 @@ TEST(unistd, getpid_caching_and_clone) { void* child_stack[1024]; int clone_result = clone(GetPidCachingCloneStartRoutine, &child_stack[1024], CLONE_NEWNS | SIGCHLD, NULL); + if (clone_result == -1 && errno == EPERM && getuid() != 0) { + GTEST_LOG_(INFO) << "This test only works if you have permission to CLONE_NEWNS; try running as root.\n"; + return; + } ASSERT_NE(clone_result, -1); ASSERT_EQ(parent_pid, getpid()); From 642182341018b282148280a7bdb771493e15bd7d Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 25 Aug 2014 17:26:50 -0700 Subject: [PATCH 113/148] Fix pthread_getattr_np for the main thread. On most architectures the kernel subtracts a random offset to the stack pointer in create_elf_tables by calling arch_align_stack before writing the auxval table and so on. On all but x86 this doesn't cause a problem because the random offset is less than a page, but on x86 it's up to two pages. This means that our old technique of rounding the stack pointer doesn't work. (Our old implementation of that technique was wrong too.) It's also incorrect to assume that the main thread's stack base and size are constant. Likewise to assume that the main thread has a guard page. The main thread is not like other threads. This patch switches to reading /proc/self/maps (and checking RLIMIT_STACK) whenever we're asked. Bug: 17111575 Signed-off-by: Fengwei Yin (cherry picked from commit 57b7a6110e7e8b446fc23cce4765ff625ee0a105) Change-Id: I87e679ee1c0db8092f2d1221c8e7c1461545c5a4 --- libc/arch-arm/arm.mk | 1 - libc/arch-arm/bionic/__get_sp.S | 34 ------------ libc/arch-arm64/arm64.mk | 1 - libc/arch-arm64/bionic/__get_sp.S | 34 ------------ libc/arch-mips/bionic/__get_sp.S | 34 ------------ libc/arch-mips/mips.mk | 1 - libc/arch-mips64/bionic/__get_sp.S | 34 ------------ libc/arch-x86/bionic/__get_sp.S | 34 ------------ libc/arch-x86/x86.mk | 1 - libc/arch-x86_64/bionic/__get_sp.S | 34 ------------ libc/arch-x86_64/x86_64.mk | 1 - libc/bionic/libc_init_common.cpp | 24 ++------- libc/bionic/pthread_attr.cpp | 51 ++++++++++++++++-- libc/private/bionic_string_utils.h | 31 +++++++++++ tests/dlfcn_test.cpp | 4 +- tests/pthread_test.cpp | 86 ++++++++++++++++++++++++++++++ 16 files changed, 169 insertions(+), 236 deletions(-) delete mode 100644 libc/arch-arm/bionic/__get_sp.S delete mode 100644 libc/arch-arm64/bionic/__get_sp.S delete mode 100644 libc/arch-mips/bionic/__get_sp.S delete mode 100644 libc/arch-mips64/bionic/__get_sp.S delete mode 100644 libc/arch-x86/bionic/__get_sp.S delete mode 100644 libc/arch-x86_64/bionic/__get_sp.S create mode 100644 libc/private/bionic_string_utils.h diff --git a/libc/arch-arm/arm.mk b/libc/arch-arm/arm.mk index 00be4aed5..70cc8eba6 100644 --- a/libc/arch-arm/arm.mk +++ b/libc/arch-arm/arm.mk @@ -53,7 +53,6 @@ libc_bionic_src_files_arm += \ arch-arm/bionic/atomics_arm.c \ arch-arm/bionic/__bionic_clone.S \ arch-arm/bionic/_exit_with_stack_teardown.S \ - arch-arm/bionic/__get_sp.S \ arch-arm/bionic/libgcc_compat.c \ arch-arm/bionic/memcmp.S \ arch-arm/bionic/_setjmp.S \ diff --git a/libc/arch-arm/bionic/__get_sp.S b/libc/arch-arm/bionic/__get_sp.S deleted file mode 100644 index 9ae6f247f..000000000 --- a/libc/arch-arm/bionic/__get_sp.S +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -ENTRY_PRIVATE(__get_sp) - mov r0, sp - bx lr -END(__get_sp) diff --git a/libc/arch-arm64/arm64.mk b/libc/arch-arm64/arm64.mk index ed991ce60..6c4f6a6e8 100644 --- a/libc/arch-arm64/arm64.mk +++ b/libc/arch-arm64/arm64.mk @@ -29,7 +29,6 @@ libc_common_src_files_arm64 += \ libc_bionic_src_files_arm64 := \ arch-arm64/bionic/__bionic_clone.S \ arch-arm64/bionic/_exit_with_stack_teardown.S \ - arch-arm64/bionic/__get_sp.S \ arch-arm64/bionic/__rt_sigreturn.S \ arch-arm64/bionic/_setjmp.S \ arch-arm64/bionic/setjmp.S \ diff --git a/libc/arch-arm64/bionic/__get_sp.S b/libc/arch-arm64/bionic/__get_sp.S deleted file mode 100644 index d5e88e973..000000000 --- a/libc/arch-arm64/bionic/__get_sp.S +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -ENTRY_PRIVATE(__get_sp) - mov x0, sp - ret -END(__get_sp) diff --git a/libc/arch-mips/bionic/__get_sp.S b/libc/arch-mips/bionic/__get_sp.S deleted file mode 100644 index 5f5d32ef7..000000000 --- a/libc/arch-mips/bionic/__get_sp.S +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -ENTRY_PRIVATE(__get_sp) - move v0, sp - j ra -END(__get_sp) diff --git a/libc/arch-mips/mips.mk b/libc/arch-mips/mips.mk index 8e415f957..31a1f32fd 100644 --- a/libc/arch-mips/mips.mk +++ b/libc/arch-mips/mips.mk @@ -54,7 +54,6 @@ libc_bionic_src_files_mips += \ arch-mips/bionic/bzero.S \ arch-mips/bionic/cacheflush.cpp \ arch-mips/bionic/_exit_with_stack_teardown.S \ - arch-mips/bionic/__get_sp.S \ arch-mips/bionic/_setjmp.S \ arch-mips/bionic/setjmp.S \ arch-mips/bionic/sigsetjmp.S \ diff --git a/libc/arch-mips64/bionic/__get_sp.S b/libc/arch-mips64/bionic/__get_sp.S deleted file mode 100644 index 5f5d32ef7..000000000 --- a/libc/arch-mips64/bionic/__get_sp.S +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -ENTRY_PRIVATE(__get_sp) - move v0, sp - j ra -END(__get_sp) diff --git a/libc/arch-x86/bionic/__get_sp.S b/libc/arch-x86/bionic/__get_sp.S deleted file mode 100644 index aea6ac62c..000000000 --- a/libc/arch-x86/bionic/__get_sp.S +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -ENTRY_PRIVATE(__get_sp) - mov %esp, %eax - ret -END(__get_sp) diff --git a/libc/arch-x86/x86.mk b/libc/arch-x86/x86.mk index 019dc8e81..a14154866 100644 --- a/libc/arch-x86/x86.mk +++ b/libc/arch-x86/x86.mk @@ -25,7 +25,6 @@ libc_bionic_src_files_x86 := \ libc_bionic_src_files_x86 += \ arch-x86/bionic/__bionic_clone.S \ arch-x86/bionic/_exit_with_stack_teardown.S \ - arch-x86/bionic/__get_sp.S \ arch-x86/bionic/_setjmp.S \ arch-x86/bionic/setjmp.S \ arch-x86/bionic/__set_tls.c \ diff --git a/libc/arch-x86_64/bionic/__get_sp.S b/libc/arch-x86_64/bionic/__get_sp.S deleted file mode 100644 index 49a2406e7..000000000 --- a/libc/arch-x86_64/bionic/__get_sp.S +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -ENTRY_PRIVATE(__get_sp) - mov %rsp, %rax - ret -END(__get_sp) diff --git a/libc/arch-x86_64/x86_64.mk b/libc/arch-x86_64/x86_64.mk index 7887c519e..b001b5e98 100644 --- a/libc/arch-x86_64/x86_64.mk +++ b/libc/arch-x86_64/x86_64.mk @@ -30,7 +30,6 @@ libc_common_src_files_x86_64 += \ libc_bionic_src_files_x86_64 := \ arch-x86_64/bionic/__bionic_clone.S \ arch-x86_64/bionic/_exit_with_stack_teardown.S \ - arch-x86_64/bionic/__get_sp.S \ arch-x86_64/bionic/__rt_sigreturn.S \ arch-x86_64/bionic/_setjmp.S \ arch-x86_64/bionic/setjmp.S \ diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp index 9e4eecde4..950073a29 100644 --- a/libc/bionic/libc_init_common.cpp +++ b/libc/bionic/libc_init_common.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include "private/bionic_auxv.h" @@ -46,7 +45,6 @@ #include "pthread_internal.h" extern "C" abort_msg_t** __abort_message_ptr; -extern "C" uintptr_t __get_sp(void); extern "C" int __system_properties_init(void); extern "C" int __set_tls(void* ptr); extern "C" int __set_tid_address(int* tid_address); @@ -62,17 +60,6 @@ char** environ; // Declared in "private/bionic_ssp.h". uintptr_t __stack_chk_guard = 0; -static size_t get_main_thread_stack_size() { - rlimit stack_limit; - int rlimit_result = getrlimit(RLIMIT_STACK, &stack_limit); - if ((rlimit_result == 0) && - (stack_limit.rlim_cur != RLIM_INFINITY) && - (stack_limit.rlim_cur > PTHREAD_STACK_MIN)) { - return (stack_limit.rlim_cur & ~(PAGE_SIZE - 1)); - } - return PTHREAD_STACK_SIZE_DEFAULT; -} - /* Init TLS for the initial thread. Called by the linker _before_ libc is mapped * in memory. Beware: all writes to libc globals from this function will * apply to linker-private copies and will not be visible from libc later on. @@ -96,16 +83,15 @@ void __libc_init_tls(KernelArgumentBlock& args) { main_thread.tid = __set_tid_address(&main_thread.tid); main_thread.set_cached_pid(main_thread.tid); - // Work out the extent of the main thread's stack. - uintptr_t stack_top = (__get_sp() & ~(PAGE_SIZE - 1)) + PAGE_SIZE; - size_t stack_size = get_main_thread_stack_size(); - void* stack_bottom = reinterpret_cast(stack_top - stack_size); - // We don't want to free the main thread's stack even when the main thread exits // because things like environment variables with global scope live on it. + // We also can't free the pthread_internal_t itself, since that lives on the main + // thread's stack rather than on the heap. pthread_attr_init(&main_thread.attr); - pthread_attr_setstack(&main_thread.attr, stack_bottom, stack_size); main_thread.attr.flags = PTHREAD_ATTR_FLAG_USER_ALLOCATED_STACK | PTHREAD_ATTR_FLAG_MAIN_THREAD; + main_thread.attr.guard_size = 0; // The main thread has no guard page. + main_thread.attr.stack_size = 0; // User code should never see this; we'll compute it when asked. + // TODO: the main thread's sched_policy and sched_priority need to be queried. __init_thread(&main_thread, false); __init_tls(&main_thread); diff --git a/libc/bionic/pthread_attr.cpp b/libc/bionic/pthread_attr.cpp index e1cd85365..8df3bffac 100644 --- a/libc/bionic/pthread_attr.cpp +++ b/libc/bionic/pthread_attr.cpp @@ -28,6 +28,13 @@ #include +#include +#include +#include + +#include "private/bionic_string_utils.h" +#include "private/ErrnoRestorer.h" +#include "private/libc_logging.h" #include "pthread_internal.h" int pthread_attr_init(pthread_attr_t* attr) { @@ -90,8 +97,8 @@ int pthread_attr_setstacksize(pthread_attr_t* attr, size_t stack_size) { } int pthread_attr_getstacksize(const pthread_attr_t* attr, size_t* stack_size) { - *stack_size = attr->stack_size; - return 0; + void* unused; + return pthread_attr_getstack(attr, &unused, stack_size); } int pthread_attr_setstack(pthread_attr_t* attr, void* stack_base, size_t stack_size) { @@ -106,7 +113,42 @@ int pthread_attr_setstack(pthread_attr_t* attr, void* stack_base, size_t stack_s return 0; } +static int __pthread_attr_getstack_main_thread(void** stack_base, size_t* stack_size) { + ErrnoRestorer errno_restorer; + + // It doesn't matter which thread we are; we're just looking for "[stack]". + FILE* fp = fopen("/proc/self/maps", "re"); + if (fp == NULL) { + return errno; + } + char line[BUFSIZ]; + while (fgets(line, sizeof(line), fp) != NULL) { + if (ends_with(line, " [stack]\n")) { + uintptr_t lo, hi; + if (sscanf(line, "%" SCNxPTR "-%" SCNxPTR, &lo, &hi) == 2) { + *stack_base = reinterpret_cast(lo); + *stack_size = hi - lo; + + // Does our current RLIMIT_STACK mean we won't actually get everything /proc/maps promises? + rlimit stack_limit; + if (getrlimit(RLIMIT_STACK, &stack_limit) != -1) { + if (*stack_size > stack_limit.rlim_cur) { + *stack_size = stack_limit.rlim_cur; + } + } + + fclose(fp); + return 0; + } + } + } + __libc_fatal("No [stack] line found in /proc/self/maps!"); +} + int pthread_attr_getstack(const pthread_attr_t* attr, void** stack_base, size_t* stack_size) { + if ((attr->flags & PTHREAD_ATTR_FLAG_MAIN_THREAD) != 0) { + return __pthread_attr_getstack_main_thread(stack_base, stack_size); + } *stack_base = attr->stack_base; *stack_size = attr->stack_size; return 0; @@ -122,9 +164,8 @@ int pthread_attr_getguardsize(const pthread_attr_t* attr, size_t* guard_size) { return 0; } -int pthread_getattr_np(pthread_t thid, pthread_attr_t* attr) { - pthread_internal_t* thread = (pthread_internal_t*) thid; - *attr = thread->attr; +int pthread_getattr_np(pthread_t t, pthread_attr_t* attr) { + *attr = reinterpret_cast(t)->attr; return 0; } diff --git a/libc/private/bionic_string_utils.h b/libc/private/bionic_string_utils.h new file mode 100644 index 000000000..ab0eccf02 --- /dev/null +++ b/libc/private/bionic_string_utils.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _BIONIC_STRING_UTILS_H_ +#define _BIONIC_STRING_UTILS_H_ + +#include + +static inline bool ends_with(const char* s1, const char* s2) { + size_t s1_length = strlen(s1); + size_t s2_length = strlen(s2); + if (s2_length > s1_length) { + return false; + } + return memcmp(s1 + (s1_length - s2_length), s2, s2_length) == 0; +} + +#endif // _BIONIC_STRING_UTILS_H_ diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp index c2c9286f6..457fcd5c0 100644 --- a/tests/dlfcn_test.cpp +++ b/tests/dlfcn_test.cpp @@ -188,10 +188,8 @@ TEST(dlfcn, dladdr) { // Look in /proc/pid/maps to find out what address we were loaded at. // TODO: factor /proc/pid/maps parsing out into a class and reuse all over bionic. void* base_address = NULL; - char path[PATH_MAX]; - snprintf(path, sizeof(path), "/proc/%d/maps", getpid()); char line[BUFSIZ]; - FILE* fp = fopen(path, "r"); + FILE* fp = fopen("/proc/self/maps", "r"); ASSERT_TRUE(fp != NULL); while (fgets(line, sizeof(line), fp) != NULL) { uintptr_t start = strtoul(line, 0, 16); diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp index 5328e48cf..5f74e388d 100644 --- a/tests/pthread_test.cpp +++ b/tests/pthread_test.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -816,3 +817,88 @@ TEST(pthread, pthread_mutex_timedlock) { ASSERT_EQ(0, pthread_mutex_unlock(&m)); ASSERT_EQ(0, pthread_mutex_destroy(&m)); } + +TEST(pthread, pthread_attr_getstack__main_thread) { + // This test is only meaningful for the main thread, so make sure we're running on it! + ASSERT_EQ(getpid(), syscall(__NR_gettid)); + + // Get the main thread's attributes. + pthread_attr_t attributes; + ASSERT_EQ(0, pthread_getattr_np(pthread_self(), &attributes)); + + // Check that we correctly report that the main thread has no guard page. + size_t guard_size; + ASSERT_EQ(0, pthread_attr_getguardsize(&attributes, &guard_size)); + ASSERT_EQ(0U, guard_size); // The main thread has no guard page. + + // Get the stack base and the stack size (both ways). + void* stack_base; + size_t stack_size; + ASSERT_EQ(0, pthread_attr_getstack(&attributes, &stack_base, &stack_size)); + size_t stack_size2; + ASSERT_EQ(0, pthread_attr_getstacksize(&attributes, &stack_size2)); + + // The two methods of asking for the stack size should agree. + EXPECT_EQ(stack_size, stack_size2); + + // What does /proc/self/maps' [stack] line say? + void* maps_stack_base = NULL; + size_t maps_stack_size = 0; + FILE* fp = fopen("/proc/self/maps", "r"); + ASSERT_TRUE(fp != NULL); + char line[BUFSIZ]; + while (fgets(line, sizeof(line), fp) != NULL) { + uintptr_t lo, hi; + char name[10]; + sscanf(line, "%" PRIxPTR "-%" PRIxPTR " %*4s %*x %*x:%*x %*d %10s", &lo, &hi, name); + if (strcmp(name, "[stack]") == 0) { + maps_stack_base = reinterpret_cast(lo); + maps_stack_size = hi - lo; + break; + } + } + fclose(fp); + +#if defined(__BIONIC__) + // bionic thinks that the stack base and size should correspond to the mapped region. + EXPECT_EQ(maps_stack_base, stack_base); + EXPECT_EQ(maps_stack_size, stack_size); +#else + // glibc doesn't give the true extent for some reason. +#endif + + // Both bionic and glibc agree that the high address you can compute from the returned + // values should match what /proc/self/maps says. + void* stack_end = reinterpret_cast(stack_base) + stack_size; + void* maps_stack_end = reinterpret_cast(maps_stack_base) + maps_stack_size; + EXPECT_EQ(maps_stack_end, stack_end); + + // + // What if the rlimit is smaller than the stack's current extent? + // + rlimit rl; + rl.rlim_cur = rl.rlim_max = 1024; // 1KiB. We know the stack must be at least a page already. + rl.rlim_max = RLIM_INFINITY; + ASSERT_EQ(0, setrlimit(RLIMIT_STACK, &rl)); + + ASSERT_EQ(0, pthread_getattr_np(pthread_self(), &attributes)); + ASSERT_EQ(0, pthread_attr_getstack(&attributes, &stack_base, &stack_size)); + ASSERT_EQ(0, pthread_attr_getstacksize(&attributes, &stack_size2)); + + EXPECT_EQ(stack_size, stack_size2); + ASSERT_EQ(1024U, stack_size); + + // + // What if the rlimit isn't a whole number of pages? + // + rl.rlim_cur = rl.rlim_max = 6666; // Not a whole number of pages. + rl.rlim_max = RLIM_INFINITY; + ASSERT_EQ(0, setrlimit(RLIMIT_STACK, &rl)); + + ASSERT_EQ(0, pthread_getattr_np(pthread_self(), &attributes)); + ASSERT_EQ(0, pthread_attr_getstack(&attributes, &stack_base, &stack_size)); + ASSERT_EQ(0, pthread_attr_getstacksize(&attributes, &stack_size2)); + + EXPECT_EQ(stack_size, stack_size2); + ASSERT_EQ(6666U, stack_size); +} From 3f7635f4906c53fa744731efc35235456b7d93bf Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Tue, 26 Aug 2014 15:47:42 -0700 Subject: [PATCH 114/148] Use the default unwind code. This speeds up the debug malloc code by using the original unwinding code. The only catch is that it has to link in the libc++ arm unwind code or there will be crashes when attempting to unwind through libc++ compiled code. Bug: 16874447 Change-Id: Ifdbbcbd4137d668b25cf3c2bd59535e06ebfa5a7 --- libc/Android.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libc/Android.mk b/libc/Android.mk index 32c9fa6cb..50981718d 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -1070,7 +1070,6 @@ LOCAL_CPPFLAGS := $(libc_common_cppflags) # Make sure that unwind.h comes from libunwind. LOCAL_C_INCLUDES := \ - external/libunwind/include \ $(libc_common_c_includes) \ LOCAL_SRC_FILES := \ @@ -1086,7 +1085,9 @@ LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SHARED_LIBRARIES := libc libdl LOCAL_SYSTEM_SHARED_LIBRARIES := -LOCAL_WHOLE_STATIC_LIBRARIES := libunwindbacktrace +# Only need this for arm since libc++ uses its own unwind code that +# doesn't mix with the other default unwind code. +LOCAL_STATIC_LIBRARIES_arm := libc++ LOCAL_ALLOW_UNDEFINED_SYMBOLS := true # Don't install on release build From 8a46cf0fcf82b8c76e05be7e066ec854f974603a Mon Sep 17 00:00:00 2001 From: Wally Yau Date: Tue, 26 Aug 2014 09:47:23 -0700 Subject: [PATCH 115/148] call uselocale() before freelocale() to make sure that g_local_key has a valid locale. For tests that call uselocale(), the locale is stored in the g_userlocale_key thread-specific key. If freelocale() is called later, then g_uselocal_key points to a deleted pointer. CTS eventually calls vfprintf to print the result, which calls MB_CUR_MAX and MB_CUR_MAX accesses the deleted locale stored in g_uselocale_key, causing unpredictable errors. Fixed the tests by calling uselocale() with the old locale before calling freelocale. Bug: 17299565 Change-Id: I87efa2a9b16999a11d587f68d3aeedcbe6ac8a2c --- tests/locale_test.cpp | 3 ++- tests/stdio_test.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/locale_test.cpp b/tests/locale_test.cpp index 325f6ceda..7ec607a28 100644 --- a/tests/locale_test.cpp +++ b/tests/locale_test.cpp @@ -114,11 +114,12 @@ TEST(locale, mb_cur_max) { locale_t cloc = newlocale(LC_ALL, "C", 0); locale_t cloc_utf8 = newlocale(LC_ALL, "C.UTF-8", 0); - uselocale(cloc); + locale_t old_locale = uselocale(cloc); ASSERT_EQ(1U, MB_CUR_MAX); uselocale(cloc_utf8); ASSERT_EQ(4U, MB_CUR_MAX); + uselocale(old_locale); freelocale(cloc); freelocale(cloc_utf8); } diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp index bb86509c2..8c8c235ad 100644 --- a/tests/stdio_test.cpp +++ b/tests/stdio_test.cpp @@ -428,7 +428,7 @@ TEST(stdio, snprintf_negative_zero_5084292) { TEST(stdio, snprintf_utf8_15439554) { locale_t cloc = newlocale(LC_ALL, "C.UTF-8", 0); - uselocale(cloc); + locale_t old_locale = uselocale(cloc); // http://b/15439554 char buf[BUFSIZ]; @@ -446,6 +446,7 @@ TEST(stdio, snprintf_utf8_15439554) { snprintf(buf, sizeof(buf), "%d\xf0\xa4\xad\xa2%d", 1, 2); EXPECT_STREQ("1𤭢2", buf); + uselocale(old_locale); freelocale(cloc); } From 172955a4e30b88ce8239a7ef426b4e8903e9923c Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Tue, 26 Aug 2014 20:48:11 -0700 Subject: [PATCH 116/148] Replace snprintf calls in linker. When enabling debug malloc, the snprintf calls in the linker fails to update the buffer. The problem is that snprintf makes a call to pthread_getspecific that returns a valid pointer, but the data it points to is zero. This should never happen and causes the snprintf to stop and do nothing. Temporarily replace snprintf with a different implementation to work around this issue. Bug: 16874447 Bug: 17302493 Change-Id: I7a500f28adf153150cf2812fae745ff41f1c48d3 --- linker/debugger.cpp | 4 ++-- linker/linker.cpp | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/linker/debugger.cpp b/linker/debugger.cpp index 079682cab..c31615171 100644 --- a/linker/debugger.cpp +++ b/linker/debugger.cpp @@ -170,9 +170,9 @@ static void log_signal_summary(int signum, const siginfo_t* info) { if (info != NULL) { // For a rethrown signal, this si_code will be right and the one debuggerd shows will // always be SI_TKILL. - snprintf(code_desc, sizeof(code_desc), ", code %d", info->si_code); + __libc_format_buffer(code_desc, sizeof(code_desc), ", code %d", info->si_code); if (has_address) { - snprintf(addr_desc, sizeof(addr_desc), ", fault addr %p", info->si_addr); + __libc_format_buffer(addr_desc, sizeof(addr_desc), ", fault addr %p", info->si_addr); } } __libc_format_log(ANDROID_LOG_FATAL, "libc", diff --git a/linker/linker.cpp b/linker/linker.cpp index 52eb56ab8..2d8e07eb4 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -866,7 +866,21 @@ static void soinfo_unload(soinfo* si) { } void do_android_get_LD_LIBRARY_PATH(char* buffer, size_t buffer_size) { - snprintf(buffer, buffer_size, "%s:%s", kDefaultLdPaths[0], kDefaultLdPaths[1]); + // Use basic string manipulation calls to avoid snprintf. + // snprintf indirectly calls pthread_getspecific to get the size of a buffer. + // When debug malloc is enabled, this call returns 0. This in turn causes + // snprintf to do nothing, which causes libraries to fail to load. + // See b/17302493 for further details. + // Once the above bug is fixed, this code can be modified to use + // snprintf again. + size_t required_len = strlen(kDefaultLdPaths[0]) + strlen(kDefaultLdPaths[1]) + 2; + if (buffer_size < required_len) { + __libc_fatal("android_get_LD_LIBRARY_PATH failed, buffer too small: buffer len %zu, required len %zu", + buffer_size, required_len); + } + char* end = stpcpy(buffer, kDefaultLdPaths[0]); + *end = ':'; + strcpy(end + 1, kDefaultLdPaths[1]); } void do_android_update_LD_LIBRARY_PATH(const char* ld_library_path) { From 67f1f3b171ecd5f68f51465bbe4b8c8440bb6b2e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 27 Aug 2014 15:32:01 -0700 Subject: [PATCH 117/148] Have pthread_attr_getstack for the main thread report RLIMIT_STACK... ...rather than just what's already mapped in. This seems somewhat contrary to POSIX's "All pages within the stack described by stackaddr and stacksize shall be both readable and writable by the thread", but it's what glibc does. Bug: 17111575 (cherry picked from commit 9e4ffa7032eaab308876b8e3da86b05c3c613878) Change-Id: I73f219a569917b2e4546c09436d7ef5231facc07 --- libc/bionic/pthread_attr.cpp | 23 +++++++++++----------- tests/pthread_test.cpp | 37 +++++++++++++++--------------------- 2 files changed, 27 insertions(+), 33 deletions(-) diff --git a/libc/bionic/pthread_attr.cpp b/libc/bionic/pthread_attr.cpp index 8df3bffac..c93970a19 100644 --- a/libc/bionic/pthread_attr.cpp +++ b/libc/bionic/pthread_attr.cpp @@ -116,6 +116,16 @@ int pthread_attr_setstack(pthread_attr_t* attr, void* stack_base, size_t stack_s static int __pthread_attr_getstack_main_thread(void** stack_base, size_t* stack_size) { ErrnoRestorer errno_restorer; + rlimit stack_limit; + if (getrlimit(RLIMIT_STACK, &stack_limit) == -1) { + return errno; + } + + // If the current RLIMIT_STACK is RLIM_INFINITY, only admit to an 8MiB stack for sanity's sake. + if (stack_limit.rlim_cur == RLIM_INFINITY) { + stack_limit.rlim_cur = 8 * 1024 * 1024; + } + // It doesn't matter which thread we are; we're just looking for "[stack]". FILE* fp = fopen("/proc/self/maps", "re"); if (fp == NULL) { @@ -126,17 +136,8 @@ static int __pthread_attr_getstack_main_thread(void** stack_base, size_t* stack_ if (ends_with(line, " [stack]\n")) { uintptr_t lo, hi; if (sscanf(line, "%" SCNxPTR "-%" SCNxPTR, &lo, &hi) == 2) { - *stack_base = reinterpret_cast(lo); - *stack_size = hi - lo; - - // Does our current RLIMIT_STACK mean we won't actually get everything /proc/maps promises? - rlimit stack_limit; - if (getrlimit(RLIMIT_STACK, &stack_limit) != -1) { - if (*stack_size > stack_limit.rlim_cur) { - *stack_size = stack_limit.rlim_cur; - } - } - + *stack_size = stack_limit.rlim_cur; + *stack_base = reinterpret_cast(hi - *stack_size); fclose(fp); return 0; } diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp index 5f74e388d..65577385d 100644 --- a/tests/pthread_test.cpp +++ b/tests/pthread_test.cpp @@ -842,8 +842,7 @@ TEST(pthread, pthread_attr_getstack__main_thread) { EXPECT_EQ(stack_size, stack_size2); // What does /proc/self/maps' [stack] line say? - void* maps_stack_base = NULL; - size_t maps_stack_size = 0; + void* maps_stack_hi = NULL; FILE* fp = fopen("/proc/self/maps", "r"); ASSERT_TRUE(fp != NULL); char line[BUFSIZ]; @@ -852,31 +851,25 @@ TEST(pthread, pthread_attr_getstack__main_thread) { char name[10]; sscanf(line, "%" PRIxPTR "-%" PRIxPTR " %*4s %*x %*x:%*x %*d %10s", &lo, &hi, name); if (strcmp(name, "[stack]") == 0) { - maps_stack_base = reinterpret_cast(lo); - maps_stack_size = hi - lo; + maps_stack_hi = reinterpret_cast(hi); break; } } fclose(fp); -#if defined(__BIONIC__) - // bionic thinks that the stack base and size should correspond to the mapped region. - EXPECT_EQ(maps_stack_base, stack_base); - EXPECT_EQ(maps_stack_size, stack_size); -#else - // glibc doesn't give the true extent for some reason. -#endif - - // Both bionic and glibc agree that the high address you can compute from the returned - // values should match what /proc/self/maps says. - void* stack_end = reinterpret_cast(stack_base) + stack_size; - void* maps_stack_end = reinterpret_cast(maps_stack_base) + maps_stack_size; - EXPECT_EQ(maps_stack_end, stack_end); - - // - // What if the rlimit is smaller than the stack's current extent? - // + // The stack size should correspond to RLIMIT_STACK. rlimit rl; + ASSERT_EQ(0, getrlimit(RLIMIT_STACK, &rl)); + EXPECT_EQ(rl.rlim_cur, stack_size); + + // The high address of the /proc/self/maps [stack] region should equal stack_base + stack_size. + // Remember that the stack grows down (and is mapped in on demand), so the low address of the + // region isn't very interesting. + EXPECT_EQ(maps_stack_hi, reinterpret_cast(stack_base) + stack_size); + + // + // What if RLIMIT_STACK is smaller than the stack's current extent? + // rl.rlim_cur = rl.rlim_max = 1024; // 1KiB. We know the stack must be at least a page already. rl.rlim_max = RLIM_INFINITY; ASSERT_EQ(0, setrlimit(RLIMIT_STACK, &rl)); @@ -889,7 +882,7 @@ TEST(pthread, pthread_attr_getstack__main_thread) { ASSERT_EQ(1024U, stack_size); // - // What if the rlimit isn't a whole number of pages? + // What if RLIMIT_STACK isn't a whole number of pages? // rl.rlim_cur = rl.rlim_max = 6666; // Not a whole number of pages. rl.rlim_max = RLIM_INFINITY; From 05e190c093ad5b04691ed87100a711ef91f380b0 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Fri, 29 Aug 2014 10:15:25 -0700 Subject: [PATCH 118/148] Look into ld_preloads before current library Change lookup order during relocation so that ld_preloads always precede caller (unless caller is main executable). Asan needs this change in order to intercept libc->libc calls. Bug: 15432753 Change-Id: If69aa16efe59aa35bb30e96feb83d08f1efbec86 --- linker/linker.cpp | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/linker/linker.cpp b/linker/linker.cpp index 2d8e07eb4..cf657057e 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -495,6 +495,15 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s *lsi = si; goto done; } + + /* Next, look for it in the preloads list */ + for (int i = 0; g_ld_preloads[i] != NULL; i++) { + s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name); + if (s != NULL) { + *lsi = g_ld_preloads[i]; + goto done; + } + } } else { /* Order of symbol lookup is controlled by DT_SYMBOLIC flag */ @@ -512,6 +521,15 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s *lsi = somain; goto done; } + + /* Next, look for it in the preloads list */ + for (int i = 0; g_ld_preloads[i] != NULL; i++) { + s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name); + if (s != NULL) { + *lsi = g_ld_preloads[i]; + goto done; + } + } } /* Look for symbols in the local scope (the object who is @@ -543,16 +561,16 @@ static ElfW(Sym)* soinfo_do_lookup(soinfo* si, const char* name, soinfo** lsi, s *lsi = somain; goto done; } - } - } - } - /* Next, look for it in the preloads list */ - for (int i = 0; g_ld_preloads[i] != NULL; i++) { - s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name); - if (s != NULL) { - *lsi = g_ld_preloads[i]; - goto done; + /* Next, look for it in the preloads list */ + for (int i = 0; g_ld_preloads[i] != NULL; i++) { + s = soinfo_elf_lookup(g_ld_preloads[i], elf_hash, name); + if (s != NULL) { + *lsi = g_ld_preloads[i]; + goto done; + } + } + } } } From b2eb09a9ed9e08d9e49f4245d1959b2ca3fbaaf8 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 29 Aug 2014 15:54:11 -0700 Subject: [PATCH 119/148] Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc. Bug: 16874785 (cherry picked from commit e0c56efddf55ad40cb35b2c22e1dd9b4b50df159) Change-Id: I9c922ba019f648766fc399d1c4e35e789e25acd4 --- libc/include/stdatomic.h | 2 +- libc/include/sys/cdefs.h | 38 +++++++++++++++++++------------------- libm/include/math.h | 4 ++-- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libc/include/stdatomic.h b/libc/include/stdatomic.h index 2c0422138..6854d8b85 100644 --- a/libc/include/stdatomic.h +++ b/libc/include/stdatomic.h @@ -125,7 +125,7 @@ using std::atomic_uintmax_t; #if __has_extension(c_atomic) || __has_extension(cxx_atomic) #define __CLANG_ATOMICS -#elif __GNUC_PREREQ__(4, 7) +#elif __GNUC_PREREQ(4, 7) #define __GNUC_ATOMICS #elif defined(__GNUC__) #define __SYNC_ATOMICS diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h index 028661628..9a8dfdd20 100644 --- a/libc/include/sys/cdefs.h +++ b/libc/include/sys/cdefs.h @@ -60,18 +60,18 @@ * or later, for e.g. features that appeared in a particular version * of GNU C. Usage: * - * #if __GNUC_PREREQ__(major, minor) + * #if __GNUC_PREREQ(major, minor) * ...cool feature... * #else * ...delete feature... * #endif */ #ifdef __GNUC__ -#define __GNUC_PREREQ__(x, y) \ +#define __GNUC_PREREQ(x, y) \ ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \ (__GNUC__ > (x))) #else -#define __GNUC_PREREQ__(x, y) 0 +#define __GNUC_PREREQ(x, y) 0 #endif #include @@ -163,7 +163,7 @@ * GCC2 provides __extension__ to suppress warnings for various GNU C * language extensions under "-ansi -pedantic". */ -#if !__GNUC_PREREQ__(2, 0) +#if !__GNUC_PREREQ(2, 0) #define __extension__ /* delete __extension__ if non-gcc or gcc1 */ #endif @@ -175,7 +175,7 @@ * these work for GNU C++ (modulo a slight glitch in the C++ grammar * in the distribution version of 2.5.5). */ -#if !__GNUC_PREREQ__(2, 5) +#if !__GNUC_PREREQ(2, 5) #define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ #if defined(__GNUC__) && !defined(__STRICT_ANSI__) #define __dead __volatile @@ -189,7 +189,7 @@ #define __pure #endif -#if __GNUC_PREREQ__(2, 7) +#if __GNUC_PREREQ(2, 7) #define __unused __attribute__((__unused__)) #else #define __unused /* delete */ @@ -197,13 +197,13 @@ #define __pure2 __attribute__((__const__)) /* Android-added: used by FreeBSD libm */ -#if __GNUC_PREREQ__(3, 1) +#if __GNUC_PREREQ(3, 1) #define __used __attribute__((__used__)) #else #define __used /* delete */ #endif -#if __GNUC_PREREQ__(2, 7) +#if __GNUC_PREREQ(2, 7) #define __packed __attribute__((__packed__)) #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((__section__(x))) @@ -217,11 +217,11 @@ #define __section(x) error: no __section for this compiler #endif -#if !__GNUC_PREREQ__(2, 8) +#if !__GNUC_PREREQ(2, 8) #define __extension__ #endif -#if __GNUC_PREREQ__(2, 8) +#if __GNUC_PREREQ(2, 8) #define __statement(x) __extension__(x) #elif defined(lint) #define __statement(x) (0) @@ -241,7 +241,7 @@ #if defined(__STDC__VERSION__) && __STDC_VERSION__ >= 199901L #define __restrict restrict #else -#if !__GNUC_PREREQ__(2, 92) +#if !__GNUC_PREREQ(2, 92) #define __restrict /* delete __restrict when not supported */ #endif #endif @@ -251,9 +251,9 @@ * in GCC 2.95. */ #if !defined(__STDC_VERSION__) || !(__STDC_VERSION__ >= 199901L) -#if __GNUC_PREREQ__(2, 6) +#if __GNUC_PREREQ(2, 6) #define __func__ __PRETTY_FUNCTION__ -#elif __GNUC_PREREQ__(2, 4) +#elif __GNUC_PREREQ(2, 4) #define __func__ __FUNCTION__ #else #define __func__ "" @@ -286,7 +286,7 @@ * register values. This is gcc specific, the version is more or less * arbitrary, might work with older compilers. */ -#if __GNUC_PREREQ__(2, 95) +#if __GNUC_PREREQ(2, 95) #define __insn_barrier() __asm __volatile("":::"memory") #else #define __insn_barrier() /* */ @@ -320,7 +320,7 @@ * basic block reordering that this affects can often generate * larger code. */ -#if __GNUC_PREREQ__(2, 96) +#if __GNUC_PREREQ(2, 96) #define __predict_true(exp) __builtin_expect((exp) != 0, 1) #define __predict_false(exp) __builtin_expect((exp) != 0, 0) #else @@ -328,7 +328,7 @@ #define __predict_false(exp) (exp) #endif -#if __GNUC_PREREQ__(2, 96) +#if __GNUC_PREREQ(2, 96) #define __noreturn __attribute__((__noreturn__)) #define __mallocfunc __attribute__((malloc)) #define __purefunc __attribute__((pure)) @@ -338,19 +338,19 @@ #define __purefunc #endif -#if __GNUC_PREREQ__(3, 1) +#if __GNUC_PREREQ(3, 1) #define __always_inline __attribute__((__always_inline__)) #else #define __always_inline #endif -#if __GNUC_PREREQ__(3, 4) +#if __GNUC_PREREQ(3, 4) #define __wur __attribute__((__warn_unused_result__)) #else #define __wur #endif -#if __GNUC_PREREQ__(4, 3) +#if __GNUC_PREREQ(4, 3) #define __errordecl(name, msg) extern void name(void) __attribute__((__error__(msg))) #define __warnattr(msg) __attribute__((__warning__(msg))) #else diff --git a/libm/include/math.h b/libm/include/math.h index 4faec333f..3eca1407d 100644 --- a/libm/include/math.h +++ b/libm/include/math.h @@ -36,11 +36,11 @@ extern const union __nan_un { float __uf; } __nan; -#if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) +#if __GNUC_PREREQ(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) #define __MATH_BUILTIN_CONSTANTS #endif -#if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER) +#if __GNUC_PREREQ(3, 0) && !defined(__INTEL_COMPILER) #define __MATH_BUILTIN_RELOPS #endif From c8cf3513ecb265ba3aadc846aa2113290a504c44 Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Tue, 19 Aug 2014 16:14:01 -0700 Subject: [PATCH 120/148] Fix, generalize stdatomic.h; improve test. We seem to use this stdatomic.h sometimes, and slightly different prebuilts at other times, making them all difficult to test, and making it unclear which one we're testing. This generalizes the bionic header so that it can be used directly as the prebuilt header as well. So long as they don't diverge again, that should somewhat improve test coverage. Use the correct builtin for atomic_is_lock_free. Fix atomic_flag_init. Turn on atomic tests even with __GLIBC__, since they now appear to pass. Include uchar.h in stdatomic.h where needed. Add a basic memory ordering test. Fix bit-rotted comments in bionic tests makefile. Prerequisite for fixing b/16880454 and Bug:16513433 Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68 (cherry picked from commit 00aaea364501b3b0abe58dae461136159df1e356) --- libc/include/stdatomic.h | 14 +++++-- tests/Android.mk | 6 ++- tests/stdatomic_test.cpp | 85 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 94 insertions(+), 11 deletions(-) diff --git a/libc/include/stdatomic.h b/libc/include/stdatomic.h index 6854d8b85..e5420ff46 100644 --- a/libc/include/stdatomic.h +++ b/libc/include/stdatomic.h @@ -123,6 +123,12 @@ using std::atomic_uintmax_t; * bits as a T. */ +#include /* For ptrdiff_t. */ +#include /* TODO: Should pollute namespace less. */ +#if __STDC_VERSION__ >= 201112L +# include /* For char16_t and char32_t. */ +#endif + #if __has_extension(c_atomic) || __has_extension(cxx_atomic) #define __CLANG_ATOMICS #elif __GNUC_PREREQ(4, 7) @@ -228,7 +234,7 @@ typedef enum { */ static __inline void -atomic_thread_fence(memory_order __order __unused) +atomic_thread_fence(memory_order __order __attribute__((unused))) { #ifdef __CLANG_ATOMICS @@ -241,7 +247,7 @@ atomic_thread_fence(memory_order __order __unused) } static __inline void -atomic_signal_fence(memory_order __order __unused) +atomic_signal_fence(memory_order __order __attribute__((unused))) { #ifdef __CLANG_ATOMICS @@ -263,7 +269,7 @@ atomic_signal_fence(memory_order __order __unused) ((void)(obj), (_Bool)1) #elif defined(__CLANG_ATOMICS) #define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof(*(obj)), obj) + __c11_atomic_is_lock_free(sizeof(*(obj))) #elif defined(__GNUC_ATOMICS) #define atomic_is_lock_free(obj) \ __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val) @@ -477,7 +483,7 @@ typedef struct { atomic_bool __flag; } atomic_flag; -#define ATOMIC_FLAG_INIT { ATOMIC_VAR_INIT(0) } +#define ATOMIC_FLAG_INIT { ATOMIC_VAR_INIT(false) } static __inline bool atomic_flag_test_and_set_explicit(volatile atomic_flag *__object, diff --git a/tests/Android.mk b/tests/Android.mk index b370b92c1..8184bf74b 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -237,7 +237,8 @@ include $(LOCAL_PATH)/Android.build.mk # ----------------------------------------------------------------------------- # Tests for the device using bionic's .so. Run with: -# adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests +# adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32 +# adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64 # ----------------------------------------------------------------------------- bionic-unit-tests_whole_static_libraries := \ libBionicTests \ @@ -269,7 +270,8 @@ include $(LOCAL_PATH)/Android.build.mk # ----------------------------------------------------------------------------- # Tests for the device linked against bionic's static library. Run with: -# adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static +# adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32 +# adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64 # ----------------------------------------------------------------------------- bionic-unit-tests-static_whole_static_libraries := \ libBionicTests \ diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp index 5e88c8801..222bd9c80 100644 --- a/tests/stdatomic_test.cpp +++ b/tests/stdatomic_test.cpp @@ -14,11 +14,10 @@ * limitations under the License. */ -#include - -#if !defined(__GLIBC__) /* TODO: fix our prebuilt toolchains! */ - #include +#include +#include +#include TEST(stdatomic, LOCK_FREE) { ASSERT_TRUE(ATOMIC_BOOL_LOCK_FREE); @@ -167,4 +166,80 @@ TEST(stdatomic, atomic_fetch_and) { ASSERT_EQ(0x002, atomic_load(&i)); } -#endif +// And a rudimentary test of acquire-release memory ordering: + +constexpr static uint_least32_t BIG = 10000000ul; // Assumed even below. + +struct three_atomics { + atomic_uint_least32_t x; + char a[123]; // Everything in different cache lines, + // increase chance of compiler getting alignment wrong. + atomic_uint_least32_t y; + char b[4013]; + atomic_uint_least32_t z; +}; + +// Very simple acquire/release memory ordering sanity check. +static void* writer(void* arg) { + three_atomics* a = reinterpret_cast(arg); + for (uint_least32_t i = 0; i <= BIG; i+=2) { + atomic_store_explicit(&a->x, i, memory_order_relaxed); + atomic_store_explicit(&a->z, i, memory_order_relaxed); + atomic_store_explicit(&a->y, i, memory_order_release); + atomic_store_explicit(&a->x, i+1, memory_order_relaxed); + atomic_store_explicit(&a->z, i+1, memory_order_relaxed); + atomic_store_explicit(&a->y, i+1, memory_order_release); + } + return 0; +} + +static void* reader(void* arg) { + three_atomics* a = reinterpret_cast(arg); + uint_least32_t xval = 0, yval = 0, zval = 0; + size_t repeat = 0; + size_t repeat_limit = 1000; + while (yval != BIG + 1) { + yval = atomic_load_explicit(&a->y, memory_order_acquire); + zval = atomic_load_explicit(&a->z, memory_order_relaxed); + xval = atomic_load_explicit(&a->x, memory_order_relaxed); + // If we see a given value of y, the immediately preceding + // stores to z and x, or later ones, should also be visible. + if (zval < yval) { + // Cant just ASSERT, since we are in a non-void function. + ADD_FAILURE() << "acquire-release ordering violation: " + << zval << " < " << yval << ", " << xval << "\n"; + return 0; // Only report once. + } + if (xval < yval) { + // Cant just ASSERT, since we are in a non-void function. + ADD_FAILURE() << "acquire-release ordering violation: " + << xval << " < " << yval << ", " << zval << "\n"; + return 0; // Only report once. + } + if (repeat < repeat_limit) ++repeat; + } + // The following assertion is not technically guaranteed to hold. + // But if it fails to hold, this test was useless, and we have a + // serious scheduling issue that we should probably know about. + EXPECT_EQ(repeat, repeat_limit); + return 0; +} + +TEST(stdatomic, ordering) { + // Run a memory ordering sanity test. + void* result; + three_atomics a; + atomic_init(&a.x, 0ul); + atomic_init(&a.y, 0ul); + atomic_init(&a.z, 0ul); + pthread_t t1,t2; + ASSERT_EQ(0, pthread_create(&t1, 0, reader, &a)); + ASSERT_EQ(0, pthread_create(&t2, 0, writer, &a)); + ASSERT_EQ(0, pthread_join(t1, &result)); + EXPECT_EQ(0, result); + ASSERT_EQ(0, pthread_join(t2, &result)); + EXPECT_EQ(0, result); + EXPECT_EQ(atomic_load_explicit(&a.x, memory_order_consume), BIG + 1); + EXPECT_EQ(atomic_load_explicit(&a.y, memory_order_seq_cst), BIG + 1); + EXPECT_EQ(atomic_load(&a.z), BIG + 1); +} From 2b10e2f12262c5ac5d8dac4f0bfc16b1848cbfec Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Tue, 26 Aug 2014 15:58:15 -0700 Subject: [PATCH 121/148] Undefine _Atomic before redefining Stdatomic.h was potentially redefining _Atomic, in spite of a prior definition by . This could cause g++ builds that included with an available header to break. A functional stdatomic.h is a prerequisite for fixing the following bugs. This is the middle of 3 AOSP updates to bionics stdatomic.h that are needded to get there. Bug:16880454 Bug:16513433 Change-Id: I562c7115118c0587d594d4d5b62d25101e47bfd8 (cherry picked from commit 3e4a0099a179d7acee63d78c8fc4c3cc7b0bae42) --- libc/include/stdatomic.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libc/include/stdatomic.h b/libc/include/stdatomic.h index e5420ff46..47b333cf1 100644 --- a/libc/include/stdatomic.h +++ b/libc/include/stdatomic.h @@ -39,6 +39,13 @@ #include +#undef _Atomic + /* Also defined by for gcc. But not used in macros. */ + /* Also a clang intrinsic. */ + /* Should not be used by client code before this file is */ + /* included. The definitions in themselves see */ + /* the old definition, as they should. */ + /* Client code sees the following definition. */ #define _Atomic(t) std::atomic using std::atomic_is_lock_free; From b519ea4903c336479fc05703c1f83741dfdee108 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 2 Sep 2014 09:44:33 -0700 Subject: [PATCH 122/148] Upgrade bionic to tzdata2014g. From the release notes: Changes affecting future time stamps Turks & Caicos is switching from US eastern time to UTC-4 year-round, modeled as a switch from EST/EDT to AST on 2014-11-02 at 02:00. Changes affecting past time stamps Time in Russia or the USSR before 1926 or so has been corrected by a few seconds in the following zones: Asia/Irkutsk, Asia/Krasnoyarsk, Asia/Omsk, Asia/Samarkand, Asia/Tbilisi, Asia/Vladivostok, Asia/Yakutsk, Europe/Riga, Europe/Samara. For Asia/Yekaterinburg the correction is a few minutes. (Thanks to Vladimir Karpinsky.) The Portuguese decree of 1911-05-26 took effect on 1912-01-01. This affects 1911 time stamps in Africa/Bissau, Africa/Luanda, Atlantic/Azores, and Atlantic/Madeira. Also, Lisbon's pre-1912 GMT offset was -0:36:45 (rounded from -0:36:44.68), not -0:36:32. (Thanks to Stephen Colebourne for pointing to the decree.) Asia/Dhaka ended DST on 2009-12-31 at 24:00, not 23:59. A new file 'backzone' contains data which may appeal to connoisseurs of old time stamps, although it is out of scope for the tz database, is often poorly sourced, and contains some data that is known to be incorrect. The new file is not recommended for ordinary use and its entries are not installed by default. (Thanks to Lester Caine for the high-quality Jersey, Guernsey, and Isle of Man entries.) Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Africa/Bangui, Africa/Brazzaville, Africa/Douala, Africa/Kinshasa, Africa/Libreville, Africa/Luanda, Africa/Malabo, Africa/Niamey, and Africa/Porto-Novo. Bug: 17277574 (cherry picked from commit 9685c30a2375635f7410e60eff2f0559f7e84df6) Change-Id: I6120be3a0ec76af2d07ca6f9ea6f83d81d215803 --- libc/zoneinfo/tzdata | Bin 568999 -> 566837 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/libc/zoneinfo/tzdata b/libc/zoneinfo/tzdata index 9547f584c50ca416c607c0c764ed9c4c6d7a152a..8d574f5611ee934b7ec6e0e111f12d831787090b 100644 GIT binary patch delta 5458 zcmc)Nk6#pZ{s-`#VP|*21rbpfLPbDDC0#~RGEz(oOwd(ULq$ae0VP8Z6FVw6IVIaX zh(`cA$%Jna;3kWcqG5B}D^8t`+e}Rxj6l8Cz)q$eMUj5BI5P)bOg+5} zArko+NhIzL93-|2^{!MmnY|sM2H6lln#0sl#VCsj zHtaG!Y|zAlggfYE!JO@|nq+bALZqtvfKpX|0aHI&Tvm=Kl70!<rkCep8#+3U@Y^r7`Crra*3K$X00)qalq3o?)bab=&Ywj zgdXi|q;PiFsLIm5_w*-SP_XTB3(xZsoVrhe_5>K65(7p$ajNLuhNWe(piAefwK5R5|RmrR7^NO4Fkj7biHBd zQT-(yVZQXiD5Usmm$8c&_M?%wFG4RFkOk`?Ssb(xsbp9eN(q;yiHzP}GFTR^ZHOQf zvyefaI*BskC_^)eNP>QdEKUwWB$@UevPg+Q%U z8*))Wem4d!BxelFezI8bDx&>l!}e~SPN+n?pD!GK{su>xPG?xJCF}kCMR=l>b;~l~ z?JpbtGC-#@F4qc^{r$yvveE8uK`{@je!(GsSvrK-#IOhjdD0)fC&#(r`;<^uzN?y2+Qj$LcP2>-^ zN`g5dqe_B@VqWkdarX*jFylZO%1A{vn#o%upbwG7!xIom{2WnaDmyosd{IAguy}eVT3Dm88s<@)``;s)T%3y>!cHm) z_i!t@_9(nZ%i`CGh#?(LjkjNhZ!fz*uhN*|3o*kD-uolh=~j9k@-{XW%$lT(lW>!c-AStw9~h`WRhg zQx8JIIIo>ZB1L=PAg`99o@_saZt@!M*hgh?XBv{p`XMMLCBbMQHA~Us$_yLNR4-D< zu`=u;9}GbwIsOfL)sz#~35+v#q>__&QA*nPqKSMvro<|XHwzF!?)(WEF3Lz(Aezbj zub~g;c6|$x;o)v>y-y%Z^A5_HEzQRj;+_eU%xGso6!8c_Hu3rgD#*<$w74)&JDIr|zK_XbMknG(=2hg8b<0pi z)|aD$#LtIi61VL<#FI^LBcJ5vp@!@$Kqo01kATUtSbi8bV)Q{FIVhvn#ch=y1V(CC zWG8R;M-e&vF6zjU;pigO7KA)bjv>i~gVdZsJ$ZjQy2%HN5ITiZUy5W>_ZW&vgAom+ z@fv!_g)InsLKZ(8jui66QtTpE{D{l#;K$Llep9EP0Zv zS%?Vo?Q~?2?{1)saLSs=tqAC+%Hr*_h$Q!3LKf-Xf^zcXFkG1$?xz2F4NTLtS&AY; zJ+fU?5OE7y2(QQ-&5+cLXcswzQ&*{S1g*q;0N&GO(eri05TCKgoh};&pVjFk3#z7% z7awUuI|~9Y!1pOx9G{3dGRY5lP>r*)P>*lrhL%|^mO^b*D>>ntsNrV_@X zQo_LAM9MdoJi|TqE+Pn@W*LOhp^PxlH4}yt{cQEAib%o`l|>j;$_cAnA&e@fcrD&V zku4Tv$IJZ+Ue)Q`*Q$|pCJHu&x=GbenIw7T$~!_-y8kdGE1SLG@Wk%mQRSGf+~xw828MTk@39ZAkEK$Xg6bdZnd z!D1s95lwe#gE7RfG(T{NhiKo4mRLf8U6N4`P| z*}yxJ+^Rq$xjzBDf@s!VonQF@*6am+-N0h@9GmcEUb=leH^~BbToukF@5Yiri>H zhbv`Ss@04qx5JR{O4X2iU!!wrxSQc8e*`RJ=y(}6;{FQ?3Fn}e_>919GDAS%a;r4eHYOxGIIM ztgE;pFCvvB7*MLR8%<=6T$0NF7ZE|`@&%XJhM|ni^F(v1Y@YWH``)jeU<0Z*jMy1% z&?0PPnigTR2;Uvc(_{~kue(BmS`*f+5r}p(xfw6C!L*veZaJdJ{8(g@#V?^k+8bbWx@-fsp6O zPe>x4oq>Z~&P6@BQh{#r`2mEkW1t<2WR>eEcF{ntu0;=N@j}@1e1ghIA#AscT<2So ziW9x0H5S%v?V?l3m-#3qZQf|oGE3HLn=^v&Ud$kTkd_fXYnzGsklmo&!;yqRCX4W+ zwVd#)?+W2-u<3W&S6CF`$51xmt9Aw9?6eSmFPL+*FREz5Rm&m#P^csvbSq)t^4=(W zHOF!lwGIF5qlpV#%PzSYc%$cToQvd7BvlHyP znTh-<<0FMpO7;f9?EVZ}OZ@pd6K@GNQK>cpVr){l2Q`+3+` zj9oW9(XR9rxkV_pT*0*M!9NB5MCXHlx@~?}C{}X!=}!p7&Pio@i(NS7oZF?35rosq zu6z2e?$i4CchIN*DQEEa`kA8fG)JOaaoYKOw|>q<;d|%F(Gn|rDHq2{iArmVK3JLH zklgp|ko5XD|Lys`bAOCOQjGX(B_}Ht3=}3SU8|%5;hZudQ}3sEt(I)c@aOd7+=r?IeaG*Qla))E z`onwH=}k&Qnq>X8qLUR*_7?=_g^iL)5c-raUXUu?1y`HBg0j3!I_8YZl|lq#pL&I3 z`kd*Tr7J$dQfHJyy~4jJ1+Pn6nKbQChomJFmGWXKQds7^R;*SzsN8etWyMw^*@b1w zydr6^^JK8JPEf24eVxQju=#&#j8LB3Ee%(eCmPHHp5pnu_#3uwx%=oheX9GEsag7^ z%4fT!3T5SLqmRiT86>00?5+s!8pk{vc}*Q)#A$U~MMmpPI-Na5@YLy^wyDRi|G(v^ z`48(1)Jpxd`v2=#=cn!#o6`GdX{h2;CRvoWiNX+VXnqfercRVPJXLLooaAB7?TYk` z@c%MK=Y+jdu*5s{ZRdhFq@VQK(fkVOxGJL(Uax#uHq)$ delta 5943 zcmb8z4_FlCz6bD~*_qu%7Fd-(3u2O@VWGiDg~d?_R7{X1Rz<}`Lq$VFt|pZ!97x2$#uOWReG(QA(ztfZMazOHvmh!lal||C5(hifq$(apqQ(nG_)n$4tviY0W(T z?}##w7aflw+pLJ`A}Y*^Dg70mIEEIUcyKZLdE&tVL|GIu;|y|$^AS{$S>w<`W=rK> zia19=jF)1X)5f9~k>^!u$~>TFu?(sd=N6)7kRs0i8ExdD*J1Hi#GFHjBP+i_J~`Zl zTCy$-?HXUfYE{H1orotJABW8+1kYRTziu{hb8~}!^ha(!^Ak4}Q|a9XgOm!JH4qQ^ z*iB`dxjSFqE%&ht74Y*JhT}eV@x|fjWcaRlJ-pt>jws(i(;uGW?s7eRv9Dcx{YR|# zRm8W_QBS;k(M9%@!S1Js2iG8lumwea${^Q1gTbivu|eIt)e^X)$zObbFS;3U^aMg} zig;`=95!XphiQy!(&LKqEdHpm1&XHzqk$2pZ^u>AQiHI;iulnpa1yq@gq&+dBl)ro zJ>=5s2p^(|SJRM5*fXW%+MRG~TtP4SZYLs!Dq{a?WD#C#8DVcV4~;eo;uQ308jBF= zPo>Go_Sf52L97RHlK2&%p9F0|RDdE5dmcGtv=^!fZ&V8z_gZ)o&hE8^BL#0M)TY%>^yI&=p6s~=Qbtf&h1HN7ywU@)!Lj=>!qBED3M4i=~# zfGtEZynI`CN;DGoM-TDsLHG#XiO-Np0@6`R$~MDIhNYpGgxe4irif!-MHY#4 zqKqh2XeJYHK_8j25RtcXb~ul0k}(1mgf*Nb+56E?mX{-HB%io+D-Rva!LH5}=q0>oW?$mM}IC!m_VV@9h+1Eg?8Ja8Pb2V%reJlg}<;4Pm)D!m-;yE;hqoFmgO=0J6!E38)}VdvKC`;6y(; zHWN{Il5deiPHaIHxe|>Qa?M>HrHDV+5kr0)gIo{Qq|b#`(*HQ5XpYc0#70LOCFv~k zH05H{@UYJnw2>hOSQJI9--S3bdLxoa!78jLkNpkx<~42%o5k@1-EqLn%2t7jAO&NA!}W9z@)$h|PB*OQQv4q~&EalTY%|N6v*H z@;*iU%Ryw5FMClzE_{uXRy#Xy`^~Unw@oo-747t{h zT+;ItstLQSmHfvUNRt%tZwnAhZuldQ{1Sp1GH?KGlcJ5XB)~FR@1;00Xb$o{)DrIy zv=g?-8qZm18R9*xA?&(3Vw;K%5^xu635pmPjwBLt6om&X<}Lo)TR=<;As)CX`1N$p2bqB3ZHAv3Mj*T?krmOz|M^cNRi zLwDj*F}o0sBt@)AM=@Cvi3YN=4Ohvd8xS@{Kj$Qc51@n;T|guGy%jxV^Ld0%RmA5% zMkXo!5~ZF!H+kVF^b)3yn5LJ@A}^PsjIf4g!ut9MLn4#)WZ8t}DhMM_5?(|<;e-`6 zU7tR42q&c~!il|w)LklnfFmswF@#H6F5y&BO*red63#8s3~gyeEa7~WM>xgQ5Qel7 zPBE4gee#PV+nz;!isHRB%wX_(MC-UI*t9mnD8DxZ?L2*SDXgia1M#WKAn(}*!{}35 z6b7=#n5b!j8+8mgeHI-aY%>+{Ofr%*j-!yYBxAS6X>^j0QsAFPP9vFooQ(Av$5BuI zl!PvgCfFT{*cy)%jUy-`tYJU-Bo5sg?;|u_5zkJ7L*pol$)`zZ&^Upsr0oHOJxET$ zN&cLS5{(mRB|;XK<-VLZ-$sloD3t_Rve(??;4_G$6}EnTKX_emwd}7Z5p1 z5x;dHn>_I`DoAetPLjXZpr3sDG@@ol8%@&d$eGQDVKl0Uol7K{QBXdID~%B`^`z?> z>dE)h(dF5*FVG`XGN4EOLa!!Xj&NRlT6yJ@ACvjF6I}@Ib<(ZdZ#6Rw|R);d&?*(S7TyjGsWkDGYJXncWOlDQq#WbOvE<|x*A!P9tjqM*!T4p0HPXpvI7v%5bDq`>JL1hoGv6ZW7_xZ~ zItbt0ZMlly57St6u@>pbaK<{Ycj;&`ZypMBIR!beo3L0XVKM*ZeAWIL$%OOEda~yY z)RX$h&_(v%5Bmyo4Jo8`9g4^&683AHLN_^^i_k|n%uH}-e1u{T4Wx|^IQcUWmdA%U z4NmgeNR()NghtZ-D0;~GClS7qE9WD~B%e<}sm2w!$rl0WC13g>VikD_S>!?r$~-h{ zbfAxPZbamxTw`BDHetC6@^uMLlCB8!YcwD#UvG2{`RjF5kxQG;Qf&D*{lhGd@cSsA@Ws29uy@)CzaFe> z^pC7~!rQin@Ux+g@S-~ir!m`F#kakIw^1J*bH-)N(uaTRT$A?L7p~>ogD-ZI_J)0( zYaJFf`!+eitNhYa{(`|UI1l_bMP^gfe>OQzpwRdP>~aRPtNyTAs6X+?@NjBcABM9nFO)46?>(qn+uc zgfypN4umHZHEo3?k6StYZuTrH5{k{)hJNp%|ZA_;uD_SH0{2<)Gr@TZe{ zUpZ1Fuz)2_E5P4P1vnA08A!MsJFfiF(@9$Xe;v;JsA(Fdw{4%$yj)h}lPng+T7Idt zxUu|r*|jJOD>U-S?Kc<(2CnyLHS%Ziv`f3tIlRbesYp07PA{8i)oRwtYic<(|Ic}N zL7q#}TU=^wEN{?TEUwW`@b|y9xKywAUx)wNVr>v?UUAB`;*?+yW@T2Nb_S>T`O%DrqXd|Pm;7t5u?g46X1B)d~M;A*%mB?-bA^_OnxX|KDqo_=+R-vL+Y z6={lSKEqUoMQ2>?-%2wl2z~1HNphaL?Ou7SIy_9CDOglnqC8&R875~6eJ)d+{GFg) z94XJf>BMN)wo$TQm{70gMN6~Po<#Y3p;cW}DczxZPm$;IxbIWa0axf$dAo4ai3r!g zGHwUTl^W^|FKT9?lUB!F)q&=-3;s)_l2b zh%nFf`evEE@`n0NvHUc5S8tJ%M9*%9>Q%xD@>N@~>{k1Wq#~IE>hUsl(Qm3l!_~@4IZ)l>D+K8&2mh8* zYo4B#{c?-Tx?TQS_e~1qqXhjLnV9) z1_rcZnp#m^7T45MWTu)kBp*FRV72yeh3|GXq?_;Y7OGu6S>{ARyi-yaEHc0A>A}t_ rvsE=OG~0OEzR;W~^0bSmANj@VTvAZ5BrG9kN#61$u1_DbES~mX&$cTD From 9ac60bf82b1f0e316666b862e9924f90caa60342 Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Thu, 28 Aug 2014 15:21:32 -0700 Subject: [PATCH 123/148] Make stdatomic.h work with gcc4.6 host compiler This is needed to make L work correctly, and bionic tests pass again, after applying the equivalent of commit 00aaea364501b3b0abe58dae461136159df1e356 there. It makes the preexisting code that uses __sync implementations much more useful, although we should no longer be exercising that code in AOSP. Specifically fixes: We were invoking __has_extension and __has_builtin for GCC compilations. They're clang specific. Restructured the tests. The __sync implementation was not defining the LOCK_FREE macros. ATOMIC_VAR_INIT was using named field initializations. These are a C, not C++, feature, that is not supported by g++ 4.6. The stdatomic bionic test still failed with 4.6 and glibc with our questionable LOCK_FREE macro implementation. Don't run that piece with 4.6. In L, this is a prerequisite for fixing: Bug:16880454 Bug:16513433 Change-Id: I9b61e42307f96a114dce7552b6ead4ad1c544eab (cherry picked from commit 32429606bf696d3b2ca555f132a0d60c566d0bd0) --- libc/include/stdatomic.h | 69 +++++++++++++++++++++++++++++++++------- tests/stdatomic_test.cpp | 5 ++- 2 files changed, 62 insertions(+), 12 deletions(-) diff --git a/libc/include/stdatomic.h b/libc/include/stdatomic.h index 47b333cf1..3db25a78e 100644 --- a/libc/include/stdatomic.h +++ b/libc/include/stdatomic.h @@ -32,8 +32,20 @@ #include -#if defined(__cplusplus) && defined(_USING_LIBCXX) && \ - (__has_feature(cxx_atomic) || _GNUC_VER >= 407) + +#if defined(__cplusplus) && defined(_USING_LIBCXX) +# ifdef __clang__ +# if __has_feature(cxx_atomic) +# define _STDATOMIC_HAVE_ATOMIC +# endif +# else /* gcc */ +# if __GNUC_PREREQ(4, 7) +# define _STDATOMIC_HAVE_ATOMIC +# endif +# endif +#endif + +#ifdef _STDATOMIC_HAVE_ATOMIC /* We have a usable C++ ; use it instead. */ @@ -46,6 +58,7 @@ /* included. The definitions in themselves see */ /* the old definition, as they should. */ /* Client code sees the following definition. */ + #define _Atomic(t) std::atomic using std::atomic_is_lock_free; @@ -136,14 +149,24 @@ using std::atomic_uintmax_t; # include /* For char16_t and char32_t. */ #endif -#if __has_extension(c_atomic) || __has_extension(cxx_atomic) -#define __CLANG_ATOMICS -#elif __GNUC_PREREQ(4, 7) -#define __GNUC_ATOMICS -#elif defined(__GNUC__) -#define __SYNC_ATOMICS +#ifdef __clang__ +# if __has_extension(c_atomic) || __has_extension(cxx_atomic) +# define __CLANG_ATOMICS +# else +# error "stdatomic.h does not support your compiler" +# endif +# if __has_builtin(__sync_swap) +# define __HAS_BUILTIN_SYNC_SWAP +# endif #else -#error "stdatomic.h does not support your compiler" +# if __GNUC_PREREQ(4, 7) +# define __GNUC_ATOMICS +# else +# define __SYNC_ATOMICS +# ifdef __cplusplus +# define __ATOMICS_AVOID_DOT_INIT +# endif +# endif #endif /* @@ -152,33 +175,53 @@ using std::atomic_uintmax_t; #ifdef __GCC_ATOMIC_BOOL_LOCK_FREE #define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE +#elif defined(__SYNC_ATOMICS) +#define ATOMIC_BOOL_LOCK_FREE 2 /* For all modern platforms */ #endif #ifdef __GCC_ATOMIC_CHAR_LOCK_FREE #define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE +#elif defined(__SYNC_ATOMICS) +#define ATOMIC_CHAR_LOCK_FREE 2 #endif #ifdef __GCC_ATOMIC_CHAR16_T_LOCK_FREE #define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE +#elif defined(__SYNC_ATOMICS) +#define ATOMIC_CHAR16_T_LOCK_FREE 2 #endif #ifdef __GCC_ATOMIC_CHAR32_T_LOCK_FREE #define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE +#elif defined(__SYNC_ATOMICS) +#define ATOMIC_CHAR32_T_LOCK_FREE 2 #endif #ifdef __GCC_ATOMIC_WCHAR_T_LOCK_FREE #define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE +#elif defined(__SYNC_ATOMICS) +#define ATOMIC_WCHAR_T_LOCK_FREE 2 #endif #ifdef __GCC_ATOMIC_SHORT_LOCK_FREE #define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE +#elif defined(__SYNC_ATOMICS) +#define ATOMIC_SHORT_LOCK_FREE 2 #endif #ifdef __GCC_ATOMIC_INT_LOCK_FREE #define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE +#elif defined(__SYNC_ATOMICS) +#define ATOMIC_INT_LOCK_FREE 2 #endif #ifdef __GCC_ATOMIC_LONG_LOCK_FREE #define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE +#elif defined(__SYNC_ATOMICS) +#define ATOMIC_LONG_LOCK_FREE 2 #endif #ifdef __GCC_ATOMIC_LLONG_LOCK_FREE #define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE +#elif defined(__SYNC_ATOMICS) +#define ATOMIC_LLONG_LOCK_FREE 1 /* maybe */ #endif #ifdef __GCC_ATOMIC_POINTER_LOCK_FREE #define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE +#elif defined(__SYNC_ATOMICS) +#define ATOMIC_POINTER_LOCK_FREE 2 #endif /* @@ -189,7 +232,11 @@ using std::atomic_uintmax_t; #define ATOMIC_VAR_INIT(value) (value) #define atomic_init(obj, value) __c11_atomic_init(obj, value) #else +#ifdef __ATOMICS_AVOID_DOT_INIT +#define ATOMIC_VAR_INIT(value) { value } +#else #define ATOMIC_VAR_INIT(value) { .__val = (value) } +#endif #define atomic_init(obj, value) ((void)((obj)->__val = (value))) #endif @@ -289,7 +336,7 @@ atomic_signal_fence(memory_order __order __attribute__((unused))) * 7.17.6 Atomic integer types. */ -#if !__has_extension(c_atomic) && !__has_extension(cxx_atomic) +#ifndef __CLANG_ATOMICS /* * No native support for _Atomic(). Place object in structure to prevent * most forms of direct non-atomic access. @@ -410,7 +457,7 @@ typedef _Atomic(uintmax_t) atomic_uintmax_t; desired, success, failure) \ atomic_compare_exchange_strong_explicit(object, expected, \ desired, success, failure) -#if __has_builtin(__sync_swap) +#ifdef __HAS_BUILTIN_SYNC_SWAP /* Clang provides a full-barrier atomic exchange - use it if available. */ #define atomic_exchange_explicit(object, desired, order) \ ((void)(order), __sync_swap(&(object)->__val, desired)) diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp index 222bd9c80..b7fb19b0d 100644 --- a/tests/stdatomic_test.cpp +++ b/tests/stdatomic_test.cpp @@ -63,14 +63,17 @@ TEST(stdatomic, atomic_signal_fence) { TEST(stdatomic, atomic_is_lock_free) { atomic_char small; - atomic_intmax_t big; ASSERT_TRUE(atomic_is_lock_free(&small)); +#if defined(__clang__) || __GNUC_PREREQ(4, 7) + // Otherwise stdatomic.h doesn't handle this. + atomic_intmax_t big; // atomic_intmax_t(size = 64) is not lock free on mips32. #if defined(__mips__) && !defined(__LP64__) ASSERT_FALSE(atomic_is_lock_free(&big)); #else ASSERT_TRUE(atomic_is_lock_free(&big)); #endif +#endif } TEST(stdatomic, atomic_flag) { From 1e010d60397db706cd3d1c4d5701a2bced441aa8 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 3 Sep 2014 15:53:11 -0700 Subject: [PATCH 124/148] Add back a dummy arc4random_stir for compatibility. The current arc4random implementation stirs itself as needed, but we need to keep an arc4random_stir symbol around for binary compatibility. Bug: 17291075 Change-Id: Iaf6171c3ec65c39c1868364d5b35ea280e29a363 --- libc/bionic/ndk_cruft.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index 0c7201986..45ead624e 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -303,4 +303,9 @@ extern "C" char* index(const char* str, int ch) { return strchr(str, ch); } +// This was removed from BSD. +extern "C" void arc4random_stir(void) { + // The current implementation stirs itself as needed. +} + #endif From 5beddb7d642524ecb6655ab2823caf2add679917 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 4 Sep 2014 16:09:25 -0700 Subject: [PATCH 125/148] Fix pthread_attr_getstack__main_thread. There were two problems here: * This would fail when run with unlimited stack, because it didn't know that bionic reports unlimited stacks as 8MiB. * This would leave RLIMIT_STACK small, causing failures to exec (so the popen and system tests would fail). (cherry-pick of 27a9aed81978af792cb06035a1619c8141a5fb5b plus the new ScopeGuard.h from a3ad450a2e3fb6b3fe359683b247eba20896f646.) Bug: 17394276 Change-Id: I5b92dc64ca089400223b2d9a3743e9b9d57c1bc2 --- libc/private/ScopeGuard.h | 53 +++++++++++++++++++++++++++++++++++++++ tests/pthread_test.cpp | 12 +++++++++ 2 files changed, 65 insertions(+) create mode 100644 libc/private/ScopeGuard.h diff --git a/libc/private/ScopeGuard.h b/libc/private/ScopeGuard.h new file mode 100644 index 000000000..183e322f7 --- /dev/null +++ b/libc/private/ScopeGuard.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SCOPE_GUARD_H +#define SCOPE_GUARD_H + +// TODO: include explicit std::move when it becomes available +template +class ScopeGuard { + public: + ScopeGuard(F f) : f_(f), active_(true) {} + + ScopeGuard(ScopeGuard&& that) : f_(that.f_), active_(that.active_) { + that.active_ = false; + } + + ~ScopeGuard() { + if (active_) { + f_(); + } + } + + void disable() { + active_ = false; + } + private: + F f_; + bool active_; + + ScopeGuard() = delete; + ScopeGuard(const ScopeGuard&) = delete; + ScopeGuard& operator=(const ScopeGuard&) = delete; +}; + +template +ScopeGuard create_scope_guard(T f) { + return ScopeGuard(f); +} + +#endif // SCOPE_GUARD_H diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp index 65577385d..4a7c6bd88 100644 --- a/tests/pthread_test.cpp +++ b/tests/pthread_test.cpp @@ -27,6 +27,7 @@ #include #include +#include "private/ScopeGuard.h" #include "ScopedSignalHandler.h" TEST(pthread, pthread_key_create) { @@ -860,8 +861,19 @@ TEST(pthread, pthread_attr_getstack__main_thread) { // The stack size should correspond to RLIMIT_STACK. rlimit rl; ASSERT_EQ(0, getrlimit(RLIMIT_STACK, &rl)); + uint64_t original_rlim_cur = rl.rlim_cur; +#if defined(__BIONIC__) + if (rl.rlim_cur == RLIM_INFINITY) { + rl.rlim_cur = 8 * 1024 * 1024; // Bionic reports unlimited stacks as 8MiB. + } +#endif EXPECT_EQ(rl.rlim_cur, stack_size); + auto guard = create_scope_guard([&rl, original_rlim_cur]() { + rl.rlim_cur = original_rlim_cur; + ASSERT_EQ(0, setrlimit(RLIMIT_STACK, &rl)); + }); + // The high address of the /proc/self/maps [stack] region should equal stack_base + stack_size. // Remember that the stack grows down (and is mapped in on demand), so the low address of the // region isn't very interesting. From f0e9458ea596227720fa745df15f5357f6c0c8f6 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 5 Sep 2014 16:12:42 -0700 Subject: [PATCH 126/148] Don't expose non-standard basename_r and dirname_r in LP64. Bug: 17407423 Change-Id: I47fe499a4c396bf09d7b78fd828728d04777398b --- libc/bionic/libgen.cpp | 34 +++++++++++++++++----------------- libc/include/libgen.h | 25 ++++++++----------------- tests/libgen_test.cpp | 6 +++--- 3 files changed, 28 insertions(+), 37 deletions(-) diff --git a/libc/bionic/libgen.cpp b/libc/bionic/libgen.cpp index d8df494dc..b98f504b0 100644 --- a/libc/bionic/libgen.cpp +++ b/libc/bionic/libgen.cpp @@ -36,22 +36,7 @@ #include "private/ThreadLocalBuffer.h" -GLOBAL_INIT_THREAD_LOCAL_BUFFER(basename); -GLOBAL_INIT_THREAD_LOCAL_BUFFER(dirname); - -char* basename(const char* path) { - LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, basename, MAXPATHLEN); - int rc = basename_r(path, basename_tls_buffer, basename_tls_buffer_size); - return (rc < 0) ? NULL : basename_tls_buffer; -} - -char* dirname(const char* path) { - LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, dirname, MAXPATHLEN); - int rc = dirname_r(path, dirname_tls_buffer, dirname_tls_buffer_size); - return (rc < 0) ? NULL : dirname_tls_buffer; -} - -int basename_r(const char* path, char* buffer, size_t buffer_size) { +__LIBC64_HIDDEN__ int basename_r(const char* path, char* buffer, size_t buffer_size) { const char* startp = NULL; const char* endp = NULL; int len; @@ -103,7 +88,7 @@ int basename_r(const char* path, char* buffer, size_t buffer_size) { return result; } -int dirname_r(const char* path, char* buffer, size_t buffer_size) { +__LIBC64_HIDDEN__ int dirname_r(const char* path, char* buffer, size_t buffer_size) { const char* endp = NULL; int len; int result; @@ -161,3 +146,18 @@ int dirname_r(const char* path, char* buffer, size_t buffer_size) { } return result; } + +GLOBAL_INIT_THREAD_LOCAL_BUFFER(basename); +GLOBAL_INIT_THREAD_LOCAL_BUFFER(dirname); + +char* basename(const char* path) { + LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, basename, MAXPATHLEN); + int rc = basename_r(path, basename_tls_buffer, basename_tls_buffer_size); + return (rc < 0) ? NULL : basename_tls_buffer; +} + +char* dirname(const char* path) { + LOCAL_INIT_THREAD_LOCAL_BUFFER(char*, dirname, MAXPATHLEN); + int rc = dirname_r(path, dirname_tls_buffer, dirname_tls_buffer_size); + return (rc < 0) ? NULL : dirname_tls_buffer; +} diff --git a/libc/include/libgen.h b/libc/include/libgen.h index c5fc76a79..9dcec75cc 100644 --- a/libc/include/libgen.h +++ b/libc/include/libgen.h @@ -33,24 +33,15 @@ __BEGIN_DECLS -/* our version of dirname/basename don't modify the input path */ -extern char* dirname (const char* path); -extern char* basename(const char* path); +/* On Android these don't modify their input, and use thread-local storage for their results. */ +extern char* basename(const char*); +extern char* dirname(const char*); -/* special thread-safe Bionic versions - * - * if 'buffer' is NULL, 'bufflen' is ignored and the length of the result is returned - * otherwise, place result in 'buffer' - * - * at most bufflen-1 characters written, plus a terminating zero - * - * return length of result, or -1 in case of error, with errno set to: - * - * ERANGE: buffer is too short - * ENAMETOOLONG: the result is too long for a valid path - */ -extern int dirname_r(const char* path, char* buffer, size_t bufflen); -extern int basename_r(const char* path, char* buffer, size_t bufflen); +#if !defined(__LP64__) +/* These non-standard functions are not needed on Android; basename and dirname use thread-local storage. */ +extern int dirname_r(const char*, char*, size_t); +extern int basename_r(const char*, char*, size_t); +#endif __END_DECLS diff --git a/tests/libgen_test.cpp b/tests/libgen_test.cpp index cae646f25..3958f81ed 100644 --- a/tests/libgen_test.cpp +++ b/tests/libgen_test.cpp @@ -64,7 +64,7 @@ TEST(libgen, dirname) { TestDirname("/", "/"); } -#if defined(__BIONIC__) +#if defined(__BIONIC__) && !defined(__LP64__) static void TestBasename(const char* in, const char* expected_out, int expected_rc, char* buf, size_t buf_size, int expected_errno) { errno = 0; @@ -89,7 +89,7 @@ static void TestDirname(const char* in, const char* expected_out, int expected_r #endif // __BIONIC__ TEST(libgen, basename_r) { -#if defined(__BIONIC__) +#if defined(__BIONIC__) && !defined(__LP64__) char buf[256]; TestBasename("", ".", 1, NULL, 0, 0); TestBasename("", ".", -1, buf, 0, ERANGE); @@ -108,7 +108,7 @@ TEST(libgen, basename_r) { } TEST(libgen, dirname_r) { -#if defined(__BIONIC__) +#if defined(__BIONIC__) && !defined(__LP64__) char buf[256]; TestDirname("", ".", 1, NULL, 0, 0); TestDirname("", ".", -1, buf, 0, ERANGE); From 1c365cb494d8cab1b639ecef21514425647e606b Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 5 Sep 2014 16:39:22 -0700 Subject: [PATCH 127/148] Add dlmalloc_usable_size for 32 bit arches. Bug: 17337831 Change-Id: I50c50559a5dfa083c85f064042bc0726718c988b --- libc/bionic/dlmalloc.h | 7 +++++++ libc/bionic/ndk_cruft.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/libc/bionic/dlmalloc.h b/libc/bionic/dlmalloc.h index 46efa911f..ef7881436 100644 --- a/libc/bionic/dlmalloc.h +++ b/libc/bionic/dlmalloc.h @@ -34,6 +34,13 @@ #define malloc_getpagesize getpagesize() +/* dlmalloc_usable_size was exposed in the NDK, so change the name + * of the function on 32 bit architectures. + */ +#if !defined(__LP64__) +#define dlmalloc_usable_size dlmalloc_usable_size_real +#endif + /* Export two symbols used by the VM. */ __BEGIN_DECLS int dlmalloc_trim(size_t) __LIBC_ABI_PUBLIC__; diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index 45ead624e..7879b7f32 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -308,4 +308,11 @@ extern "C" void arc4random_stir(void) { // The current implementation stirs itself as needed. } +// Old versions of the NDK did not export malloc_usable_size, but did +// export dlmalloc_usable_size. We are moving away from dlmalloc in L +// so make this call malloc_usable_size. +extern "C" size_t dlmalloc_usable_size(void* ptr) { + return malloc_usable_size(ptr); +} + #endif From 51c8355d5cf4b83ccd2ad250ca4c61a616356c2b Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 8 Sep 2014 10:25:33 -0700 Subject: [PATCH 128/148] Add arc4random_addrandom binary compatibility. This was in in older releases. It's no longer used, but we can preserve backwards compatibility by making it a no-op. Bug: 16205834 Change-Id: Idde7b46df4f253e39675600bcf82352879a716e7 --- libc/bionic/ndk_cruft.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index 7879b7f32..829e8f3b6 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -308,6 +308,11 @@ extern "C" void arc4random_stir(void) { // The current implementation stirs itself as needed. } +// This was removed from BSD. +extern "C" void arc4random_addrandom(unsigned char*, int) { + // The current implementation adds randomness as needed. +} + // Old versions of the NDK did not export malloc_usable_size, but did // export dlmalloc_usable_size. We are moving away from dlmalloc in L // so make this call malloc_usable_size. From 7efad83d430f4d824f2aaa75edea5106f6ff8aae Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 8 Sep 2014 15:25:01 -0700 Subject: [PATCH 129/148] Ensure __set_errno is still visible on LP32. The use of the .hidden directive to avoid going via the PLT for __set_errno had the side-effect of actually making __set_errno hidden (which is odd because assembler directives don't usually affect symbols defined in a different file --- you can't even create a weak reference to a symbol that's defined in a different file). This change switches the system call stubs over to a new always-hidden __set_errno_internal and has a visible __set_errno on LP32 just for binary compatibility with old NDK apps. Bug: 17423135 Change-Id: I6b6d7a05dda85f923d22e5ffd169a91e23499b7b --- libc/arch-arm/bionic/__bionic_clone.S | 2 +- libc/arch-arm/bionic/syscall.S | 2 +- libc/arch-arm/syscalls/__accept4.S | 4 +--- libc/arch-arm/syscalls/__brk.S | 4 +--- libc/arch-arm/syscalls/__connect.S | 4 +--- libc/arch-arm/syscalls/__epoll_pwait.S | 4 +--- libc/arch-arm/syscalls/__exit.S | 4 +--- libc/arch-arm/syscalls/__fcntl64.S | 4 +--- libc/arch-arm/syscalls/__fstatfs64.S | 4 +--- libc/arch-arm/syscalls/__getcpu.S | 4 +--- libc/arch-arm/syscalls/__getcwd.S | 4 +--- libc/arch-arm/syscalls/__getdents64.S | 4 +--- libc/arch-arm/syscalls/__getpid.S | 4 +--- libc/arch-arm/syscalls/__getpriority.S | 4 +--- libc/arch-arm/syscalls/__ioctl.S | 4 +--- libc/arch-arm/syscalls/__llseek.S | 4 +--- libc/arch-arm/syscalls/__mmap2.S | 4 +--- libc/arch-arm/syscalls/__openat.S | 4 +--- libc/arch-arm/syscalls/__ppoll.S | 4 +--- libc/arch-arm/syscalls/__pselect6.S | 4 +--- libc/arch-arm/syscalls/__ptrace.S | 4 +--- libc/arch-arm/syscalls/__reboot.S | 4 +--- libc/arch-arm/syscalls/__rt_sigaction.S | 4 +--- libc/arch-arm/syscalls/__rt_sigpending.S | 4 +--- libc/arch-arm/syscalls/__rt_sigprocmask.S | 4 +--- libc/arch-arm/syscalls/__rt_sigsuspend.S | 4 +--- libc/arch-arm/syscalls/__rt_sigtimedwait.S | 4 +--- libc/arch-arm/syscalls/__sched_getaffinity.S | 4 +--- libc/arch-arm/syscalls/__set_tid_address.S | 4 +--- libc/arch-arm/syscalls/__set_tls.S | 4 +--- libc/arch-arm/syscalls/__sigaction.S | 4 +--- libc/arch-arm/syscalls/__signalfd4.S | 4 +--- libc/arch-arm/syscalls/__socket.S | 4 +--- libc/arch-arm/syscalls/__statfs64.S | 4 +--- libc/arch-arm/syscalls/__timer_create.S | 4 +--- libc/arch-arm/syscalls/__timer_delete.S | 4 +--- libc/arch-arm/syscalls/__timer_getoverrun.S | 4 +--- libc/arch-arm/syscalls/__timer_gettime.S | 4 +--- libc/arch-arm/syscalls/__timer_settime.S | 4 +--- libc/arch-arm/syscalls/__waitid.S | 4 +--- libc/arch-arm/syscalls/_exit.S | 4 +--- libc/arch-arm/syscalls/acct.S | 4 +--- libc/arch-arm/syscalls/bind.S | 4 +--- libc/arch-arm/syscalls/cacheflush.S | 4 +--- libc/arch-arm/syscalls/capget.S | 4 +--- libc/arch-arm/syscalls/capset.S | 4 +--- libc/arch-arm/syscalls/chdir.S | 4 +--- libc/arch-arm/syscalls/chroot.S | 4 +--- libc/arch-arm/syscalls/clock_getres.S | 4 +--- libc/arch-arm/syscalls/clock_gettime.S | 4 +--- libc/arch-arm/syscalls/clock_nanosleep.S | 4 +--- libc/arch-arm/syscalls/clock_settime.S | 4 +--- libc/arch-arm/syscalls/close.S | 4 +--- libc/arch-arm/syscalls/delete_module.S | 4 +--- libc/arch-arm/syscalls/dup.S | 4 +--- libc/arch-arm/syscalls/dup3.S | 4 +--- libc/arch-arm/syscalls/epoll_create1.S | 4 +--- libc/arch-arm/syscalls/epoll_ctl.S | 4 +--- libc/arch-arm/syscalls/eventfd.S | 4 +--- libc/arch-arm/syscalls/execve.S | 4 +--- libc/arch-arm/syscalls/faccessat.S | 4 +--- libc/arch-arm/syscalls/fallocate64.S | 4 +--- libc/arch-arm/syscalls/fchdir.S | 4 +--- libc/arch-arm/syscalls/fchmod.S | 4 +--- libc/arch-arm/syscalls/fchmodat.S | 4 +--- libc/arch-arm/syscalls/fchown.S | 4 +--- libc/arch-arm/syscalls/fchownat.S | 4 +--- libc/arch-arm/syscalls/fdatasync.S | 4 +--- libc/arch-arm/syscalls/fgetxattr.S | 4 +--- libc/arch-arm/syscalls/flistxattr.S | 4 +--- libc/arch-arm/syscalls/flock.S | 4 +--- libc/arch-arm/syscalls/fremovexattr.S | 4 +--- libc/arch-arm/syscalls/fsetxattr.S | 4 +--- libc/arch-arm/syscalls/fstat64.S | 4 +--- libc/arch-arm/syscalls/fstatat64.S | 4 +--- libc/arch-arm/syscalls/fsync.S | 4 +--- libc/arch-arm/syscalls/ftruncate.S | 4 +--- libc/arch-arm/syscalls/ftruncate64.S | 4 +--- libc/arch-arm/syscalls/getegid.S | 4 +--- libc/arch-arm/syscalls/geteuid.S | 4 +--- libc/arch-arm/syscalls/getgid.S | 4 +--- libc/arch-arm/syscalls/getgroups.S | 4 +--- libc/arch-arm/syscalls/getitimer.S | 4 +--- libc/arch-arm/syscalls/getpeername.S | 4 +--- libc/arch-arm/syscalls/getpgid.S | 4 +--- libc/arch-arm/syscalls/getppid.S | 4 +--- libc/arch-arm/syscalls/getresgid.S | 4 +--- libc/arch-arm/syscalls/getresuid.S | 4 +--- libc/arch-arm/syscalls/getrlimit.S | 4 +--- libc/arch-arm/syscalls/getrusage.S | 4 +--- libc/arch-arm/syscalls/getsid.S | 4 +--- libc/arch-arm/syscalls/getsockname.S | 4 +--- libc/arch-arm/syscalls/getsockopt.S | 4 +--- libc/arch-arm/syscalls/gettimeofday.S | 4 +--- libc/arch-arm/syscalls/getuid.S | 4 +--- libc/arch-arm/syscalls/getxattr.S | 4 +--- libc/arch-arm/syscalls/init_module.S | 4 +--- libc/arch-arm/syscalls/inotify_add_watch.S | 4 +--- libc/arch-arm/syscalls/inotify_init1.S | 4 +--- libc/arch-arm/syscalls/inotify_rm_watch.S | 4 +--- libc/arch-arm/syscalls/kill.S | 4 +--- libc/arch-arm/syscalls/klogctl.S | 4 +--- libc/arch-arm/syscalls/lgetxattr.S | 4 +--- libc/arch-arm/syscalls/linkat.S | 4 +--- libc/arch-arm/syscalls/listen.S | 4 +--- libc/arch-arm/syscalls/listxattr.S | 4 +--- libc/arch-arm/syscalls/llistxattr.S | 4 +--- libc/arch-arm/syscalls/lremovexattr.S | 4 +--- libc/arch-arm/syscalls/lseek.S | 4 +--- libc/arch-arm/syscalls/lsetxattr.S | 4 +--- libc/arch-arm/syscalls/madvise.S | 4 +--- libc/arch-arm/syscalls/mincore.S | 4 +--- libc/arch-arm/syscalls/mkdirat.S | 4 +--- libc/arch-arm/syscalls/mknodat.S | 4 +--- libc/arch-arm/syscalls/mlock.S | 4 +--- libc/arch-arm/syscalls/mlockall.S | 4 +--- libc/arch-arm/syscalls/mount.S | 4 +--- libc/arch-arm/syscalls/mprotect.S | 4 +--- libc/arch-arm/syscalls/mremap.S | 4 +--- libc/arch-arm/syscalls/msync.S | 4 +--- libc/arch-arm/syscalls/munlock.S | 4 +--- libc/arch-arm/syscalls/munlockall.S | 4 +--- libc/arch-arm/syscalls/munmap.S | 4 +--- libc/arch-arm/syscalls/nanosleep.S | 4 +--- libc/arch-arm/syscalls/personality.S | 4 +--- libc/arch-arm/syscalls/pipe2.S | 4 +--- libc/arch-arm/syscalls/prctl.S | 4 +--- libc/arch-arm/syscalls/pread64.S | 4 +--- libc/arch-arm/syscalls/prlimit64.S | 4 +--- libc/arch-arm/syscalls/pwrite64.S | 4 +--- libc/arch-arm/syscalls/read.S | 4 +--- libc/arch-arm/syscalls/readahead.S | 4 +--- libc/arch-arm/syscalls/readlinkat.S | 4 +--- libc/arch-arm/syscalls/readv.S | 4 +--- libc/arch-arm/syscalls/recvfrom.S | 4 +--- libc/arch-arm/syscalls/recvmmsg.S | 4 +--- libc/arch-arm/syscalls/recvmsg.S | 4 +--- libc/arch-arm/syscalls/removexattr.S | 4 +--- libc/arch-arm/syscalls/renameat.S | 4 +--- .../arch-arm/syscalls/sched_get_priority_max.S | 4 +--- .../arch-arm/syscalls/sched_get_priority_min.S | 4 +--- libc/arch-arm/syscalls/sched_getparam.S | 4 +--- libc/arch-arm/syscalls/sched_getscheduler.S | 4 +--- libc/arch-arm/syscalls/sched_rr_get_interval.S | 4 +--- libc/arch-arm/syscalls/sched_setaffinity.S | 4 +--- libc/arch-arm/syscalls/sched_setparam.S | 4 +--- libc/arch-arm/syscalls/sched_setscheduler.S | 4 +--- libc/arch-arm/syscalls/sched_yield.S | 4 +--- libc/arch-arm/syscalls/sendfile.S | 4 +--- libc/arch-arm/syscalls/sendfile64.S | 4 +--- libc/arch-arm/syscalls/sendmmsg.S | 4 +--- libc/arch-arm/syscalls/sendmsg.S | 4 +--- libc/arch-arm/syscalls/sendto.S | 4 +--- libc/arch-arm/syscalls/setfsgid.S | 4 +--- libc/arch-arm/syscalls/setfsuid.S | 4 +--- libc/arch-arm/syscalls/setgid.S | 4 +--- libc/arch-arm/syscalls/setgroups.S | 4 +--- libc/arch-arm/syscalls/setitimer.S | 4 +--- libc/arch-arm/syscalls/setns.S | 4 +--- libc/arch-arm/syscalls/setpgid.S | 4 +--- libc/arch-arm/syscalls/setpriority.S | 4 +--- libc/arch-arm/syscalls/setregid.S | 4 +--- libc/arch-arm/syscalls/setresgid.S | 4 +--- libc/arch-arm/syscalls/setresuid.S | 4 +--- libc/arch-arm/syscalls/setreuid.S | 4 +--- libc/arch-arm/syscalls/setrlimit.S | 4 +--- libc/arch-arm/syscalls/setsid.S | 4 +--- libc/arch-arm/syscalls/setsockopt.S | 4 +--- libc/arch-arm/syscalls/settimeofday.S | 4 +--- libc/arch-arm/syscalls/setuid.S | 4 +--- libc/arch-arm/syscalls/setxattr.S | 4 +--- libc/arch-arm/syscalls/shutdown.S | 4 +--- libc/arch-arm/syscalls/sigaltstack.S | 4 +--- libc/arch-arm/syscalls/socketpair.S | 4 +--- libc/arch-arm/syscalls/splice.S | 4 +--- libc/arch-arm/syscalls/swapoff.S | 4 +--- libc/arch-arm/syscalls/swapon.S | 4 +--- libc/arch-arm/syscalls/symlinkat.S | 4 +--- libc/arch-arm/syscalls/sync.S | 4 +--- libc/arch-arm/syscalls/sysinfo.S | 4 +--- libc/arch-arm/syscalls/tee.S | 4 +--- libc/arch-arm/syscalls/tgkill.S | 4 +--- libc/arch-arm/syscalls/timerfd_create.S | 4 +--- libc/arch-arm/syscalls/timerfd_gettime.S | 4 +--- libc/arch-arm/syscalls/timerfd_settime.S | 4 +--- libc/arch-arm/syscalls/times.S | 4 +--- libc/arch-arm/syscalls/truncate.S | 4 +--- libc/arch-arm/syscalls/truncate64.S | 4 +--- libc/arch-arm/syscalls/umask.S | 4 +--- libc/arch-arm/syscalls/umount2.S | 4 +--- libc/arch-arm/syscalls/uname.S | 4 +--- libc/arch-arm/syscalls/unlinkat.S | 4 +--- libc/arch-arm/syscalls/unshare.S | 4 +--- libc/arch-arm/syscalls/utimensat.S | 4 +--- libc/arch-arm/syscalls/vfork.S | 4 +--- libc/arch-arm/syscalls/vmsplice.S | 4 +--- libc/arch-arm/syscalls/wait4.S | 4 +--- libc/arch-arm/syscalls/write.S | 4 +--- libc/arch-arm/syscalls/writev.S | 4 +--- libc/arch-arm64/bionic/__bionic_clone.S | 2 +- libc/arch-arm64/bionic/syscall.S | 2 +- libc/arch-arm64/bionic/vfork.S | 2 +- libc/arch-arm64/syscalls/__accept4.S | 4 +--- libc/arch-arm64/syscalls/__brk.S | 4 +--- libc/arch-arm64/syscalls/__clock_gettime.S | 4 +--- libc/arch-arm64/syscalls/__connect.S | 4 +--- libc/arch-arm64/syscalls/__epoll_pwait.S | 4 +--- libc/arch-arm64/syscalls/__exit.S | 4 +--- libc/arch-arm64/syscalls/__getcpu.S | 4 +--- libc/arch-arm64/syscalls/__getcwd.S | 4 +--- libc/arch-arm64/syscalls/__getdents64.S | 4 +--- libc/arch-arm64/syscalls/__getpid.S | 4 +--- libc/arch-arm64/syscalls/__getpriority.S | 4 +--- libc/arch-arm64/syscalls/__gettimeofday.S | 4 +--- libc/arch-arm64/syscalls/__ioctl.S | 4 +--- libc/arch-arm64/syscalls/__openat.S | 4 +--- libc/arch-arm64/syscalls/__ppoll.S | 4 +--- libc/arch-arm64/syscalls/__pselect6.S | 4 +--- libc/arch-arm64/syscalls/__ptrace.S | 4 +--- libc/arch-arm64/syscalls/__reboot.S | 4 +--- libc/arch-arm64/syscalls/__rt_sigaction.S | 4 +--- libc/arch-arm64/syscalls/__rt_sigpending.S | 4 +--- libc/arch-arm64/syscalls/__rt_sigprocmask.S | 4 +--- libc/arch-arm64/syscalls/__rt_sigsuspend.S | 4 +--- libc/arch-arm64/syscalls/__rt_sigtimedwait.S | 4 +--- libc/arch-arm64/syscalls/__sched_getaffinity.S | 4 +--- libc/arch-arm64/syscalls/__set_tid_address.S | 4 +--- libc/arch-arm64/syscalls/__signalfd4.S | 4 +--- libc/arch-arm64/syscalls/__socket.S | 4 +--- libc/arch-arm64/syscalls/__timer_create.S | 4 +--- libc/arch-arm64/syscalls/__timer_delete.S | 4 +--- libc/arch-arm64/syscalls/__timer_getoverrun.S | 4 +--- libc/arch-arm64/syscalls/__timer_gettime.S | 4 +--- libc/arch-arm64/syscalls/__timer_settime.S | 4 +--- libc/arch-arm64/syscalls/__waitid.S | 4 +--- libc/arch-arm64/syscalls/_exit.S | 4 +--- libc/arch-arm64/syscalls/acct.S | 4 +--- libc/arch-arm64/syscalls/bind.S | 4 +--- libc/arch-arm64/syscalls/capget.S | 4 +--- libc/arch-arm64/syscalls/capset.S | 4 +--- libc/arch-arm64/syscalls/chdir.S | 4 +--- libc/arch-arm64/syscalls/chroot.S | 4 +--- libc/arch-arm64/syscalls/clock_getres.S | 4 +--- libc/arch-arm64/syscalls/clock_nanosleep.S | 4 +--- libc/arch-arm64/syscalls/clock_settime.S | 4 +--- libc/arch-arm64/syscalls/close.S | 4 +--- libc/arch-arm64/syscalls/delete_module.S | 4 +--- libc/arch-arm64/syscalls/dup.S | 4 +--- libc/arch-arm64/syscalls/dup3.S | 4 +--- libc/arch-arm64/syscalls/epoll_create1.S | 4 +--- libc/arch-arm64/syscalls/epoll_ctl.S | 4 +--- libc/arch-arm64/syscalls/eventfd.S | 4 +--- libc/arch-arm64/syscalls/execve.S | 4 +--- libc/arch-arm64/syscalls/faccessat.S | 4 +--- libc/arch-arm64/syscalls/fallocate.S | 4 +--- libc/arch-arm64/syscalls/fchdir.S | 4 +--- libc/arch-arm64/syscalls/fchmod.S | 4 +--- libc/arch-arm64/syscalls/fchmodat.S | 4 +--- libc/arch-arm64/syscalls/fchown.S | 4 +--- libc/arch-arm64/syscalls/fchownat.S | 4 +--- libc/arch-arm64/syscalls/fcntl.S | 4 +--- libc/arch-arm64/syscalls/fdatasync.S | 4 +--- libc/arch-arm64/syscalls/fgetxattr.S | 4 +--- libc/arch-arm64/syscalls/flistxattr.S | 4 +--- libc/arch-arm64/syscalls/flock.S | 4 +--- libc/arch-arm64/syscalls/fremovexattr.S | 4 +--- libc/arch-arm64/syscalls/fsetxattr.S | 4 +--- libc/arch-arm64/syscalls/fstat64.S | 4 +--- libc/arch-arm64/syscalls/fstatat64.S | 4 +--- libc/arch-arm64/syscalls/fstatfs64.S | 4 +--- libc/arch-arm64/syscalls/fsync.S | 4 +--- libc/arch-arm64/syscalls/ftruncate.S | 4 +--- libc/arch-arm64/syscalls/getegid.S | 4 +--- libc/arch-arm64/syscalls/geteuid.S | 4 +--- libc/arch-arm64/syscalls/getgid.S | 4 +--- libc/arch-arm64/syscalls/getgroups.S | 4 +--- libc/arch-arm64/syscalls/getitimer.S | 4 +--- libc/arch-arm64/syscalls/getpeername.S | 4 +--- libc/arch-arm64/syscalls/getpgid.S | 4 +--- libc/arch-arm64/syscalls/getppid.S | 4 +--- libc/arch-arm64/syscalls/getresgid.S | 4 +--- libc/arch-arm64/syscalls/getresuid.S | 4 +--- libc/arch-arm64/syscalls/getrlimit.S | 4 +--- libc/arch-arm64/syscalls/getrusage.S | 4 +--- libc/arch-arm64/syscalls/getsid.S | 4 +--- libc/arch-arm64/syscalls/getsockname.S | 4 +--- libc/arch-arm64/syscalls/getsockopt.S | 4 +--- libc/arch-arm64/syscalls/getuid.S | 4 +--- libc/arch-arm64/syscalls/getxattr.S | 4 +--- libc/arch-arm64/syscalls/init_module.S | 4 +--- libc/arch-arm64/syscalls/inotify_add_watch.S | 4 +--- libc/arch-arm64/syscalls/inotify_init1.S | 4 +--- libc/arch-arm64/syscalls/inotify_rm_watch.S | 4 +--- libc/arch-arm64/syscalls/kill.S | 4 +--- libc/arch-arm64/syscalls/klogctl.S | 4 +--- libc/arch-arm64/syscalls/lgetxattr.S | 4 +--- libc/arch-arm64/syscalls/linkat.S | 4 +--- libc/arch-arm64/syscalls/listen.S | 4 +--- libc/arch-arm64/syscalls/listxattr.S | 4 +--- libc/arch-arm64/syscalls/llistxattr.S | 4 +--- libc/arch-arm64/syscalls/lremovexattr.S | 4 +--- libc/arch-arm64/syscalls/lseek.S | 4 +--- libc/arch-arm64/syscalls/lsetxattr.S | 4 +--- libc/arch-arm64/syscalls/madvise.S | 4 +--- libc/arch-arm64/syscalls/mincore.S | 4 +--- libc/arch-arm64/syscalls/mkdirat.S | 4 +--- libc/arch-arm64/syscalls/mknodat.S | 4 +--- libc/arch-arm64/syscalls/mlock.S | 4 +--- libc/arch-arm64/syscalls/mlockall.S | 4 +--- libc/arch-arm64/syscalls/mmap.S | 4 +--- libc/arch-arm64/syscalls/mount.S | 4 +--- libc/arch-arm64/syscalls/mprotect.S | 4 +--- libc/arch-arm64/syscalls/mremap.S | 4 +--- libc/arch-arm64/syscalls/msync.S | 4 +--- libc/arch-arm64/syscalls/munlock.S | 4 +--- libc/arch-arm64/syscalls/munlockall.S | 4 +--- libc/arch-arm64/syscalls/munmap.S | 4 +--- libc/arch-arm64/syscalls/nanosleep.S | 4 +--- libc/arch-arm64/syscalls/personality.S | 4 +--- libc/arch-arm64/syscalls/pipe2.S | 4 +--- libc/arch-arm64/syscalls/prctl.S | 4 +--- libc/arch-arm64/syscalls/pread64.S | 4 +--- libc/arch-arm64/syscalls/prlimit64.S | 4 +--- libc/arch-arm64/syscalls/pwrite64.S | 4 +--- libc/arch-arm64/syscalls/read.S | 4 +--- libc/arch-arm64/syscalls/readahead.S | 4 +--- libc/arch-arm64/syscalls/readlinkat.S | 4 +--- libc/arch-arm64/syscalls/readv.S | 4 +--- libc/arch-arm64/syscalls/recvfrom.S | 4 +--- libc/arch-arm64/syscalls/recvmmsg.S | 4 +--- libc/arch-arm64/syscalls/recvmsg.S | 4 +--- libc/arch-arm64/syscalls/removexattr.S | 4 +--- libc/arch-arm64/syscalls/renameat.S | 4 +--- .../syscalls/sched_get_priority_max.S | 4 +--- .../syscalls/sched_get_priority_min.S | 4 +--- libc/arch-arm64/syscalls/sched_getparam.S | 4 +--- libc/arch-arm64/syscalls/sched_getscheduler.S | 4 +--- .../syscalls/sched_rr_get_interval.S | 4 +--- libc/arch-arm64/syscalls/sched_setaffinity.S | 4 +--- libc/arch-arm64/syscalls/sched_setparam.S | 4 +--- libc/arch-arm64/syscalls/sched_setscheduler.S | 4 +--- libc/arch-arm64/syscalls/sched_yield.S | 4 +--- libc/arch-arm64/syscalls/sendfile.S | 4 +--- libc/arch-arm64/syscalls/sendmmsg.S | 4 +--- libc/arch-arm64/syscalls/sendmsg.S | 4 +--- libc/arch-arm64/syscalls/sendto.S | 4 +--- libc/arch-arm64/syscalls/setfsgid.S | 4 +--- libc/arch-arm64/syscalls/setfsuid.S | 4 +--- libc/arch-arm64/syscalls/setgid.S | 4 +--- libc/arch-arm64/syscalls/setgroups.S | 4 +--- libc/arch-arm64/syscalls/setitimer.S | 4 +--- libc/arch-arm64/syscalls/setns.S | 4 +--- libc/arch-arm64/syscalls/setpgid.S | 4 +--- libc/arch-arm64/syscalls/setpriority.S | 4 +--- libc/arch-arm64/syscalls/setregid.S | 4 +--- libc/arch-arm64/syscalls/setresgid.S | 4 +--- libc/arch-arm64/syscalls/setresuid.S | 4 +--- libc/arch-arm64/syscalls/setreuid.S | 4 +--- libc/arch-arm64/syscalls/setrlimit.S | 4 +--- libc/arch-arm64/syscalls/setsid.S | 4 +--- libc/arch-arm64/syscalls/setsockopt.S | 4 +--- libc/arch-arm64/syscalls/settimeofday.S | 4 +--- libc/arch-arm64/syscalls/setuid.S | 4 +--- libc/arch-arm64/syscalls/setxattr.S | 4 +--- libc/arch-arm64/syscalls/shutdown.S | 4 +--- libc/arch-arm64/syscalls/sigaltstack.S | 4 +--- libc/arch-arm64/syscalls/socketpair.S | 4 +--- libc/arch-arm64/syscalls/splice.S | 4 +--- libc/arch-arm64/syscalls/statfs64.S | 4 +--- libc/arch-arm64/syscalls/swapoff.S | 4 +--- libc/arch-arm64/syscalls/swapon.S | 4 +--- libc/arch-arm64/syscalls/symlinkat.S | 4 +--- libc/arch-arm64/syscalls/sync.S | 4 +--- libc/arch-arm64/syscalls/sysinfo.S | 4 +--- libc/arch-arm64/syscalls/tee.S | 4 +--- libc/arch-arm64/syscalls/tgkill.S | 4 +--- libc/arch-arm64/syscalls/timerfd_create.S | 4 +--- libc/arch-arm64/syscalls/timerfd_gettime.S | 4 +--- libc/arch-arm64/syscalls/timerfd_settime.S | 4 +--- libc/arch-arm64/syscalls/times.S | 4 +--- libc/arch-arm64/syscalls/truncate.S | 4 +--- libc/arch-arm64/syscalls/umask.S | 4 +--- libc/arch-arm64/syscalls/umount2.S | 4 +--- libc/arch-arm64/syscalls/uname.S | 4 +--- libc/arch-arm64/syscalls/unlinkat.S | 4 +--- libc/arch-arm64/syscalls/unshare.S | 4 +--- libc/arch-arm64/syscalls/utimensat.S | 4 +--- libc/arch-arm64/syscalls/vmsplice.S | 4 +--- libc/arch-arm64/syscalls/wait4.S | 4 +--- libc/arch-arm64/syscalls/write.S | 4 +--- libc/arch-arm64/syscalls/writev.S | 4 +--- libc/arch-mips/bionic/__bionic_clone.S | 2 +- libc/arch-mips/bionic/syscall.S | 2 +- libc/arch-mips/bionic/vfork.S | 2 +- libc/arch-mips/syscalls/__accept4.S | 4 +--- libc/arch-mips/syscalls/__brk.S | 4 +--- libc/arch-mips/syscalls/__connect.S | 4 +--- libc/arch-mips/syscalls/__epoll_pwait.S | 4 +--- libc/arch-mips/syscalls/__exit.S | 4 +--- libc/arch-mips/syscalls/__fcntl64.S | 4 +--- libc/arch-mips/syscalls/__fstatfs64.S | 4 +--- libc/arch-mips/syscalls/__getcpu.S | 4 +--- libc/arch-mips/syscalls/__getcwd.S | 4 +--- libc/arch-mips/syscalls/__getdents64.S | 4 +--- libc/arch-mips/syscalls/__getpid.S | 4 +--- libc/arch-mips/syscalls/__getpriority.S | 4 +--- libc/arch-mips/syscalls/__ioctl.S | 4 +--- libc/arch-mips/syscalls/__llseek.S | 4 +--- libc/arch-mips/syscalls/__mmap2.S | 4 +--- libc/arch-mips/syscalls/__openat.S | 4 +--- libc/arch-mips/syscalls/__ppoll.S | 4 +--- libc/arch-mips/syscalls/__pselect6.S | 4 +--- libc/arch-mips/syscalls/__ptrace.S | 4 +--- libc/arch-mips/syscalls/__reboot.S | 4 +--- libc/arch-mips/syscalls/__rt_sigaction.S | 4 +--- libc/arch-mips/syscalls/__rt_sigpending.S | 4 +--- libc/arch-mips/syscalls/__rt_sigprocmask.S | 4 +--- libc/arch-mips/syscalls/__rt_sigsuspend.S | 4 +--- libc/arch-mips/syscalls/__rt_sigtimedwait.S | 4 +--- libc/arch-mips/syscalls/__sched_getaffinity.S | 4 +--- libc/arch-mips/syscalls/__set_tid_address.S | 4 +--- libc/arch-mips/syscalls/__set_tls.S | 4 +--- libc/arch-mips/syscalls/__sigaction.S | 4 +--- libc/arch-mips/syscalls/__signalfd4.S | 4 +--- libc/arch-mips/syscalls/__socket.S | 4 +--- libc/arch-mips/syscalls/__statfs64.S | 4 +--- libc/arch-mips/syscalls/__timer_create.S | 4 +--- libc/arch-mips/syscalls/__timer_delete.S | 4 +--- libc/arch-mips/syscalls/__timer_getoverrun.S | 4 +--- libc/arch-mips/syscalls/__timer_gettime.S | 4 +--- libc/arch-mips/syscalls/__timer_settime.S | 4 +--- libc/arch-mips/syscalls/__waitid.S | 4 +--- libc/arch-mips/syscalls/_exit.S | 4 +--- libc/arch-mips/syscalls/_flush_cache.S | 4 +--- libc/arch-mips/syscalls/acct.S | 4 +--- libc/arch-mips/syscalls/bind.S | 4 +--- libc/arch-mips/syscalls/capget.S | 4 +--- libc/arch-mips/syscalls/capset.S | 4 +--- libc/arch-mips/syscalls/chdir.S | 4 +--- libc/arch-mips/syscalls/chroot.S | 4 +--- libc/arch-mips/syscalls/clock_getres.S | 4 +--- libc/arch-mips/syscalls/clock_gettime.S | 4 +--- libc/arch-mips/syscalls/clock_nanosleep.S | 4 +--- libc/arch-mips/syscalls/clock_settime.S | 4 +--- libc/arch-mips/syscalls/close.S | 4 +--- libc/arch-mips/syscalls/delete_module.S | 4 +--- libc/arch-mips/syscalls/dup.S | 4 +--- libc/arch-mips/syscalls/dup3.S | 4 +--- libc/arch-mips/syscalls/epoll_create1.S | 4 +--- libc/arch-mips/syscalls/epoll_ctl.S | 4 +--- libc/arch-mips/syscalls/eventfd.S | 4 +--- libc/arch-mips/syscalls/execve.S | 4 +--- libc/arch-mips/syscalls/faccessat.S | 4 +--- libc/arch-mips/syscalls/fallocate64.S | 4 +--- libc/arch-mips/syscalls/fchdir.S | 4 +--- libc/arch-mips/syscalls/fchmod.S | 4 +--- libc/arch-mips/syscalls/fchmodat.S | 4 +--- libc/arch-mips/syscalls/fchown.S | 4 +--- libc/arch-mips/syscalls/fchownat.S | 4 +--- libc/arch-mips/syscalls/fdatasync.S | 4 +--- libc/arch-mips/syscalls/fgetxattr.S | 4 +--- libc/arch-mips/syscalls/flistxattr.S | 4 +--- libc/arch-mips/syscalls/flock.S | 4 +--- libc/arch-mips/syscalls/fremovexattr.S | 4 +--- libc/arch-mips/syscalls/fsetxattr.S | 4 +--- libc/arch-mips/syscalls/fstat64.S | 4 +--- libc/arch-mips/syscalls/fstatat64.S | 4 +--- libc/arch-mips/syscalls/fsync.S | 4 +--- libc/arch-mips/syscalls/ftruncate.S | 4 +--- libc/arch-mips/syscalls/ftruncate64.S | 4 +--- libc/arch-mips/syscalls/getegid.S | 4 +--- libc/arch-mips/syscalls/geteuid.S | 4 +--- libc/arch-mips/syscalls/getgid.S | 4 +--- libc/arch-mips/syscalls/getgroups.S | 4 +--- libc/arch-mips/syscalls/getitimer.S | 4 +--- libc/arch-mips/syscalls/getpeername.S | 4 +--- libc/arch-mips/syscalls/getpgid.S | 4 +--- libc/arch-mips/syscalls/getppid.S | 4 +--- libc/arch-mips/syscalls/getresgid.S | 4 +--- libc/arch-mips/syscalls/getresuid.S | 4 +--- libc/arch-mips/syscalls/getrlimit.S | 4 +--- libc/arch-mips/syscalls/getrusage.S | 4 +--- libc/arch-mips/syscalls/getsid.S | 4 +--- libc/arch-mips/syscalls/getsockname.S | 4 +--- libc/arch-mips/syscalls/getsockopt.S | 4 +--- libc/arch-mips/syscalls/gettimeofday.S | 4 +--- libc/arch-mips/syscalls/getuid.S | 4 +--- libc/arch-mips/syscalls/getxattr.S | 4 +--- libc/arch-mips/syscalls/init_module.S | 4 +--- libc/arch-mips/syscalls/inotify_add_watch.S | 4 +--- libc/arch-mips/syscalls/inotify_init1.S | 4 +--- libc/arch-mips/syscalls/inotify_rm_watch.S | 4 +--- libc/arch-mips/syscalls/kill.S | 4 +--- libc/arch-mips/syscalls/klogctl.S | 4 +--- libc/arch-mips/syscalls/lgetxattr.S | 4 +--- libc/arch-mips/syscalls/linkat.S | 4 +--- libc/arch-mips/syscalls/listen.S | 4 +--- libc/arch-mips/syscalls/listxattr.S | 4 +--- libc/arch-mips/syscalls/llistxattr.S | 4 +--- libc/arch-mips/syscalls/lremovexattr.S | 4 +--- libc/arch-mips/syscalls/lseek.S | 4 +--- libc/arch-mips/syscalls/lsetxattr.S | 4 +--- libc/arch-mips/syscalls/madvise.S | 4 +--- libc/arch-mips/syscalls/mincore.S | 4 +--- libc/arch-mips/syscalls/mkdirat.S | 4 +--- libc/arch-mips/syscalls/mknodat.S | 4 +--- libc/arch-mips/syscalls/mlock.S | 4 +--- libc/arch-mips/syscalls/mlockall.S | 4 +--- libc/arch-mips/syscalls/mount.S | 4 +--- libc/arch-mips/syscalls/mprotect.S | 4 +--- libc/arch-mips/syscalls/mremap.S | 4 +--- libc/arch-mips/syscalls/msync.S | 4 +--- libc/arch-mips/syscalls/munlock.S | 4 +--- libc/arch-mips/syscalls/munlockall.S | 4 +--- libc/arch-mips/syscalls/munmap.S | 4 +--- libc/arch-mips/syscalls/nanosleep.S | 4 +--- libc/arch-mips/syscalls/personality.S | 4 +--- libc/arch-mips/syscalls/pipe2.S | 4 +--- libc/arch-mips/syscalls/prctl.S | 4 +--- libc/arch-mips/syscalls/pread64.S | 4 +--- libc/arch-mips/syscalls/prlimit64.S | 4 +--- libc/arch-mips/syscalls/pwrite64.S | 4 +--- libc/arch-mips/syscalls/read.S | 4 +--- libc/arch-mips/syscalls/readahead.S | 4 +--- libc/arch-mips/syscalls/readlinkat.S | 4 +--- libc/arch-mips/syscalls/readv.S | 4 +--- libc/arch-mips/syscalls/recvfrom.S | 4 +--- libc/arch-mips/syscalls/recvmmsg.S | 4 +--- libc/arch-mips/syscalls/recvmsg.S | 4 +--- libc/arch-mips/syscalls/removexattr.S | 4 +--- libc/arch-mips/syscalls/renameat.S | 4 +--- .../syscalls/sched_get_priority_max.S | 4 +--- .../syscalls/sched_get_priority_min.S | 4 +--- libc/arch-mips/syscalls/sched_getparam.S | 4 +--- libc/arch-mips/syscalls/sched_getscheduler.S | 4 +--- .../arch-mips/syscalls/sched_rr_get_interval.S | 4 +--- libc/arch-mips/syscalls/sched_setaffinity.S | 4 +--- libc/arch-mips/syscalls/sched_setparam.S | 4 +--- libc/arch-mips/syscalls/sched_setscheduler.S | 4 +--- libc/arch-mips/syscalls/sched_yield.S | 4 +--- libc/arch-mips/syscalls/sendfile.S | 4 +--- libc/arch-mips/syscalls/sendfile64.S | 4 +--- libc/arch-mips/syscalls/sendmmsg.S | 4 +--- libc/arch-mips/syscalls/sendmsg.S | 4 +--- libc/arch-mips/syscalls/sendto.S | 4 +--- libc/arch-mips/syscalls/setfsgid.S | 4 +--- libc/arch-mips/syscalls/setfsuid.S | 4 +--- libc/arch-mips/syscalls/setgid.S | 4 +--- libc/arch-mips/syscalls/setgroups.S | 4 +--- libc/arch-mips/syscalls/setitimer.S | 4 +--- libc/arch-mips/syscalls/setns.S | 4 +--- libc/arch-mips/syscalls/setpgid.S | 4 +--- libc/arch-mips/syscalls/setpriority.S | 4 +--- libc/arch-mips/syscalls/setregid.S | 4 +--- libc/arch-mips/syscalls/setresgid.S | 4 +--- libc/arch-mips/syscalls/setresuid.S | 4 +--- libc/arch-mips/syscalls/setreuid.S | 4 +--- libc/arch-mips/syscalls/setrlimit.S | 4 +--- libc/arch-mips/syscalls/setsid.S | 4 +--- libc/arch-mips/syscalls/setsockopt.S | 4 +--- libc/arch-mips/syscalls/settimeofday.S | 4 +--- libc/arch-mips/syscalls/setuid.S | 4 +--- libc/arch-mips/syscalls/setxattr.S | 4 +--- libc/arch-mips/syscalls/shutdown.S | 4 +--- libc/arch-mips/syscalls/sigaltstack.S | 4 +--- libc/arch-mips/syscalls/socketpair.S | 4 +--- libc/arch-mips/syscalls/splice.S | 4 +--- libc/arch-mips/syscalls/swapoff.S | 4 +--- libc/arch-mips/syscalls/swapon.S | 4 +--- libc/arch-mips/syscalls/symlinkat.S | 4 +--- libc/arch-mips/syscalls/sync.S | 4 +--- libc/arch-mips/syscalls/sysinfo.S | 4 +--- libc/arch-mips/syscalls/tee.S | 4 +--- libc/arch-mips/syscalls/tgkill.S | 4 +--- libc/arch-mips/syscalls/timerfd_create.S | 4 +--- libc/arch-mips/syscalls/timerfd_gettime.S | 4 +--- libc/arch-mips/syscalls/timerfd_settime.S | 4 +--- libc/arch-mips/syscalls/times.S | 4 +--- libc/arch-mips/syscalls/truncate.S | 4 +--- libc/arch-mips/syscalls/truncate64.S | 4 +--- libc/arch-mips/syscalls/umask.S | 4 +--- libc/arch-mips/syscalls/umount2.S | 4 +--- libc/arch-mips/syscalls/uname.S | 4 +--- libc/arch-mips/syscalls/unlinkat.S | 4 +--- libc/arch-mips/syscalls/unshare.S | 4 +--- libc/arch-mips/syscalls/utimensat.S | 4 +--- libc/arch-mips/syscalls/vmsplice.S | 4 +--- libc/arch-mips/syscalls/wait4.S | 4 +--- libc/arch-mips/syscalls/write.S | 4 +--- libc/arch-mips/syscalls/writev.S | 4 +--- libc/arch-mips64/bionic/__bionic_clone.S | 2 +- libc/arch-mips64/bionic/syscall.S | 2 +- libc/arch-mips64/bionic/vfork.S | 2 +- libc/arch-mips64/syscalls/__accept4.S | 4 +--- libc/arch-mips64/syscalls/__brk.S | 4 +--- libc/arch-mips64/syscalls/__connect.S | 4 +--- libc/arch-mips64/syscalls/__epoll_pwait.S | 4 +--- libc/arch-mips64/syscalls/__exit.S | 4 +--- libc/arch-mips64/syscalls/__getcpu.S | 4 +--- libc/arch-mips64/syscalls/__getcwd.S | 4 +--- libc/arch-mips64/syscalls/__getdents64.S | 4 +--- libc/arch-mips64/syscalls/__getpid.S | 4 +--- libc/arch-mips64/syscalls/__getpriority.S | 4 +--- libc/arch-mips64/syscalls/__ioctl.S | 4 +--- libc/arch-mips64/syscalls/__openat.S | 4 +--- libc/arch-mips64/syscalls/__ppoll.S | 4 +--- libc/arch-mips64/syscalls/__pselect6.S | 4 +--- libc/arch-mips64/syscalls/__ptrace.S | 4 +--- libc/arch-mips64/syscalls/__reboot.S | 4 +--- libc/arch-mips64/syscalls/__rt_sigaction.S | 4 +--- libc/arch-mips64/syscalls/__rt_sigpending.S | 4 +--- libc/arch-mips64/syscalls/__rt_sigprocmask.S | 4 +--- libc/arch-mips64/syscalls/__rt_sigsuspend.S | 4 +--- libc/arch-mips64/syscalls/__rt_sigtimedwait.S | 4 +--- .../arch-mips64/syscalls/__sched_getaffinity.S | 4 +--- libc/arch-mips64/syscalls/__set_tid_address.S | 4 +--- libc/arch-mips64/syscalls/__set_tls.S | 4 +--- libc/arch-mips64/syscalls/__signalfd4.S | 4 +--- libc/arch-mips64/syscalls/__socket.S | 4 +--- libc/arch-mips64/syscalls/__timer_create.S | 4 +--- libc/arch-mips64/syscalls/__timer_delete.S | 4 +--- libc/arch-mips64/syscalls/__timer_getoverrun.S | 4 +--- libc/arch-mips64/syscalls/__timer_gettime.S | 4 +--- libc/arch-mips64/syscalls/__timer_settime.S | 4 +--- libc/arch-mips64/syscalls/__waitid.S | 4 +--- libc/arch-mips64/syscalls/_exit.S | 4 +--- libc/arch-mips64/syscalls/_flush_cache.S | 4 +--- libc/arch-mips64/syscalls/acct.S | 4 +--- libc/arch-mips64/syscalls/bind.S | 4 +--- libc/arch-mips64/syscalls/capget.S | 4 +--- libc/arch-mips64/syscalls/capset.S | 4 +--- libc/arch-mips64/syscalls/chdir.S | 4 +--- libc/arch-mips64/syscalls/chroot.S | 4 +--- libc/arch-mips64/syscalls/clock_getres.S | 4 +--- libc/arch-mips64/syscalls/clock_gettime.S | 4 +--- libc/arch-mips64/syscalls/clock_nanosleep.S | 4 +--- libc/arch-mips64/syscalls/clock_settime.S | 4 +--- libc/arch-mips64/syscalls/close.S | 4 +--- libc/arch-mips64/syscalls/delete_module.S | 4 +--- libc/arch-mips64/syscalls/dup.S | 4 +--- libc/arch-mips64/syscalls/dup3.S | 4 +--- libc/arch-mips64/syscalls/epoll_create1.S | 4 +--- libc/arch-mips64/syscalls/epoll_ctl.S | 4 +--- libc/arch-mips64/syscalls/eventfd.S | 4 +--- libc/arch-mips64/syscalls/execve.S | 4 +--- libc/arch-mips64/syscalls/faccessat.S | 4 +--- libc/arch-mips64/syscalls/fallocate.S | 4 +--- libc/arch-mips64/syscalls/fchdir.S | 4 +--- libc/arch-mips64/syscalls/fchmod.S | 4 +--- libc/arch-mips64/syscalls/fchmodat.S | 4 +--- libc/arch-mips64/syscalls/fchown.S | 4 +--- libc/arch-mips64/syscalls/fchownat.S | 4 +--- libc/arch-mips64/syscalls/fcntl.S | 4 +--- libc/arch-mips64/syscalls/fdatasync.S | 4 +--- libc/arch-mips64/syscalls/fgetxattr.S | 4 +--- libc/arch-mips64/syscalls/flistxattr.S | 4 +--- libc/arch-mips64/syscalls/flock.S | 4 +--- libc/arch-mips64/syscalls/fremovexattr.S | 4 +--- libc/arch-mips64/syscalls/fsetxattr.S | 4 +--- libc/arch-mips64/syscalls/fstat64.S | 4 +--- libc/arch-mips64/syscalls/fstatat64.S | 4 +--- libc/arch-mips64/syscalls/fstatfs64.S | 4 +--- libc/arch-mips64/syscalls/fsync.S | 4 +--- libc/arch-mips64/syscalls/ftruncate.S | 4 +--- libc/arch-mips64/syscalls/getegid.S | 4 +--- libc/arch-mips64/syscalls/geteuid.S | 4 +--- libc/arch-mips64/syscalls/getgid.S | 4 +--- libc/arch-mips64/syscalls/getgroups.S | 4 +--- libc/arch-mips64/syscalls/getitimer.S | 4 +--- libc/arch-mips64/syscalls/getpeername.S | 4 +--- libc/arch-mips64/syscalls/getpgid.S | 4 +--- libc/arch-mips64/syscalls/getppid.S | 4 +--- libc/arch-mips64/syscalls/getresgid.S | 4 +--- libc/arch-mips64/syscalls/getresuid.S | 4 +--- libc/arch-mips64/syscalls/getrlimit.S | 4 +--- libc/arch-mips64/syscalls/getrusage.S | 4 +--- libc/arch-mips64/syscalls/getsid.S | 4 +--- libc/arch-mips64/syscalls/getsockname.S | 4 +--- libc/arch-mips64/syscalls/getsockopt.S | 4 +--- libc/arch-mips64/syscalls/gettimeofday.S | 4 +--- libc/arch-mips64/syscalls/getuid.S | 4 +--- libc/arch-mips64/syscalls/getxattr.S | 4 +--- libc/arch-mips64/syscalls/init_module.S | 4 +--- libc/arch-mips64/syscalls/inotify_add_watch.S | 4 +--- libc/arch-mips64/syscalls/inotify_init1.S | 4 +--- libc/arch-mips64/syscalls/inotify_rm_watch.S | 4 +--- libc/arch-mips64/syscalls/kill.S | 4 +--- libc/arch-mips64/syscalls/klogctl.S | 4 +--- libc/arch-mips64/syscalls/lgetxattr.S | 4 +--- libc/arch-mips64/syscalls/linkat.S | 4 +--- libc/arch-mips64/syscalls/listen.S | 4 +--- libc/arch-mips64/syscalls/listxattr.S | 4 +--- libc/arch-mips64/syscalls/llistxattr.S | 4 +--- libc/arch-mips64/syscalls/lremovexattr.S | 4 +--- libc/arch-mips64/syscalls/lseek.S | 4 +--- libc/arch-mips64/syscalls/lsetxattr.S | 4 +--- libc/arch-mips64/syscalls/madvise.S | 4 +--- libc/arch-mips64/syscalls/mincore.S | 4 +--- libc/arch-mips64/syscalls/mkdirat.S | 4 +--- libc/arch-mips64/syscalls/mknodat.S | 4 +--- libc/arch-mips64/syscalls/mlock.S | 4 +--- libc/arch-mips64/syscalls/mlockall.S | 4 +--- libc/arch-mips64/syscalls/mmap.S | 4 +--- libc/arch-mips64/syscalls/mount.S | 4 +--- libc/arch-mips64/syscalls/mprotect.S | 4 +--- libc/arch-mips64/syscalls/mremap.S | 4 +--- libc/arch-mips64/syscalls/msync.S | 4 +--- libc/arch-mips64/syscalls/munlock.S | 4 +--- libc/arch-mips64/syscalls/munlockall.S | 4 +--- libc/arch-mips64/syscalls/munmap.S | 4 +--- libc/arch-mips64/syscalls/nanosleep.S | 4 +--- libc/arch-mips64/syscalls/personality.S | 4 +--- libc/arch-mips64/syscalls/pipe2.S | 4 +--- libc/arch-mips64/syscalls/prctl.S | 4 +--- libc/arch-mips64/syscalls/pread64.S | 4 +--- libc/arch-mips64/syscalls/prlimit64.S | 4 +--- libc/arch-mips64/syscalls/pwrite64.S | 4 +--- libc/arch-mips64/syscalls/read.S | 4 +--- libc/arch-mips64/syscalls/readahead.S | 4 +--- libc/arch-mips64/syscalls/readlinkat.S | 4 +--- libc/arch-mips64/syscalls/readv.S | 4 +--- libc/arch-mips64/syscalls/recvfrom.S | 4 +--- libc/arch-mips64/syscalls/recvmmsg.S | 4 +--- libc/arch-mips64/syscalls/recvmsg.S | 4 +--- libc/arch-mips64/syscalls/removexattr.S | 4 +--- libc/arch-mips64/syscalls/renameat.S | 4 +--- .../syscalls/sched_get_priority_max.S | 4 +--- .../syscalls/sched_get_priority_min.S | 4 +--- libc/arch-mips64/syscalls/sched_getparam.S | 4 +--- libc/arch-mips64/syscalls/sched_getscheduler.S | 4 +--- .../syscalls/sched_rr_get_interval.S | 4 +--- libc/arch-mips64/syscalls/sched_setaffinity.S | 4 +--- libc/arch-mips64/syscalls/sched_setparam.S | 4 +--- libc/arch-mips64/syscalls/sched_setscheduler.S | 4 +--- libc/arch-mips64/syscalls/sched_yield.S | 4 +--- libc/arch-mips64/syscalls/sendfile.S | 4 +--- libc/arch-mips64/syscalls/sendmmsg.S | 4 +--- libc/arch-mips64/syscalls/sendmsg.S | 4 +--- libc/arch-mips64/syscalls/sendto.S | 4 +--- libc/arch-mips64/syscalls/setfsgid.S | 4 +--- libc/arch-mips64/syscalls/setfsuid.S | 4 +--- libc/arch-mips64/syscalls/setgid.S | 4 +--- libc/arch-mips64/syscalls/setgroups.S | 4 +--- libc/arch-mips64/syscalls/setitimer.S | 4 +--- libc/arch-mips64/syscalls/setns.S | 4 +--- libc/arch-mips64/syscalls/setpgid.S | 4 +--- libc/arch-mips64/syscalls/setpriority.S | 4 +--- libc/arch-mips64/syscalls/setregid.S | 4 +--- libc/arch-mips64/syscalls/setresgid.S | 4 +--- libc/arch-mips64/syscalls/setresuid.S | 4 +--- libc/arch-mips64/syscalls/setreuid.S | 4 +--- libc/arch-mips64/syscalls/setrlimit.S | 4 +--- libc/arch-mips64/syscalls/setsid.S | 4 +--- libc/arch-mips64/syscalls/setsockopt.S | 4 +--- libc/arch-mips64/syscalls/settimeofday.S | 4 +--- libc/arch-mips64/syscalls/setuid.S | 4 +--- libc/arch-mips64/syscalls/setxattr.S | 4 +--- libc/arch-mips64/syscalls/shutdown.S | 4 +--- libc/arch-mips64/syscalls/sigaltstack.S | 4 +--- libc/arch-mips64/syscalls/socketpair.S | 4 +--- libc/arch-mips64/syscalls/splice.S | 4 +--- libc/arch-mips64/syscalls/statfs64.S | 4 +--- libc/arch-mips64/syscalls/swapoff.S | 4 +--- libc/arch-mips64/syscalls/swapon.S | 4 +--- libc/arch-mips64/syscalls/symlinkat.S | 4 +--- libc/arch-mips64/syscalls/sync.S | 4 +--- libc/arch-mips64/syscalls/sysinfo.S | 4 +--- libc/arch-mips64/syscalls/tee.S | 4 +--- libc/arch-mips64/syscalls/tgkill.S | 4 +--- libc/arch-mips64/syscalls/timerfd_create.S | 4 +--- libc/arch-mips64/syscalls/timerfd_gettime.S | 4 +--- libc/arch-mips64/syscalls/timerfd_settime.S | 4 +--- libc/arch-mips64/syscalls/times.S | 4 +--- libc/arch-mips64/syscalls/truncate.S | 4 +--- libc/arch-mips64/syscalls/umask.S | 4 +--- libc/arch-mips64/syscalls/umount2.S | 4 +--- libc/arch-mips64/syscalls/uname.S | 4 +--- libc/arch-mips64/syscalls/unlinkat.S | 4 +--- libc/arch-mips64/syscalls/unshare.S | 4 +--- libc/arch-mips64/syscalls/utimensat.S | 4 +--- libc/arch-mips64/syscalls/vmsplice.S | 4 +--- libc/arch-mips64/syscalls/wait4.S | 4 +--- libc/arch-mips64/syscalls/write.S | 4 +--- libc/arch-mips64/syscalls/writev.S | 4 +--- libc/arch-x86/bionic/__bionic_clone.S | 2 +- libc/arch-x86/bionic/syscall.S | 2 +- libc/arch-x86/bionic/vfork.S | 2 +- libc/arch-x86/syscalls/__accept4.S | 4 +--- libc/arch-x86/syscalls/__brk.S | 4 +--- libc/arch-x86/syscalls/__connect.S | 4 +--- libc/arch-x86/syscalls/__epoll_pwait.S | 4 +--- libc/arch-x86/syscalls/__exit.S | 4 +--- libc/arch-x86/syscalls/__fcntl64.S | 4 +--- libc/arch-x86/syscalls/__fstatfs64.S | 4 +--- libc/arch-x86/syscalls/__getcpu.S | 4 +--- libc/arch-x86/syscalls/__getcwd.S | 4 +--- libc/arch-x86/syscalls/__getdents64.S | 4 +--- libc/arch-x86/syscalls/__getpid.S | 4 +--- libc/arch-x86/syscalls/__getpriority.S | 4 +--- libc/arch-x86/syscalls/__ioctl.S | 4 +--- libc/arch-x86/syscalls/__llseek.S | 4 +--- libc/arch-x86/syscalls/__mmap2.S | 4 +--- libc/arch-x86/syscalls/__openat.S | 4 +--- libc/arch-x86/syscalls/__ppoll.S | 4 +--- libc/arch-x86/syscalls/__pselect6.S | 4 +--- libc/arch-x86/syscalls/__ptrace.S | 4 +--- libc/arch-x86/syscalls/__reboot.S | 4 +--- libc/arch-x86/syscalls/__rt_sigaction.S | 4 +--- libc/arch-x86/syscalls/__rt_sigpending.S | 4 +--- libc/arch-x86/syscalls/__rt_sigprocmask.S | 4 +--- libc/arch-x86/syscalls/__rt_sigsuspend.S | 4 +--- libc/arch-x86/syscalls/__rt_sigtimedwait.S | 4 +--- libc/arch-x86/syscalls/__sched_getaffinity.S | 4 +--- libc/arch-x86/syscalls/__set_thread_area.S | 4 +--- libc/arch-x86/syscalls/__set_tid_address.S | 4 +--- libc/arch-x86/syscalls/__sigaction.S | 4 +--- libc/arch-x86/syscalls/__signalfd4.S | 4 +--- libc/arch-x86/syscalls/__socket.S | 4 +--- libc/arch-x86/syscalls/__statfs64.S | 4 +--- libc/arch-x86/syscalls/__timer_create.S | 4 +--- libc/arch-x86/syscalls/__timer_delete.S | 4 +--- libc/arch-x86/syscalls/__timer_getoverrun.S | 4 +--- libc/arch-x86/syscalls/__timer_gettime.S | 4 +--- libc/arch-x86/syscalls/__timer_settime.S | 4 +--- libc/arch-x86/syscalls/__waitid.S | 4 +--- libc/arch-x86/syscalls/_exit.S | 4 +--- libc/arch-x86/syscalls/acct.S | 4 +--- libc/arch-x86/syscalls/bind.S | 4 +--- libc/arch-x86/syscalls/capget.S | 4 +--- libc/arch-x86/syscalls/capset.S | 4 +--- libc/arch-x86/syscalls/chdir.S | 4 +--- libc/arch-x86/syscalls/chroot.S | 4 +--- libc/arch-x86/syscalls/clock_getres.S | 4 +--- libc/arch-x86/syscalls/clock_gettime.S | 4 +--- libc/arch-x86/syscalls/clock_nanosleep.S | 4 +--- libc/arch-x86/syscalls/clock_settime.S | 4 +--- libc/arch-x86/syscalls/close.S | 4 +--- libc/arch-x86/syscalls/delete_module.S | 4 +--- libc/arch-x86/syscalls/dup.S | 4 +--- libc/arch-x86/syscalls/dup3.S | 4 +--- libc/arch-x86/syscalls/epoll_create1.S | 4 +--- libc/arch-x86/syscalls/epoll_ctl.S | 4 +--- libc/arch-x86/syscalls/eventfd.S | 4 +--- libc/arch-x86/syscalls/execve.S | 4 +--- libc/arch-x86/syscalls/faccessat.S | 4 +--- libc/arch-x86/syscalls/fallocate64.S | 4 +--- libc/arch-x86/syscalls/fchdir.S | 4 +--- libc/arch-x86/syscalls/fchmod.S | 4 +--- libc/arch-x86/syscalls/fchmodat.S | 4 +--- libc/arch-x86/syscalls/fchown.S | 4 +--- libc/arch-x86/syscalls/fchownat.S | 4 +--- libc/arch-x86/syscalls/fdatasync.S | 4 +--- libc/arch-x86/syscalls/fgetxattr.S | 4 +--- libc/arch-x86/syscalls/flistxattr.S | 4 +--- libc/arch-x86/syscalls/flock.S | 4 +--- libc/arch-x86/syscalls/fremovexattr.S | 4 +--- libc/arch-x86/syscalls/fsetxattr.S | 4 +--- libc/arch-x86/syscalls/fstat64.S | 4 +--- libc/arch-x86/syscalls/fstatat64.S | 4 +--- libc/arch-x86/syscalls/fsync.S | 4 +--- libc/arch-x86/syscalls/ftruncate.S | 4 +--- libc/arch-x86/syscalls/ftruncate64.S | 4 +--- libc/arch-x86/syscalls/getegid.S | 4 +--- libc/arch-x86/syscalls/geteuid.S | 4 +--- libc/arch-x86/syscalls/getgid.S | 4 +--- libc/arch-x86/syscalls/getgroups.S | 4 +--- libc/arch-x86/syscalls/getitimer.S | 4 +--- libc/arch-x86/syscalls/getpeername.S | 4 +--- libc/arch-x86/syscalls/getpgid.S | 4 +--- libc/arch-x86/syscalls/getppid.S | 4 +--- libc/arch-x86/syscalls/getresgid.S | 4 +--- libc/arch-x86/syscalls/getresuid.S | 4 +--- libc/arch-x86/syscalls/getrlimit.S | 4 +--- libc/arch-x86/syscalls/getrusage.S | 4 +--- libc/arch-x86/syscalls/getsid.S | 4 +--- libc/arch-x86/syscalls/getsockname.S | 4 +--- libc/arch-x86/syscalls/getsockopt.S | 4 +--- libc/arch-x86/syscalls/gettimeofday.S | 4 +--- libc/arch-x86/syscalls/getuid.S | 4 +--- libc/arch-x86/syscalls/getxattr.S | 4 +--- libc/arch-x86/syscalls/init_module.S | 4 +--- libc/arch-x86/syscalls/inotify_add_watch.S | 4 +--- libc/arch-x86/syscalls/inotify_init1.S | 4 +--- libc/arch-x86/syscalls/inotify_rm_watch.S | 4 +--- libc/arch-x86/syscalls/kill.S | 4 +--- libc/arch-x86/syscalls/klogctl.S | 4 +--- libc/arch-x86/syscalls/lgetxattr.S | 4 +--- libc/arch-x86/syscalls/linkat.S | 4 +--- libc/arch-x86/syscalls/listen.S | 4 +--- libc/arch-x86/syscalls/listxattr.S | 4 +--- libc/arch-x86/syscalls/llistxattr.S | 4 +--- libc/arch-x86/syscalls/lremovexattr.S | 4 +--- libc/arch-x86/syscalls/lseek.S | 4 +--- libc/arch-x86/syscalls/lsetxattr.S | 4 +--- libc/arch-x86/syscalls/madvise.S | 4 +--- libc/arch-x86/syscalls/mincore.S | 4 +--- libc/arch-x86/syscalls/mkdirat.S | 4 +--- libc/arch-x86/syscalls/mknodat.S | 4 +--- libc/arch-x86/syscalls/mlock.S | 4 +--- libc/arch-x86/syscalls/mlockall.S | 4 +--- libc/arch-x86/syscalls/mount.S | 4 +--- libc/arch-x86/syscalls/mprotect.S | 4 +--- libc/arch-x86/syscalls/mremap.S | 4 +--- libc/arch-x86/syscalls/msync.S | 4 +--- libc/arch-x86/syscalls/munlock.S | 4 +--- libc/arch-x86/syscalls/munlockall.S | 4 +--- libc/arch-x86/syscalls/munmap.S | 4 +--- libc/arch-x86/syscalls/nanosleep.S | 4 +--- libc/arch-x86/syscalls/personality.S | 4 +--- libc/arch-x86/syscalls/pipe2.S | 4 +--- libc/arch-x86/syscalls/prctl.S | 4 +--- libc/arch-x86/syscalls/pread64.S | 4 +--- libc/arch-x86/syscalls/prlimit64.S | 4 +--- libc/arch-x86/syscalls/pwrite64.S | 4 +--- libc/arch-x86/syscalls/read.S | 4 +--- libc/arch-x86/syscalls/readahead.S | 4 +--- libc/arch-x86/syscalls/readlinkat.S | 4 +--- libc/arch-x86/syscalls/readv.S | 4 +--- libc/arch-x86/syscalls/recvfrom.S | 4 +--- libc/arch-x86/syscalls/recvmmsg.S | 4 +--- libc/arch-x86/syscalls/recvmsg.S | 4 +--- libc/arch-x86/syscalls/removexattr.S | 4 +--- libc/arch-x86/syscalls/renameat.S | 4 +--- .../arch-x86/syscalls/sched_get_priority_max.S | 4 +--- .../arch-x86/syscalls/sched_get_priority_min.S | 4 +--- libc/arch-x86/syscalls/sched_getparam.S | 4 +--- libc/arch-x86/syscalls/sched_getscheduler.S | 4 +--- libc/arch-x86/syscalls/sched_rr_get_interval.S | 4 +--- libc/arch-x86/syscalls/sched_setaffinity.S | 4 +--- libc/arch-x86/syscalls/sched_setparam.S | 4 +--- libc/arch-x86/syscalls/sched_setscheduler.S | 4 +--- libc/arch-x86/syscalls/sched_yield.S | 4 +--- libc/arch-x86/syscalls/sendfile.S | 4 +--- libc/arch-x86/syscalls/sendfile64.S | 4 +--- libc/arch-x86/syscalls/sendmmsg.S | 4 +--- libc/arch-x86/syscalls/sendmsg.S | 4 +--- libc/arch-x86/syscalls/sendto.S | 4 +--- libc/arch-x86/syscalls/setfsgid.S | 4 +--- libc/arch-x86/syscalls/setfsuid.S | 4 +--- libc/arch-x86/syscalls/setgid.S | 4 +--- libc/arch-x86/syscalls/setgroups.S | 4 +--- libc/arch-x86/syscalls/setitimer.S | 4 +--- libc/arch-x86/syscalls/setns.S | 4 +--- libc/arch-x86/syscalls/setpgid.S | 4 +--- libc/arch-x86/syscalls/setpriority.S | 4 +--- libc/arch-x86/syscalls/setregid.S | 4 +--- libc/arch-x86/syscalls/setresgid.S | 4 +--- libc/arch-x86/syscalls/setresuid.S | 4 +--- libc/arch-x86/syscalls/setreuid.S | 4 +--- libc/arch-x86/syscalls/setrlimit.S | 4 +--- libc/arch-x86/syscalls/setsid.S | 4 +--- libc/arch-x86/syscalls/setsockopt.S | 4 +--- libc/arch-x86/syscalls/settimeofday.S | 4 +--- libc/arch-x86/syscalls/setuid.S | 4 +--- libc/arch-x86/syscalls/setxattr.S | 4 +--- libc/arch-x86/syscalls/shutdown.S | 4 +--- libc/arch-x86/syscalls/sigaltstack.S | 4 +--- libc/arch-x86/syscalls/socketpair.S | 4 +--- libc/arch-x86/syscalls/splice.S | 4 +--- libc/arch-x86/syscalls/swapoff.S | 4 +--- libc/arch-x86/syscalls/swapon.S | 4 +--- libc/arch-x86/syscalls/symlinkat.S | 4 +--- libc/arch-x86/syscalls/sync.S | 4 +--- libc/arch-x86/syscalls/sysinfo.S | 4 +--- libc/arch-x86/syscalls/tee.S | 4 +--- libc/arch-x86/syscalls/tgkill.S | 4 +--- libc/arch-x86/syscalls/timerfd_create.S | 4 +--- libc/arch-x86/syscalls/timerfd_gettime.S | 4 +--- libc/arch-x86/syscalls/timerfd_settime.S | 4 +--- libc/arch-x86/syscalls/times.S | 4 +--- libc/arch-x86/syscalls/truncate.S | 4 +--- libc/arch-x86/syscalls/truncate64.S | 4 +--- libc/arch-x86/syscalls/umask.S | 4 +--- libc/arch-x86/syscalls/umount2.S | 4 +--- libc/arch-x86/syscalls/uname.S | 4 +--- libc/arch-x86/syscalls/unlinkat.S | 4 +--- libc/arch-x86/syscalls/unshare.S | 4 +--- libc/arch-x86/syscalls/utimensat.S | 4 +--- libc/arch-x86/syscalls/vmsplice.S | 4 +--- libc/arch-x86/syscalls/wait4.S | 4 +--- libc/arch-x86/syscalls/write.S | 4 +--- libc/arch-x86/syscalls/writev.S | 4 +--- libc/arch-x86_64/bionic/__bionic_clone.S | 2 +- libc/arch-x86_64/bionic/syscall.S | 2 +- libc/arch-x86_64/bionic/vfork.S | 2 +- libc/arch-x86_64/syscalls/__accept4.S | 4 +--- libc/arch-x86_64/syscalls/__arch_prctl.S | 4 +--- libc/arch-x86_64/syscalls/__brk.S | 4 +--- libc/arch-x86_64/syscalls/__clock_gettime.S | 4 +--- libc/arch-x86_64/syscalls/__connect.S | 4 +--- libc/arch-x86_64/syscalls/__epoll_pwait.S | 4 +--- libc/arch-x86_64/syscalls/__exit.S | 4 +--- libc/arch-x86_64/syscalls/__getcpu.S | 4 +--- libc/arch-x86_64/syscalls/__getcwd.S | 4 +--- libc/arch-x86_64/syscalls/__getdents64.S | 4 +--- libc/arch-x86_64/syscalls/__getpid.S | 4 +--- libc/arch-x86_64/syscalls/__getpriority.S | 4 +--- libc/arch-x86_64/syscalls/__gettimeofday.S | 4 +--- libc/arch-x86_64/syscalls/__ioctl.S | 4 +--- libc/arch-x86_64/syscalls/__openat.S | 4 +--- libc/arch-x86_64/syscalls/__ppoll.S | 4 +--- libc/arch-x86_64/syscalls/__pselect6.S | 4 +--- libc/arch-x86_64/syscalls/__ptrace.S | 4 +--- libc/arch-x86_64/syscalls/__reboot.S | 4 +--- libc/arch-x86_64/syscalls/__rt_sigaction.S | 4 +--- libc/arch-x86_64/syscalls/__rt_sigpending.S | 4 +--- libc/arch-x86_64/syscalls/__rt_sigprocmask.S | 4 +--- libc/arch-x86_64/syscalls/__rt_sigsuspend.S | 4 +--- libc/arch-x86_64/syscalls/__rt_sigtimedwait.S | 4 +--- .../arch-x86_64/syscalls/__sched_getaffinity.S | 4 +--- libc/arch-x86_64/syscalls/__set_tid_address.S | 4 +--- libc/arch-x86_64/syscalls/__signalfd4.S | 4 +--- libc/arch-x86_64/syscalls/__socket.S | 4 +--- libc/arch-x86_64/syscalls/__timer_create.S | 4 +--- libc/arch-x86_64/syscalls/__timer_delete.S | 4 +--- libc/arch-x86_64/syscalls/__timer_getoverrun.S | 4 +--- libc/arch-x86_64/syscalls/__timer_gettime.S | 4 +--- libc/arch-x86_64/syscalls/__timer_settime.S | 4 +--- libc/arch-x86_64/syscalls/__waitid.S | 4 +--- libc/arch-x86_64/syscalls/_exit.S | 4 +--- libc/arch-x86_64/syscalls/acct.S | 4 +--- libc/arch-x86_64/syscalls/bind.S | 4 +--- libc/arch-x86_64/syscalls/capget.S | 4 +--- libc/arch-x86_64/syscalls/capset.S | 4 +--- libc/arch-x86_64/syscalls/chdir.S | 4 +--- libc/arch-x86_64/syscalls/chroot.S | 4 +--- libc/arch-x86_64/syscalls/clock_getres.S | 4 +--- libc/arch-x86_64/syscalls/clock_nanosleep.S | 4 +--- libc/arch-x86_64/syscalls/clock_settime.S | 4 +--- libc/arch-x86_64/syscalls/close.S | 4 +--- libc/arch-x86_64/syscalls/delete_module.S | 4 +--- libc/arch-x86_64/syscalls/dup.S | 4 +--- libc/arch-x86_64/syscalls/dup3.S | 4 +--- libc/arch-x86_64/syscalls/epoll_create1.S | 4 +--- libc/arch-x86_64/syscalls/epoll_ctl.S | 4 +--- libc/arch-x86_64/syscalls/eventfd.S | 4 +--- libc/arch-x86_64/syscalls/execve.S | 4 +--- libc/arch-x86_64/syscalls/faccessat.S | 4 +--- libc/arch-x86_64/syscalls/fallocate.S | 4 +--- libc/arch-x86_64/syscalls/fchdir.S | 4 +--- libc/arch-x86_64/syscalls/fchmod.S | 4 +--- libc/arch-x86_64/syscalls/fchmodat.S | 4 +--- libc/arch-x86_64/syscalls/fchown.S | 4 +--- libc/arch-x86_64/syscalls/fchownat.S | 4 +--- libc/arch-x86_64/syscalls/fcntl.S | 4 +--- libc/arch-x86_64/syscalls/fdatasync.S | 4 +--- libc/arch-x86_64/syscalls/fgetxattr.S | 4 +--- libc/arch-x86_64/syscalls/flistxattr.S | 4 +--- libc/arch-x86_64/syscalls/flock.S | 4 +--- libc/arch-x86_64/syscalls/fremovexattr.S | 4 +--- libc/arch-x86_64/syscalls/fsetxattr.S | 4 +--- libc/arch-x86_64/syscalls/fstat64.S | 4 +--- libc/arch-x86_64/syscalls/fstatat64.S | 4 +--- libc/arch-x86_64/syscalls/fstatfs64.S | 4 +--- libc/arch-x86_64/syscalls/fsync.S | 4 +--- libc/arch-x86_64/syscalls/ftruncate.S | 4 +--- libc/arch-x86_64/syscalls/getegid.S | 4 +--- libc/arch-x86_64/syscalls/geteuid.S | 4 +--- libc/arch-x86_64/syscalls/getgid.S | 4 +--- libc/arch-x86_64/syscalls/getgroups.S | 4 +--- libc/arch-x86_64/syscalls/getitimer.S | 4 +--- libc/arch-x86_64/syscalls/getpeername.S | 4 +--- libc/arch-x86_64/syscalls/getpgid.S | 4 +--- libc/arch-x86_64/syscalls/getppid.S | 4 +--- libc/arch-x86_64/syscalls/getresgid.S | 4 +--- libc/arch-x86_64/syscalls/getresuid.S | 4 +--- libc/arch-x86_64/syscalls/getrlimit.S | 4 +--- libc/arch-x86_64/syscalls/getrusage.S | 4 +--- libc/arch-x86_64/syscalls/getsid.S | 4 +--- libc/arch-x86_64/syscalls/getsockname.S | 4 +--- libc/arch-x86_64/syscalls/getsockopt.S | 4 +--- libc/arch-x86_64/syscalls/getuid.S | 4 +--- libc/arch-x86_64/syscalls/getxattr.S | 4 +--- libc/arch-x86_64/syscalls/init_module.S | 4 +--- libc/arch-x86_64/syscalls/inotify_add_watch.S | 4 +--- libc/arch-x86_64/syscalls/inotify_init1.S | 4 +--- libc/arch-x86_64/syscalls/inotify_rm_watch.S | 4 +--- libc/arch-x86_64/syscalls/kill.S | 4 +--- libc/arch-x86_64/syscalls/klogctl.S | 4 +--- libc/arch-x86_64/syscalls/lgetxattr.S | 4 +--- libc/arch-x86_64/syscalls/linkat.S | 4 +--- libc/arch-x86_64/syscalls/listen.S | 4 +--- libc/arch-x86_64/syscalls/listxattr.S | 4 +--- libc/arch-x86_64/syscalls/llistxattr.S | 4 +--- libc/arch-x86_64/syscalls/lremovexattr.S | 4 +--- libc/arch-x86_64/syscalls/lseek.S | 4 +--- libc/arch-x86_64/syscalls/lsetxattr.S | 4 +--- libc/arch-x86_64/syscalls/madvise.S | 4 +--- libc/arch-x86_64/syscalls/mincore.S | 4 +--- libc/arch-x86_64/syscalls/mkdirat.S | 4 +--- libc/arch-x86_64/syscalls/mknodat.S | 4 +--- libc/arch-x86_64/syscalls/mlock.S | 4 +--- libc/arch-x86_64/syscalls/mlockall.S | 4 +--- libc/arch-x86_64/syscalls/mmap.S | 4 +--- libc/arch-x86_64/syscalls/mount.S | 4 +--- libc/arch-x86_64/syscalls/mprotect.S | 4 +--- libc/arch-x86_64/syscalls/mremap.S | 4 +--- libc/arch-x86_64/syscalls/msync.S | 4 +--- libc/arch-x86_64/syscalls/munlock.S | 4 +--- libc/arch-x86_64/syscalls/munlockall.S | 4 +--- libc/arch-x86_64/syscalls/munmap.S | 4 +--- libc/arch-x86_64/syscalls/nanosleep.S | 4 +--- libc/arch-x86_64/syscalls/personality.S | 4 +--- libc/arch-x86_64/syscalls/pipe2.S | 4 +--- libc/arch-x86_64/syscalls/prctl.S | 4 +--- libc/arch-x86_64/syscalls/pread64.S | 4 +--- libc/arch-x86_64/syscalls/prlimit64.S | 4 +--- libc/arch-x86_64/syscalls/pwrite64.S | 4 +--- libc/arch-x86_64/syscalls/read.S | 4 +--- libc/arch-x86_64/syscalls/readahead.S | 4 +--- libc/arch-x86_64/syscalls/readlinkat.S | 4 +--- libc/arch-x86_64/syscalls/readv.S | 4 +--- libc/arch-x86_64/syscalls/recvfrom.S | 4 +--- libc/arch-x86_64/syscalls/recvmmsg.S | 4 +--- libc/arch-x86_64/syscalls/recvmsg.S | 4 +--- libc/arch-x86_64/syscalls/removexattr.S | 4 +--- libc/arch-x86_64/syscalls/renameat.S | 4 +--- .../syscalls/sched_get_priority_max.S | 4 +--- .../syscalls/sched_get_priority_min.S | 4 +--- libc/arch-x86_64/syscalls/sched_getparam.S | 4 +--- libc/arch-x86_64/syscalls/sched_getscheduler.S | 4 +--- .../syscalls/sched_rr_get_interval.S | 4 +--- libc/arch-x86_64/syscalls/sched_setaffinity.S | 4 +--- libc/arch-x86_64/syscalls/sched_setparam.S | 4 +--- libc/arch-x86_64/syscalls/sched_setscheduler.S | 4 +--- libc/arch-x86_64/syscalls/sched_yield.S | 4 +--- libc/arch-x86_64/syscalls/sendfile.S | 4 +--- libc/arch-x86_64/syscalls/sendmmsg.S | 4 +--- libc/arch-x86_64/syscalls/sendmsg.S | 4 +--- libc/arch-x86_64/syscalls/sendto.S | 4 +--- libc/arch-x86_64/syscalls/setfsgid.S | 4 +--- libc/arch-x86_64/syscalls/setfsuid.S | 4 +--- libc/arch-x86_64/syscalls/setgid.S | 4 +--- libc/arch-x86_64/syscalls/setgroups.S | 4 +--- libc/arch-x86_64/syscalls/setitimer.S | 4 +--- libc/arch-x86_64/syscalls/setns.S | 4 +--- libc/arch-x86_64/syscalls/setpgid.S | 4 +--- libc/arch-x86_64/syscalls/setpriority.S | 4 +--- libc/arch-x86_64/syscalls/setregid.S | 4 +--- libc/arch-x86_64/syscalls/setresgid.S | 4 +--- libc/arch-x86_64/syscalls/setresuid.S | 4 +--- libc/arch-x86_64/syscalls/setreuid.S | 4 +--- libc/arch-x86_64/syscalls/setrlimit.S | 4 +--- libc/arch-x86_64/syscalls/setsid.S | 4 +--- libc/arch-x86_64/syscalls/setsockopt.S | 4 +--- libc/arch-x86_64/syscalls/settimeofday.S | 4 +--- libc/arch-x86_64/syscalls/setuid.S | 4 +--- libc/arch-x86_64/syscalls/setxattr.S | 4 +--- libc/arch-x86_64/syscalls/shutdown.S | 4 +--- libc/arch-x86_64/syscalls/sigaltstack.S | 4 +--- libc/arch-x86_64/syscalls/socketpair.S | 4 +--- libc/arch-x86_64/syscalls/splice.S | 4 +--- libc/arch-x86_64/syscalls/statfs64.S | 4 +--- libc/arch-x86_64/syscalls/swapoff.S | 4 +--- libc/arch-x86_64/syscalls/swapon.S | 4 +--- libc/arch-x86_64/syscalls/symlinkat.S | 4 +--- libc/arch-x86_64/syscalls/sync.S | 4 +--- libc/arch-x86_64/syscalls/sysinfo.S | 4 +--- libc/arch-x86_64/syscalls/tee.S | 4 +--- libc/arch-x86_64/syscalls/tgkill.S | 4 +--- libc/arch-x86_64/syscalls/timerfd_create.S | 4 +--- libc/arch-x86_64/syscalls/timerfd_gettime.S | 4 +--- libc/arch-x86_64/syscalls/timerfd_settime.S | 4 +--- libc/arch-x86_64/syscalls/times.S | 4 +--- libc/arch-x86_64/syscalls/truncate.S | 4 +--- libc/arch-x86_64/syscalls/umask.S | 4 +--- libc/arch-x86_64/syscalls/umount2.S | 4 +--- libc/arch-x86_64/syscalls/uname.S | 4 +--- libc/arch-x86_64/syscalls/unlinkat.S | 4 +--- libc/arch-x86_64/syscalls/unshare.S | 4 +--- libc/arch-x86_64/syscalls/utimensat.S | 4 +--- libc/arch-x86_64/syscalls/vmsplice.S | 4 +--- libc/arch-x86_64/syscalls/wait4.S | 4 +--- libc/arch-x86_64/syscalls/write.S | 4 +--- libc/arch-x86_64/syscalls/writev.S | 4 +--- libc/bionic/__set_errno.cpp | 18 ++++++++++++------ libc/tools/gensyscalls.py | 16 +++++++--------- 1177 files changed, 1194 insertions(+), 3506 deletions(-) diff --git a/libc/arch-arm/bionic/__bionic_clone.S b/libc/arch-arm/bionic/__bionic_clone.S index 48f2f98a5..f5cf9e0e3 100644 --- a/libc/arch-arm/bionic/__bionic_clone.S +++ b/libc/arch-arm/bionic/__bionic_clone.S @@ -57,7 +57,7 @@ ENTRY(__bionic_clone) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal 1: # The child. # Setting lr to 0 will make the unwinder stop at __start_thread diff --git a/libc/arch-arm/bionic/syscall.S b/libc/arch-arm/bionic/syscall.S index 864771841..d0df37977 100644 --- a/libc/arch-arm/bionic/syscall.S +++ b/libc/arch-arm/bionic/syscall.S @@ -47,5 +47,5 @@ ENTRY(syscall) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(syscall) diff --git a/libc/arch-arm/syscalls/__accept4.S b/libc/arch-arm/syscalls/__accept4.S index 2b1eb285f..dca5699e0 100644 --- a/libc/arch-arm/syscalls/__accept4.S +++ b/libc/arch-arm/syscalls/__accept4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__accept4) mov ip, r7 ldr r7, =__NR_accept4 @@ -12,5 +10,5 @@ ENTRY(__accept4) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__accept4) diff --git a/libc/arch-arm/syscalls/__brk.S b/libc/arch-arm/syscalls/__brk.S index 0987f0e28..be304da43 100644 --- a/libc/arch-arm/syscalls/__brk.S +++ b/libc/arch-arm/syscalls/__brk.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__brk) mov ip, r7 ldr r7, =__NR_brk @@ -12,5 +10,5 @@ ENTRY(__brk) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__brk) diff --git a/libc/arch-arm/syscalls/__connect.S b/libc/arch-arm/syscalls/__connect.S index 510af9591..a2a997ebe 100644 --- a/libc/arch-arm/syscalls/__connect.S +++ b/libc/arch-arm/syscalls/__connect.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__connect) mov ip, r7 ldr r7, =__NR_connect @@ -12,5 +10,5 @@ ENTRY(__connect) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__connect) diff --git a/libc/arch-arm/syscalls/__epoll_pwait.S b/libc/arch-arm/syscalls/__epoll_pwait.S index bbba2e12a..3642ee38c 100644 --- a/libc/arch-arm/syscalls/__epoll_pwait.S +++ b/libc/arch-arm/syscalls/__epoll_pwait.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__epoll_pwait) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(__epoll_pwait) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__epoll_pwait) diff --git a/libc/arch-arm/syscalls/__exit.S b/libc/arch-arm/syscalls/__exit.S index ceef94ed4..6ebd5b36b 100644 --- a/libc/arch-arm/syscalls/__exit.S +++ b/libc/arch-arm/syscalls/__exit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__exit) mov ip, r7 ldr r7, =__NR_exit @@ -12,5 +10,5 @@ ENTRY(__exit) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__exit) diff --git a/libc/arch-arm/syscalls/__fcntl64.S b/libc/arch-arm/syscalls/__fcntl64.S index bb2068d11..229c5c605 100644 --- a/libc/arch-arm/syscalls/__fcntl64.S +++ b/libc/arch-arm/syscalls/__fcntl64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__fcntl64) mov ip, r7 ldr r7, =__NR_fcntl64 @@ -12,5 +10,5 @@ ENTRY(__fcntl64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__fcntl64) diff --git a/libc/arch-arm/syscalls/__fstatfs64.S b/libc/arch-arm/syscalls/__fstatfs64.S index b493aa047..9c0c439ec 100644 --- a/libc/arch-arm/syscalls/__fstatfs64.S +++ b/libc/arch-arm/syscalls/__fstatfs64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__fstatfs64) mov ip, r7 ldr r7, =__NR_fstatfs64 @@ -12,5 +10,5 @@ ENTRY(__fstatfs64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__fstatfs64) diff --git a/libc/arch-arm/syscalls/__getcpu.S b/libc/arch-arm/syscalls/__getcpu.S index 1b3fc4612..d523d8e68 100644 --- a/libc/arch-arm/syscalls/__getcpu.S +++ b/libc/arch-arm/syscalls/__getcpu.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getcpu) mov ip, r7 ldr r7, =__NR_getcpu @@ -12,5 +10,5 @@ ENTRY(__getcpu) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__getcpu) diff --git a/libc/arch-arm/syscalls/__getcwd.S b/libc/arch-arm/syscalls/__getcwd.S index d91b3ca19..4ff666732 100644 --- a/libc/arch-arm/syscalls/__getcwd.S +++ b/libc/arch-arm/syscalls/__getcwd.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getcwd) mov ip, r7 ldr r7, =__NR_getcwd @@ -12,5 +10,5 @@ ENTRY(__getcwd) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__getcwd) diff --git a/libc/arch-arm/syscalls/__getdents64.S b/libc/arch-arm/syscalls/__getdents64.S index 7d3d81c43..dac3bfc82 100644 --- a/libc/arch-arm/syscalls/__getdents64.S +++ b/libc/arch-arm/syscalls/__getdents64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getdents64) mov ip, r7 ldr r7, =__NR_getdents64 @@ -12,5 +10,5 @@ ENTRY(__getdents64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__getdents64) diff --git a/libc/arch-arm/syscalls/__getpid.S b/libc/arch-arm/syscalls/__getpid.S index ede0865bd..dbb192e74 100644 --- a/libc/arch-arm/syscalls/__getpid.S +++ b/libc/arch-arm/syscalls/__getpid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getpid) mov ip, r7 ldr r7, =__NR_getpid @@ -12,5 +10,5 @@ ENTRY(__getpid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__getpid) diff --git a/libc/arch-arm/syscalls/__getpriority.S b/libc/arch-arm/syscalls/__getpriority.S index d3a646885..e637d6fd4 100644 --- a/libc/arch-arm/syscalls/__getpriority.S +++ b/libc/arch-arm/syscalls/__getpriority.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getpriority) mov ip, r7 ldr r7, =__NR_getpriority @@ -12,5 +10,5 @@ ENTRY(__getpriority) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__getpriority) diff --git a/libc/arch-arm/syscalls/__ioctl.S b/libc/arch-arm/syscalls/__ioctl.S index b3ac82fac..fcd1157d4 100644 --- a/libc/arch-arm/syscalls/__ioctl.S +++ b/libc/arch-arm/syscalls/__ioctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ioctl) mov ip, r7 ldr r7, =__NR_ioctl @@ -12,5 +10,5 @@ ENTRY(__ioctl) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__ioctl) diff --git a/libc/arch-arm/syscalls/__llseek.S b/libc/arch-arm/syscalls/__llseek.S index b36164ca2..3cff31815 100644 --- a/libc/arch-arm/syscalls/__llseek.S +++ b/libc/arch-arm/syscalls/__llseek.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__llseek) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(__llseek) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__llseek) diff --git a/libc/arch-arm/syscalls/__mmap2.S b/libc/arch-arm/syscalls/__mmap2.S index ba7471699..f11e46795 100644 --- a/libc/arch-arm/syscalls/__mmap2.S +++ b/libc/arch-arm/syscalls/__mmap2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__mmap2) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(__mmap2) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__mmap2) diff --git a/libc/arch-arm/syscalls/__openat.S b/libc/arch-arm/syscalls/__openat.S index 6b119e162..9b774dbb9 100644 --- a/libc/arch-arm/syscalls/__openat.S +++ b/libc/arch-arm/syscalls/__openat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__openat) mov ip, r7 ldr r7, =__NR_openat @@ -12,5 +10,5 @@ ENTRY(__openat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__openat) diff --git a/libc/arch-arm/syscalls/__ppoll.S b/libc/arch-arm/syscalls/__ppoll.S index 3a0e80ceb..02de8a8bc 100644 --- a/libc/arch-arm/syscalls/__ppoll.S +++ b/libc/arch-arm/syscalls/__ppoll.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ppoll) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(__ppoll) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__ppoll) diff --git a/libc/arch-arm/syscalls/__pselect6.S b/libc/arch-arm/syscalls/__pselect6.S index 1417be879..8f31e1b7f 100644 --- a/libc/arch-arm/syscalls/__pselect6.S +++ b/libc/arch-arm/syscalls/__pselect6.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__pselect6) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(__pselect6) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__pselect6) diff --git a/libc/arch-arm/syscalls/__ptrace.S b/libc/arch-arm/syscalls/__ptrace.S index bc0323261..975ab0fd8 100644 --- a/libc/arch-arm/syscalls/__ptrace.S +++ b/libc/arch-arm/syscalls/__ptrace.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ptrace) mov ip, r7 ldr r7, =__NR_ptrace @@ -12,5 +10,5 @@ ENTRY(__ptrace) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__ptrace) diff --git a/libc/arch-arm/syscalls/__reboot.S b/libc/arch-arm/syscalls/__reboot.S index 91bbf7c4e..03f8c89c4 100644 --- a/libc/arch-arm/syscalls/__reboot.S +++ b/libc/arch-arm/syscalls/__reboot.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__reboot) mov ip, r7 ldr r7, =__NR_reboot @@ -12,5 +10,5 @@ ENTRY(__reboot) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__reboot) diff --git a/libc/arch-arm/syscalls/__rt_sigaction.S b/libc/arch-arm/syscalls/__rt_sigaction.S index 6a5e05864..2c210123d 100644 --- a/libc/arch-arm/syscalls/__rt_sigaction.S +++ b/libc/arch-arm/syscalls/__rt_sigaction.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigaction) mov ip, r7 ldr r7, =__NR_rt_sigaction @@ -12,5 +10,5 @@ ENTRY(__rt_sigaction) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__rt_sigaction) diff --git a/libc/arch-arm/syscalls/__rt_sigpending.S b/libc/arch-arm/syscalls/__rt_sigpending.S index 44da9b2d1..6a32e5025 100644 --- a/libc/arch-arm/syscalls/__rt_sigpending.S +++ b/libc/arch-arm/syscalls/__rt_sigpending.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigpending) mov ip, r7 ldr r7, =__NR_rt_sigpending @@ -12,5 +10,5 @@ ENTRY(__rt_sigpending) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__rt_sigpending) diff --git a/libc/arch-arm/syscalls/__rt_sigprocmask.S b/libc/arch-arm/syscalls/__rt_sigprocmask.S index 81cdb8546..136dc7956 100644 --- a/libc/arch-arm/syscalls/__rt_sigprocmask.S +++ b/libc/arch-arm/syscalls/__rt_sigprocmask.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigprocmask) mov ip, r7 ldr r7, =__NR_rt_sigprocmask @@ -12,5 +10,5 @@ ENTRY(__rt_sigprocmask) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__rt_sigprocmask) diff --git a/libc/arch-arm/syscalls/__rt_sigsuspend.S b/libc/arch-arm/syscalls/__rt_sigsuspend.S index a9a39032a..2cef4a4f8 100644 --- a/libc/arch-arm/syscalls/__rt_sigsuspend.S +++ b/libc/arch-arm/syscalls/__rt_sigsuspend.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigsuspend) mov ip, r7 ldr r7, =__NR_rt_sigsuspend @@ -12,5 +10,5 @@ ENTRY(__rt_sigsuspend) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__rt_sigsuspend) diff --git a/libc/arch-arm/syscalls/__rt_sigtimedwait.S b/libc/arch-arm/syscalls/__rt_sigtimedwait.S index 7b78a43b8..cb43ad1c8 100644 --- a/libc/arch-arm/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-arm/syscalls/__rt_sigtimedwait.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigtimedwait) mov ip, r7 ldr r7, =__NR_rt_sigtimedwait @@ -12,5 +10,5 @@ ENTRY(__rt_sigtimedwait) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__rt_sigtimedwait) diff --git a/libc/arch-arm/syscalls/__sched_getaffinity.S b/libc/arch-arm/syscalls/__sched_getaffinity.S index a22c55e33..6613ea573 100644 --- a/libc/arch-arm/syscalls/__sched_getaffinity.S +++ b/libc/arch-arm/syscalls/__sched_getaffinity.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__sched_getaffinity) mov ip, r7 ldr r7, =__NR_sched_getaffinity @@ -12,5 +10,5 @@ ENTRY(__sched_getaffinity) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__sched_getaffinity) diff --git a/libc/arch-arm/syscalls/__set_tid_address.S b/libc/arch-arm/syscalls/__set_tid_address.S index 0838c8b3c..d3558f5ab 100644 --- a/libc/arch-arm/syscalls/__set_tid_address.S +++ b/libc/arch-arm/syscalls/__set_tid_address.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__set_tid_address) mov ip, r7 ldr r7, =__NR_set_tid_address @@ -12,5 +10,5 @@ ENTRY(__set_tid_address) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__set_tid_address) diff --git a/libc/arch-arm/syscalls/__set_tls.S b/libc/arch-arm/syscalls/__set_tls.S index c4c2eb7cd..4d5d96330 100644 --- a/libc/arch-arm/syscalls/__set_tls.S +++ b/libc/arch-arm/syscalls/__set_tls.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__set_tls) mov ip, r7 ldr r7, =__ARM_NR_set_tls @@ -12,5 +10,5 @@ ENTRY(__set_tls) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__set_tls) diff --git a/libc/arch-arm/syscalls/__sigaction.S b/libc/arch-arm/syscalls/__sigaction.S index 869b4c8bd..600593d25 100644 --- a/libc/arch-arm/syscalls/__sigaction.S +++ b/libc/arch-arm/syscalls/__sigaction.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__sigaction) mov ip, r7 ldr r7, =__NR_sigaction @@ -12,5 +10,5 @@ ENTRY(__sigaction) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__sigaction) diff --git a/libc/arch-arm/syscalls/__signalfd4.S b/libc/arch-arm/syscalls/__signalfd4.S index 3bcf0319a..630a71f24 100644 --- a/libc/arch-arm/syscalls/__signalfd4.S +++ b/libc/arch-arm/syscalls/__signalfd4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__signalfd4) mov ip, r7 ldr r7, =__NR_signalfd4 @@ -12,5 +10,5 @@ ENTRY(__signalfd4) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__signalfd4) diff --git a/libc/arch-arm/syscalls/__socket.S b/libc/arch-arm/syscalls/__socket.S index a655b5b2c..fffe0cc49 100644 --- a/libc/arch-arm/syscalls/__socket.S +++ b/libc/arch-arm/syscalls/__socket.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__socket) mov ip, r7 ldr r7, =__NR_socket @@ -12,5 +10,5 @@ ENTRY(__socket) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__socket) diff --git a/libc/arch-arm/syscalls/__statfs64.S b/libc/arch-arm/syscalls/__statfs64.S index 80ea6ce1d..ec4321864 100644 --- a/libc/arch-arm/syscalls/__statfs64.S +++ b/libc/arch-arm/syscalls/__statfs64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__statfs64) mov ip, r7 ldr r7, =__NR_statfs64 @@ -12,5 +10,5 @@ ENTRY(__statfs64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__statfs64) diff --git a/libc/arch-arm/syscalls/__timer_create.S b/libc/arch-arm/syscalls/__timer_create.S index 75fc34781..2e4c63420 100644 --- a/libc/arch-arm/syscalls/__timer_create.S +++ b/libc/arch-arm/syscalls/__timer_create.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_create) mov ip, r7 ldr r7, =__NR_timer_create @@ -12,5 +10,5 @@ ENTRY(__timer_create) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__timer_create) diff --git a/libc/arch-arm/syscalls/__timer_delete.S b/libc/arch-arm/syscalls/__timer_delete.S index ad5ec361b..237024c7b 100644 --- a/libc/arch-arm/syscalls/__timer_delete.S +++ b/libc/arch-arm/syscalls/__timer_delete.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_delete) mov ip, r7 ldr r7, =__NR_timer_delete @@ -12,5 +10,5 @@ ENTRY(__timer_delete) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__timer_delete) diff --git a/libc/arch-arm/syscalls/__timer_getoverrun.S b/libc/arch-arm/syscalls/__timer_getoverrun.S index 529712cd4..f29d5b361 100644 --- a/libc/arch-arm/syscalls/__timer_getoverrun.S +++ b/libc/arch-arm/syscalls/__timer_getoverrun.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_getoverrun) mov ip, r7 ldr r7, =__NR_timer_getoverrun @@ -12,5 +10,5 @@ ENTRY(__timer_getoverrun) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__timer_getoverrun) diff --git a/libc/arch-arm/syscalls/__timer_gettime.S b/libc/arch-arm/syscalls/__timer_gettime.S index 180da3905..e6dc2edf1 100644 --- a/libc/arch-arm/syscalls/__timer_gettime.S +++ b/libc/arch-arm/syscalls/__timer_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_gettime) mov ip, r7 ldr r7, =__NR_timer_gettime @@ -12,5 +10,5 @@ ENTRY(__timer_gettime) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__timer_gettime) diff --git a/libc/arch-arm/syscalls/__timer_settime.S b/libc/arch-arm/syscalls/__timer_settime.S index e2950dd01..4aea279a6 100644 --- a/libc/arch-arm/syscalls/__timer_settime.S +++ b/libc/arch-arm/syscalls/__timer_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_settime) mov ip, r7 ldr r7, =__NR_timer_settime @@ -12,5 +10,5 @@ ENTRY(__timer_settime) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__timer_settime) diff --git a/libc/arch-arm/syscalls/__waitid.S b/libc/arch-arm/syscalls/__waitid.S index 8c6ba6625..f4dfa5968 100644 --- a/libc/arch-arm/syscalls/__waitid.S +++ b/libc/arch-arm/syscalls/__waitid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__waitid) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(__waitid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(__waitid) diff --git a/libc/arch-arm/syscalls/_exit.S b/libc/arch-arm/syscalls/_exit.S index fd072c3f6..328a5ce0b 100644 --- a/libc/arch-arm/syscalls/_exit.S +++ b/libc/arch-arm/syscalls/_exit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(_exit) mov ip, r7 ldr r7, =__NR_exit_group @@ -12,7 +10,7 @@ ENTRY(_exit) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(_exit) .globl _Exit diff --git a/libc/arch-arm/syscalls/acct.S b/libc/arch-arm/syscalls/acct.S index 156db4850..dbc5d5800 100644 --- a/libc/arch-arm/syscalls/acct.S +++ b/libc/arch-arm/syscalls/acct.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(acct) mov ip, r7 ldr r7, =__NR_acct @@ -12,5 +10,5 @@ ENTRY(acct) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(acct) diff --git a/libc/arch-arm/syscalls/bind.S b/libc/arch-arm/syscalls/bind.S index 892c77fcb..c901417da 100644 --- a/libc/arch-arm/syscalls/bind.S +++ b/libc/arch-arm/syscalls/bind.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(bind) mov ip, r7 ldr r7, =__NR_bind @@ -12,5 +10,5 @@ ENTRY(bind) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(bind) diff --git a/libc/arch-arm/syscalls/cacheflush.S b/libc/arch-arm/syscalls/cacheflush.S index 0739c32e8..76f4623b1 100644 --- a/libc/arch-arm/syscalls/cacheflush.S +++ b/libc/arch-arm/syscalls/cacheflush.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(cacheflush) mov ip, r7 ldr r7, =__ARM_NR_cacheflush @@ -12,5 +10,5 @@ ENTRY(cacheflush) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(cacheflush) diff --git a/libc/arch-arm/syscalls/capget.S b/libc/arch-arm/syscalls/capget.S index 6fd0f7cad..59a5a3c70 100644 --- a/libc/arch-arm/syscalls/capget.S +++ b/libc/arch-arm/syscalls/capget.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(capget) mov ip, r7 ldr r7, =__NR_capget @@ -12,5 +10,5 @@ ENTRY(capget) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(capget) diff --git a/libc/arch-arm/syscalls/capset.S b/libc/arch-arm/syscalls/capset.S index 2708ff6b9..af284ab70 100644 --- a/libc/arch-arm/syscalls/capset.S +++ b/libc/arch-arm/syscalls/capset.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(capset) mov ip, r7 ldr r7, =__NR_capset @@ -12,5 +10,5 @@ ENTRY(capset) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(capset) diff --git a/libc/arch-arm/syscalls/chdir.S b/libc/arch-arm/syscalls/chdir.S index 0b86a0f14..25f27ba19 100644 --- a/libc/arch-arm/syscalls/chdir.S +++ b/libc/arch-arm/syscalls/chdir.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(chdir) mov ip, r7 ldr r7, =__NR_chdir @@ -12,5 +10,5 @@ ENTRY(chdir) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(chdir) diff --git a/libc/arch-arm/syscalls/chroot.S b/libc/arch-arm/syscalls/chroot.S index 15aa392aa..6f829a6ac 100644 --- a/libc/arch-arm/syscalls/chroot.S +++ b/libc/arch-arm/syscalls/chroot.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(chroot) mov ip, r7 ldr r7, =__NR_chroot @@ -12,5 +10,5 @@ ENTRY(chroot) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(chroot) diff --git a/libc/arch-arm/syscalls/clock_getres.S b/libc/arch-arm/syscalls/clock_getres.S index b92289a12..48fa07cc4 100644 --- a/libc/arch-arm/syscalls/clock_getres.S +++ b/libc/arch-arm/syscalls/clock_getres.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_getres) mov ip, r7 ldr r7, =__NR_clock_getres @@ -12,5 +10,5 @@ ENTRY(clock_getres) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(clock_getres) diff --git a/libc/arch-arm/syscalls/clock_gettime.S b/libc/arch-arm/syscalls/clock_gettime.S index 203db8fbd..317481d46 100644 --- a/libc/arch-arm/syscalls/clock_gettime.S +++ b/libc/arch-arm/syscalls/clock_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_gettime) mov ip, r7 ldr r7, =__NR_clock_gettime @@ -12,5 +10,5 @@ ENTRY(clock_gettime) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(clock_gettime) diff --git a/libc/arch-arm/syscalls/clock_nanosleep.S b/libc/arch-arm/syscalls/clock_nanosleep.S index 5de2267cf..80295bb24 100644 --- a/libc/arch-arm/syscalls/clock_nanosleep.S +++ b/libc/arch-arm/syscalls/clock_nanosleep.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_nanosleep) mov ip, r7 ldr r7, =__NR_clock_nanosleep @@ -12,5 +10,5 @@ ENTRY(clock_nanosleep) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(clock_nanosleep) diff --git a/libc/arch-arm/syscalls/clock_settime.S b/libc/arch-arm/syscalls/clock_settime.S index 71e61f8cc..bf54702ee 100644 --- a/libc/arch-arm/syscalls/clock_settime.S +++ b/libc/arch-arm/syscalls/clock_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_settime) mov ip, r7 ldr r7, =__NR_clock_settime @@ -12,5 +10,5 @@ ENTRY(clock_settime) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(clock_settime) diff --git a/libc/arch-arm/syscalls/close.S b/libc/arch-arm/syscalls/close.S index 3e0fd3268..ec0544565 100644 --- a/libc/arch-arm/syscalls/close.S +++ b/libc/arch-arm/syscalls/close.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(close) mov ip, r7 ldr r7, =__NR_close @@ -12,5 +10,5 @@ ENTRY(close) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(close) diff --git a/libc/arch-arm/syscalls/delete_module.S b/libc/arch-arm/syscalls/delete_module.S index 0af25208a..57580c950 100644 --- a/libc/arch-arm/syscalls/delete_module.S +++ b/libc/arch-arm/syscalls/delete_module.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(delete_module) mov ip, r7 ldr r7, =__NR_delete_module @@ -12,5 +10,5 @@ ENTRY(delete_module) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(delete_module) diff --git a/libc/arch-arm/syscalls/dup.S b/libc/arch-arm/syscalls/dup.S index 4105438fa..2cd69d769 100644 --- a/libc/arch-arm/syscalls/dup.S +++ b/libc/arch-arm/syscalls/dup.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(dup) mov ip, r7 ldr r7, =__NR_dup @@ -12,5 +10,5 @@ ENTRY(dup) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(dup) diff --git a/libc/arch-arm/syscalls/dup3.S b/libc/arch-arm/syscalls/dup3.S index 409e8f976..4613d634d 100644 --- a/libc/arch-arm/syscalls/dup3.S +++ b/libc/arch-arm/syscalls/dup3.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(dup3) mov ip, r7 ldr r7, =__NR_dup3 @@ -12,5 +10,5 @@ ENTRY(dup3) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(dup3) diff --git a/libc/arch-arm/syscalls/epoll_create1.S b/libc/arch-arm/syscalls/epoll_create1.S index 631afab3d..108c24fe3 100644 --- a/libc/arch-arm/syscalls/epoll_create1.S +++ b/libc/arch-arm/syscalls/epoll_create1.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(epoll_create1) mov ip, r7 ldr r7, =__NR_epoll_create1 @@ -12,5 +10,5 @@ ENTRY(epoll_create1) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(epoll_create1) diff --git a/libc/arch-arm/syscalls/epoll_ctl.S b/libc/arch-arm/syscalls/epoll_ctl.S index 187fe0a0b..473af6a54 100644 --- a/libc/arch-arm/syscalls/epoll_ctl.S +++ b/libc/arch-arm/syscalls/epoll_ctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(epoll_ctl) mov ip, r7 ldr r7, =__NR_epoll_ctl @@ -12,5 +10,5 @@ ENTRY(epoll_ctl) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(epoll_ctl) diff --git a/libc/arch-arm/syscalls/eventfd.S b/libc/arch-arm/syscalls/eventfd.S index c35f537e8..ca6bceee7 100644 --- a/libc/arch-arm/syscalls/eventfd.S +++ b/libc/arch-arm/syscalls/eventfd.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(eventfd) mov ip, r7 ldr r7, =__NR_eventfd2 @@ -12,5 +10,5 @@ ENTRY(eventfd) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(eventfd) diff --git a/libc/arch-arm/syscalls/execve.S b/libc/arch-arm/syscalls/execve.S index 1b24f765f..3eca81049 100644 --- a/libc/arch-arm/syscalls/execve.S +++ b/libc/arch-arm/syscalls/execve.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(execve) mov ip, r7 ldr r7, =__NR_execve @@ -12,5 +10,5 @@ ENTRY(execve) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(execve) diff --git a/libc/arch-arm/syscalls/faccessat.S b/libc/arch-arm/syscalls/faccessat.S index 3f663e3ab..a1df5c09f 100644 --- a/libc/arch-arm/syscalls/faccessat.S +++ b/libc/arch-arm/syscalls/faccessat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(faccessat) mov ip, r7 ldr r7, =__NR_faccessat @@ -12,5 +10,5 @@ ENTRY(faccessat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(faccessat) diff --git a/libc/arch-arm/syscalls/fallocate64.S b/libc/arch-arm/syscalls/fallocate64.S index fd9063754..4bfd5e38f 100644 --- a/libc/arch-arm/syscalls/fallocate64.S +++ b/libc/arch-arm/syscalls/fallocate64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fallocate64) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(fallocate64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fallocate64) diff --git a/libc/arch-arm/syscalls/fchdir.S b/libc/arch-arm/syscalls/fchdir.S index c10971878..705ad32cb 100644 --- a/libc/arch-arm/syscalls/fchdir.S +++ b/libc/arch-arm/syscalls/fchdir.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchdir) mov ip, r7 ldr r7, =__NR_fchdir @@ -12,5 +10,5 @@ ENTRY(fchdir) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fchdir) diff --git a/libc/arch-arm/syscalls/fchmod.S b/libc/arch-arm/syscalls/fchmod.S index 4b598a29d..5675f0a33 100644 --- a/libc/arch-arm/syscalls/fchmod.S +++ b/libc/arch-arm/syscalls/fchmod.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchmod) mov ip, r7 ldr r7, =__NR_fchmod @@ -12,5 +10,5 @@ ENTRY(fchmod) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fchmod) diff --git a/libc/arch-arm/syscalls/fchmodat.S b/libc/arch-arm/syscalls/fchmodat.S index 8e4311810..3f7e0ee24 100644 --- a/libc/arch-arm/syscalls/fchmodat.S +++ b/libc/arch-arm/syscalls/fchmodat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchmodat) mov ip, r7 ldr r7, =__NR_fchmodat @@ -12,5 +10,5 @@ ENTRY(fchmodat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fchmodat) diff --git a/libc/arch-arm/syscalls/fchown.S b/libc/arch-arm/syscalls/fchown.S index 24a38f65f..45ad9bfe3 100644 --- a/libc/arch-arm/syscalls/fchown.S +++ b/libc/arch-arm/syscalls/fchown.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchown) mov ip, r7 ldr r7, =__NR_fchown32 @@ -12,5 +10,5 @@ ENTRY(fchown) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fchown) diff --git a/libc/arch-arm/syscalls/fchownat.S b/libc/arch-arm/syscalls/fchownat.S index 8fd76a3b8..2aac0fe98 100644 --- a/libc/arch-arm/syscalls/fchownat.S +++ b/libc/arch-arm/syscalls/fchownat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchownat) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(fchownat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fchownat) diff --git a/libc/arch-arm/syscalls/fdatasync.S b/libc/arch-arm/syscalls/fdatasync.S index 955666524..7fefd22fa 100644 --- a/libc/arch-arm/syscalls/fdatasync.S +++ b/libc/arch-arm/syscalls/fdatasync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fdatasync) mov ip, r7 ldr r7, =__NR_fdatasync @@ -12,5 +10,5 @@ ENTRY(fdatasync) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fdatasync) diff --git a/libc/arch-arm/syscalls/fgetxattr.S b/libc/arch-arm/syscalls/fgetxattr.S index 95e2809bc..3f1e5fc4e 100644 --- a/libc/arch-arm/syscalls/fgetxattr.S +++ b/libc/arch-arm/syscalls/fgetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fgetxattr) mov ip, r7 ldr r7, =__NR_fgetxattr @@ -12,5 +10,5 @@ ENTRY(fgetxattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fgetxattr) diff --git a/libc/arch-arm/syscalls/flistxattr.S b/libc/arch-arm/syscalls/flistxattr.S index 0d411b17b..ee09295f6 100644 --- a/libc/arch-arm/syscalls/flistxattr.S +++ b/libc/arch-arm/syscalls/flistxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(flistxattr) mov ip, r7 ldr r7, =__NR_flistxattr @@ -12,5 +10,5 @@ ENTRY(flistxattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(flistxattr) diff --git a/libc/arch-arm/syscalls/flock.S b/libc/arch-arm/syscalls/flock.S index e59d4f682..c946fe994 100644 --- a/libc/arch-arm/syscalls/flock.S +++ b/libc/arch-arm/syscalls/flock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(flock) mov ip, r7 ldr r7, =__NR_flock @@ -12,5 +10,5 @@ ENTRY(flock) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(flock) diff --git a/libc/arch-arm/syscalls/fremovexattr.S b/libc/arch-arm/syscalls/fremovexattr.S index 3ec647fa2..f4e950b9c 100644 --- a/libc/arch-arm/syscalls/fremovexattr.S +++ b/libc/arch-arm/syscalls/fremovexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fremovexattr) mov ip, r7 ldr r7, =__NR_fremovexattr @@ -12,5 +10,5 @@ ENTRY(fremovexattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fremovexattr) diff --git a/libc/arch-arm/syscalls/fsetxattr.S b/libc/arch-arm/syscalls/fsetxattr.S index 225e64b9f..0e33ad29f 100644 --- a/libc/arch-arm/syscalls/fsetxattr.S +++ b/libc/arch-arm/syscalls/fsetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fsetxattr) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(fsetxattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fsetxattr) diff --git a/libc/arch-arm/syscalls/fstat64.S b/libc/arch-arm/syscalls/fstat64.S index 560bb94cc..c60e7eee5 100644 --- a/libc/arch-arm/syscalls/fstat64.S +++ b/libc/arch-arm/syscalls/fstat64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstat64) mov ip, r7 ldr r7, =__NR_fstat64 @@ -12,7 +10,7 @@ ENTRY(fstat64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fstat64) .globl fstat diff --git a/libc/arch-arm/syscalls/fstatat64.S b/libc/arch-arm/syscalls/fstatat64.S index cda584580..ce56c36fd 100644 --- a/libc/arch-arm/syscalls/fstatat64.S +++ b/libc/arch-arm/syscalls/fstatat64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstatat64) mov ip, r7 ldr r7, =__NR_fstatat64 @@ -12,7 +10,7 @@ ENTRY(fstatat64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fstatat64) .globl fstatat diff --git a/libc/arch-arm/syscalls/fsync.S b/libc/arch-arm/syscalls/fsync.S index c6ba47bca..1dfff05f4 100644 --- a/libc/arch-arm/syscalls/fsync.S +++ b/libc/arch-arm/syscalls/fsync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fsync) mov ip, r7 ldr r7, =__NR_fsync @@ -12,5 +10,5 @@ ENTRY(fsync) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(fsync) diff --git a/libc/arch-arm/syscalls/ftruncate.S b/libc/arch-arm/syscalls/ftruncate.S index 168d72296..1bfe2f39c 100644 --- a/libc/arch-arm/syscalls/ftruncate.S +++ b/libc/arch-arm/syscalls/ftruncate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(ftruncate) mov ip, r7 ldr r7, =__NR_ftruncate @@ -12,5 +10,5 @@ ENTRY(ftruncate) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(ftruncate) diff --git a/libc/arch-arm/syscalls/ftruncate64.S b/libc/arch-arm/syscalls/ftruncate64.S index a2b73b838..ac0caa88f 100644 --- a/libc/arch-arm/syscalls/ftruncate64.S +++ b/libc/arch-arm/syscalls/ftruncate64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(ftruncate64) mov ip, r7 ldr r7, =__NR_ftruncate64 @@ -12,5 +10,5 @@ ENTRY(ftruncate64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(ftruncate64) diff --git a/libc/arch-arm/syscalls/getegid.S b/libc/arch-arm/syscalls/getegid.S index e2f9fe976..afa9cc8f1 100644 --- a/libc/arch-arm/syscalls/getegid.S +++ b/libc/arch-arm/syscalls/getegid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getegid) mov ip, r7 ldr r7, =__NR_getegid32 @@ -12,5 +10,5 @@ ENTRY(getegid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getegid) diff --git a/libc/arch-arm/syscalls/geteuid.S b/libc/arch-arm/syscalls/geteuid.S index 1d5532049..10c8a25f4 100644 --- a/libc/arch-arm/syscalls/geteuid.S +++ b/libc/arch-arm/syscalls/geteuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(geteuid) mov ip, r7 ldr r7, =__NR_geteuid32 @@ -12,5 +10,5 @@ ENTRY(geteuid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(geteuid) diff --git a/libc/arch-arm/syscalls/getgid.S b/libc/arch-arm/syscalls/getgid.S index 9d81d73ef..877276227 100644 --- a/libc/arch-arm/syscalls/getgid.S +++ b/libc/arch-arm/syscalls/getgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getgid) mov ip, r7 ldr r7, =__NR_getgid32 @@ -12,5 +10,5 @@ ENTRY(getgid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getgid) diff --git a/libc/arch-arm/syscalls/getgroups.S b/libc/arch-arm/syscalls/getgroups.S index 23aafaf7b..366299b60 100644 --- a/libc/arch-arm/syscalls/getgroups.S +++ b/libc/arch-arm/syscalls/getgroups.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getgroups) mov ip, r7 ldr r7, =__NR_getgroups32 @@ -12,5 +10,5 @@ ENTRY(getgroups) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getgroups) diff --git a/libc/arch-arm/syscalls/getitimer.S b/libc/arch-arm/syscalls/getitimer.S index 095cf8fcb..80fb0f21d 100644 --- a/libc/arch-arm/syscalls/getitimer.S +++ b/libc/arch-arm/syscalls/getitimer.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getitimer) mov ip, r7 ldr r7, =__NR_getitimer @@ -12,5 +10,5 @@ ENTRY(getitimer) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getitimer) diff --git a/libc/arch-arm/syscalls/getpeername.S b/libc/arch-arm/syscalls/getpeername.S index 760f6fb3c..25f00268c 100644 --- a/libc/arch-arm/syscalls/getpeername.S +++ b/libc/arch-arm/syscalls/getpeername.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getpeername) mov ip, r7 ldr r7, =__NR_getpeername @@ -12,5 +10,5 @@ ENTRY(getpeername) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getpeername) diff --git a/libc/arch-arm/syscalls/getpgid.S b/libc/arch-arm/syscalls/getpgid.S index d07b05824..36c4c19c5 100644 --- a/libc/arch-arm/syscalls/getpgid.S +++ b/libc/arch-arm/syscalls/getpgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getpgid) mov ip, r7 ldr r7, =__NR_getpgid @@ -12,5 +10,5 @@ ENTRY(getpgid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getpgid) diff --git a/libc/arch-arm/syscalls/getppid.S b/libc/arch-arm/syscalls/getppid.S index bcc13a8a6..606b2e01a 100644 --- a/libc/arch-arm/syscalls/getppid.S +++ b/libc/arch-arm/syscalls/getppid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getppid) mov ip, r7 ldr r7, =__NR_getppid @@ -12,5 +10,5 @@ ENTRY(getppid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getppid) diff --git a/libc/arch-arm/syscalls/getresgid.S b/libc/arch-arm/syscalls/getresgid.S index 9a87eaa3a..a5e4689f5 100644 --- a/libc/arch-arm/syscalls/getresgid.S +++ b/libc/arch-arm/syscalls/getresgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getresgid) mov ip, r7 ldr r7, =__NR_getresgid32 @@ -12,5 +10,5 @@ ENTRY(getresgid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getresgid) diff --git a/libc/arch-arm/syscalls/getresuid.S b/libc/arch-arm/syscalls/getresuid.S index a332928fb..74c26a764 100644 --- a/libc/arch-arm/syscalls/getresuid.S +++ b/libc/arch-arm/syscalls/getresuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getresuid) mov ip, r7 ldr r7, =__NR_getresuid32 @@ -12,5 +10,5 @@ ENTRY(getresuid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getresuid) diff --git a/libc/arch-arm/syscalls/getrlimit.S b/libc/arch-arm/syscalls/getrlimit.S index 4a9c62aaa..166da6398 100644 --- a/libc/arch-arm/syscalls/getrlimit.S +++ b/libc/arch-arm/syscalls/getrlimit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getrlimit) mov ip, r7 ldr r7, =__NR_ugetrlimit @@ -12,5 +10,5 @@ ENTRY(getrlimit) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getrlimit) diff --git a/libc/arch-arm/syscalls/getrusage.S b/libc/arch-arm/syscalls/getrusage.S index 4799b6931..93979c668 100644 --- a/libc/arch-arm/syscalls/getrusage.S +++ b/libc/arch-arm/syscalls/getrusage.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getrusage) mov ip, r7 ldr r7, =__NR_getrusage @@ -12,5 +10,5 @@ ENTRY(getrusage) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getrusage) diff --git a/libc/arch-arm/syscalls/getsid.S b/libc/arch-arm/syscalls/getsid.S index 5a26e94a1..87d38fbba 100644 --- a/libc/arch-arm/syscalls/getsid.S +++ b/libc/arch-arm/syscalls/getsid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsid) mov ip, r7 ldr r7, =__NR_getsid @@ -12,5 +10,5 @@ ENTRY(getsid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getsid) diff --git a/libc/arch-arm/syscalls/getsockname.S b/libc/arch-arm/syscalls/getsockname.S index 78e07524a..5dc4eab96 100644 --- a/libc/arch-arm/syscalls/getsockname.S +++ b/libc/arch-arm/syscalls/getsockname.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsockname) mov ip, r7 ldr r7, =__NR_getsockname @@ -12,5 +10,5 @@ ENTRY(getsockname) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getsockname) diff --git a/libc/arch-arm/syscalls/getsockopt.S b/libc/arch-arm/syscalls/getsockopt.S index e1badfb45..4143bbde1 100644 --- a/libc/arch-arm/syscalls/getsockopt.S +++ b/libc/arch-arm/syscalls/getsockopt.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsockopt) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(getsockopt) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getsockopt) diff --git a/libc/arch-arm/syscalls/gettimeofday.S b/libc/arch-arm/syscalls/gettimeofday.S index 611c0d4ef..174f94b04 100644 --- a/libc/arch-arm/syscalls/gettimeofday.S +++ b/libc/arch-arm/syscalls/gettimeofday.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(gettimeofday) mov ip, r7 ldr r7, =__NR_gettimeofday @@ -12,5 +10,5 @@ ENTRY(gettimeofday) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(gettimeofday) diff --git a/libc/arch-arm/syscalls/getuid.S b/libc/arch-arm/syscalls/getuid.S index 2e97c5509..3d07d3cb3 100644 --- a/libc/arch-arm/syscalls/getuid.S +++ b/libc/arch-arm/syscalls/getuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getuid) mov ip, r7 ldr r7, =__NR_getuid32 @@ -12,5 +10,5 @@ ENTRY(getuid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getuid) diff --git a/libc/arch-arm/syscalls/getxattr.S b/libc/arch-arm/syscalls/getxattr.S index da0e86d4f..6661aaf84 100644 --- a/libc/arch-arm/syscalls/getxattr.S +++ b/libc/arch-arm/syscalls/getxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getxattr) mov ip, r7 ldr r7, =__NR_getxattr @@ -12,5 +10,5 @@ ENTRY(getxattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(getxattr) diff --git a/libc/arch-arm/syscalls/init_module.S b/libc/arch-arm/syscalls/init_module.S index bf30b03a2..82515336e 100644 --- a/libc/arch-arm/syscalls/init_module.S +++ b/libc/arch-arm/syscalls/init_module.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(init_module) mov ip, r7 ldr r7, =__NR_init_module @@ -12,5 +10,5 @@ ENTRY(init_module) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(init_module) diff --git a/libc/arch-arm/syscalls/inotify_add_watch.S b/libc/arch-arm/syscalls/inotify_add_watch.S index 982d33857..b945bd17f 100644 --- a/libc/arch-arm/syscalls/inotify_add_watch.S +++ b/libc/arch-arm/syscalls/inotify_add_watch.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_add_watch) mov ip, r7 ldr r7, =__NR_inotify_add_watch @@ -12,5 +10,5 @@ ENTRY(inotify_add_watch) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(inotify_add_watch) diff --git a/libc/arch-arm/syscalls/inotify_init1.S b/libc/arch-arm/syscalls/inotify_init1.S index 2253ec846..32090de97 100644 --- a/libc/arch-arm/syscalls/inotify_init1.S +++ b/libc/arch-arm/syscalls/inotify_init1.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_init1) mov ip, r7 ldr r7, =__NR_inotify_init1 @@ -12,5 +10,5 @@ ENTRY(inotify_init1) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(inotify_init1) diff --git a/libc/arch-arm/syscalls/inotify_rm_watch.S b/libc/arch-arm/syscalls/inotify_rm_watch.S index 9d7e6aefb..e8230e2f3 100644 --- a/libc/arch-arm/syscalls/inotify_rm_watch.S +++ b/libc/arch-arm/syscalls/inotify_rm_watch.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_rm_watch) mov ip, r7 ldr r7, =__NR_inotify_rm_watch @@ -12,5 +10,5 @@ ENTRY(inotify_rm_watch) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(inotify_rm_watch) diff --git a/libc/arch-arm/syscalls/kill.S b/libc/arch-arm/syscalls/kill.S index 7e4d6c45f..0b5f4a4f8 100644 --- a/libc/arch-arm/syscalls/kill.S +++ b/libc/arch-arm/syscalls/kill.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(kill) mov ip, r7 ldr r7, =__NR_kill @@ -12,5 +10,5 @@ ENTRY(kill) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(kill) diff --git a/libc/arch-arm/syscalls/klogctl.S b/libc/arch-arm/syscalls/klogctl.S index f5fe27fe2..b76b2b58d 100644 --- a/libc/arch-arm/syscalls/klogctl.S +++ b/libc/arch-arm/syscalls/klogctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(klogctl) mov ip, r7 ldr r7, =__NR_syslog @@ -12,5 +10,5 @@ ENTRY(klogctl) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(klogctl) diff --git a/libc/arch-arm/syscalls/lgetxattr.S b/libc/arch-arm/syscalls/lgetxattr.S index 70b7235aa..b033a9afc 100644 --- a/libc/arch-arm/syscalls/lgetxattr.S +++ b/libc/arch-arm/syscalls/lgetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lgetxattr) mov ip, r7 ldr r7, =__NR_lgetxattr @@ -12,5 +10,5 @@ ENTRY(lgetxattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(lgetxattr) diff --git a/libc/arch-arm/syscalls/linkat.S b/libc/arch-arm/syscalls/linkat.S index 7a578f8ed..6e74d063b 100644 --- a/libc/arch-arm/syscalls/linkat.S +++ b/libc/arch-arm/syscalls/linkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(linkat) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(linkat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(linkat) diff --git a/libc/arch-arm/syscalls/listen.S b/libc/arch-arm/syscalls/listen.S index 5c33912ea..3aaa80154 100644 --- a/libc/arch-arm/syscalls/listen.S +++ b/libc/arch-arm/syscalls/listen.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(listen) mov ip, r7 ldr r7, =__NR_listen @@ -12,5 +10,5 @@ ENTRY(listen) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(listen) diff --git a/libc/arch-arm/syscalls/listxattr.S b/libc/arch-arm/syscalls/listxattr.S index ea8f5d832..51ff267b9 100644 --- a/libc/arch-arm/syscalls/listxattr.S +++ b/libc/arch-arm/syscalls/listxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(listxattr) mov ip, r7 ldr r7, =__NR_listxattr @@ -12,5 +10,5 @@ ENTRY(listxattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(listxattr) diff --git a/libc/arch-arm/syscalls/llistxattr.S b/libc/arch-arm/syscalls/llistxattr.S index b7f337522..46e8116fc 100644 --- a/libc/arch-arm/syscalls/llistxattr.S +++ b/libc/arch-arm/syscalls/llistxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(llistxattr) mov ip, r7 ldr r7, =__NR_llistxattr @@ -12,5 +10,5 @@ ENTRY(llistxattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(llistxattr) diff --git a/libc/arch-arm/syscalls/lremovexattr.S b/libc/arch-arm/syscalls/lremovexattr.S index a8d0d2d3b..a945062f2 100644 --- a/libc/arch-arm/syscalls/lremovexattr.S +++ b/libc/arch-arm/syscalls/lremovexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lremovexattr) mov ip, r7 ldr r7, =__NR_lremovexattr @@ -12,5 +10,5 @@ ENTRY(lremovexattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(lremovexattr) diff --git a/libc/arch-arm/syscalls/lseek.S b/libc/arch-arm/syscalls/lseek.S index 17697d486..00aeab3aa 100644 --- a/libc/arch-arm/syscalls/lseek.S +++ b/libc/arch-arm/syscalls/lseek.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lseek) mov ip, r7 ldr r7, =__NR_lseek @@ -12,5 +10,5 @@ ENTRY(lseek) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(lseek) diff --git a/libc/arch-arm/syscalls/lsetxattr.S b/libc/arch-arm/syscalls/lsetxattr.S index 166ef7f1d..c41fb8806 100644 --- a/libc/arch-arm/syscalls/lsetxattr.S +++ b/libc/arch-arm/syscalls/lsetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lsetxattr) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(lsetxattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(lsetxattr) diff --git a/libc/arch-arm/syscalls/madvise.S b/libc/arch-arm/syscalls/madvise.S index ffa71c463..4d3cdcde9 100644 --- a/libc/arch-arm/syscalls/madvise.S +++ b/libc/arch-arm/syscalls/madvise.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(madvise) mov ip, r7 ldr r7, =__NR_madvise @@ -12,5 +10,5 @@ ENTRY(madvise) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(madvise) diff --git a/libc/arch-arm/syscalls/mincore.S b/libc/arch-arm/syscalls/mincore.S index 5eb5f1010..f1154d0a1 100644 --- a/libc/arch-arm/syscalls/mincore.S +++ b/libc/arch-arm/syscalls/mincore.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mincore) mov ip, r7 ldr r7, =__NR_mincore @@ -12,5 +10,5 @@ ENTRY(mincore) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(mincore) diff --git a/libc/arch-arm/syscalls/mkdirat.S b/libc/arch-arm/syscalls/mkdirat.S index d9c58ad08..1f8957beb 100644 --- a/libc/arch-arm/syscalls/mkdirat.S +++ b/libc/arch-arm/syscalls/mkdirat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mkdirat) mov ip, r7 ldr r7, =__NR_mkdirat @@ -12,5 +10,5 @@ ENTRY(mkdirat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(mkdirat) diff --git a/libc/arch-arm/syscalls/mknodat.S b/libc/arch-arm/syscalls/mknodat.S index d6296f1fd..1a2bf6ff3 100644 --- a/libc/arch-arm/syscalls/mknodat.S +++ b/libc/arch-arm/syscalls/mknodat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mknodat) mov ip, r7 ldr r7, =__NR_mknodat @@ -12,5 +10,5 @@ ENTRY(mknodat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(mknodat) diff --git a/libc/arch-arm/syscalls/mlock.S b/libc/arch-arm/syscalls/mlock.S index 21fd5f9f3..8a4fc7aa3 100644 --- a/libc/arch-arm/syscalls/mlock.S +++ b/libc/arch-arm/syscalls/mlock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mlock) mov ip, r7 ldr r7, =__NR_mlock @@ -12,5 +10,5 @@ ENTRY(mlock) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(mlock) diff --git a/libc/arch-arm/syscalls/mlockall.S b/libc/arch-arm/syscalls/mlockall.S index 750b7ece5..b49ca0540 100644 --- a/libc/arch-arm/syscalls/mlockall.S +++ b/libc/arch-arm/syscalls/mlockall.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mlockall) mov ip, r7 ldr r7, =__NR_mlockall @@ -12,5 +10,5 @@ ENTRY(mlockall) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(mlockall) diff --git a/libc/arch-arm/syscalls/mount.S b/libc/arch-arm/syscalls/mount.S index d2fa20e38..ed28ab2e8 100644 --- a/libc/arch-arm/syscalls/mount.S +++ b/libc/arch-arm/syscalls/mount.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mount) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(mount) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(mount) diff --git a/libc/arch-arm/syscalls/mprotect.S b/libc/arch-arm/syscalls/mprotect.S index dfc6f0891..cb5130666 100644 --- a/libc/arch-arm/syscalls/mprotect.S +++ b/libc/arch-arm/syscalls/mprotect.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mprotect) mov ip, r7 ldr r7, =__NR_mprotect @@ -12,5 +10,5 @@ ENTRY(mprotect) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(mprotect) diff --git a/libc/arch-arm/syscalls/mremap.S b/libc/arch-arm/syscalls/mremap.S index a67457156..505ea3c5d 100644 --- a/libc/arch-arm/syscalls/mremap.S +++ b/libc/arch-arm/syscalls/mremap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mremap) mov ip, r7 ldr r7, =__NR_mremap @@ -12,5 +10,5 @@ ENTRY(mremap) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(mremap) diff --git a/libc/arch-arm/syscalls/msync.S b/libc/arch-arm/syscalls/msync.S index e062a5ee7..220fb4d56 100644 --- a/libc/arch-arm/syscalls/msync.S +++ b/libc/arch-arm/syscalls/msync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(msync) mov ip, r7 ldr r7, =__NR_msync @@ -12,5 +10,5 @@ ENTRY(msync) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(msync) diff --git a/libc/arch-arm/syscalls/munlock.S b/libc/arch-arm/syscalls/munlock.S index c44d14750..05bf94128 100644 --- a/libc/arch-arm/syscalls/munlock.S +++ b/libc/arch-arm/syscalls/munlock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munlock) mov ip, r7 ldr r7, =__NR_munlock @@ -12,5 +10,5 @@ ENTRY(munlock) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(munlock) diff --git a/libc/arch-arm/syscalls/munlockall.S b/libc/arch-arm/syscalls/munlockall.S index 3a36b7e90..e2c5dd5fd 100644 --- a/libc/arch-arm/syscalls/munlockall.S +++ b/libc/arch-arm/syscalls/munlockall.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munlockall) mov ip, r7 ldr r7, =__NR_munlockall @@ -12,5 +10,5 @@ ENTRY(munlockall) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(munlockall) diff --git a/libc/arch-arm/syscalls/munmap.S b/libc/arch-arm/syscalls/munmap.S index a94e4e5b2..740c3608e 100644 --- a/libc/arch-arm/syscalls/munmap.S +++ b/libc/arch-arm/syscalls/munmap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munmap) mov ip, r7 ldr r7, =__NR_munmap @@ -12,5 +10,5 @@ ENTRY(munmap) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(munmap) diff --git a/libc/arch-arm/syscalls/nanosleep.S b/libc/arch-arm/syscalls/nanosleep.S index 743adc218..fcd6e90cb 100644 --- a/libc/arch-arm/syscalls/nanosleep.S +++ b/libc/arch-arm/syscalls/nanosleep.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(nanosleep) mov ip, r7 ldr r7, =__NR_nanosleep @@ -12,5 +10,5 @@ ENTRY(nanosleep) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(nanosleep) diff --git a/libc/arch-arm/syscalls/personality.S b/libc/arch-arm/syscalls/personality.S index 90dfe224e..d43d76384 100644 --- a/libc/arch-arm/syscalls/personality.S +++ b/libc/arch-arm/syscalls/personality.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(personality) mov ip, r7 ldr r7, =__NR_personality @@ -12,5 +10,5 @@ ENTRY(personality) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(personality) diff --git a/libc/arch-arm/syscalls/pipe2.S b/libc/arch-arm/syscalls/pipe2.S index b295df57b..1cbdfb2d7 100644 --- a/libc/arch-arm/syscalls/pipe2.S +++ b/libc/arch-arm/syscalls/pipe2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pipe2) mov ip, r7 ldr r7, =__NR_pipe2 @@ -12,5 +10,5 @@ ENTRY(pipe2) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(pipe2) diff --git a/libc/arch-arm/syscalls/prctl.S b/libc/arch-arm/syscalls/prctl.S index c8f68d36c..a2d869cc7 100644 --- a/libc/arch-arm/syscalls/prctl.S +++ b/libc/arch-arm/syscalls/prctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(prctl) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(prctl) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(prctl) diff --git a/libc/arch-arm/syscalls/pread64.S b/libc/arch-arm/syscalls/pread64.S index 3eeae3db3..dc07bb310 100644 --- a/libc/arch-arm/syscalls/pread64.S +++ b/libc/arch-arm/syscalls/pread64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pread64) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(pread64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(pread64) diff --git a/libc/arch-arm/syscalls/prlimit64.S b/libc/arch-arm/syscalls/prlimit64.S index 87c53d582..3ae9e1b19 100644 --- a/libc/arch-arm/syscalls/prlimit64.S +++ b/libc/arch-arm/syscalls/prlimit64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(prlimit64) mov ip, r7 ldr r7, =__NR_prlimit64 @@ -12,5 +10,5 @@ ENTRY(prlimit64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(prlimit64) diff --git a/libc/arch-arm/syscalls/pwrite64.S b/libc/arch-arm/syscalls/pwrite64.S index c63b835d2..5749f6b22 100644 --- a/libc/arch-arm/syscalls/pwrite64.S +++ b/libc/arch-arm/syscalls/pwrite64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pwrite64) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(pwrite64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(pwrite64) diff --git a/libc/arch-arm/syscalls/read.S b/libc/arch-arm/syscalls/read.S index 9de525c92..1c3b39578 100644 --- a/libc/arch-arm/syscalls/read.S +++ b/libc/arch-arm/syscalls/read.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(read) mov ip, r7 ldr r7, =__NR_read @@ -12,5 +10,5 @@ ENTRY(read) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(read) diff --git a/libc/arch-arm/syscalls/readahead.S b/libc/arch-arm/syscalls/readahead.S index 995f00eb4..6952b4ed2 100644 --- a/libc/arch-arm/syscalls/readahead.S +++ b/libc/arch-arm/syscalls/readahead.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readahead) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(readahead) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(readahead) diff --git a/libc/arch-arm/syscalls/readlinkat.S b/libc/arch-arm/syscalls/readlinkat.S index f865de52a..e7cc8ff23 100644 --- a/libc/arch-arm/syscalls/readlinkat.S +++ b/libc/arch-arm/syscalls/readlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readlinkat) mov ip, r7 ldr r7, =__NR_readlinkat @@ -12,5 +10,5 @@ ENTRY(readlinkat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(readlinkat) diff --git a/libc/arch-arm/syscalls/readv.S b/libc/arch-arm/syscalls/readv.S index 9401687c8..c7807bde8 100644 --- a/libc/arch-arm/syscalls/readv.S +++ b/libc/arch-arm/syscalls/readv.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readv) mov ip, r7 ldr r7, =__NR_readv @@ -12,5 +10,5 @@ ENTRY(readv) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(readv) diff --git a/libc/arch-arm/syscalls/recvfrom.S b/libc/arch-arm/syscalls/recvfrom.S index 6390a82ca..115a09ca5 100644 --- a/libc/arch-arm/syscalls/recvfrom.S +++ b/libc/arch-arm/syscalls/recvfrom.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvfrom) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(recvfrom) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(recvfrom) diff --git a/libc/arch-arm/syscalls/recvmmsg.S b/libc/arch-arm/syscalls/recvmmsg.S index 067ed1e15..6cf2b9285 100644 --- a/libc/arch-arm/syscalls/recvmmsg.S +++ b/libc/arch-arm/syscalls/recvmmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvmmsg) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(recvmmsg) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(recvmmsg) diff --git a/libc/arch-arm/syscalls/recvmsg.S b/libc/arch-arm/syscalls/recvmsg.S index f6884818d..995a9e348 100644 --- a/libc/arch-arm/syscalls/recvmsg.S +++ b/libc/arch-arm/syscalls/recvmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvmsg) mov ip, r7 ldr r7, =__NR_recvmsg @@ -12,5 +10,5 @@ ENTRY(recvmsg) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(recvmsg) diff --git a/libc/arch-arm/syscalls/removexattr.S b/libc/arch-arm/syscalls/removexattr.S index 59d0e2fa2..3a32e5cea 100644 --- a/libc/arch-arm/syscalls/removexattr.S +++ b/libc/arch-arm/syscalls/removexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(removexattr) mov ip, r7 ldr r7, =__NR_removexattr @@ -12,5 +10,5 @@ ENTRY(removexattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(removexattr) diff --git a/libc/arch-arm/syscalls/renameat.S b/libc/arch-arm/syscalls/renameat.S index 7a4d26882..98e86dc32 100644 --- a/libc/arch-arm/syscalls/renameat.S +++ b/libc/arch-arm/syscalls/renameat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(renameat) mov ip, r7 ldr r7, =__NR_renameat @@ -12,5 +10,5 @@ ENTRY(renameat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(renameat) diff --git a/libc/arch-arm/syscalls/sched_get_priority_max.S b/libc/arch-arm/syscalls/sched_get_priority_max.S index 2aafafc61..187e68039 100644 --- a/libc/arch-arm/syscalls/sched_get_priority_max.S +++ b/libc/arch-arm/syscalls/sched_get_priority_max.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_max) mov ip, r7 ldr r7, =__NR_sched_get_priority_max @@ -12,5 +10,5 @@ ENTRY(sched_get_priority_max) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sched_get_priority_max) diff --git a/libc/arch-arm/syscalls/sched_get_priority_min.S b/libc/arch-arm/syscalls/sched_get_priority_min.S index 40e14ef66..68bf7dfc0 100644 --- a/libc/arch-arm/syscalls/sched_get_priority_min.S +++ b/libc/arch-arm/syscalls/sched_get_priority_min.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_min) mov ip, r7 ldr r7, =__NR_sched_get_priority_min @@ -12,5 +10,5 @@ ENTRY(sched_get_priority_min) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sched_get_priority_min) diff --git a/libc/arch-arm/syscalls/sched_getparam.S b/libc/arch-arm/syscalls/sched_getparam.S index 3d58651c8..32b97b850 100644 --- a/libc/arch-arm/syscalls/sched_getparam.S +++ b/libc/arch-arm/syscalls/sched_getparam.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_getparam) mov ip, r7 ldr r7, =__NR_sched_getparam @@ -12,5 +10,5 @@ ENTRY(sched_getparam) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sched_getparam) diff --git a/libc/arch-arm/syscalls/sched_getscheduler.S b/libc/arch-arm/syscalls/sched_getscheduler.S index e9478ca2c..330c2080f 100644 --- a/libc/arch-arm/syscalls/sched_getscheduler.S +++ b/libc/arch-arm/syscalls/sched_getscheduler.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_getscheduler) mov ip, r7 ldr r7, =__NR_sched_getscheduler @@ -12,5 +10,5 @@ ENTRY(sched_getscheduler) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sched_getscheduler) diff --git a/libc/arch-arm/syscalls/sched_rr_get_interval.S b/libc/arch-arm/syscalls/sched_rr_get_interval.S index ed90b73db..5d176ac2b 100644 --- a/libc/arch-arm/syscalls/sched_rr_get_interval.S +++ b/libc/arch-arm/syscalls/sched_rr_get_interval.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_rr_get_interval) mov ip, r7 ldr r7, =__NR_sched_rr_get_interval @@ -12,5 +10,5 @@ ENTRY(sched_rr_get_interval) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sched_rr_get_interval) diff --git a/libc/arch-arm/syscalls/sched_setaffinity.S b/libc/arch-arm/syscalls/sched_setaffinity.S index d5f72a94c..6653471f5 100644 --- a/libc/arch-arm/syscalls/sched_setaffinity.S +++ b/libc/arch-arm/syscalls/sched_setaffinity.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setaffinity) mov ip, r7 ldr r7, =__NR_sched_setaffinity @@ -12,5 +10,5 @@ ENTRY(sched_setaffinity) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sched_setaffinity) diff --git a/libc/arch-arm/syscalls/sched_setparam.S b/libc/arch-arm/syscalls/sched_setparam.S index 3ec06c006..16e1997a8 100644 --- a/libc/arch-arm/syscalls/sched_setparam.S +++ b/libc/arch-arm/syscalls/sched_setparam.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setparam) mov ip, r7 ldr r7, =__NR_sched_setparam @@ -12,5 +10,5 @@ ENTRY(sched_setparam) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sched_setparam) diff --git a/libc/arch-arm/syscalls/sched_setscheduler.S b/libc/arch-arm/syscalls/sched_setscheduler.S index 0e61ffb37..2ec9fecf1 100644 --- a/libc/arch-arm/syscalls/sched_setscheduler.S +++ b/libc/arch-arm/syscalls/sched_setscheduler.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setscheduler) mov ip, r7 ldr r7, =__NR_sched_setscheduler @@ -12,5 +10,5 @@ ENTRY(sched_setscheduler) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sched_setscheduler) diff --git a/libc/arch-arm/syscalls/sched_yield.S b/libc/arch-arm/syscalls/sched_yield.S index f26297ef6..1ec328f3c 100644 --- a/libc/arch-arm/syscalls/sched_yield.S +++ b/libc/arch-arm/syscalls/sched_yield.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_yield) mov ip, r7 ldr r7, =__NR_sched_yield @@ -12,5 +10,5 @@ ENTRY(sched_yield) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sched_yield) diff --git a/libc/arch-arm/syscalls/sendfile.S b/libc/arch-arm/syscalls/sendfile.S index e4df8fff6..afae0213a 100644 --- a/libc/arch-arm/syscalls/sendfile.S +++ b/libc/arch-arm/syscalls/sendfile.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendfile) mov ip, r7 ldr r7, =__NR_sendfile @@ -12,5 +10,5 @@ ENTRY(sendfile) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sendfile) diff --git a/libc/arch-arm/syscalls/sendfile64.S b/libc/arch-arm/syscalls/sendfile64.S index ab489632b..d0ad0b865 100644 --- a/libc/arch-arm/syscalls/sendfile64.S +++ b/libc/arch-arm/syscalls/sendfile64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendfile64) mov ip, r7 ldr r7, =__NR_sendfile64 @@ -12,5 +10,5 @@ ENTRY(sendfile64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sendfile64) diff --git a/libc/arch-arm/syscalls/sendmmsg.S b/libc/arch-arm/syscalls/sendmmsg.S index 998e6c7c9..8bb5f8065 100644 --- a/libc/arch-arm/syscalls/sendmmsg.S +++ b/libc/arch-arm/syscalls/sendmmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendmmsg) mov ip, r7 ldr r7, =__NR_sendmmsg @@ -12,5 +10,5 @@ ENTRY(sendmmsg) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sendmmsg) diff --git a/libc/arch-arm/syscalls/sendmsg.S b/libc/arch-arm/syscalls/sendmsg.S index d25d6b42e..fd381408f 100644 --- a/libc/arch-arm/syscalls/sendmsg.S +++ b/libc/arch-arm/syscalls/sendmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendmsg) mov ip, r7 ldr r7, =__NR_sendmsg @@ -12,5 +10,5 @@ ENTRY(sendmsg) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sendmsg) diff --git a/libc/arch-arm/syscalls/sendto.S b/libc/arch-arm/syscalls/sendto.S index b5e8de98a..29b7b0bf6 100644 --- a/libc/arch-arm/syscalls/sendto.S +++ b/libc/arch-arm/syscalls/sendto.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendto) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(sendto) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sendto) diff --git a/libc/arch-arm/syscalls/setfsgid.S b/libc/arch-arm/syscalls/setfsgid.S index 7cdb6103b..f677a9480 100644 --- a/libc/arch-arm/syscalls/setfsgid.S +++ b/libc/arch-arm/syscalls/setfsgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setfsgid) mov ip, r7 ldr r7, =__NR_setfsgid @@ -12,5 +10,5 @@ ENTRY(setfsgid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setfsgid) diff --git a/libc/arch-arm/syscalls/setfsuid.S b/libc/arch-arm/syscalls/setfsuid.S index ae65298b1..5d27a4d2d 100644 --- a/libc/arch-arm/syscalls/setfsuid.S +++ b/libc/arch-arm/syscalls/setfsuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setfsuid) mov ip, r7 ldr r7, =__NR_setfsuid @@ -12,5 +10,5 @@ ENTRY(setfsuid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setfsuid) diff --git a/libc/arch-arm/syscalls/setgid.S b/libc/arch-arm/syscalls/setgid.S index 15583ac0c..d9b2b889a 100644 --- a/libc/arch-arm/syscalls/setgid.S +++ b/libc/arch-arm/syscalls/setgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setgid) mov ip, r7 ldr r7, =__NR_setgid32 @@ -12,5 +10,5 @@ ENTRY(setgid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setgid) diff --git a/libc/arch-arm/syscalls/setgroups.S b/libc/arch-arm/syscalls/setgroups.S index eb610b1da..169de73f7 100644 --- a/libc/arch-arm/syscalls/setgroups.S +++ b/libc/arch-arm/syscalls/setgroups.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setgroups) mov ip, r7 ldr r7, =__NR_setgroups32 @@ -12,5 +10,5 @@ ENTRY(setgroups) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setgroups) diff --git a/libc/arch-arm/syscalls/setitimer.S b/libc/arch-arm/syscalls/setitimer.S index 4da2b4085..31b277b7c 100644 --- a/libc/arch-arm/syscalls/setitimer.S +++ b/libc/arch-arm/syscalls/setitimer.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setitimer) mov ip, r7 ldr r7, =__NR_setitimer @@ -12,5 +10,5 @@ ENTRY(setitimer) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setitimer) diff --git a/libc/arch-arm/syscalls/setns.S b/libc/arch-arm/syscalls/setns.S index 891a0ac4f..59203ef4a 100644 --- a/libc/arch-arm/syscalls/setns.S +++ b/libc/arch-arm/syscalls/setns.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setns) mov ip, r7 ldr r7, =__NR_setns @@ -12,5 +10,5 @@ ENTRY(setns) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setns) diff --git a/libc/arch-arm/syscalls/setpgid.S b/libc/arch-arm/syscalls/setpgid.S index e4edcdf31..4a91520b9 100644 --- a/libc/arch-arm/syscalls/setpgid.S +++ b/libc/arch-arm/syscalls/setpgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setpgid) mov ip, r7 ldr r7, =__NR_setpgid @@ -12,5 +10,5 @@ ENTRY(setpgid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setpgid) diff --git a/libc/arch-arm/syscalls/setpriority.S b/libc/arch-arm/syscalls/setpriority.S index 80d0d82c9..2053ce101 100644 --- a/libc/arch-arm/syscalls/setpriority.S +++ b/libc/arch-arm/syscalls/setpriority.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setpriority) mov ip, r7 ldr r7, =__NR_setpriority @@ -12,5 +10,5 @@ ENTRY(setpriority) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setpriority) diff --git a/libc/arch-arm/syscalls/setregid.S b/libc/arch-arm/syscalls/setregid.S index b2cd345ea..f1bdc6011 100644 --- a/libc/arch-arm/syscalls/setregid.S +++ b/libc/arch-arm/syscalls/setregid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setregid) mov ip, r7 ldr r7, =__NR_setregid32 @@ -12,5 +10,5 @@ ENTRY(setregid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setregid) diff --git a/libc/arch-arm/syscalls/setresgid.S b/libc/arch-arm/syscalls/setresgid.S index 75a9f7511..9b8968acd 100644 --- a/libc/arch-arm/syscalls/setresgid.S +++ b/libc/arch-arm/syscalls/setresgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setresgid) mov ip, r7 ldr r7, =__NR_setresgid32 @@ -12,5 +10,5 @@ ENTRY(setresgid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setresgid) diff --git a/libc/arch-arm/syscalls/setresuid.S b/libc/arch-arm/syscalls/setresuid.S index f3382f246..c26a95542 100644 --- a/libc/arch-arm/syscalls/setresuid.S +++ b/libc/arch-arm/syscalls/setresuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setresuid) mov ip, r7 ldr r7, =__NR_setresuid32 @@ -12,5 +10,5 @@ ENTRY(setresuid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setresuid) diff --git a/libc/arch-arm/syscalls/setreuid.S b/libc/arch-arm/syscalls/setreuid.S index 1d866e995..796191a25 100644 --- a/libc/arch-arm/syscalls/setreuid.S +++ b/libc/arch-arm/syscalls/setreuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setreuid) mov ip, r7 ldr r7, =__NR_setreuid32 @@ -12,5 +10,5 @@ ENTRY(setreuid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setreuid) diff --git a/libc/arch-arm/syscalls/setrlimit.S b/libc/arch-arm/syscalls/setrlimit.S index 0ddd7118f..c87b21b78 100644 --- a/libc/arch-arm/syscalls/setrlimit.S +++ b/libc/arch-arm/syscalls/setrlimit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setrlimit) mov ip, r7 ldr r7, =__NR_setrlimit @@ -12,5 +10,5 @@ ENTRY(setrlimit) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setrlimit) diff --git a/libc/arch-arm/syscalls/setsid.S b/libc/arch-arm/syscalls/setsid.S index 69b351fd4..83bda1b03 100644 --- a/libc/arch-arm/syscalls/setsid.S +++ b/libc/arch-arm/syscalls/setsid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setsid) mov ip, r7 ldr r7, =__NR_setsid @@ -12,5 +10,5 @@ ENTRY(setsid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setsid) diff --git a/libc/arch-arm/syscalls/setsockopt.S b/libc/arch-arm/syscalls/setsockopt.S index 87df622e8..8ea38932c 100644 --- a/libc/arch-arm/syscalls/setsockopt.S +++ b/libc/arch-arm/syscalls/setsockopt.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setsockopt) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(setsockopt) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setsockopt) diff --git a/libc/arch-arm/syscalls/settimeofday.S b/libc/arch-arm/syscalls/settimeofday.S index 76697fc22..5763f40ef 100644 --- a/libc/arch-arm/syscalls/settimeofday.S +++ b/libc/arch-arm/syscalls/settimeofday.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(settimeofday) mov ip, r7 ldr r7, =__NR_settimeofday @@ -12,5 +10,5 @@ ENTRY(settimeofday) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(settimeofday) diff --git a/libc/arch-arm/syscalls/setuid.S b/libc/arch-arm/syscalls/setuid.S index 26d3ed184..55b349cb0 100644 --- a/libc/arch-arm/syscalls/setuid.S +++ b/libc/arch-arm/syscalls/setuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setuid) mov ip, r7 ldr r7, =__NR_setuid32 @@ -12,5 +10,5 @@ ENTRY(setuid) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setuid) diff --git a/libc/arch-arm/syscalls/setxattr.S b/libc/arch-arm/syscalls/setxattr.S index ec948ce18..8ba4b77bf 100644 --- a/libc/arch-arm/syscalls/setxattr.S +++ b/libc/arch-arm/syscalls/setxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setxattr) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(setxattr) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(setxattr) diff --git a/libc/arch-arm/syscalls/shutdown.S b/libc/arch-arm/syscalls/shutdown.S index e9a27d42d..889934a97 100644 --- a/libc/arch-arm/syscalls/shutdown.S +++ b/libc/arch-arm/syscalls/shutdown.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(shutdown) mov ip, r7 ldr r7, =__NR_shutdown @@ -12,5 +10,5 @@ ENTRY(shutdown) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(shutdown) diff --git a/libc/arch-arm/syscalls/sigaltstack.S b/libc/arch-arm/syscalls/sigaltstack.S index 18a1ffe2d..b61b25d10 100644 --- a/libc/arch-arm/syscalls/sigaltstack.S +++ b/libc/arch-arm/syscalls/sigaltstack.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sigaltstack) mov ip, r7 ldr r7, =__NR_sigaltstack @@ -12,5 +10,5 @@ ENTRY(sigaltstack) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sigaltstack) diff --git a/libc/arch-arm/syscalls/socketpair.S b/libc/arch-arm/syscalls/socketpair.S index 66f0c3208..f3c8a4bed 100644 --- a/libc/arch-arm/syscalls/socketpair.S +++ b/libc/arch-arm/syscalls/socketpair.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(socketpair) mov ip, r7 ldr r7, =__NR_socketpair @@ -12,5 +10,5 @@ ENTRY(socketpair) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(socketpair) diff --git a/libc/arch-arm/syscalls/splice.S b/libc/arch-arm/syscalls/splice.S index 6273138a2..6bc3f0d4a 100644 --- a/libc/arch-arm/syscalls/splice.S +++ b/libc/arch-arm/syscalls/splice.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(splice) mov ip, sp stmfd sp!, {r4, r5, r6, r7} @@ -20,5 +18,5 @@ ENTRY(splice) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(splice) diff --git a/libc/arch-arm/syscalls/swapoff.S b/libc/arch-arm/syscalls/swapoff.S index a497aad8a..a7aaa8245 100644 --- a/libc/arch-arm/syscalls/swapoff.S +++ b/libc/arch-arm/syscalls/swapoff.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(swapoff) mov ip, r7 ldr r7, =__NR_swapoff @@ -12,5 +10,5 @@ ENTRY(swapoff) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(swapoff) diff --git a/libc/arch-arm/syscalls/swapon.S b/libc/arch-arm/syscalls/swapon.S index ded2abc87..6ea93c3c8 100644 --- a/libc/arch-arm/syscalls/swapon.S +++ b/libc/arch-arm/syscalls/swapon.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(swapon) mov ip, r7 ldr r7, =__NR_swapon @@ -12,5 +10,5 @@ ENTRY(swapon) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(swapon) diff --git a/libc/arch-arm/syscalls/symlinkat.S b/libc/arch-arm/syscalls/symlinkat.S index cc91b8804..d330a54e7 100644 --- a/libc/arch-arm/syscalls/symlinkat.S +++ b/libc/arch-arm/syscalls/symlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(symlinkat) mov ip, r7 ldr r7, =__NR_symlinkat @@ -12,5 +10,5 @@ ENTRY(symlinkat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(symlinkat) diff --git a/libc/arch-arm/syscalls/sync.S b/libc/arch-arm/syscalls/sync.S index ab228553b..48ecfc0c3 100644 --- a/libc/arch-arm/syscalls/sync.S +++ b/libc/arch-arm/syscalls/sync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sync) mov ip, r7 ldr r7, =__NR_sync @@ -12,5 +10,5 @@ ENTRY(sync) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sync) diff --git a/libc/arch-arm/syscalls/sysinfo.S b/libc/arch-arm/syscalls/sysinfo.S index f5fb4e666..709478e7d 100644 --- a/libc/arch-arm/syscalls/sysinfo.S +++ b/libc/arch-arm/syscalls/sysinfo.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sysinfo) mov ip, r7 ldr r7, =__NR_sysinfo @@ -12,5 +10,5 @@ ENTRY(sysinfo) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(sysinfo) diff --git a/libc/arch-arm/syscalls/tee.S b/libc/arch-arm/syscalls/tee.S index 7e155dfe0..a019c005c 100644 --- a/libc/arch-arm/syscalls/tee.S +++ b/libc/arch-arm/syscalls/tee.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(tee) mov ip, r7 ldr r7, =__NR_tee @@ -12,5 +10,5 @@ ENTRY(tee) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(tee) diff --git a/libc/arch-arm/syscalls/tgkill.S b/libc/arch-arm/syscalls/tgkill.S index 98440b1ed..206846535 100644 --- a/libc/arch-arm/syscalls/tgkill.S +++ b/libc/arch-arm/syscalls/tgkill.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(tgkill) mov ip, r7 ldr r7, =__NR_tgkill @@ -12,5 +10,5 @@ ENTRY(tgkill) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(tgkill) diff --git a/libc/arch-arm/syscalls/timerfd_create.S b/libc/arch-arm/syscalls/timerfd_create.S index 9211b54b2..89a80cd9c 100644 --- a/libc/arch-arm/syscalls/timerfd_create.S +++ b/libc/arch-arm/syscalls/timerfd_create.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_create) mov ip, r7 ldr r7, =__NR_timerfd_create @@ -12,5 +10,5 @@ ENTRY(timerfd_create) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(timerfd_create) diff --git a/libc/arch-arm/syscalls/timerfd_gettime.S b/libc/arch-arm/syscalls/timerfd_gettime.S index c27e008e7..4a7df7616 100644 --- a/libc/arch-arm/syscalls/timerfd_gettime.S +++ b/libc/arch-arm/syscalls/timerfd_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_gettime) mov ip, r7 ldr r7, =__NR_timerfd_gettime @@ -12,5 +10,5 @@ ENTRY(timerfd_gettime) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(timerfd_gettime) diff --git a/libc/arch-arm/syscalls/timerfd_settime.S b/libc/arch-arm/syscalls/timerfd_settime.S index 7acd40832..2e0fe93a6 100644 --- a/libc/arch-arm/syscalls/timerfd_settime.S +++ b/libc/arch-arm/syscalls/timerfd_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_settime) mov ip, r7 ldr r7, =__NR_timerfd_settime @@ -12,5 +10,5 @@ ENTRY(timerfd_settime) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(timerfd_settime) diff --git a/libc/arch-arm/syscalls/times.S b/libc/arch-arm/syscalls/times.S index b5695c455..289c18510 100644 --- a/libc/arch-arm/syscalls/times.S +++ b/libc/arch-arm/syscalls/times.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(times) mov ip, r7 ldr r7, =__NR_times @@ -12,5 +10,5 @@ ENTRY(times) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(times) diff --git a/libc/arch-arm/syscalls/truncate.S b/libc/arch-arm/syscalls/truncate.S index 791572282..bb33beba2 100644 --- a/libc/arch-arm/syscalls/truncate.S +++ b/libc/arch-arm/syscalls/truncate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(truncate) mov ip, r7 ldr r7, =__NR_truncate @@ -12,5 +10,5 @@ ENTRY(truncate) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(truncate) diff --git a/libc/arch-arm/syscalls/truncate64.S b/libc/arch-arm/syscalls/truncate64.S index d59374a80..9cafbb5f6 100644 --- a/libc/arch-arm/syscalls/truncate64.S +++ b/libc/arch-arm/syscalls/truncate64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(truncate64) mov ip, r7 ldr r7, =__NR_truncate64 @@ -12,5 +10,5 @@ ENTRY(truncate64) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(truncate64) diff --git a/libc/arch-arm/syscalls/umask.S b/libc/arch-arm/syscalls/umask.S index 5b03fb35c..5dc446104 100644 --- a/libc/arch-arm/syscalls/umask.S +++ b/libc/arch-arm/syscalls/umask.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(umask) mov ip, r7 ldr r7, =__NR_umask @@ -12,5 +10,5 @@ ENTRY(umask) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(umask) diff --git a/libc/arch-arm/syscalls/umount2.S b/libc/arch-arm/syscalls/umount2.S index 841eb9748..435eda432 100644 --- a/libc/arch-arm/syscalls/umount2.S +++ b/libc/arch-arm/syscalls/umount2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(umount2) mov ip, r7 ldr r7, =__NR_umount2 @@ -12,5 +10,5 @@ ENTRY(umount2) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(umount2) diff --git a/libc/arch-arm/syscalls/uname.S b/libc/arch-arm/syscalls/uname.S index 76480b429..8af612331 100644 --- a/libc/arch-arm/syscalls/uname.S +++ b/libc/arch-arm/syscalls/uname.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(uname) mov ip, r7 ldr r7, =__NR_uname @@ -12,5 +10,5 @@ ENTRY(uname) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(uname) diff --git a/libc/arch-arm/syscalls/unlinkat.S b/libc/arch-arm/syscalls/unlinkat.S index 675976815..96257e6f9 100644 --- a/libc/arch-arm/syscalls/unlinkat.S +++ b/libc/arch-arm/syscalls/unlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(unlinkat) mov ip, r7 ldr r7, =__NR_unlinkat @@ -12,5 +10,5 @@ ENTRY(unlinkat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(unlinkat) diff --git a/libc/arch-arm/syscalls/unshare.S b/libc/arch-arm/syscalls/unshare.S index 19a5b6a2e..8054171a5 100644 --- a/libc/arch-arm/syscalls/unshare.S +++ b/libc/arch-arm/syscalls/unshare.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(unshare) mov ip, r7 ldr r7, =__NR_unshare @@ -12,5 +10,5 @@ ENTRY(unshare) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(unshare) diff --git a/libc/arch-arm/syscalls/utimensat.S b/libc/arch-arm/syscalls/utimensat.S index 6d506880e..f3c2fa2b8 100644 --- a/libc/arch-arm/syscalls/utimensat.S +++ b/libc/arch-arm/syscalls/utimensat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(utimensat) mov ip, r7 ldr r7, =__NR_utimensat @@ -12,5 +10,5 @@ ENTRY(utimensat) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(utimensat) diff --git a/libc/arch-arm/syscalls/vfork.S b/libc/arch-arm/syscalls/vfork.S index 8543986c1..5f4cb3dbd 100644 --- a/libc/arch-arm/syscalls/vfork.S +++ b/libc/arch-arm/syscalls/vfork.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(vfork) mov ip, r7 ldr r7, =__NR_vfork @@ -12,5 +10,5 @@ ENTRY(vfork) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(vfork) diff --git a/libc/arch-arm/syscalls/vmsplice.S b/libc/arch-arm/syscalls/vmsplice.S index 8239158bf..cc12ca52d 100644 --- a/libc/arch-arm/syscalls/vmsplice.S +++ b/libc/arch-arm/syscalls/vmsplice.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(vmsplice) mov ip, r7 ldr r7, =__NR_vmsplice @@ -12,5 +10,5 @@ ENTRY(vmsplice) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(vmsplice) diff --git a/libc/arch-arm/syscalls/wait4.S b/libc/arch-arm/syscalls/wait4.S index ffb2587ab..26a492917 100644 --- a/libc/arch-arm/syscalls/wait4.S +++ b/libc/arch-arm/syscalls/wait4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(wait4) mov ip, r7 ldr r7, =__NR_wait4 @@ -12,5 +10,5 @@ ENTRY(wait4) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(wait4) diff --git a/libc/arch-arm/syscalls/write.S b/libc/arch-arm/syscalls/write.S index 8da1176ca..bf89d7ff8 100644 --- a/libc/arch-arm/syscalls/write.S +++ b/libc/arch-arm/syscalls/write.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(write) mov ip, r7 ldr r7, =__NR_write @@ -12,5 +10,5 @@ ENTRY(write) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(write) diff --git a/libc/arch-arm/syscalls/writev.S b/libc/arch-arm/syscalls/writev.S index f17ad9429..15b527507 100644 --- a/libc/arch-arm/syscalls/writev.S +++ b/libc/arch-arm/syscalls/writev.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(writev) mov ip, r7 ldr r7, =__NR_writev @@ -12,5 +10,5 @@ ENTRY(writev) cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(writev) diff --git a/libc/arch-arm64/bionic/__bionic_clone.S b/libc/arch-arm64/bionic/__bionic_clone.S index 74db4b5b8..56ac0f69d 100644 --- a/libc/arch-arm64/bionic/__bionic_clone.S +++ b/libc/arch-arm64/bionic/__bionic_clone.S @@ -44,7 +44,7 @@ ENTRY(__bionic_clone) # Set errno if something went wrong. cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret diff --git a/libc/arch-arm64/bionic/syscall.S b/libc/arch-arm64/bionic/syscall.S index 658af78ae..8389f9830 100644 --- a/libc/arch-arm64/bionic/syscall.S +++ b/libc/arch-arm64/bionic/syscall.S @@ -43,7 +43,7 @@ ENTRY(syscall) /* check if syscall returned successfully */ cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(syscall) diff --git a/libc/arch-arm64/bionic/vfork.S b/libc/arch-arm64/bionic/vfork.S index c70062317..b6a672d43 100644 --- a/libc/arch-arm64/bionic/vfork.S +++ b/libc/arch-arm64/bionic/vfork.S @@ -42,7 +42,7 @@ ENTRY(vfork) cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(vfork) diff --git a/libc/arch-arm64/syscalls/__accept4.S b/libc/arch-arm64/syscalls/__accept4.S index bee9fdaab..559e6a735 100644 --- a/libc/arch-arm64/syscalls/__accept4.S +++ b/libc/arch-arm64/syscalls/__accept4.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__accept4) mov x8, __NR_accept4 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__accept4) diff --git a/libc/arch-arm64/syscalls/__brk.S b/libc/arch-arm64/syscalls/__brk.S index e91e76232..fb794bf46 100644 --- a/libc/arch-arm64/syscalls/__brk.S +++ b/libc/arch-arm64/syscalls/__brk.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__brk) mov x8, __NR_brk svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__brk) diff --git a/libc/arch-arm64/syscalls/__clock_gettime.S b/libc/arch-arm64/syscalls/__clock_gettime.S index d4a65e8a1..658ab2991 100644 --- a/libc/arch-arm64/syscalls/__clock_gettime.S +++ b/libc/arch-arm64/syscalls/__clock_gettime.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__clock_gettime) mov x8, __NR_clock_gettime svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__clock_gettime) diff --git a/libc/arch-arm64/syscalls/__connect.S b/libc/arch-arm64/syscalls/__connect.S index 4f19dc756..c18e6ebba 100644 --- a/libc/arch-arm64/syscalls/__connect.S +++ b/libc/arch-arm64/syscalls/__connect.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__connect) mov x8, __NR_connect svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__connect) diff --git a/libc/arch-arm64/syscalls/__epoll_pwait.S b/libc/arch-arm64/syscalls/__epoll_pwait.S index 7f40fbc98..acf2bbf1e 100644 --- a/libc/arch-arm64/syscalls/__epoll_pwait.S +++ b/libc/arch-arm64/syscalls/__epoll_pwait.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__epoll_pwait) mov x8, __NR_epoll_pwait svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__epoll_pwait) diff --git a/libc/arch-arm64/syscalls/__exit.S b/libc/arch-arm64/syscalls/__exit.S index 30849ce01..b6b1866a5 100644 --- a/libc/arch-arm64/syscalls/__exit.S +++ b/libc/arch-arm64/syscalls/__exit.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__exit) mov x8, __NR_exit svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__exit) diff --git a/libc/arch-arm64/syscalls/__getcpu.S b/libc/arch-arm64/syscalls/__getcpu.S index 482191708..11ed68ea5 100644 --- a/libc/arch-arm64/syscalls/__getcpu.S +++ b/libc/arch-arm64/syscalls/__getcpu.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__getcpu) mov x8, __NR_getcpu svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__getcpu) diff --git a/libc/arch-arm64/syscalls/__getcwd.S b/libc/arch-arm64/syscalls/__getcwd.S index f0212a288..c64f4d2bb 100644 --- a/libc/arch-arm64/syscalls/__getcwd.S +++ b/libc/arch-arm64/syscalls/__getcwd.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__getcwd) mov x8, __NR_getcwd svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__getcwd) diff --git a/libc/arch-arm64/syscalls/__getdents64.S b/libc/arch-arm64/syscalls/__getdents64.S index 0061cd69f..994339005 100644 --- a/libc/arch-arm64/syscalls/__getdents64.S +++ b/libc/arch-arm64/syscalls/__getdents64.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__getdents64) mov x8, __NR_getdents64 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__getdents64) diff --git a/libc/arch-arm64/syscalls/__getpid.S b/libc/arch-arm64/syscalls/__getpid.S index 011d82d47..fbc96dff8 100644 --- a/libc/arch-arm64/syscalls/__getpid.S +++ b/libc/arch-arm64/syscalls/__getpid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__getpid) mov x8, __NR_getpid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__getpid) diff --git a/libc/arch-arm64/syscalls/__getpriority.S b/libc/arch-arm64/syscalls/__getpriority.S index 80188b301..9d98e226f 100644 --- a/libc/arch-arm64/syscalls/__getpriority.S +++ b/libc/arch-arm64/syscalls/__getpriority.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__getpriority) mov x8, __NR_getpriority svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__getpriority) diff --git a/libc/arch-arm64/syscalls/__gettimeofday.S b/libc/arch-arm64/syscalls/__gettimeofday.S index 7d1b5d3cb..0c8206abd 100644 --- a/libc/arch-arm64/syscalls/__gettimeofday.S +++ b/libc/arch-arm64/syscalls/__gettimeofday.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__gettimeofday) mov x8, __NR_gettimeofday svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__gettimeofday) diff --git a/libc/arch-arm64/syscalls/__ioctl.S b/libc/arch-arm64/syscalls/__ioctl.S index 3d42f1a5b..62bc28c53 100644 --- a/libc/arch-arm64/syscalls/__ioctl.S +++ b/libc/arch-arm64/syscalls/__ioctl.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__ioctl) mov x8, __NR_ioctl svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__ioctl) diff --git a/libc/arch-arm64/syscalls/__openat.S b/libc/arch-arm64/syscalls/__openat.S index 1ff0b4871..8b6853fd8 100644 --- a/libc/arch-arm64/syscalls/__openat.S +++ b/libc/arch-arm64/syscalls/__openat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__openat) mov x8, __NR_openat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__openat) diff --git a/libc/arch-arm64/syscalls/__ppoll.S b/libc/arch-arm64/syscalls/__ppoll.S index 9517ce3fd..1f54d67df 100644 --- a/libc/arch-arm64/syscalls/__ppoll.S +++ b/libc/arch-arm64/syscalls/__ppoll.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__ppoll) mov x8, __NR_ppoll svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__ppoll) diff --git a/libc/arch-arm64/syscalls/__pselect6.S b/libc/arch-arm64/syscalls/__pselect6.S index 7e14e02df..388d84e81 100644 --- a/libc/arch-arm64/syscalls/__pselect6.S +++ b/libc/arch-arm64/syscalls/__pselect6.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__pselect6) mov x8, __NR_pselect6 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__pselect6) diff --git a/libc/arch-arm64/syscalls/__ptrace.S b/libc/arch-arm64/syscalls/__ptrace.S index b325e291d..d68b67407 100644 --- a/libc/arch-arm64/syscalls/__ptrace.S +++ b/libc/arch-arm64/syscalls/__ptrace.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__ptrace) mov x8, __NR_ptrace svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__ptrace) diff --git a/libc/arch-arm64/syscalls/__reboot.S b/libc/arch-arm64/syscalls/__reboot.S index 04b18c9b9..79cd5be97 100644 --- a/libc/arch-arm64/syscalls/__reboot.S +++ b/libc/arch-arm64/syscalls/__reboot.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__reboot) mov x8, __NR_reboot svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__reboot) diff --git a/libc/arch-arm64/syscalls/__rt_sigaction.S b/libc/arch-arm64/syscalls/__rt_sigaction.S index 3def55839..65fea2e7c 100644 --- a/libc/arch-arm64/syscalls/__rt_sigaction.S +++ b/libc/arch-arm64/syscalls/__rt_sigaction.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__rt_sigaction) mov x8, __NR_rt_sigaction svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__rt_sigaction) diff --git a/libc/arch-arm64/syscalls/__rt_sigpending.S b/libc/arch-arm64/syscalls/__rt_sigpending.S index 3ac0cb890..65537812d 100644 --- a/libc/arch-arm64/syscalls/__rt_sigpending.S +++ b/libc/arch-arm64/syscalls/__rt_sigpending.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__rt_sigpending) mov x8, __NR_rt_sigpending svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__rt_sigpending) diff --git a/libc/arch-arm64/syscalls/__rt_sigprocmask.S b/libc/arch-arm64/syscalls/__rt_sigprocmask.S index 72c7ea6fb..95127d659 100644 --- a/libc/arch-arm64/syscalls/__rt_sigprocmask.S +++ b/libc/arch-arm64/syscalls/__rt_sigprocmask.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__rt_sigprocmask) mov x8, __NR_rt_sigprocmask svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__rt_sigprocmask) diff --git a/libc/arch-arm64/syscalls/__rt_sigsuspend.S b/libc/arch-arm64/syscalls/__rt_sigsuspend.S index a289713f5..7cbd8d6d3 100644 --- a/libc/arch-arm64/syscalls/__rt_sigsuspend.S +++ b/libc/arch-arm64/syscalls/__rt_sigsuspend.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__rt_sigsuspend) mov x8, __NR_rt_sigsuspend svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__rt_sigsuspend) diff --git a/libc/arch-arm64/syscalls/__rt_sigtimedwait.S b/libc/arch-arm64/syscalls/__rt_sigtimedwait.S index c61e4ac99..8001635d1 100644 --- a/libc/arch-arm64/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-arm64/syscalls/__rt_sigtimedwait.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__rt_sigtimedwait) mov x8, __NR_rt_sigtimedwait svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__rt_sigtimedwait) diff --git a/libc/arch-arm64/syscalls/__sched_getaffinity.S b/libc/arch-arm64/syscalls/__sched_getaffinity.S index 5bee77e70..7dad15e20 100644 --- a/libc/arch-arm64/syscalls/__sched_getaffinity.S +++ b/libc/arch-arm64/syscalls/__sched_getaffinity.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__sched_getaffinity) mov x8, __NR_sched_getaffinity svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__sched_getaffinity) diff --git a/libc/arch-arm64/syscalls/__set_tid_address.S b/libc/arch-arm64/syscalls/__set_tid_address.S index e4790bf65..f7ae16dc6 100644 --- a/libc/arch-arm64/syscalls/__set_tid_address.S +++ b/libc/arch-arm64/syscalls/__set_tid_address.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__set_tid_address) mov x8, __NR_set_tid_address svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__set_tid_address) diff --git a/libc/arch-arm64/syscalls/__signalfd4.S b/libc/arch-arm64/syscalls/__signalfd4.S index a977a6cb6..f6e34974c 100644 --- a/libc/arch-arm64/syscalls/__signalfd4.S +++ b/libc/arch-arm64/syscalls/__signalfd4.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__signalfd4) mov x8, __NR_signalfd4 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__signalfd4) diff --git a/libc/arch-arm64/syscalls/__socket.S b/libc/arch-arm64/syscalls/__socket.S index f8bb2ac2e..344bb2dc7 100644 --- a/libc/arch-arm64/syscalls/__socket.S +++ b/libc/arch-arm64/syscalls/__socket.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__socket) mov x8, __NR_socket svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__socket) diff --git a/libc/arch-arm64/syscalls/__timer_create.S b/libc/arch-arm64/syscalls/__timer_create.S index bb54952d6..4790845f8 100644 --- a/libc/arch-arm64/syscalls/__timer_create.S +++ b/libc/arch-arm64/syscalls/__timer_create.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__timer_create) mov x8, __NR_timer_create svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__timer_create) diff --git a/libc/arch-arm64/syscalls/__timer_delete.S b/libc/arch-arm64/syscalls/__timer_delete.S index 47d82f253..ce12613c2 100644 --- a/libc/arch-arm64/syscalls/__timer_delete.S +++ b/libc/arch-arm64/syscalls/__timer_delete.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__timer_delete) mov x8, __NR_timer_delete svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__timer_delete) diff --git a/libc/arch-arm64/syscalls/__timer_getoverrun.S b/libc/arch-arm64/syscalls/__timer_getoverrun.S index 9c0611284..2cfdf6a3c 100644 --- a/libc/arch-arm64/syscalls/__timer_getoverrun.S +++ b/libc/arch-arm64/syscalls/__timer_getoverrun.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__timer_getoverrun) mov x8, __NR_timer_getoverrun svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__timer_getoverrun) diff --git a/libc/arch-arm64/syscalls/__timer_gettime.S b/libc/arch-arm64/syscalls/__timer_gettime.S index e7c7cfe40..a1ea323bb 100644 --- a/libc/arch-arm64/syscalls/__timer_gettime.S +++ b/libc/arch-arm64/syscalls/__timer_gettime.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__timer_gettime) mov x8, __NR_timer_gettime svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__timer_gettime) diff --git a/libc/arch-arm64/syscalls/__timer_settime.S b/libc/arch-arm64/syscalls/__timer_settime.S index d4a4996f8..059d705d8 100644 --- a/libc/arch-arm64/syscalls/__timer_settime.S +++ b/libc/arch-arm64/syscalls/__timer_settime.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__timer_settime) mov x8, __NR_timer_settime svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__timer_settime) diff --git a/libc/arch-arm64/syscalls/__waitid.S b/libc/arch-arm64/syscalls/__waitid.S index 5bff48804..8bd649db9 100644 --- a/libc/arch-arm64/syscalls/__waitid.S +++ b/libc/arch-arm64/syscalls/__waitid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(__waitid) mov x8, __NR_waitid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(__waitid) diff --git a/libc/arch-arm64/syscalls/_exit.S b/libc/arch-arm64/syscalls/_exit.S index e88e77acd..edf6744a8 100644 --- a/libc/arch-arm64/syscalls/_exit.S +++ b/libc/arch-arm64/syscalls/_exit.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(_exit) mov x8, __NR_exit_group svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(_exit) diff --git a/libc/arch-arm64/syscalls/acct.S b/libc/arch-arm64/syscalls/acct.S index 97a8a0c85..48cb4e937 100644 --- a/libc/arch-arm64/syscalls/acct.S +++ b/libc/arch-arm64/syscalls/acct.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(acct) mov x8, __NR_acct svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(acct) diff --git a/libc/arch-arm64/syscalls/bind.S b/libc/arch-arm64/syscalls/bind.S index 1d6d90189..47170ff9e 100644 --- a/libc/arch-arm64/syscalls/bind.S +++ b/libc/arch-arm64/syscalls/bind.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(bind) mov x8, __NR_bind svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(bind) diff --git a/libc/arch-arm64/syscalls/capget.S b/libc/arch-arm64/syscalls/capget.S index de849297a..7e0dfe9a9 100644 --- a/libc/arch-arm64/syscalls/capget.S +++ b/libc/arch-arm64/syscalls/capget.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(capget) mov x8, __NR_capget svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(capget) diff --git a/libc/arch-arm64/syscalls/capset.S b/libc/arch-arm64/syscalls/capset.S index 1616f8f07..e7b7a8dd9 100644 --- a/libc/arch-arm64/syscalls/capset.S +++ b/libc/arch-arm64/syscalls/capset.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(capset) mov x8, __NR_capset svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(capset) diff --git a/libc/arch-arm64/syscalls/chdir.S b/libc/arch-arm64/syscalls/chdir.S index ccaa2e283..723cd08b1 100644 --- a/libc/arch-arm64/syscalls/chdir.S +++ b/libc/arch-arm64/syscalls/chdir.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(chdir) mov x8, __NR_chdir svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(chdir) diff --git a/libc/arch-arm64/syscalls/chroot.S b/libc/arch-arm64/syscalls/chroot.S index bede17204..e4f6bd9e3 100644 --- a/libc/arch-arm64/syscalls/chroot.S +++ b/libc/arch-arm64/syscalls/chroot.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(chroot) mov x8, __NR_chroot svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(chroot) diff --git a/libc/arch-arm64/syscalls/clock_getres.S b/libc/arch-arm64/syscalls/clock_getres.S index 3944a155b..33fda8f80 100644 --- a/libc/arch-arm64/syscalls/clock_getres.S +++ b/libc/arch-arm64/syscalls/clock_getres.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(clock_getres) mov x8, __NR_clock_getres svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(clock_getres) diff --git a/libc/arch-arm64/syscalls/clock_nanosleep.S b/libc/arch-arm64/syscalls/clock_nanosleep.S index 2182f6713..349c5cca7 100644 --- a/libc/arch-arm64/syscalls/clock_nanosleep.S +++ b/libc/arch-arm64/syscalls/clock_nanosleep.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(clock_nanosleep) mov x8, __NR_clock_nanosleep svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(clock_nanosleep) diff --git a/libc/arch-arm64/syscalls/clock_settime.S b/libc/arch-arm64/syscalls/clock_settime.S index 14a662b29..62354d19a 100644 --- a/libc/arch-arm64/syscalls/clock_settime.S +++ b/libc/arch-arm64/syscalls/clock_settime.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(clock_settime) mov x8, __NR_clock_settime svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(clock_settime) diff --git a/libc/arch-arm64/syscalls/close.S b/libc/arch-arm64/syscalls/close.S index da9a151af..3624581cb 100644 --- a/libc/arch-arm64/syscalls/close.S +++ b/libc/arch-arm64/syscalls/close.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(close) mov x8, __NR_close svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(close) diff --git a/libc/arch-arm64/syscalls/delete_module.S b/libc/arch-arm64/syscalls/delete_module.S index 5dcd07f5c..db8d947ee 100644 --- a/libc/arch-arm64/syscalls/delete_module.S +++ b/libc/arch-arm64/syscalls/delete_module.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(delete_module) mov x8, __NR_delete_module svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(delete_module) diff --git a/libc/arch-arm64/syscalls/dup.S b/libc/arch-arm64/syscalls/dup.S index 33a1b6597..4e95045e5 100644 --- a/libc/arch-arm64/syscalls/dup.S +++ b/libc/arch-arm64/syscalls/dup.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(dup) mov x8, __NR_dup svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(dup) diff --git a/libc/arch-arm64/syscalls/dup3.S b/libc/arch-arm64/syscalls/dup3.S index 441fec9f1..2e6be32b6 100644 --- a/libc/arch-arm64/syscalls/dup3.S +++ b/libc/arch-arm64/syscalls/dup3.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(dup3) mov x8, __NR_dup3 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(dup3) diff --git a/libc/arch-arm64/syscalls/epoll_create1.S b/libc/arch-arm64/syscalls/epoll_create1.S index d314f5557..6ef518e8e 100644 --- a/libc/arch-arm64/syscalls/epoll_create1.S +++ b/libc/arch-arm64/syscalls/epoll_create1.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(epoll_create1) mov x8, __NR_epoll_create1 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(epoll_create1) diff --git a/libc/arch-arm64/syscalls/epoll_ctl.S b/libc/arch-arm64/syscalls/epoll_ctl.S index 004c0666e..1188f38de 100644 --- a/libc/arch-arm64/syscalls/epoll_ctl.S +++ b/libc/arch-arm64/syscalls/epoll_ctl.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(epoll_ctl) mov x8, __NR_epoll_ctl svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(epoll_ctl) diff --git a/libc/arch-arm64/syscalls/eventfd.S b/libc/arch-arm64/syscalls/eventfd.S index 11e97d01f..ca5df12d3 100644 --- a/libc/arch-arm64/syscalls/eventfd.S +++ b/libc/arch-arm64/syscalls/eventfd.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(eventfd) mov x8, __NR_eventfd2 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(eventfd) diff --git a/libc/arch-arm64/syscalls/execve.S b/libc/arch-arm64/syscalls/execve.S index 7b6d943f4..fc8fb6850 100644 --- a/libc/arch-arm64/syscalls/execve.S +++ b/libc/arch-arm64/syscalls/execve.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(execve) mov x8, __NR_execve svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(execve) diff --git a/libc/arch-arm64/syscalls/faccessat.S b/libc/arch-arm64/syscalls/faccessat.S index 7bd866546..4c96cfa7b 100644 --- a/libc/arch-arm64/syscalls/faccessat.S +++ b/libc/arch-arm64/syscalls/faccessat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(faccessat) mov x8, __NR_faccessat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(faccessat) diff --git a/libc/arch-arm64/syscalls/fallocate.S b/libc/arch-arm64/syscalls/fallocate.S index d8795ae1e..ef3d4a4c4 100644 --- a/libc/arch-arm64/syscalls/fallocate.S +++ b/libc/arch-arm64/syscalls/fallocate.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fallocate) mov x8, __NR_fallocate svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fallocate) diff --git a/libc/arch-arm64/syscalls/fchdir.S b/libc/arch-arm64/syscalls/fchdir.S index 7739fedef..2e164cbe3 100644 --- a/libc/arch-arm64/syscalls/fchdir.S +++ b/libc/arch-arm64/syscalls/fchdir.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fchdir) mov x8, __NR_fchdir svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fchdir) diff --git a/libc/arch-arm64/syscalls/fchmod.S b/libc/arch-arm64/syscalls/fchmod.S index 3eec6cbb5..83a80607d 100644 --- a/libc/arch-arm64/syscalls/fchmod.S +++ b/libc/arch-arm64/syscalls/fchmod.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fchmod) mov x8, __NR_fchmod svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fchmod) diff --git a/libc/arch-arm64/syscalls/fchmodat.S b/libc/arch-arm64/syscalls/fchmodat.S index f2f285eda..8c5bb0e13 100644 --- a/libc/arch-arm64/syscalls/fchmodat.S +++ b/libc/arch-arm64/syscalls/fchmodat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fchmodat) mov x8, __NR_fchmodat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fchmodat) diff --git a/libc/arch-arm64/syscalls/fchown.S b/libc/arch-arm64/syscalls/fchown.S index a689ba0c1..4456f1be0 100644 --- a/libc/arch-arm64/syscalls/fchown.S +++ b/libc/arch-arm64/syscalls/fchown.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fchown) mov x8, __NR_fchown svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fchown) diff --git a/libc/arch-arm64/syscalls/fchownat.S b/libc/arch-arm64/syscalls/fchownat.S index 7ede083d7..7ba661151 100644 --- a/libc/arch-arm64/syscalls/fchownat.S +++ b/libc/arch-arm64/syscalls/fchownat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fchownat) mov x8, __NR_fchownat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fchownat) diff --git a/libc/arch-arm64/syscalls/fcntl.S b/libc/arch-arm64/syscalls/fcntl.S index 257c765b5..e2787aebf 100644 --- a/libc/arch-arm64/syscalls/fcntl.S +++ b/libc/arch-arm64/syscalls/fcntl.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fcntl) mov x8, __NR_fcntl svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fcntl) diff --git a/libc/arch-arm64/syscalls/fdatasync.S b/libc/arch-arm64/syscalls/fdatasync.S index 233abda7b..225ab29e3 100644 --- a/libc/arch-arm64/syscalls/fdatasync.S +++ b/libc/arch-arm64/syscalls/fdatasync.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fdatasync) mov x8, __NR_fdatasync svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fdatasync) diff --git a/libc/arch-arm64/syscalls/fgetxattr.S b/libc/arch-arm64/syscalls/fgetxattr.S index bd579ff45..0d6ada791 100644 --- a/libc/arch-arm64/syscalls/fgetxattr.S +++ b/libc/arch-arm64/syscalls/fgetxattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fgetxattr) mov x8, __NR_fgetxattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fgetxattr) diff --git a/libc/arch-arm64/syscalls/flistxattr.S b/libc/arch-arm64/syscalls/flistxattr.S index 95ccbe269..8921bb4cc 100644 --- a/libc/arch-arm64/syscalls/flistxattr.S +++ b/libc/arch-arm64/syscalls/flistxattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(flistxattr) mov x8, __NR_flistxattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(flistxattr) diff --git a/libc/arch-arm64/syscalls/flock.S b/libc/arch-arm64/syscalls/flock.S index 2151d6cca..0c036c804 100644 --- a/libc/arch-arm64/syscalls/flock.S +++ b/libc/arch-arm64/syscalls/flock.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(flock) mov x8, __NR_flock svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(flock) diff --git a/libc/arch-arm64/syscalls/fremovexattr.S b/libc/arch-arm64/syscalls/fremovexattr.S index 8dd107d06..cf3a37131 100644 --- a/libc/arch-arm64/syscalls/fremovexattr.S +++ b/libc/arch-arm64/syscalls/fremovexattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fremovexattr) mov x8, __NR_fremovexattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fremovexattr) diff --git a/libc/arch-arm64/syscalls/fsetxattr.S b/libc/arch-arm64/syscalls/fsetxattr.S index 9e546869a..e69e718b0 100644 --- a/libc/arch-arm64/syscalls/fsetxattr.S +++ b/libc/arch-arm64/syscalls/fsetxattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fsetxattr) mov x8, __NR_fsetxattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fsetxattr) diff --git a/libc/arch-arm64/syscalls/fstat64.S b/libc/arch-arm64/syscalls/fstat64.S index f354e1335..85a07f5bd 100644 --- a/libc/arch-arm64/syscalls/fstat64.S +++ b/libc/arch-arm64/syscalls/fstat64.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fstat64) mov x8, __NR_fstat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fstat64) diff --git a/libc/arch-arm64/syscalls/fstatat64.S b/libc/arch-arm64/syscalls/fstatat64.S index 2fe056e43..dafd9823d 100644 --- a/libc/arch-arm64/syscalls/fstatat64.S +++ b/libc/arch-arm64/syscalls/fstatat64.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fstatat64) mov x8, __NR_newfstatat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fstatat64) diff --git a/libc/arch-arm64/syscalls/fstatfs64.S b/libc/arch-arm64/syscalls/fstatfs64.S index c67ffd691..2ca2dcd7f 100644 --- a/libc/arch-arm64/syscalls/fstatfs64.S +++ b/libc/arch-arm64/syscalls/fstatfs64.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fstatfs64) mov x8, __NR_fstatfs svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fstatfs64) diff --git a/libc/arch-arm64/syscalls/fsync.S b/libc/arch-arm64/syscalls/fsync.S index ae2fc61df..2bc0d0bbb 100644 --- a/libc/arch-arm64/syscalls/fsync.S +++ b/libc/arch-arm64/syscalls/fsync.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(fsync) mov x8, __NR_fsync svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(fsync) diff --git a/libc/arch-arm64/syscalls/ftruncate.S b/libc/arch-arm64/syscalls/ftruncate.S index adf87fe4e..c6e99f591 100644 --- a/libc/arch-arm64/syscalls/ftruncate.S +++ b/libc/arch-arm64/syscalls/ftruncate.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(ftruncate) mov x8, __NR_ftruncate svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(ftruncate) diff --git a/libc/arch-arm64/syscalls/getegid.S b/libc/arch-arm64/syscalls/getegid.S index 5066cae47..f7d60d9ab 100644 --- a/libc/arch-arm64/syscalls/getegid.S +++ b/libc/arch-arm64/syscalls/getegid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getegid) mov x8, __NR_getegid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getegid) diff --git a/libc/arch-arm64/syscalls/geteuid.S b/libc/arch-arm64/syscalls/geteuid.S index 25b1ea9fd..3096a9250 100644 --- a/libc/arch-arm64/syscalls/geteuid.S +++ b/libc/arch-arm64/syscalls/geteuid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(geteuid) mov x8, __NR_geteuid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(geteuid) diff --git a/libc/arch-arm64/syscalls/getgid.S b/libc/arch-arm64/syscalls/getgid.S index 3f49cb44c..2f921ff34 100644 --- a/libc/arch-arm64/syscalls/getgid.S +++ b/libc/arch-arm64/syscalls/getgid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getgid) mov x8, __NR_getgid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getgid) diff --git a/libc/arch-arm64/syscalls/getgroups.S b/libc/arch-arm64/syscalls/getgroups.S index 3df4974cc..a9a897e6a 100644 --- a/libc/arch-arm64/syscalls/getgroups.S +++ b/libc/arch-arm64/syscalls/getgroups.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getgroups) mov x8, __NR_getgroups svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getgroups) diff --git a/libc/arch-arm64/syscalls/getitimer.S b/libc/arch-arm64/syscalls/getitimer.S index 70cb73150..f37063c68 100644 --- a/libc/arch-arm64/syscalls/getitimer.S +++ b/libc/arch-arm64/syscalls/getitimer.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getitimer) mov x8, __NR_getitimer svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getitimer) diff --git a/libc/arch-arm64/syscalls/getpeername.S b/libc/arch-arm64/syscalls/getpeername.S index eefb24af5..8374d607c 100644 --- a/libc/arch-arm64/syscalls/getpeername.S +++ b/libc/arch-arm64/syscalls/getpeername.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getpeername) mov x8, __NR_getpeername svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getpeername) diff --git a/libc/arch-arm64/syscalls/getpgid.S b/libc/arch-arm64/syscalls/getpgid.S index d12ac5270..ffc0d9102 100644 --- a/libc/arch-arm64/syscalls/getpgid.S +++ b/libc/arch-arm64/syscalls/getpgid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getpgid) mov x8, __NR_getpgid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getpgid) diff --git a/libc/arch-arm64/syscalls/getppid.S b/libc/arch-arm64/syscalls/getppid.S index af8965beb..1e21bdf4c 100644 --- a/libc/arch-arm64/syscalls/getppid.S +++ b/libc/arch-arm64/syscalls/getppid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getppid) mov x8, __NR_getppid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getppid) diff --git a/libc/arch-arm64/syscalls/getresgid.S b/libc/arch-arm64/syscalls/getresgid.S index 3c1c0c098..b15357a58 100644 --- a/libc/arch-arm64/syscalls/getresgid.S +++ b/libc/arch-arm64/syscalls/getresgid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getresgid) mov x8, __NR_getresgid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getresgid) diff --git a/libc/arch-arm64/syscalls/getresuid.S b/libc/arch-arm64/syscalls/getresuid.S index f50e060fa..53de6b746 100644 --- a/libc/arch-arm64/syscalls/getresuid.S +++ b/libc/arch-arm64/syscalls/getresuid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getresuid) mov x8, __NR_getresuid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getresuid) diff --git a/libc/arch-arm64/syscalls/getrlimit.S b/libc/arch-arm64/syscalls/getrlimit.S index b759912b7..518ab73d7 100644 --- a/libc/arch-arm64/syscalls/getrlimit.S +++ b/libc/arch-arm64/syscalls/getrlimit.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getrlimit) mov x8, __NR_getrlimit svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getrlimit) diff --git a/libc/arch-arm64/syscalls/getrusage.S b/libc/arch-arm64/syscalls/getrusage.S index 1a0d30f16..676221a95 100644 --- a/libc/arch-arm64/syscalls/getrusage.S +++ b/libc/arch-arm64/syscalls/getrusage.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getrusage) mov x8, __NR_getrusage svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getrusage) diff --git a/libc/arch-arm64/syscalls/getsid.S b/libc/arch-arm64/syscalls/getsid.S index 3c3d7530b..cfbdfdb9e 100644 --- a/libc/arch-arm64/syscalls/getsid.S +++ b/libc/arch-arm64/syscalls/getsid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getsid) mov x8, __NR_getsid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getsid) diff --git a/libc/arch-arm64/syscalls/getsockname.S b/libc/arch-arm64/syscalls/getsockname.S index a337986d6..4cca55daf 100644 --- a/libc/arch-arm64/syscalls/getsockname.S +++ b/libc/arch-arm64/syscalls/getsockname.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getsockname) mov x8, __NR_getsockname svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getsockname) diff --git a/libc/arch-arm64/syscalls/getsockopt.S b/libc/arch-arm64/syscalls/getsockopt.S index 4b3abd5c9..96b8c0f13 100644 --- a/libc/arch-arm64/syscalls/getsockopt.S +++ b/libc/arch-arm64/syscalls/getsockopt.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getsockopt) mov x8, __NR_getsockopt svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getsockopt) diff --git a/libc/arch-arm64/syscalls/getuid.S b/libc/arch-arm64/syscalls/getuid.S index a9193c5cc..ef95ba7fc 100644 --- a/libc/arch-arm64/syscalls/getuid.S +++ b/libc/arch-arm64/syscalls/getuid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getuid) mov x8, __NR_getuid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getuid) diff --git a/libc/arch-arm64/syscalls/getxattr.S b/libc/arch-arm64/syscalls/getxattr.S index afa81ef85..2b38f3dfc 100644 --- a/libc/arch-arm64/syscalls/getxattr.S +++ b/libc/arch-arm64/syscalls/getxattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(getxattr) mov x8, __NR_getxattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(getxattr) diff --git a/libc/arch-arm64/syscalls/init_module.S b/libc/arch-arm64/syscalls/init_module.S index bf0f7d330..913c7cc46 100644 --- a/libc/arch-arm64/syscalls/init_module.S +++ b/libc/arch-arm64/syscalls/init_module.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(init_module) mov x8, __NR_init_module svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(init_module) diff --git a/libc/arch-arm64/syscalls/inotify_add_watch.S b/libc/arch-arm64/syscalls/inotify_add_watch.S index dc30ae57d..83a5b57ce 100644 --- a/libc/arch-arm64/syscalls/inotify_add_watch.S +++ b/libc/arch-arm64/syscalls/inotify_add_watch.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(inotify_add_watch) mov x8, __NR_inotify_add_watch svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(inotify_add_watch) diff --git a/libc/arch-arm64/syscalls/inotify_init1.S b/libc/arch-arm64/syscalls/inotify_init1.S index 1b40ef2cb..d3bc81bc7 100644 --- a/libc/arch-arm64/syscalls/inotify_init1.S +++ b/libc/arch-arm64/syscalls/inotify_init1.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(inotify_init1) mov x8, __NR_inotify_init1 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(inotify_init1) diff --git a/libc/arch-arm64/syscalls/inotify_rm_watch.S b/libc/arch-arm64/syscalls/inotify_rm_watch.S index 7c99e866d..c44445fa6 100644 --- a/libc/arch-arm64/syscalls/inotify_rm_watch.S +++ b/libc/arch-arm64/syscalls/inotify_rm_watch.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(inotify_rm_watch) mov x8, __NR_inotify_rm_watch svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(inotify_rm_watch) diff --git a/libc/arch-arm64/syscalls/kill.S b/libc/arch-arm64/syscalls/kill.S index e86e3a4d8..0334ff05b 100644 --- a/libc/arch-arm64/syscalls/kill.S +++ b/libc/arch-arm64/syscalls/kill.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(kill) mov x8, __NR_kill svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(kill) diff --git a/libc/arch-arm64/syscalls/klogctl.S b/libc/arch-arm64/syscalls/klogctl.S index 567db27fb..625f3592e 100644 --- a/libc/arch-arm64/syscalls/klogctl.S +++ b/libc/arch-arm64/syscalls/klogctl.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(klogctl) mov x8, __NR_syslog svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(klogctl) diff --git a/libc/arch-arm64/syscalls/lgetxattr.S b/libc/arch-arm64/syscalls/lgetxattr.S index 187462a7b..89db20626 100644 --- a/libc/arch-arm64/syscalls/lgetxattr.S +++ b/libc/arch-arm64/syscalls/lgetxattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(lgetxattr) mov x8, __NR_lgetxattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(lgetxattr) diff --git a/libc/arch-arm64/syscalls/linkat.S b/libc/arch-arm64/syscalls/linkat.S index 7cfc2e036..62aea3a2f 100644 --- a/libc/arch-arm64/syscalls/linkat.S +++ b/libc/arch-arm64/syscalls/linkat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(linkat) mov x8, __NR_linkat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(linkat) diff --git a/libc/arch-arm64/syscalls/listen.S b/libc/arch-arm64/syscalls/listen.S index 028b9bd42..ba97be9a7 100644 --- a/libc/arch-arm64/syscalls/listen.S +++ b/libc/arch-arm64/syscalls/listen.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(listen) mov x8, __NR_listen svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(listen) diff --git a/libc/arch-arm64/syscalls/listxattr.S b/libc/arch-arm64/syscalls/listxattr.S index 335fafe82..48208e626 100644 --- a/libc/arch-arm64/syscalls/listxattr.S +++ b/libc/arch-arm64/syscalls/listxattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(listxattr) mov x8, __NR_listxattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(listxattr) diff --git a/libc/arch-arm64/syscalls/llistxattr.S b/libc/arch-arm64/syscalls/llistxattr.S index e79674118..ed66005c8 100644 --- a/libc/arch-arm64/syscalls/llistxattr.S +++ b/libc/arch-arm64/syscalls/llistxattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(llistxattr) mov x8, __NR_llistxattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(llistxattr) diff --git a/libc/arch-arm64/syscalls/lremovexattr.S b/libc/arch-arm64/syscalls/lremovexattr.S index 9f4c02755..b5e51c7fa 100644 --- a/libc/arch-arm64/syscalls/lremovexattr.S +++ b/libc/arch-arm64/syscalls/lremovexattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(lremovexattr) mov x8, __NR_lremovexattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(lremovexattr) diff --git a/libc/arch-arm64/syscalls/lseek.S b/libc/arch-arm64/syscalls/lseek.S index aa717687b..de96df042 100644 --- a/libc/arch-arm64/syscalls/lseek.S +++ b/libc/arch-arm64/syscalls/lseek.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(lseek) mov x8, __NR_lseek svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(lseek) diff --git a/libc/arch-arm64/syscalls/lsetxattr.S b/libc/arch-arm64/syscalls/lsetxattr.S index babf02d37..b873513d5 100644 --- a/libc/arch-arm64/syscalls/lsetxattr.S +++ b/libc/arch-arm64/syscalls/lsetxattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(lsetxattr) mov x8, __NR_lsetxattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(lsetxattr) diff --git a/libc/arch-arm64/syscalls/madvise.S b/libc/arch-arm64/syscalls/madvise.S index 3d393f1d8..6fced4153 100644 --- a/libc/arch-arm64/syscalls/madvise.S +++ b/libc/arch-arm64/syscalls/madvise.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(madvise) mov x8, __NR_madvise svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(madvise) diff --git a/libc/arch-arm64/syscalls/mincore.S b/libc/arch-arm64/syscalls/mincore.S index 443257486..5781b4c97 100644 --- a/libc/arch-arm64/syscalls/mincore.S +++ b/libc/arch-arm64/syscalls/mincore.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(mincore) mov x8, __NR_mincore svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(mincore) diff --git a/libc/arch-arm64/syscalls/mkdirat.S b/libc/arch-arm64/syscalls/mkdirat.S index 36c876d87..fa868a25d 100644 --- a/libc/arch-arm64/syscalls/mkdirat.S +++ b/libc/arch-arm64/syscalls/mkdirat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(mkdirat) mov x8, __NR_mkdirat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(mkdirat) diff --git a/libc/arch-arm64/syscalls/mknodat.S b/libc/arch-arm64/syscalls/mknodat.S index e0584dba3..13632ec6a 100644 --- a/libc/arch-arm64/syscalls/mknodat.S +++ b/libc/arch-arm64/syscalls/mknodat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(mknodat) mov x8, __NR_mknodat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(mknodat) diff --git a/libc/arch-arm64/syscalls/mlock.S b/libc/arch-arm64/syscalls/mlock.S index 10ddb077b..1eee85cd8 100644 --- a/libc/arch-arm64/syscalls/mlock.S +++ b/libc/arch-arm64/syscalls/mlock.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(mlock) mov x8, __NR_mlock svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(mlock) diff --git a/libc/arch-arm64/syscalls/mlockall.S b/libc/arch-arm64/syscalls/mlockall.S index 3602d7170..d4ca1857e 100644 --- a/libc/arch-arm64/syscalls/mlockall.S +++ b/libc/arch-arm64/syscalls/mlockall.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(mlockall) mov x8, __NR_mlockall svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(mlockall) diff --git a/libc/arch-arm64/syscalls/mmap.S b/libc/arch-arm64/syscalls/mmap.S index e4e39ca69..64b955e26 100644 --- a/libc/arch-arm64/syscalls/mmap.S +++ b/libc/arch-arm64/syscalls/mmap.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(mmap) mov x8, __NR_mmap svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(mmap) diff --git a/libc/arch-arm64/syscalls/mount.S b/libc/arch-arm64/syscalls/mount.S index 9b53754dc..cd3501721 100644 --- a/libc/arch-arm64/syscalls/mount.S +++ b/libc/arch-arm64/syscalls/mount.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(mount) mov x8, __NR_mount svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(mount) diff --git a/libc/arch-arm64/syscalls/mprotect.S b/libc/arch-arm64/syscalls/mprotect.S index 788d46e87..9dd881299 100644 --- a/libc/arch-arm64/syscalls/mprotect.S +++ b/libc/arch-arm64/syscalls/mprotect.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(mprotect) mov x8, __NR_mprotect svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(mprotect) diff --git a/libc/arch-arm64/syscalls/mremap.S b/libc/arch-arm64/syscalls/mremap.S index 861d52a04..69b91d6bc 100644 --- a/libc/arch-arm64/syscalls/mremap.S +++ b/libc/arch-arm64/syscalls/mremap.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(mremap) mov x8, __NR_mremap svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(mremap) diff --git a/libc/arch-arm64/syscalls/msync.S b/libc/arch-arm64/syscalls/msync.S index 009ce18e4..72387ea80 100644 --- a/libc/arch-arm64/syscalls/msync.S +++ b/libc/arch-arm64/syscalls/msync.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(msync) mov x8, __NR_msync svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(msync) diff --git a/libc/arch-arm64/syscalls/munlock.S b/libc/arch-arm64/syscalls/munlock.S index 45d6d17f8..d2a248cd0 100644 --- a/libc/arch-arm64/syscalls/munlock.S +++ b/libc/arch-arm64/syscalls/munlock.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(munlock) mov x8, __NR_munlock svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(munlock) diff --git a/libc/arch-arm64/syscalls/munlockall.S b/libc/arch-arm64/syscalls/munlockall.S index 624062254..ac42cb44c 100644 --- a/libc/arch-arm64/syscalls/munlockall.S +++ b/libc/arch-arm64/syscalls/munlockall.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(munlockall) mov x8, __NR_munlockall svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(munlockall) diff --git a/libc/arch-arm64/syscalls/munmap.S b/libc/arch-arm64/syscalls/munmap.S index 029126858..9d3f6a6dd 100644 --- a/libc/arch-arm64/syscalls/munmap.S +++ b/libc/arch-arm64/syscalls/munmap.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(munmap) mov x8, __NR_munmap svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(munmap) diff --git a/libc/arch-arm64/syscalls/nanosleep.S b/libc/arch-arm64/syscalls/nanosleep.S index 7496530de..d3e6fae62 100644 --- a/libc/arch-arm64/syscalls/nanosleep.S +++ b/libc/arch-arm64/syscalls/nanosleep.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(nanosleep) mov x8, __NR_nanosleep svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(nanosleep) diff --git a/libc/arch-arm64/syscalls/personality.S b/libc/arch-arm64/syscalls/personality.S index 1c6530c68..f9f3bf692 100644 --- a/libc/arch-arm64/syscalls/personality.S +++ b/libc/arch-arm64/syscalls/personality.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(personality) mov x8, __NR_personality svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(personality) diff --git a/libc/arch-arm64/syscalls/pipe2.S b/libc/arch-arm64/syscalls/pipe2.S index 45538d35b..89181cd46 100644 --- a/libc/arch-arm64/syscalls/pipe2.S +++ b/libc/arch-arm64/syscalls/pipe2.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(pipe2) mov x8, __NR_pipe2 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(pipe2) diff --git a/libc/arch-arm64/syscalls/prctl.S b/libc/arch-arm64/syscalls/prctl.S index ddfe5a61f..86f4df510 100644 --- a/libc/arch-arm64/syscalls/prctl.S +++ b/libc/arch-arm64/syscalls/prctl.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(prctl) mov x8, __NR_prctl svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(prctl) diff --git a/libc/arch-arm64/syscalls/pread64.S b/libc/arch-arm64/syscalls/pread64.S index 9c2fb3416..eafc04426 100644 --- a/libc/arch-arm64/syscalls/pread64.S +++ b/libc/arch-arm64/syscalls/pread64.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(pread64) mov x8, __NR_pread64 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(pread64) diff --git a/libc/arch-arm64/syscalls/prlimit64.S b/libc/arch-arm64/syscalls/prlimit64.S index d3e07b9a4..2bece996f 100644 --- a/libc/arch-arm64/syscalls/prlimit64.S +++ b/libc/arch-arm64/syscalls/prlimit64.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(prlimit64) mov x8, __NR_prlimit64 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(prlimit64) diff --git a/libc/arch-arm64/syscalls/pwrite64.S b/libc/arch-arm64/syscalls/pwrite64.S index 33ae24b4f..6970954b6 100644 --- a/libc/arch-arm64/syscalls/pwrite64.S +++ b/libc/arch-arm64/syscalls/pwrite64.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(pwrite64) mov x8, __NR_pwrite64 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(pwrite64) diff --git a/libc/arch-arm64/syscalls/read.S b/libc/arch-arm64/syscalls/read.S index 344039187..ddb88c8dc 100644 --- a/libc/arch-arm64/syscalls/read.S +++ b/libc/arch-arm64/syscalls/read.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(read) mov x8, __NR_read svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(read) diff --git a/libc/arch-arm64/syscalls/readahead.S b/libc/arch-arm64/syscalls/readahead.S index 73683f22f..445abd45b 100644 --- a/libc/arch-arm64/syscalls/readahead.S +++ b/libc/arch-arm64/syscalls/readahead.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(readahead) mov x8, __NR_readahead svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(readahead) diff --git a/libc/arch-arm64/syscalls/readlinkat.S b/libc/arch-arm64/syscalls/readlinkat.S index 1a89d21c3..62cc9e2a8 100644 --- a/libc/arch-arm64/syscalls/readlinkat.S +++ b/libc/arch-arm64/syscalls/readlinkat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(readlinkat) mov x8, __NR_readlinkat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(readlinkat) diff --git a/libc/arch-arm64/syscalls/readv.S b/libc/arch-arm64/syscalls/readv.S index b5d154a87..6e7f15136 100644 --- a/libc/arch-arm64/syscalls/readv.S +++ b/libc/arch-arm64/syscalls/readv.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(readv) mov x8, __NR_readv svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(readv) diff --git a/libc/arch-arm64/syscalls/recvfrom.S b/libc/arch-arm64/syscalls/recvfrom.S index 80bc1aa66..aecf165a7 100644 --- a/libc/arch-arm64/syscalls/recvfrom.S +++ b/libc/arch-arm64/syscalls/recvfrom.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(recvfrom) mov x8, __NR_recvfrom svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(recvfrom) diff --git a/libc/arch-arm64/syscalls/recvmmsg.S b/libc/arch-arm64/syscalls/recvmmsg.S index aa69442b5..b9cae69bb 100644 --- a/libc/arch-arm64/syscalls/recvmmsg.S +++ b/libc/arch-arm64/syscalls/recvmmsg.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(recvmmsg) mov x8, __NR_recvmmsg svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(recvmmsg) diff --git a/libc/arch-arm64/syscalls/recvmsg.S b/libc/arch-arm64/syscalls/recvmsg.S index 095e2aaac..2dafdc9ba 100644 --- a/libc/arch-arm64/syscalls/recvmsg.S +++ b/libc/arch-arm64/syscalls/recvmsg.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(recvmsg) mov x8, __NR_recvmsg svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(recvmsg) diff --git a/libc/arch-arm64/syscalls/removexattr.S b/libc/arch-arm64/syscalls/removexattr.S index f279f01f5..ede36a6bb 100644 --- a/libc/arch-arm64/syscalls/removexattr.S +++ b/libc/arch-arm64/syscalls/removexattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(removexattr) mov x8, __NR_removexattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(removexattr) diff --git a/libc/arch-arm64/syscalls/renameat.S b/libc/arch-arm64/syscalls/renameat.S index 7c308cd06..96025df29 100644 --- a/libc/arch-arm64/syscalls/renameat.S +++ b/libc/arch-arm64/syscalls/renameat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(renameat) mov x8, __NR_renameat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(renameat) diff --git a/libc/arch-arm64/syscalls/sched_get_priority_max.S b/libc/arch-arm64/syscalls/sched_get_priority_max.S index e80ce3585..c8488898e 100644 --- a/libc/arch-arm64/syscalls/sched_get_priority_max.S +++ b/libc/arch-arm64/syscalls/sched_get_priority_max.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_max) mov x8, __NR_sched_get_priority_max svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sched_get_priority_max) diff --git a/libc/arch-arm64/syscalls/sched_get_priority_min.S b/libc/arch-arm64/syscalls/sched_get_priority_min.S index 3f5f4870a..74b72a29d 100644 --- a/libc/arch-arm64/syscalls/sched_get_priority_min.S +++ b/libc/arch-arm64/syscalls/sched_get_priority_min.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_min) mov x8, __NR_sched_get_priority_min svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sched_get_priority_min) diff --git a/libc/arch-arm64/syscalls/sched_getparam.S b/libc/arch-arm64/syscalls/sched_getparam.S index 17568671e..75a32d420 100644 --- a/libc/arch-arm64/syscalls/sched_getparam.S +++ b/libc/arch-arm64/syscalls/sched_getparam.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sched_getparam) mov x8, __NR_sched_getparam svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sched_getparam) diff --git a/libc/arch-arm64/syscalls/sched_getscheduler.S b/libc/arch-arm64/syscalls/sched_getscheduler.S index 8fa145f16..e24baf268 100644 --- a/libc/arch-arm64/syscalls/sched_getscheduler.S +++ b/libc/arch-arm64/syscalls/sched_getscheduler.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sched_getscheduler) mov x8, __NR_sched_getscheduler svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sched_getscheduler) diff --git a/libc/arch-arm64/syscalls/sched_rr_get_interval.S b/libc/arch-arm64/syscalls/sched_rr_get_interval.S index 7ff393c10..2a6936b1b 100644 --- a/libc/arch-arm64/syscalls/sched_rr_get_interval.S +++ b/libc/arch-arm64/syscalls/sched_rr_get_interval.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sched_rr_get_interval) mov x8, __NR_sched_rr_get_interval svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sched_rr_get_interval) diff --git a/libc/arch-arm64/syscalls/sched_setaffinity.S b/libc/arch-arm64/syscalls/sched_setaffinity.S index 287845956..30b58f61f 100644 --- a/libc/arch-arm64/syscalls/sched_setaffinity.S +++ b/libc/arch-arm64/syscalls/sched_setaffinity.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sched_setaffinity) mov x8, __NR_sched_setaffinity svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sched_setaffinity) diff --git a/libc/arch-arm64/syscalls/sched_setparam.S b/libc/arch-arm64/syscalls/sched_setparam.S index 413560655..eaf25bab4 100644 --- a/libc/arch-arm64/syscalls/sched_setparam.S +++ b/libc/arch-arm64/syscalls/sched_setparam.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sched_setparam) mov x8, __NR_sched_setparam svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sched_setparam) diff --git a/libc/arch-arm64/syscalls/sched_setscheduler.S b/libc/arch-arm64/syscalls/sched_setscheduler.S index e8f991ce9..31d53c442 100644 --- a/libc/arch-arm64/syscalls/sched_setscheduler.S +++ b/libc/arch-arm64/syscalls/sched_setscheduler.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sched_setscheduler) mov x8, __NR_sched_setscheduler svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sched_setscheduler) diff --git a/libc/arch-arm64/syscalls/sched_yield.S b/libc/arch-arm64/syscalls/sched_yield.S index cd6a97871..4cfeedaa1 100644 --- a/libc/arch-arm64/syscalls/sched_yield.S +++ b/libc/arch-arm64/syscalls/sched_yield.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sched_yield) mov x8, __NR_sched_yield svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sched_yield) diff --git a/libc/arch-arm64/syscalls/sendfile.S b/libc/arch-arm64/syscalls/sendfile.S index c5792247a..17a0d4657 100644 --- a/libc/arch-arm64/syscalls/sendfile.S +++ b/libc/arch-arm64/syscalls/sendfile.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sendfile) mov x8, __NR_sendfile svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sendfile) diff --git a/libc/arch-arm64/syscalls/sendmmsg.S b/libc/arch-arm64/syscalls/sendmmsg.S index e9ce811be..e91c2461a 100644 --- a/libc/arch-arm64/syscalls/sendmmsg.S +++ b/libc/arch-arm64/syscalls/sendmmsg.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sendmmsg) mov x8, __NR_sendmmsg svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sendmmsg) diff --git a/libc/arch-arm64/syscalls/sendmsg.S b/libc/arch-arm64/syscalls/sendmsg.S index 78c5e6837..a34354360 100644 --- a/libc/arch-arm64/syscalls/sendmsg.S +++ b/libc/arch-arm64/syscalls/sendmsg.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sendmsg) mov x8, __NR_sendmsg svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sendmsg) diff --git a/libc/arch-arm64/syscalls/sendto.S b/libc/arch-arm64/syscalls/sendto.S index a3ef95deb..6a6813e54 100644 --- a/libc/arch-arm64/syscalls/sendto.S +++ b/libc/arch-arm64/syscalls/sendto.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sendto) mov x8, __NR_sendto svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sendto) diff --git a/libc/arch-arm64/syscalls/setfsgid.S b/libc/arch-arm64/syscalls/setfsgid.S index 4d28536e0..1a45df34e 100644 --- a/libc/arch-arm64/syscalls/setfsgid.S +++ b/libc/arch-arm64/syscalls/setfsgid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setfsgid) mov x8, __NR_setfsgid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setfsgid) diff --git a/libc/arch-arm64/syscalls/setfsuid.S b/libc/arch-arm64/syscalls/setfsuid.S index 238bbf87b..cd4efd79e 100644 --- a/libc/arch-arm64/syscalls/setfsuid.S +++ b/libc/arch-arm64/syscalls/setfsuid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setfsuid) mov x8, __NR_setfsuid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setfsuid) diff --git a/libc/arch-arm64/syscalls/setgid.S b/libc/arch-arm64/syscalls/setgid.S index 182ce1faa..c128fb9dc 100644 --- a/libc/arch-arm64/syscalls/setgid.S +++ b/libc/arch-arm64/syscalls/setgid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setgid) mov x8, __NR_setgid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setgid) diff --git a/libc/arch-arm64/syscalls/setgroups.S b/libc/arch-arm64/syscalls/setgroups.S index 2bc5c7fb5..aedabd61d 100644 --- a/libc/arch-arm64/syscalls/setgroups.S +++ b/libc/arch-arm64/syscalls/setgroups.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setgroups) mov x8, __NR_setgroups svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setgroups) diff --git a/libc/arch-arm64/syscalls/setitimer.S b/libc/arch-arm64/syscalls/setitimer.S index 1a5bbb353..7ce861715 100644 --- a/libc/arch-arm64/syscalls/setitimer.S +++ b/libc/arch-arm64/syscalls/setitimer.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setitimer) mov x8, __NR_setitimer svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setitimer) diff --git a/libc/arch-arm64/syscalls/setns.S b/libc/arch-arm64/syscalls/setns.S index 68c32dad2..386e8f48f 100644 --- a/libc/arch-arm64/syscalls/setns.S +++ b/libc/arch-arm64/syscalls/setns.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setns) mov x8, __NR_setns svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setns) diff --git a/libc/arch-arm64/syscalls/setpgid.S b/libc/arch-arm64/syscalls/setpgid.S index 890d35420..458c88ba0 100644 --- a/libc/arch-arm64/syscalls/setpgid.S +++ b/libc/arch-arm64/syscalls/setpgid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setpgid) mov x8, __NR_setpgid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setpgid) diff --git a/libc/arch-arm64/syscalls/setpriority.S b/libc/arch-arm64/syscalls/setpriority.S index 17550ea7e..ed58f2670 100644 --- a/libc/arch-arm64/syscalls/setpriority.S +++ b/libc/arch-arm64/syscalls/setpriority.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setpriority) mov x8, __NR_setpriority svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setpriority) diff --git a/libc/arch-arm64/syscalls/setregid.S b/libc/arch-arm64/syscalls/setregid.S index aa351a887..30d902d6b 100644 --- a/libc/arch-arm64/syscalls/setregid.S +++ b/libc/arch-arm64/syscalls/setregid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setregid) mov x8, __NR_setregid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setregid) diff --git a/libc/arch-arm64/syscalls/setresgid.S b/libc/arch-arm64/syscalls/setresgid.S index 517e59eba..f56e6ce76 100644 --- a/libc/arch-arm64/syscalls/setresgid.S +++ b/libc/arch-arm64/syscalls/setresgid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setresgid) mov x8, __NR_setresgid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setresgid) diff --git a/libc/arch-arm64/syscalls/setresuid.S b/libc/arch-arm64/syscalls/setresuid.S index 6829cef33..d5c5cc6d9 100644 --- a/libc/arch-arm64/syscalls/setresuid.S +++ b/libc/arch-arm64/syscalls/setresuid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setresuid) mov x8, __NR_setresuid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setresuid) diff --git a/libc/arch-arm64/syscalls/setreuid.S b/libc/arch-arm64/syscalls/setreuid.S index af342efad..e76c72ed4 100644 --- a/libc/arch-arm64/syscalls/setreuid.S +++ b/libc/arch-arm64/syscalls/setreuid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setreuid) mov x8, __NR_setreuid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setreuid) diff --git a/libc/arch-arm64/syscalls/setrlimit.S b/libc/arch-arm64/syscalls/setrlimit.S index 4401984fa..6cb6b9898 100644 --- a/libc/arch-arm64/syscalls/setrlimit.S +++ b/libc/arch-arm64/syscalls/setrlimit.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setrlimit) mov x8, __NR_setrlimit svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setrlimit) diff --git a/libc/arch-arm64/syscalls/setsid.S b/libc/arch-arm64/syscalls/setsid.S index 64c76f221..1bb4cc771 100644 --- a/libc/arch-arm64/syscalls/setsid.S +++ b/libc/arch-arm64/syscalls/setsid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setsid) mov x8, __NR_setsid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setsid) diff --git a/libc/arch-arm64/syscalls/setsockopt.S b/libc/arch-arm64/syscalls/setsockopt.S index 51af8474b..14b01367e 100644 --- a/libc/arch-arm64/syscalls/setsockopt.S +++ b/libc/arch-arm64/syscalls/setsockopt.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setsockopt) mov x8, __NR_setsockopt svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setsockopt) diff --git a/libc/arch-arm64/syscalls/settimeofday.S b/libc/arch-arm64/syscalls/settimeofday.S index 357998cd4..4f0a078f6 100644 --- a/libc/arch-arm64/syscalls/settimeofday.S +++ b/libc/arch-arm64/syscalls/settimeofday.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(settimeofday) mov x8, __NR_settimeofday svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(settimeofday) diff --git a/libc/arch-arm64/syscalls/setuid.S b/libc/arch-arm64/syscalls/setuid.S index ad4243487..5500dd627 100644 --- a/libc/arch-arm64/syscalls/setuid.S +++ b/libc/arch-arm64/syscalls/setuid.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setuid) mov x8, __NR_setuid svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setuid) diff --git a/libc/arch-arm64/syscalls/setxattr.S b/libc/arch-arm64/syscalls/setxattr.S index cde2d5f3b..5ba9e3cb4 100644 --- a/libc/arch-arm64/syscalls/setxattr.S +++ b/libc/arch-arm64/syscalls/setxattr.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(setxattr) mov x8, __NR_setxattr svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(setxattr) diff --git a/libc/arch-arm64/syscalls/shutdown.S b/libc/arch-arm64/syscalls/shutdown.S index 48136471a..ab067fafe 100644 --- a/libc/arch-arm64/syscalls/shutdown.S +++ b/libc/arch-arm64/syscalls/shutdown.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(shutdown) mov x8, __NR_shutdown svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(shutdown) diff --git a/libc/arch-arm64/syscalls/sigaltstack.S b/libc/arch-arm64/syscalls/sigaltstack.S index 74f7e50a9..a9cbcafb6 100644 --- a/libc/arch-arm64/syscalls/sigaltstack.S +++ b/libc/arch-arm64/syscalls/sigaltstack.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sigaltstack) mov x8, __NR_sigaltstack svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sigaltstack) diff --git a/libc/arch-arm64/syscalls/socketpair.S b/libc/arch-arm64/syscalls/socketpair.S index ec2a3d257..bd70dac18 100644 --- a/libc/arch-arm64/syscalls/socketpair.S +++ b/libc/arch-arm64/syscalls/socketpair.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(socketpair) mov x8, __NR_socketpair svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(socketpair) diff --git a/libc/arch-arm64/syscalls/splice.S b/libc/arch-arm64/syscalls/splice.S index 30443a861..a5450d908 100644 --- a/libc/arch-arm64/syscalls/splice.S +++ b/libc/arch-arm64/syscalls/splice.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(splice) mov x8, __NR_splice svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(splice) diff --git a/libc/arch-arm64/syscalls/statfs64.S b/libc/arch-arm64/syscalls/statfs64.S index 00b32e79a..ec8c588df 100644 --- a/libc/arch-arm64/syscalls/statfs64.S +++ b/libc/arch-arm64/syscalls/statfs64.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(statfs64) mov x8, __NR_statfs svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(statfs64) diff --git a/libc/arch-arm64/syscalls/swapoff.S b/libc/arch-arm64/syscalls/swapoff.S index 54dabb5a6..0103bd7fa 100644 --- a/libc/arch-arm64/syscalls/swapoff.S +++ b/libc/arch-arm64/syscalls/swapoff.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(swapoff) mov x8, __NR_swapoff svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(swapoff) diff --git a/libc/arch-arm64/syscalls/swapon.S b/libc/arch-arm64/syscalls/swapon.S index 952252f4e..560c96086 100644 --- a/libc/arch-arm64/syscalls/swapon.S +++ b/libc/arch-arm64/syscalls/swapon.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(swapon) mov x8, __NR_swapon svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(swapon) diff --git a/libc/arch-arm64/syscalls/symlinkat.S b/libc/arch-arm64/syscalls/symlinkat.S index 27f9334f6..4a4ea2795 100644 --- a/libc/arch-arm64/syscalls/symlinkat.S +++ b/libc/arch-arm64/syscalls/symlinkat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(symlinkat) mov x8, __NR_symlinkat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(symlinkat) diff --git a/libc/arch-arm64/syscalls/sync.S b/libc/arch-arm64/syscalls/sync.S index 622b028e4..d285d4367 100644 --- a/libc/arch-arm64/syscalls/sync.S +++ b/libc/arch-arm64/syscalls/sync.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sync) mov x8, __NR_sync svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sync) diff --git a/libc/arch-arm64/syscalls/sysinfo.S b/libc/arch-arm64/syscalls/sysinfo.S index 81d8a944a..80a864199 100644 --- a/libc/arch-arm64/syscalls/sysinfo.S +++ b/libc/arch-arm64/syscalls/sysinfo.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(sysinfo) mov x8, __NR_sysinfo svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(sysinfo) diff --git a/libc/arch-arm64/syscalls/tee.S b/libc/arch-arm64/syscalls/tee.S index cb317aad3..d7baa26f4 100644 --- a/libc/arch-arm64/syscalls/tee.S +++ b/libc/arch-arm64/syscalls/tee.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(tee) mov x8, __NR_tee svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(tee) diff --git a/libc/arch-arm64/syscalls/tgkill.S b/libc/arch-arm64/syscalls/tgkill.S index 908811db6..fd9ec3beb 100644 --- a/libc/arch-arm64/syscalls/tgkill.S +++ b/libc/arch-arm64/syscalls/tgkill.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(tgkill) mov x8, __NR_tgkill svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(tgkill) diff --git a/libc/arch-arm64/syscalls/timerfd_create.S b/libc/arch-arm64/syscalls/timerfd_create.S index 5487492f9..ee805fd25 100644 --- a/libc/arch-arm64/syscalls/timerfd_create.S +++ b/libc/arch-arm64/syscalls/timerfd_create.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(timerfd_create) mov x8, __NR_timerfd_create svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(timerfd_create) diff --git a/libc/arch-arm64/syscalls/timerfd_gettime.S b/libc/arch-arm64/syscalls/timerfd_gettime.S index 1c5151f8a..4d5e2f91f 100644 --- a/libc/arch-arm64/syscalls/timerfd_gettime.S +++ b/libc/arch-arm64/syscalls/timerfd_gettime.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(timerfd_gettime) mov x8, __NR_timerfd_gettime svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(timerfd_gettime) diff --git a/libc/arch-arm64/syscalls/timerfd_settime.S b/libc/arch-arm64/syscalls/timerfd_settime.S index edd81facd..e925a0ce9 100644 --- a/libc/arch-arm64/syscalls/timerfd_settime.S +++ b/libc/arch-arm64/syscalls/timerfd_settime.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(timerfd_settime) mov x8, __NR_timerfd_settime svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(timerfd_settime) diff --git a/libc/arch-arm64/syscalls/times.S b/libc/arch-arm64/syscalls/times.S index 554173288..d7b9c74bc 100644 --- a/libc/arch-arm64/syscalls/times.S +++ b/libc/arch-arm64/syscalls/times.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(times) mov x8, __NR_times svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(times) diff --git a/libc/arch-arm64/syscalls/truncate.S b/libc/arch-arm64/syscalls/truncate.S index be5765c43..0e5a33ec5 100644 --- a/libc/arch-arm64/syscalls/truncate.S +++ b/libc/arch-arm64/syscalls/truncate.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(truncate) mov x8, __NR_truncate svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(truncate) diff --git a/libc/arch-arm64/syscalls/umask.S b/libc/arch-arm64/syscalls/umask.S index c605b8f3f..0d71fa69e 100644 --- a/libc/arch-arm64/syscalls/umask.S +++ b/libc/arch-arm64/syscalls/umask.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(umask) mov x8, __NR_umask svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(umask) diff --git a/libc/arch-arm64/syscalls/umount2.S b/libc/arch-arm64/syscalls/umount2.S index 73ed3307d..c25344e64 100644 --- a/libc/arch-arm64/syscalls/umount2.S +++ b/libc/arch-arm64/syscalls/umount2.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(umount2) mov x8, __NR_umount2 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(umount2) diff --git a/libc/arch-arm64/syscalls/uname.S b/libc/arch-arm64/syscalls/uname.S index 4d5219006..dfdcc03e7 100644 --- a/libc/arch-arm64/syscalls/uname.S +++ b/libc/arch-arm64/syscalls/uname.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(uname) mov x8, __NR_uname svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(uname) diff --git a/libc/arch-arm64/syscalls/unlinkat.S b/libc/arch-arm64/syscalls/unlinkat.S index 8fde96e49..b1eba63f1 100644 --- a/libc/arch-arm64/syscalls/unlinkat.S +++ b/libc/arch-arm64/syscalls/unlinkat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(unlinkat) mov x8, __NR_unlinkat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(unlinkat) diff --git a/libc/arch-arm64/syscalls/unshare.S b/libc/arch-arm64/syscalls/unshare.S index ba960e228..74f5663c2 100644 --- a/libc/arch-arm64/syscalls/unshare.S +++ b/libc/arch-arm64/syscalls/unshare.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(unshare) mov x8, __NR_unshare svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(unshare) diff --git a/libc/arch-arm64/syscalls/utimensat.S b/libc/arch-arm64/syscalls/utimensat.S index 9e4b1ca43..b8c6b0456 100644 --- a/libc/arch-arm64/syscalls/utimensat.S +++ b/libc/arch-arm64/syscalls/utimensat.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(utimensat) mov x8, __NR_utimensat svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(utimensat) diff --git a/libc/arch-arm64/syscalls/vmsplice.S b/libc/arch-arm64/syscalls/vmsplice.S index 6a13c5b64..9490efbd9 100644 --- a/libc/arch-arm64/syscalls/vmsplice.S +++ b/libc/arch-arm64/syscalls/vmsplice.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(vmsplice) mov x8, __NR_vmsplice svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(vmsplice) diff --git a/libc/arch-arm64/syscalls/wait4.S b/libc/arch-arm64/syscalls/wait4.S index f2bcd34ec..12973b817 100644 --- a/libc/arch-arm64/syscalls/wait4.S +++ b/libc/arch-arm64/syscalls/wait4.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(wait4) mov x8, __NR_wait4 svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(wait4) diff --git a/libc/arch-arm64/syscalls/write.S b/libc/arch-arm64/syscalls/write.S index 1fedabe72..e8c327079 100644 --- a/libc/arch-arm64/syscalls/write.S +++ b/libc/arch-arm64/syscalls/write.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(write) mov x8, __NR_write svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(write) diff --git a/libc/arch-arm64/syscalls/writev.S b/libc/arch-arm64/syscalls/writev.S index 9942ddb3b..baaffda62 100644 --- a/libc/arch-arm64/syscalls/writev.S +++ b/libc/arch-arm64/syscalls/writev.S @@ -2,15 +2,13 @@ #include - .hidden __set_errno - ENTRY(writev) mov x8, __NR_writev svc #0 cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(writev) diff --git a/libc/arch-mips/bionic/__bionic_clone.S b/libc/arch-mips/bionic/__bionic_clone.S index 4b4498d5e..b216efe4e 100644 --- a/libc/arch-mips/bionic/__bionic_clone.S +++ b/libc/arch-mips/bionic/__bionic_clone.S @@ -66,7 +66,7 @@ ENTRY(__bionic_clone) .L__error_bc: move a0,v0 - la t9,__set_errno + la t9,__set_errno_internal j t9 END(__bionic_clone) .hidden __bionic_clone diff --git a/libc/arch-mips/bionic/syscall.S b/libc/arch-mips/bionic/syscall.S index db477a506..5fed0ac04 100644 --- a/libc/arch-mips/bionic/syscall.S +++ b/libc/arch-mips/bionic/syscall.S @@ -54,7 +54,7 @@ ENTRY(syscall) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/bionic/vfork.S b/libc/arch-mips/bionic/vfork.S index 96de69e20..18496249b 100644 --- a/libc/arch-mips/bionic/vfork.S +++ b/libc/arch-mips/bionic/vfork.S @@ -52,7 +52,7 @@ ENTRY(vfork) j ra nop 1: - la t9, __set_errno + la t9, __set_errno_internal j t9 nop END(vfork) diff --git a/libc/arch-mips/syscalls/__accept4.S b/libc/arch-mips/syscalls/__accept4.S index 2fc8b2af4..72df04f52 100644 --- a/libc/arch-mips/syscalls/__accept4.S +++ b/libc/arch-mips/syscalls/__accept4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__accept4) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__accept4) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__brk.S b/libc/arch-mips/syscalls/__brk.S index 0593b4fc1..8472663c9 100644 --- a/libc/arch-mips/syscalls/__brk.S +++ b/libc/arch-mips/syscalls/__brk.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__brk) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__brk) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__connect.S b/libc/arch-mips/syscalls/__connect.S index 20f60e4a3..38c1b9b1f 100644 --- a/libc/arch-mips/syscalls/__connect.S +++ b/libc/arch-mips/syscalls/__connect.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__connect) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__connect) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__epoll_pwait.S b/libc/arch-mips/syscalls/__epoll_pwait.S index 3e735f18e..3aed9bcd9 100644 --- a/libc/arch-mips/syscalls/__epoll_pwait.S +++ b/libc/arch-mips/syscalls/__epoll_pwait.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__epoll_pwait) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__epoll_pwait) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__exit.S b/libc/arch-mips/syscalls/__exit.S index 40c2f87d4..734980400 100644 --- a/libc/arch-mips/syscalls/__exit.S +++ b/libc/arch-mips/syscalls/__exit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__exit) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__exit) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__fcntl64.S b/libc/arch-mips/syscalls/__fcntl64.S index b541edd37..2734be25a 100644 --- a/libc/arch-mips/syscalls/__fcntl64.S +++ b/libc/arch-mips/syscalls/__fcntl64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__fcntl64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__fcntl64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__fstatfs64.S b/libc/arch-mips/syscalls/__fstatfs64.S index d1d68abd0..e08cf7eb8 100644 --- a/libc/arch-mips/syscalls/__fstatfs64.S +++ b/libc/arch-mips/syscalls/__fstatfs64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__fstatfs64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__fstatfs64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__getcpu.S b/libc/arch-mips/syscalls/__getcpu.S index ab3acca36..262f4405b 100644 --- a/libc/arch-mips/syscalls/__getcpu.S +++ b/libc/arch-mips/syscalls/__getcpu.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getcpu) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__getcpu) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__getcwd.S b/libc/arch-mips/syscalls/__getcwd.S index af1c494b7..ca6ec7c35 100644 --- a/libc/arch-mips/syscalls/__getcwd.S +++ b/libc/arch-mips/syscalls/__getcwd.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getcwd) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__getcwd) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__getdents64.S b/libc/arch-mips/syscalls/__getdents64.S index e88c6df76..fe7ef8639 100644 --- a/libc/arch-mips/syscalls/__getdents64.S +++ b/libc/arch-mips/syscalls/__getdents64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getdents64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__getdents64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__getpid.S b/libc/arch-mips/syscalls/__getpid.S index d20188b94..f5ab0494d 100644 --- a/libc/arch-mips/syscalls/__getpid.S +++ b/libc/arch-mips/syscalls/__getpid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getpid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__getpid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__getpriority.S b/libc/arch-mips/syscalls/__getpriority.S index bc1efb345..ef6235d79 100644 --- a/libc/arch-mips/syscalls/__getpriority.S +++ b/libc/arch-mips/syscalls/__getpriority.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getpriority) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__getpriority) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__ioctl.S b/libc/arch-mips/syscalls/__ioctl.S index 28af834ae..27716e87e 100644 --- a/libc/arch-mips/syscalls/__ioctl.S +++ b/libc/arch-mips/syscalls/__ioctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ioctl) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__ioctl) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__llseek.S b/libc/arch-mips/syscalls/__llseek.S index 81cf45994..e0cb3214d 100644 --- a/libc/arch-mips/syscalls/__llseek.S +++ b/libc/arch-mips/syscalls/__llseek.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__llseek) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__llseek) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__mmap2.S b/libc/arch-mips/syscalls/__mmap2.S index e6022c382..8175b312d 100644 --- a/libc/arch-mips/syscalls/__mmap2.S +++ b/libc/arch-mips/syscalls/__mmap2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__mmap2) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__mmap2) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__openat.S b/libc/arch-mips/syscalls/__openat.S index 0482b5abe..c0c3cdf94 100644 --- a/libc/arch-mips/syscalls/__openat.S +++ b/libc/arch-mips/syscalls/__openat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__openat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__openat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__ppoll.S b/libc/arch-mips/syscalls/__ppoll.S index 7cd29f68c..75dbbc898 100644 --- a/libc/arch-mips/syscalls/__ppoll.S +++ b/libc/arch-mips/syscalls/__ppoll.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ppoll) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__ppoll) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__pselect6.S b/libc/arch-mips/syscalls/__pselect6.S index b4279b86f..d028156e4 100644 --- a/libc/arch-mips/syscalls/__pselect6.S +++ b/libc/arch-mips/syscalls/__pselect6.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__pselect6) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__pselect6) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__ptrace.S b/libc/arch-mips/syscalls/__ptrace.S index 07dcd8fff..c5d91fbc8 100644 --- a/libc/arch-mips/syscalls/__ptrace.S +++ b/libc/arch-mips/syscalls/__ptrace.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ptrace) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__ptrace) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__reboot.S b/libc/arch-mips/syscalls/__reboot.S index 3a0a70b70..c01f7fbb3 100644 --- a/libc/arch-mips/syscalls/__reboot.S +++ b/libc/arch-mips/syscalls/__reboot.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__reboot) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__reboot) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__rt_sigaction.S b/libc/arch-mips/syscalls/__rt_sigaction.S index 858a241df..7fa37fd2c 100644 --- a/libc/arch-mips/syscalls/__rt_sigaction.S +++ b/libc/arch-mips/syscalls/__rt_sigaction.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigaction) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__rt_sigaction) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__rt_sigpending.S b/libc/arch-mips/syscalls/__rt_sigpending.S index 484da4fe3..b80b311b0 100644 --- a/libc/arch-mips/syscalls/__rt_sigpending.S +++ b/libc/arch-mips/syscalls/__rt_sigpending.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigpending) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__rt_sigpending) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__rt_sigprocmask.S b/libc/arch-mips/syscalls/__rt_sigprocmask.S index 5e61f5273..e2a39ebe8 100644 --- a/libc/arch-mips/syscalls/__rt_sigprocmask.S +++ b/libc/arch-mips/syscalls/__rt_sigprocmask.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigprocmask) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__rt_sigprocmask) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__rt_sigsuspend.S b/libc/arch-mips/syscalls/__rt_sigsuspend.S index d128caa88..e91c53f1f 100644 --- a/libc/arch-mips/syscalls/__rt_sigsuspend.S +++ b/libc/arch-mips/syscalls/__rt_sigsuspend.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigsuspend) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__rt_sigsuspend) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__rt_sigtimedwait.S b/libc/arch-mips/syscalls/__rt_sigtimedwait.S index 7e70660cb..0b4195f09 100644 --- a/libc/arch-mips/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-mips/syscalls/__rt_sigtimedwait.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigtimedwait) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__rt_sigtimedwait) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__sched_getaffinity.S b/libc/arch-mips/syscalls/__sched_getaffinity.S index f83b7baf6..b09f40445 100644 --- a/libc/arch-mips/syscalls/__sched_getaffinity.S +++ b/libc/arch-mips/syscalls/__sched_getaffinity.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__sched_getaffinity) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__sched_getaffinity) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__set_tid_address.S b/libc/arch-mips/syscalls/__set_tid_address.S index 7ec0f635b..8ca071639 100644 --- a/libc/arch-mips/syscalls/__set_tid_address.S +++ b/libc/arch-mips/syscalls/__set_tid_address.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__set_tid_address) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__set_tid_address) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__set_tls.S b/libc/arch-mips/syscalls/__set_tls.S index bb2fa6dfc..1f9eba57d 100644 --- a/libc/arch-mips/syscalls/__set_tls.S +++ b/libc/arch-mips/syscalls/__set_tls.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__set_tls) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__set_tls) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__sigaction.S b/libc/arch-mips/syscalls/__sigaction.S index 03eb58215..0886e95dd 100644 --- a/libc/arch-mips/syscalls/__sigaction.S +++ b/libc/arch-mips/syscalls/__sigaction.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__sigaction) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__sigaction) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__signalfd4.S b/libc/arch-mips/syscalls/__signalfd4.S index 9b191c2a9..8e5717e09 100644 --- a/libc/arch-mips/syscalls/__signalfd4.S +++ b/libc/arch-mips/syscalls/__signalfd4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__signalfd4) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__signalfd4) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__socket.S b/libc/arch-mips/syscalls/__socket.S index 9e9a926df..c93335547 100644 --- a/libc/arch-mips/syscalls/__socket.S +++ b/libc/arch-mips/syscalls/__socket.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__socket) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__socket) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__statfs64.S b/libc/arch-mips/syscalls/__statfs64.S index 5017e96a6..ed4dcdbd1 100644 --- a/libc/arch-mips/syscalls/__statfs64.S +++ b/libc/arch-mips/syscalls/__statfs64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__statfs64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__statfs64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__timer_create.S b/libc/arch-mips/syscalls/__timer_create.S index 81cc8c4e5..ef50749d8 100644 --- a/libc/arch-mips/syscalls/__timer_create.S +++ b/libc/arch-mips/syscalls/__timer_create.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_create) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__timer_create) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__timer_delete.S b/libc/arch-mips/syscalls/__timer_delete.S index fddb703f6..5993acef2 100644 --- a/libc/arch-mips/syscalls/__timer_delete.S +++ b/libc/arch-mips/syscalls/__timer_delete.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_delete) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__timer_delete) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__timer_getoverrun.S b/libc/arch-mips/syscalls/__timer_getoverrun.S index 3a7313dcc..31234e522 100644 --- a/libc/arch-mips/syscalls/__timer_getoverrun.S +++ b/libc/arch-mips/syscalls/__timer_getoverrun.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_getoverrun) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__timer_getoverrun) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__timer_gettime.S b/libc/arch-mips/syscalls/__timer_gettime.S index 7b9bed746..38800d32a 100644 --- a/libc/arch-mips/syscalls/__timer_gettime.S +++ b/libc/arch-mips/syscalls/__timer_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_gettime) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__timer_gettime) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__timer_settime.S b/libc/arch-mips/syscalls/__timer_settime.S index b1198de03..73cea7301 100644 --- a/libc/arch-mips/syscalls/__timer_settime.S +++ b/libc/arch-mips/syscalls/__timer_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_settime) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__timer_settime) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/__waitid.S b/libc/arch-mips/syscalls/__waitid.S index e60da7f95..9d17f8f13 100644 --- a/libc/arch-mips/syscalls/__waitid.S +++ b/libc/arch-mips/syscalls/__waitid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__waitid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(__waitid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/_exit.S b/libc/arch-mips/syscalls/_exit.S index ae1d61f7b..5ac13249f 100644 --- a/libc/arch-mips/syscalls/_exit.S +++ b/libc/arch-mips/syscalls/_exit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(_exit) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(_exit) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/_flush_cache.S b/libc/arch-mips/syscalls/_flush_cache.S index 0074578fd..a4030e9b5 100644 --- a/libc/arch-mips/syscalls/_flush_cache.S +++ b/libc/arch-mips/syscalls/_flush_cache.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(_flush_cache) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(_flush_cache) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/acct.S b/libc/arch-mips/syscalls/acct.S index 29a71198e..e3a5ccdbb 100644 --- a/libc/arch-mips/syscalls/acct.S +++ b/libc/arch-mips/syscalls/acct.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(acct) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(acct) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/bind.S b/libc/arch-mips/syscalls/bind.S index 6d92fd0f3..78fe2bb97 100644 --- a/libc/arch-mips/syscalls/bind.S +++ b/libc/arch-mips/syscalls/bind.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(bind) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(bind) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/capget.S b/libc/arch-mips/syscalls/capget.S index de76fa33f..0cbb626fc 100644 --- a/libc/arch-mips/syscalls/capget.S +++ b/libc/arch-mips/syscalls/capget.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(capget) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(capget) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/capset.S b/libc/arch-mips/syscalls/capset.S index 77fb3a703..e8110800c 100644 --- a/libc/arch-mips/syscalls/capset.S +++ b/libc/arch-mips/syscalls/capset.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(capset) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(capset) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/chdir.S b/libc/arch-mips/syscalls/chdir.S index 2668d6994..82b7a2b0a 100644 --- a/libc/arch-mips/syscalls/chdir.S +++ b/libc/arch-mips/syscalls/chdir.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(chdir) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(chdir) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/chroot.S b/libc/arch-mips/syscalls/chroot.S index d804c4f0c..e6a29fc9d 100644 --- a/libc/arch-mips/syscalls/chroot.S +++ b/libc/arch-mips/syscalls/chroot.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(chroot) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(chroot) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/clock_getres.S b/libc/arch-mips/syscalls/clock_getres.S index 5219b32f9..ac7c5c617 100644 --- a/libc/arch-mips/syscalls/clock_getres.S +++ b/libc/arch-mips/syscalls/clock_getres.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_getres) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(clock_getres) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/clock_gettime.S b/libc/arch-mips/syscalls/clock_gettime.S index 32120b1ab..d227a0666 100644 --- a/libc/arch-mips/syscalls/clock_gettime.S +++ b/libc/arch-mips/syscalls/clock_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_gettime) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(clock_gettime) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/clock_nanosleep.S b/libc/arch-mips/syscalls/clock_nanosleep.S index 01bab5aa8..6002ab4db 100644 --- a/libc/arch-mips/syscalls/clock_nanosleep.S +++ b/libc/arch-mips/syscalls/clock_nanosleep.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_nanosleep) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(clock_nanosleep) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/clock_settime.S b/libc/arch-mips/syscalls/clock_settime.S index 6b642a1c1..193bdc2c6 100644 --- a/libc/arch-mips/syscalls/clock_settime.S +++ b/libc/arch-mips/syscalls/clock_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_settime) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(clock_settime) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/close.S b/libc/arch-mips/syscalls/close.S index 4e3ab6758..231f497d3 100644 --- a/libc/arch-mips/syscalls/close.S +++ b/libc/arch-mips/syscalls/close.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(close) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(close) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/delete_module.S b/libc/arch-mips/syscalls/delete_module.S index 5c849305d..8c01c06d4 100644 --- a/libc/arch-mips/syscalls/delete_module.S +++ b/libc/arch-mips/syscalls/delete_module.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(delete_module) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(delete_module) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/dup.S b/libc/arch-mips/syscalls/dup.S index 696955365..b4dcd70f3 100644 --- a/libc/arch-mips/syscalls/dup.S +++ b/libc/arch-mips/syscalls/dup.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(dup) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(dup) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/dup3.S b/libc/arch-mips/syscalls/dup3.S index 39e403d5c..1d9c23638 100644 --- a/libc/arch-mips/syscalls/dup3.S +++ b/libc/arch-mips/syscalls/dup3.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(dup3) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(dup3) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/epoll_create1.S b/libc/arch-mips/syscalls/epoll_create1.S index 6feb71597..87548790a 100644 --- a/libc/arch-mips/syscalls/epoll_create1.S +++ b/libc/arch-mips/syscalls/epoll_create1.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(epoll_create1) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(epoll_create1) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/epoll_ctl.S b/libc/arch-mips/syscalls/epoll_ctl.S index 4517ea18b..14c920222 100644 --- a/libc/arch-mips/syscalls/epoll_ctl.S +++ b/libc/arch-mips/syscalls/epoll_ctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(epoll_ctl) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(epoll_ctl) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/eventfd.S b/libc/arch-mips/syscalls/eventfd.S index 167a851b2..6494dbc89 100644 --- a/libc/arch-mips/syscalls/eventfd.S +++ b/libc/arch-mips/syscalls/eventfd.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(eventfd) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(eventfd) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/execve.S b/libc/arch-mips/syscalls/execve.S index e6f3af64e..2d20b51b0 100644 --- a/libc/arch-mips/syscalls/execve.S +++ b/libc/arch-mips/syscalls/execve.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(execve) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(execve) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/faccessat.S b/libc/arch-mips/syscalls/faccessat.S index 3bf7717ce..e61610620 100644 --- a/libc/arch-mips/syscalls/faccessat.S +++ b/libc/arch-mips/syscalls/faccessat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(faccessat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(faccessat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fallocate64.S b/libc/arch-mips/syscalls/fallocate64.S index 5395c6fff..5f0551389 100644 --- a/libc/arch-mips/syscalls/fallocate64.S +++ b/libc/arch-mips/syscalls/fallocate64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fallocate64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fallocate64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fchdir.S b/libc/arch-mips/syscalls/fchdir.S index 4a5c1e3c5..d683baa7f 100644 --- a/libc/arch-mips/syscalls/fchdir.S +++ b/libc/arch-mips/syscalls/fchdir.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchdir) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fchdir) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fchmod.S b/libc/arch-mips/syscalls/fchmod.S index 78dc3f70a..2a95cc30d 100644 --- a/libc/arch-mips/syscalls/fchmod.S +++ b/libc/arch-mips/syscalls/fchmod.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchmod) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fchmod) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fchmodat.S b/libc/arch-mips/syscalls/fchmodat.S index ebc3a7449..d9de036dd 100644 --- a/libc/arch-mips/syscalls/fchmodat.S +++ b/libc/arch-mips/syscalls/fchmodat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchmodat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fchmodat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fchown.S b/libc/arch-mips/syscalls/fchown.S index 74956e052..1ac9451a2 100644 --- a/libc/arch-mips/syscalls/fchown.S +++ b/libc/arch-mips/syscalls/fchown.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchown) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fchown) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fchownat.S b/libc/arch-mips/syscalls/fchownat.S index 54d1fde8c..be1a02184 100644 --- a/libc/arch-mips/syscalls/fchownat.S +++ b/libc/arch-mips/syscalls/fchownat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchownat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fchownat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fdatasync.S b/libc/arch-mips/syscalls/fdatasync.S index f2d1b1fe4..24d654102 100644 --- a/libc/arch-mips/syscalls/fdatasync.S +++ b/libc/arch-mips/syscalls/fdatasync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fdatasync) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fdatasync) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fgetxattr.S b/libc/arch-mips/syscalls/fgetxattr.S index 096cd9744..6516feb03 100644 --- a/libc/arch-mips/syscalls/fgetxattr.S +++ b/libc/arch-mips/syscalls/fgetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fgetxattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fgetxattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/flistxattr.S b/libc/arch-mips/syscalls/flistxattr.S index b577e5790..0b715327d 100644 --- a/libc/arch-mips/syscalls/flistxattr.S +++ b/libc/arch-mips/syscalls/flistxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(flistxattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(flistxattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/flock.S b/libc/arch-mips/syscalls/flock.S index 87e9e0409..8d70c9ef0 100644 --- a/libc/arch-mips/syscalls/flock.S +++ b/libc/arch-mips/syscalls/flock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(flock) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(flock) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fremovexattr.S b/libc/arch-mips/syscalls/fremovexattr.S index 8f7e74efc..fba2d6dcd 100644 --- a/libc/arch-mips/syscalls/fremovexattr.S +++ b/libc/arch-mips/syscalls/fremovexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fremovexattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fremovexattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fsetxattr.S b/libc/arch-mips/syscalls/fsetxattr.S index e9a3490ea..663c0df00 100644 --- a/libc/arch-mips/syscalls/fsetxattr.S +++ b/libc/arch-mips/syscalls/fsetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fsetxattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fsetxattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fstat64.S b/libc/arch-mips/syscalls/fstat64.S index c6d2a32ae..525c23c52 100644 --- a/libc/arch-mips/syscalls/fstat64.S +++ b/libc/arch-mips/syscalls/fstat64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstat64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fstat64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fstatat64.S b/libc/arch-mips/syscalls/fstatat64.S index 2418b0218..f7b8e1d88 100644 --- a/libc/arch-mips/syscalls/fstatat64.S +++ b/libc/arch-mips/syscalls/fstatat64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstatat64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fstatat64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/fsync.S b/libc/arch-mips/syscalls/fsync.S index c5528dc50..819f0f2c9 100644 --- a/libc/arch-mips/syscalls/fsync.S +++ b/libc/arch-mips/syscalls/fsync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fsync) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(fsync) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/ftruncate.S b/libc/arch-mips/syscalls/ftruncate.S index dfd57a9b4..0589c817a 100644 --- a/libc/arch-mips/syscalls/ftruncate.S +++ b/libc/arch-mips/syscalls/ftruncate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(ftruncate) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(ftruncate) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/ftruncate64.S b/libc/arch-mips/syscalls/ftruncate64.S index a1df9e8a8..059ff77dd 100644 --- a/libc/arch-mips/syscalls/ftruncate64.S +++ b/libc/arch-mips/syscalls/ftruncate64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(ftruncate64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(ftruncate64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getegid.S b/libc/arch-mips/syscalls/getegid.S index 10f102c9a..8ae2d1e94 100644 --- a/libc/arch-mips/syscalls/getegid.S +++ b/libc/arch-mips/syscalls/getegid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getegid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getegid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/geteuid.S b/libc/arch-mips/syscalls/geteuid.S index bac3b74d4..cf5cf6cb7 100644 --- a/libc/arch-mips/syscalls/geteuid.S +++ b/libc/arch-mips/syscalls/geteuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(geteuid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(geteuid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getgid.S b/libc/arch-mips/syscalls/getgid.S index a1814bbb5..9bd1fc36e 100644 --- a/libc/arch-mips/syscalls/getgid.S +++ b/libc/arch-mips/syscalls/getgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getgid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getgid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getgroups.S b/libc/arch-mips/syscalls/getgroups.S index 51ed5234c..2eda1856f 100644 --- a/libc/arch-mips/syscalls/getgroups.S +++ b/libc/arch-mips/syscalls/getgroups.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getgroups) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getgroups) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getitimer.S b/libc/arch-mips/syscalls/getitimer.S index 1afeee48e..2e382c74a 100644 --- a/libc/arch-mips/syscalls/getitimer.S +++ b/libc/arch-mips/syscalls/getitimer.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getitimer) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getitimer) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getpeername.S b/libc/arch-mips/syscalls/getpeername.S index b6e5f0797..8642798bc 100644 --- a/libc/arch-mips/syscalls/getpeername.S +++ b/libc/arch-mips/syscalls/getpeername.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getpeername) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getpeername) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getpgid.S b/libc/arch-mips/syscalls/getpgid.S index 01c6ec593..562b9ce0c 100644 --- a/libc/arch-mips/syscalls/getpgid.S +++ b/libc/arch-mips/syscalls/getpgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getpgid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getpgid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getppid.S b/libc/arch-mips/syscalls/getppid.S index 9ed04c047..afff0b948 100644 --- a/libc/arch-mips/syscalls/getppid.S +++ b/libc/arch-mips/syscalls/getppid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getppid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getppid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getresgid.S b/libc/arch-mips/syscalls/getresgid.S index a2e16d4b9..248d3f95c 100644 --- a/libc/arch-mips/syscalls/getresgid.S +++ b/libc/arch-mips/syscalls/getresgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getresgid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getresgid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getresuid.S b/libc/arch-mips/syscalls/getresuid.S index ff162e0fc..924b6cdbc 100644 --- a/libc/arch-mips/syscalls/getresuid.S +++ b/libc/arch-mips/syscalls/getresuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getresuid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getresuid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getrlimit.S b/libc/arch-mips/syscalls/getrlimit.S index 1632f4d9e..19570d674 100644 --- a/libc/arch-mips/syscalls/getrlimit.S +++ b/libc/arch-mips/syscalls/getrlimit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getrlimit) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getrlimit) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getrusage.S b/libc/arch-mips/syscalls/getrusage.S index b9c4207d3..75bc8bcf8 100644 --- a/libc/arch-mips/syscalls/getrusage.S +++ b/libc/arch-mips/syscalls/getrusage.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getrusage) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getrusage) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getsid.S b/libc/arch-mips/syscalls/getsid.S index cb56f54da..6436ecd65 100644 --- a/libc/arch-mips/syscalls/getsid.S +++ b/libc/arch-mips/syscalls/getsid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getsid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getsockname.S b/libc/arch-mips/syscalls/getsockname.S index f7bff60e2..ffadd9282 100644 --- a/libc/arch-mips/syscalls/getsockname.S +++ b/libc/arch-mips/syscalls/getsockname.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsockname) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getsockname) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getsockopt.S b/libc/arch-mips/syscalls/getsockopt.S index 1490aa325..6ebe15e4c 100644 --- a/libc/arch-mips/syscalls/getsockopt.S +++ b/libc/arch-mips/syscalls/getsockopt.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsockopt) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getsockopt) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/gettimeofday.S b/libc/arch-mips/syscalls/gettimeofday.S index a72ced64c..672faa3a6 100644 --- a/libc/arch-mips/syscalls/gettimeofday.S +++ b/libc/arch-mips/syscalls/gettimeofday.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(gettimeofday) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(gettimeofday) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getuid.S b/libc/arch-mips/syscalls/getuid.S index 290a7014f..5858632c5 100644 --- a/libc/arch-mips/syscalls/getuid.S +++ b/libc/arch-mips/syscalls/getuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getuid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getuid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/getxattr.S b/libc/arch-mips/syscalls/getxattr.S index 6ed431651..28c7fe651 100644 --- a/libc/arch-mips/syscalls/getxattr.S +++ b/libc/arch-mips/syscalls/getxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getxattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(getxattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/init_module.S b/libc/arch-mips/syscalls/init_module.S index 6caf450e5..989614a7b 100644 --- a/libc/arch-mips/syscalls/init_module.S +++ b/libc/arch-mips/syscalls/init_module.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(init_module) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(init_module) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/inotify_add_watch.S b/libc/arch-mips/syscalls/inotify_add_watch.S index 8464f8f3a..7d3315f41 100644 --- a/libc/arch-mips/syscalls/inotify_add_watch.S +++ b/libc/arch-mips/syscalls/inotify_add_watch.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_add_watch) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(inotify_add_watch) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/inotify_init1.S b/libc/arch-mips/syscalls/inotify_init1.S index b6cb6bc03..e4ec26661 100644 --- a/libc/arch-mips/syscalls/inotify_init1.S +++ b/libc/arch-mips/syscalls/inotify_init1.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_init1) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(inotify_init1) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/inotify_rm_watch.S b/libc/arch-mips/syscalls/inotify_rm_watch.S index 87a396a6f..eec9856bc 100644 --- a/libc/arch-mips/syscalls/inotify_rm_watch.S +++ b/libc/arch-mips/syscalls/inotify_rm_watch.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_rm_watch) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(inotify_rm_watch) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/kill.S b/libc/arch-mips/syscalls/kill.S index 3dda006fb..415da7329 100644 --- a/libc/arch-mips/syscalls/kill.S +++ b/libc/arch-mips/syscalls/kill.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(kill) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(kill) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/klogctl.S b/libc/arch-mips/syscalls/klogctl.S index ae9a445d0..123d8a001 100644 --- a/libc/arch-mips/syscalls/klogctl.S +++ b/libc/arch-mips/syscalls/klogctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(klogctl) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(klogctl) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/lgetxattr.S b/libc/arch-mips/syscalls/lgetxattr.S index 63c5add51..a9916d999 100644 --- a/libc/arch-mips/syscalls/lgetxattr.S +++ b/libc/arch-mips/syscalls/lgetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lgetxattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(lgetxattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/linkat.S b/libc/arch-mips/syscalls/linkat.S index 5bea417f2..a05a99528 100644 --- a/libc/arch-mips/syscalls/linkat.S +++ b/libc/arch-mips/syscalls/linkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(linkat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(linkat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/listen.S b/libc/arch-mips/syscalls/listen.S index 8d945f5ef..7bb2ec8e7 100644 --- a/libc/arch-mips/syscalls/listen.S +++ b/libc/arch-mips/syscalls/listen.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(listen) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(listen) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/listxattr.S b/libc/arch-mips/syscalls/listxattr.S index 260d0899a..c160178d0 100644 --- a/libc/arch-mips/syscalls/listxattr.S +++ b/libc/arch-mips/syscalls/listxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(listxattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(listxattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/llistxattr.S b/libc/arch-mips/syscalls/llistxattr.S index 69474d82d..9bf05b046 100644 --- a/libc/arch-mips/syscalls/llistxattr.S +++ b/libc/arch-mips/syscalls/llistxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(llistxattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(llistxattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/lremovexattr.S b/libc/arch-mips/syscalls/lremovexattr.S index e33f31fd9..fe73ddb8d 100644 --- a/libc/arch-mips/syscalls/lremovexattr.S +++ b/libc/arch-mips/syscalls/lremovexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lremovexattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(lremovexattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/lseek.S b/libc/arch-mips/syscalls/lseek.S index 21abe1c58..6d6b4e522 100644 --- a/libc/arch-mips/syscalls/lseek.S +++ b/libc/arch-mips/syscalls/lseek.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lseek) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(lseek) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/lsetxattr.S b/libc/arch-mips/syscalls/lsetxattr.S index dcd510abe..69ea0a249 100644 --- a/libc/arch-mips/syscalls/lsetxattr.S +++ b/libc/arch-mips/syscalls/lsetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lsetxattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(lsetxattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/madvise.S b/libc/arch-mips/syscalls/madvise.S index 49c007ade..7d67b80ae 100644 --- a/libc/arch-mips/syscalls/madvise.S +++ b/libc/arch-mips/syscalls/madvise.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(madvise) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(madvise) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/mincore.S b/libc/arch-mips/syscalls/mincore.S index 07102a67b..96f5e29d1 100644 --- a/libc/arch-mips/syscalls/mincore.S +++ b/libc/arch-mips/syscalls/mincore.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mincore) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(mincore) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/mkdirat.S b/libc/arch-mips/syscalls/mkdirat.S index 96a2d08a8..55dd97622 100644 --- a/libc/arch-mips/syscalls/mkdirat.S +++ b/libc/arch-mips/syscalls/mkdirat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mkdirat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(mkdirat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/mknodat.S b/libc/arch-mips/syscalls/mknodat.S index a88b9061d..1a03a8e48 100644 --- a/libc/arch-mips/syscalls/mknodat.S +++ b/libc/arch-mips/syscalls/mknodat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mknodat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(mknodat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/mlock.S b/libc/arch-mips/syscalls/mlock.S index eff66b8f9..3cf7c1b60 100644 --- a/libc/arch-mips/syscalls/mlock.S +++ b/libc/arch-mips/syscalls/mlock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mlock) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(mlock) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/mlockall.S b/libc/arch-mips/syscalls/mlockall.S index c31eeafe1..3b90f41c8 100644 --- a/libc/arch-mips/syscalls/mlockall.S +++ b/libc/arch-mips/syscalls/mlockall.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mlockall) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(mlockall) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/mount.S b/libc/arch-mips/syscalls/mount.S index cb1f1d164..fdf299f5c 100644 --- a/libc/arch-mips/syscalls/mount.S +++ b/libc/arch-mips/syscalls/mount.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mount) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(mount) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/mprotect.S b/libc/arch-mips/syscalls/mprotect.S index 4e390eb82..56183107c 100644 --- a/libc/arch-mips/syscalls/mprotect.S +++ b/libc/arch-mips/syscalls/mprotect.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mprotect) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(mprotect) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/mremap.S b/libc/arch-mips/syscalls/mremap.S index 7b9a68a48..7cbb94e7e 100644 --- a/libc/arch-mips/syscalls/mremap.S +++ b/libc/arch-mips/syscalls/mremap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mremap) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(mremap) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/msync.S b/libc/arch-mips/syscalls/msync.S index 7b19a830b..fb7462da9 100644 --- a/libc/arch-mips/syscalls/msync.S +++ b/libc/arch-mips/syscalls/msync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(msync) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(msync) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/munlock.S b/libc/arch-mips/syscalls/munlock.S index 17dc7199b..6c65c0203 100644 --- a/libc/arch-mips/syscalls/munlock.S +++ b/libc/arch-mips/syscalls/munlock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munlock) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(munlock) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/munlockall.S b/libc/arch-mips/syscalls/munlockall.S index f0dc2d4c4..e30dddcbc 100644 --- a/libc/arch-mips/syscalls/munlockall.S +++ b/libc/arch-mips/syscalls/munlockall.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munlockall) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(munlockall) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/munmap.S b/libc/arch-mips/syscalls/munmap.S index dc3a52459..903edde1e 100644 --- a/libc/arch-mips/syscalls/munmap.S +++ b/libc/arch-mips/syscalls/munmap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munmap) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(munmap) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/nanosleep.S b/libc/arch-mips/syscalls/nanosleep.S index fa74288b1..8dae88bb9 100644 --- a/libc/arch-mips/syscalls/nanosleep.S +++ b/libc/arch-mips/syscalls/nanosleep.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(nanosleep) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(nanosleep) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/personality.S b/libc/arch-mips/syscalls/personality.S index 467f2ec70..2f51d3902 100644 --- a/libc/arch-mips/syscalls/personality.S +++ b/libc/arch-mips/syscalls/personality.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(personality) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(personality) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/pipe2.S b/libc/arch-mips/syscalls/pipe2.S index c50595686..b06309c87 100644 --- a/libc/arch-mips/syscalls/pipe2.S +++ b/libc/arch-mips/syscalls/pipe2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pipe2) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(pipe2) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/prctl.S b/libc/arch-mips/syscalls/prctl.S index 60c18be69..71544ee68 100644 --- a/libc/arch-mips/syscalls/prctl.S +++ b/libc/arch-mips/syscalls/prctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(prctl) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(prctl) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/pread64.S b/libc/arch-mips/syscalls/pread64.S index debc55880..9e7248bf3 100644 --- a/libc/arch-mips/syscalls/pread64.S +++ b/libc/arch-mips/syscalls/pread64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pread64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(pread64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/prlimit64.S b/libc/arch-mips/syscalls/prlimit64.S index ce1686f26..ca913df8d 100644 --- a/libc/arch-mips/syscalls/prlimit64.S +++ b/libc/arch-mips/syscalls/prlimit64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(prlimit64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(prlimit64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/pwrite64.S b/libc/arch-mips/syscalls/pwrite64.S index b1ff89b4b..ac206aa9d 100644 --- a/libc/arch-mips/syscalls/pwrite64.S +++ b/libc/arch-mips/syscalls/pwrite64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pwrite64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(pwrite64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/read.S b/libc/arch-mips/syscalls/read.S index d98c9a691..1355b66d2 100644 --- a/libc/arch-mips/syscalls/read.S +++ b/libc/arch-mips/syscalls/read.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(read) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(read) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/readahead.S b/libc/arch-mips/syscalls/readahead.S index 7dd44730d..b28df0877 100644 --- a/libc/arch-mips/syscalls/readahead.S +++ b/libc/arch-mips/syscalls/readahead.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readahead) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(readahead) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/readlinkat.S b/libc/arch-mips/syscalls/readlinkat.S index 99f07a4c3..5cf84a25d 100644 --- a/libc/arch-mips/syscalls/readlinkat.S +++ b/libc/arch-mips/syscalls/readlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readlinkat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(readlinkat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/readv.S b/libc/arch-mips/syscalls/readv.S index 3985c9c6a..57952a0f0 100644 --- a/libc/arch-mips/syscalls/readv.S +++ b/libc/arch-mips/syscalls/readv.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readv) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(readv) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/recvfrom.S b/libc/arch-mips/syscalls/recvfrom.S index afda11e4d..707ba4bf7 100644 --- a/libc/arch-mips/syscalls/recvfrom.S +++ b/libc/arch-mips/syscalls/recvfrom.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvfrom) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(recvfrom) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/recvmmsg.S b/libc/arch-mips/syscalls/recvmmsg.S index 1122c014d..796d0d8ef 100644 --- a/libc/arch-mips/syscalls/recvmmsg.S +++ b/libc/arch-mips/syscalls/recvmmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvmmsg) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(recvmmsg) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/recvmsg.S b/libc/arch-mips/syscalls/recvmsg.S index a64606b32..fdcac3279 100644 --- a/libc/arch-mips/syscalls/recvmsg.S +++ b/libc/arch-mips/syscalls/recvmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvmsg) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(recvmsg) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/removexattr.S b/libc/arch-mips/syscalls/removexattr.S index a35616069..d99e1ae97 100644 --- a/libc/arch-mips/syscalls/removexattr.S +++ b/libc/arch-mips/syscalls/removexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(removexattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(removexattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/renameat.S b/libc/arch-mips/syscalls/renameat.S index 63de839c6..c865d7407 100644 --- a/libc/arch-mips/syscalls/renameat.S +++ b/libc/arch-mips/syscalls/renameat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(renameat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(renameat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sched_get_priority_max.S b/libc/arch-mips/syscalls/sched_get_priority_max.S index ea88c0f27..1c73af6f9 100644 --- a/libc/arch-mips/syscalls/sched_get_priority_max.S +++ b/libc/arch-mips/syscalls/sched_get_priority_max.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_max) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sched_get_priority_max) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sched_get_priority_min.S b/libc/arch-mips/syscalls/sched_get_priority_min.S index 032084770..b69b72bcb 100644 --- a/libc/arch-mips/syscalls/sched_get_priority_min.S +++ b/libc/arch-mips/syscalls/sched_get_priority_min.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_min) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sched_get_priority_min) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sched_getparam.S b/libc/arch-mips/syscalls/sched_getparam.S index 4be69b331..387257ae1 100644 --- a/libc/arch-mips/syscalls/sched_getparam.S +++ b/libc/arch-mips/syscalls/sched_getparam.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_getparam) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sched_getparam) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sched_getscheduler.S b/libc/arch-mips/syscalls/sched_getscheduler.S index aaf0e9147..9b293db52 100644 --- a/libc/arch-mips/syscalls/sched_getscheduler.S +++ b/libc/arch-mips/syscalls/sched_getscheduler.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_getscheduler) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sched_getscheduler) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sched_rr_get_interval.S b/libc/arch-mips/syscalls/sched_rr_get_interval.S index fcf2bcbb8..3d7b8a8bf 100644 --- a/libc/arch-mips/syscalls/sched_rr_get_interval.S +++ b/libc/arch-mips/syscalls/sched_rr_get_interval.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_rr_get_interval) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sched_rr_get_interval) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sched_setaffinity.S b/libc/arch-mips/syscalls/sched_setaffinity.S index b9394c53d..a0e9f6c0d 100644 --- a/libc/arch-mips/syscalls/sched_setaffinity.S +++ b/libc/arch-mips/syscalls/sched_setaffinity.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setaffinity) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sched_setaffinity) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sched_setparam.S b/libc/arch-mips/syscalls/sched_setparam.S index 90c82fe69..a8a89829a 100644 --- a/libc/arch-mips/syscalls/sched_setparam.S +++ b/libc/arch-mips/syscalls/sched_setparam.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setparam) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sched_setparam) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sched_setscheduler.S b/libc/arch-mips/syscalls/sched_setscheduler.S index 05e4e8b05..a2cd7faeb 100644 --- a/libc/arch-mips/syscalls/sched_setscheduler.S +++ b/libc/arch-mips/syscalls/sched_setscheduler.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setscheduler) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sched_setscheduler) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sched_yield.S b/libc/arch-mips/syscalls/sched_yield.S index 15565802f..295266f8f 100644 --- a/libc/arch-mips/syscalls/sched_yield.S +++ b/libc/arch-mips/syscalls/sched_yield.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_yield) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sched_yield) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sendfile.S b/libc/arch-mips/syscalls/sendfile.S index eb99d0941..5e5e88716 100644 --- a/libc/arch-mips/syscalls/sendfile.S +++ b/libc/arch-mips/syscalls/sendfile.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendfile) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sendfile) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sendfile64.S b/libc/arch-mips/syscalls/sendfile64.S index 1d5c5f095..78f1908e8 100644 --- a/libc/arch-mips/syscalls/sendfile64.S +++ b/libc/arch-mips/syscalls/sendfile64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendfile64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sendfile64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sendmmsg.S b/libc/arch-mips/syscalls/sendmmsg.S index 16f37a1eb..1dc7576eb 100644 --- a/libc/arch-mips/syscalls/sendmmsg.S +++ b/libc/arch-mips/syscalls/sendmmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendmmsg) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sendmmsg) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sendmsg.S b/libc/arch-mips/syscalls/sendmsg.S index 31bb56300..88c653e78 100644 --- a/libc/arch-mips/syscalls/sendmsg.S +++ b/libc/arch-mips/syscalls/sendmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendmsg) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sendmsg) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sendto.S b/libc/arch-mips/syscalls/sendto.S index 2ba696da2..ef3fa9f71 100644 --- a/libc/arch-mips/syscalls/sendto.S +++ b/libc/arch-mips/syscalls/sendto.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendto) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sendto) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setfsgid.S b/libc/arch-mips/syscalls/setfsgid.S index 81d33d0d3..158d2c069 100644 --- a/libc/arch-mips/syscalls/setfsgid.S +++ b/libc/arch-mips/syscalls/setfsgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setfsgid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setfsgid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setfsuid.S b/libc/arch-mips/syscalls/setfsuid.S index 68890777b..f76fd172f 100644 --- a/libc/arch-mips/syscalls/setfsuid.S +++ b/libc/arch-mips/syscalls/setfsuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setfsuid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setfsuid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setgid.S b/libc/arch-mips/syscalls/setgid.S index 83649da37..44127cd17 100644 --- a/libc/arch-mips/syscalls/setgid.S +++ b/libc/arch-mips/syscalls/setgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setgid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setgid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setgroups.S b/libc/arch-mips/syscalls/setgroups.S index b98608c48..be4dc13bf 100644 --- a/libc/arch-mips/syscalls/setgroups.S +++ b/libc/arch-mips/syscalls/setgroups.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setgroups) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setgroups) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setitimer.S b/libc/arch-mips/syscalls/setitimer.S index dc9a8f389..968b4531a 100644 --- a/libc/arch-mips/syscalls/setitimer.S +++ b/libc/arch-mips/syscalls/setitimer.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setitimer) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setitimer) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setns.S b/libc/arch-mips/syscalls/setns.S index 9a4939d03..a9270ec20 100644 --- a/libc/arch-mips/syscalls/setns.S +++ b/libc/arch-mips/syscalls/setns.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setns) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setns) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setpgid.S b/libc/arch-mips/syscalls/setpgid.S index cbc1ff3d0..d2db62fe5 100644 --- a/libc/arch-mips/syscalls/setpgid.S +++ b/libc/arch-mips/syscalls/setpgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setpgid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setpgid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setpriority.S b/libc/arch-mips/syscalls/setpriority.S index 6b8a504da..9b68335fb 100644 --- a/libc/arch-mips/syscalls/setpriority.S +++ b/libc/arch-mips/syscalls/setpriority.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setpriority) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setpriority) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setregid.S b/libc/arch-mips/syscalls/setregid.S index 6388784de..6b7474ca9 100644 --- a/libc/arch-mips/syscalls/setregid.S +++ b/libc/arch-mips/syscalls/setregid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setregid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setregid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setresgid.S b/libc/arch-mips/syscalls/setresgid.S index 76968a8c9..223a0d094 100644 --- a/libc/arch-mips/syscalls/setresgid.S +++ b/libc/arch-mips/syscalls/setresgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setresgid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setresgid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setresuid.S b/libc/arch-mips/syscalls/setresuid.S index fae15f802..1f99682dc 100644 --- a/libc/arch-mips/syscalls/setresuid.S +++ b/libc/arch-mips/syscalls/setresuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setresuid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setresuid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setreuid.S b/libc/arch-mips/syscalls/setreuid.S index 8350cb718..fa9c3d270 100644 --- a/libc/arch-mips/syscalls/setreuid.S +++ b/libc/arch-mips/syscalls/setreuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setreuid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setreuid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setrlimit.S b/libc/arch-mips/syscalls/setrlimit.S index d708c2d60..016e24c2d 100644 --- a/libc/arch-mips/syscalls/setrlimit.S +++ b/libc/arch-mips/syscalls/setrlimit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setrlimit) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setrlimit) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setsid.S b/libc/arch-mips/syscalls/setsid.S index cb5838d30..9f3cb4809 100644 --- a/libc/arch-mips/syscalls/setsid.S +++ b/libc/arch-mips/syscalls/setsid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setsid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setsid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setsockopt.S b/libc/arch-mips/syscalls/setsockopt.S index da348f112..b2368a15c 100644 --- a/libc/arch-mips/syscalls/setsockopt.S +++ b/libc/arch-mips/syscalls/setsockopt.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setsockopt) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setsockopt) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/settimeofday.S b/libc/arch-mips/syscalls/settimeofday.S index cd52b406c..e3a5a0680 100644 --- a/libc/arch-mips/syscalls/settimeofday.S +++ b/libc/arch-mips/syscalls/settimeofday.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(settimeofday) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(settimeofday) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setuid.S b/libc/arch-mips/syscalls/setuid.S index a80ec5cf0..ff3da0a44 100644 --- a/libc/arch-mips/syscalls/setuid.S +++ b/libc/arch-mips/syscalls/setuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setuid) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setuid) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/setxattr.S b/libc/arch-mips/syscalls/setxattr.S index df7bcdb9d..5b3a24162 100644 --- a/libc/arch-mips/syscalls/setxattr.S +++ b/libc/arch-mips/syscalls/setxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setxattr) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(setxattr) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/shutdown.S b/libc/arch-mips/syscalls/shutdown.S index 71e636661..5db046f31 100644 --- a/libc/arch-mips/syscalls/shutdown.S +++ b/libc/arch-mips/syscalls/shutdown.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(shutdown) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(shutdown) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sigaltstack.S b/libc/arch-mips/syscalls/sigaltstack.S index b52c60aa8..f5437592b 100644 --- a/libc/arch-mips/syscalls/sigaltstack.S +++ b/libc/arch-mips/syscalls/sigaltstack.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sigaltstack) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sigaltstack) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/socketpair.S b/libc/arch-mips/syscalls/socketpair.S index 47223e14e..7f85da362 100644 --- a/libc/arch-mips/syscalls/socketpair.S +++ b/libc/arch-mips/syscalls/socketpair.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(socketpair) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(socketpair) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/splice.S b/libc/arch-mips/syscalls/splice.S index 611a06292..a55b7e8d7 100644 --- a/libc/arch-mips/syscalls/splice.S +++ b/libc/arch-mips/syscalls/splice.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(splice) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(splice) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/swapoff.S b/libc/arch-mips/syscalls/swapoff.S index 8b570688d..ce782d084 100644 --- a/libc/arch-mips/syscalls/swapoff.S +++ b/libc/arch-mips/syscalls/swapoff.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(swapoff) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(swapoff) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/swapon.S b/libc/arch-mips/syscalls/swapon.S index ef3a53754..127c3a820 100644 --- a/libc/arch-mips/syscalls/swapon.S +++ b/libc/arch-mips/syscalls/swapon.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(swapon) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(swapon) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/symlinkat.S b/libc/arch-mips/syscalls/symlinkat.S index 65971a973..b0690a45b 100644 --- a/libc/arch-mips/syscalls/symlinkat.S +++ b/libc/arch-mips/syscalls/symlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(symlinkat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(symlinkat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sync.S b/libc/arch-mips/syscalls/sync.S index d62ae768b..8858e7480 100644 --- a/libc/arch-mips/syscalls/sync.S +++ b/libc/arch-mips/syscalls/sync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sync) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sync) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/sysinfo.S b/libc/arch-mips/syscalls/sysinfo.S index 600e086ce..beefc0e6e 100644 --- a/libc/arch-mips/syscalls/sysinfo.S +++ b/libc/arch-mips/syscalls/sysinfo.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sysinfo) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(sysinfo) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/tee.S b/libc/arch-mips/syscalls/tee.S index 90ec91180..1115907d6 100644 --- a/libc/arch-mips/syscalls/tee.S +++ b/libc/arch-mips/syscalls/tee.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(tee) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(tee) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/tgkill.S b/libc/arch-mips/syscalls/tgkill.S index 39a148b4f..bea211d8f 100644 --- a/libc/arch-mips/syscalls/tgkill.S +++ b/libc/arch-mips/syscalls/tgkill.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(tgkill) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(tgkill) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/timerfd_create.S b/libc/arch-mips/syscalls/timerfd_create.S index b50903a4d..116c6280b 100644 --- a/libc/arch-mips/syscalls/timerfd_create.S +++ b/libc/arch-mips/syscalls/timerfd_create.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_create) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(timerfd_create) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/timerfd_gettime.S b/libc/arch-mips/syscalls/timerfd_gettime.S index 97d304544..df7138cd3 100644 --- a/libc/arch-mips/syscalls/timerfd_gettime.S +++ b/libc/arch-mips/syscalls/timerfd_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_gettime) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(timerfd_gettime) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/timerfd_settime.S b/libc/arch-mips/syscalls/timerfd_settime.S index 1e56f86fb..2bfadb9c9 100644 --- a/libc/arch-mips/syscalls/timerfd_settime.S +++ b/libc/arch-mips/syscalls/timerfd_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_settime) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(timerfd_settime) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/times.S b/libc/arch-mips/syscalls/times.S index 60904d1cd..90ce97f58 100644 --- a/libc/arch-mips/syscalls/times.S +++ b/libc/arch-mips/syscalls/times.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(times) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(times) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/truncate.S b/libc/arch-mips/syscalls/truncate.S index ec7bc4989..6800705d6 100644 --- a/libc/arch-mips/syscalls/truncate.S +++ b/libc/arch-mips/syscalls/truncate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(truncate) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(truncate) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/truncate64.S b/libc/arch-mips/syscalls/truncate64.S index b6a0234ce..870e735b6 100644 --- a/libc/arch-mips/syscalls/truncate64.S +++ b/libc/arch-mips/syscalls/truncate64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(truncate64) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(truncate64) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/umask.S b/libc/arch-mips/syscalls/umask.S index 8f66e7703..ccf42921f 100644 --- a/libc/arch-mips/syscalls/umask.S +++ b/libc/arch-mips/syscalls/umask.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(umask) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(umask) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/umount2.S b/libc/arch-mips/syscalls/umount2.S index 58e31f3ab..65a7129bc 100644 --- a/libc/arch-mips/syscalls/umount2.S +++ b/libc/arch-mips/syscalls/umount2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(umount2) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(umount2) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/uname.S b/libc/arch-mips/syscalls/uname.S index 401d139e8..f540b3ac2 100644 --- a/libc/arch-mips/syscalls/uname.S +++ b/libc/arch-mips/syscalls/uname.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(uname) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(uname) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/unlinkat.S b/libc/arch-mips/syscalls/unlinkat.S index b6e849d45..001f9cf6d 100644 --- a/libc/arch-mips/syscalls/unlinkat.S +++ b/libc/arch-mips/syscalls/unlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(unlinkat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(unlinkat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/unshare.S b/libc/arch-mips/syscalls/unshare.S index 526283208..13ca45284 100644 --- a/libc/arch-mips/syscalls/unshare.S +++ b/libc/arch-mips/syscalls/unshare.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(unshare) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(unshare) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/utimensat.S b/libc/arch-mips/syscalls/utimensat.S index 9ecb5c018..14e5a10b6 100644 --- a/libc/arch-mips/syscalls/utimensat.S +++ b/libc/arch-mips/syscalls/utimensat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(utimensat) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(utimensat) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/vmsplice.S b/libc/arch-mips/syscalls/vmsplice.S index 5ad23a6e9..0191f53a4 100644 --- a/libc/arch-mips/syscalls/vmsplice.S +++ b/libc/arch-mips/syscalls/vmsplice.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(vmsplice) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(vmsplice) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/wait4.S b/libc/arch-mips/syscalls/wait4.S index 8f8d8795d..8a12533d1 100644 --- a/libc/arch-mips/syscalls/wait4.S +++ b/libc/arch-mips/syscalls/wait4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(wait4) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(wait4) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/write.S b/libc/arch-mips/syscalls/write.S index 3e37919e5..62dc36fe1 100644 --- a/libc/arch-mips/syscalls/write.S +++ b/libc/arch-mips/syscalls/write.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(write) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(write) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips/syscalls/writev.S b/libc/arch-mips/syscalls/writev.S index 72ea2f2c2..d8d661659 100644 --- a/libc/arch-mips/syscalls/writev.S +++ b/libc/arch-mips/syscalls/writev.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(writev) .set noreorder .cpload t9 @@ -14,7 +12,7 @@ ENTRY(writev) j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder diff --git a/libc/arch-mips64/bionic/__bionic_clone.S b/libc/arch-mips64/bionic/__bionic_clone.S index 4f053f99a..0d266ee9a 100644 --- a/libc/arch-mips64/bionic/__bionic_clone.S +++ b/libc/arch-mips64/bionic/__bionic_clone.S @@ -93,7 +93,7 @@ LEAF(__bionic_clone, FRAMESZ) j t9 .L__error_bc: - LA t9,__set_errno + LA t9,__set_errno_internal RESTORE_GP64 PTR_ADDU sp,FRAMESZ j t9 diff --git a/libc/arch-mips64/bionic/syscall.S b/libc/arch-mips64/bionic/syscall.S index c4fd00995..924741df1 100644 --- a/libc/arch-mips64/bionic/syscall.S +++ b/libc/arch-mips64/bionic/syscall.S @@ -61,7 +61,7 @@ LEAF(syscall,FRAMESZ) PTR_ADDU sp, FRAMESZ j ra 1: - LA t9,__set_errno + LA t9,__set_errno_internal RESTORE_GP64 PTR_ADDU sp, FRAMESZ j t9 diff --git a/libc/arch-mips64/bionic/vfork.S b/libc/arch-mips64/bionic/vfork.S index 911a264f2..d180a8cf2 100644 --- a/libc/arch-mips64/bionic/vfork.S +++ b/libc/arch-mips64/bionic/vfork.S @@ -65,7 +65,7 @@ LEAF(vfork,FRAMESZ) RESTORE_GP64 j ra 1: - LA t9,__set_errno + LA t9,__set_errno_internal RESTORE_GP64 j t9 END(vfork) diff --git a/libc/arch-mips64/syscalls/__accept4.S b/libc/arch-mips64/syscalls/__accept4.S index 0891d7f11..ed9b6c7b2 100644 --- a/libc/arch-mips64/syscalls/__accept4.S +++ b/libc/arch-mips64/syscalls/__accept4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__accept4) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__accept4) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__brk.S b/libc/arch-mips64/syscalls/__brk.S index 86f390c54..e1f89c7a0 100644 --- a/libc/arch-mips64/syscalls/__brk.S +++ b/libc/arch-mips64/syscalls/__brk.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__brk) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__brk) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__connect.S b/libc/arch-mips64/syscalls/__connect.S index 2efbb2a88..8c44464e6 100644 --- a/libc/arch-mips64/syscalls/__connect.S +++ b/libc/arch-mips64/syscalls/__connect.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__connect) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__connect) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__epoll_pwait.S b/libc/arch-mips64/syscalls/__epoll_pwait.S index 430d9bbb0..5dfb380cf 100644 --- a/libc/arch-mips64/syscalls/__epoll_pwait.S +++ b/libc/arch-mips64/syscalls/__epoll_pwait.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__epoll_pwait) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__epoll_pwait) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__exit.S b/libc/arch-mips64/syscalls/__exit.S index ebee0d158..2d5e03d64 100644 --- a/libc/arch-mips64/syscalls/__exit.S +++ b/libc/arch-mips64/syscalls/__exit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__exit) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__exit) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__getcpu.S b/libc/arch-mips64/syscalls/__getcpu.S index 34a8acb5c..a16c21e96 100644 --- a/libc/arch-mips64/syscalls/__getcpu.S +++ b/libc/arch-mips64/syscalls/__getcpu.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getcpu) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__getcpu) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__getcwd.S b/libc/arch-mips64/syscalls/__getcwd.S index e7a09a6b2..53eeb68a9 100644 --- a/libc/arch-mips64/syscalls/__getcwd.S +++ b/libc/arch-mips64/syscalls/__getcwd.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getcwd) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__getcwd) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__getdents64.S b/libc/arch-mips64/syscalls/__getdents64.S index dc51e7282..3720b8e9a 100644 --- a/libc/arch-mips64/syscalls/__getdents64.S +++ b/libc/arch-mips64/syscalls/__getdents64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getdents64) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__getdents64) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__getpid.S b/libc/arch-mips64/syscalls/__getpid.S index 86b407180..6d5d92685 100644 --- a/libc/arch-mips64/syscalls/__getpid.S +++ b/libc/arch-mips64/syscalls/__getpid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getpid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__getpid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__getpriority.S b/libc/arch-mips64/syscalls/__getpriority.S index f0c7267bb..19327abad 100644 --- a/libc/arch-mips64/syscalls/__getpriority.S +++ b/libc/arch-mips64/syscalls/__getpriority.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getpriority) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__getpriority) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__ioctl.S b/libc/arch-mips64/syscalls/__ioctl.S index 1f94075db..7fad0d19e 100644 --- a/libc/arch-mips64/syscalls/__ioctl.S +++ b/libc/arch-mips64/syscalls/__ioctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ioctl) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__ioctl) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__openat.S b/libc/arch-mips64/syscalls/__openat.S index 6cc56daeb..d3ac13aec 100644 --- a/libc/arch-mips64/syscalls/__openat.S +++ b/libc/arch-mips64/syscalls/__openat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__openat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__openat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__ppoll.S b/libc/arch-mips64/syscalls/__ppoll.S index ce3a5513e..4e6fb8a4a 100644 --- a/libc/arch-mips64/syscalls/__ppoll.S +++ b/libc/arch-mips64/syscalls/__ppoll.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ppoll) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__ppoll) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__pselect6.S b/libc/arch-mips64/syscalls/__pselect6.S index dbfe79f04..6d49d1ce5 100644 --- a/libc/arch-mips64/syscalls/__pselect6.S +++ b/libc/arch-mips64/syscalls/__pselect6.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__pselect6) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__pselect6) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__ptrace.S b/libc/arch-mips64/syscalls/__ptrace.S index e26217fc1..5a3ce16dc 100644 --- a/libc/arch-mips64/syscalls/__ptrace.S +++ b/libc/arch-mips64/syscalls/__ptrace.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ptrace) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__ptrace) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__reboot.S b/libc/arch-mips64/syscalls/__reboot.S index a4f4e71ff..587310dbe 100644 --- a/libc/arch-mips64/syscalls/__reboot.S +++ b/libc/arch-mips64/syscalls/__reboot.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__reboot) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__reboot) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__rt_sigaction.S b/libc/arch-mips64/syscalls/__rt_sigaction.S index 10f359860..7dd3cae0a 100644 --- a/libc/arch-mips64/syscalls/__rt_sigaction.S +++ b/libc/arch-mips64/syscalls/__rt_sigaction.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigaction) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__rt_sigaction) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__rt_sigpending.S b/libc/arch-mips64/syscalls/__rt_sigpending.S index 7855cca09..68ae39a4a 100644 --- a/libc/arch-mips64/syscalls/__rt_sigpending.S +++ b/libc/arch-mips64/syscalls/__rt_sigpending.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigpending) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__rt_sigpending) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__rt_sigprocmask.S b/libc/arch-mips64/syscalls/__rt_sigprocmask.S index f1ba2e934..54620e9bb 100644 --- a/libc/arch-mips64/syscalls/__rt_sigprocmask.S +++ b/libc/arch-mips64/syscalls/__rt_sigprocmask.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigprocmask) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__rt_sigprocmask) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__rt_sigsuspend.S b/libc/arch-mips64/syscalls/__rt_sigsuspend.S index 50ebf5e22..ea15defa8 100644 --- a/libc/arch-mips64/syscalls/__rt_sigsuspend.S +++ b/libc/arch-mips64/syscalls/__rt_sigsuspend.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigsuspend) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__rt_sigsuspend) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__rt_sigtimedwait.S b/libc/arch-mips64/syscalls/__rt_sigtimedwait.S index 304d049d8..177f17c98 100644 --- a/libc/arch-mips64/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-mips64/syscalls/__rt_sigtimedwait.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigtimedwait) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__rt_sigtimedwait) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__sched_getaffinity.S b/libc/arch-mips64/syscalls/__sched_getaffinity.S index cf590c37f..208170610 100644 --- a/libc/arch-mips64/syscalls/__sched_getaffinity.S +++ b/libc/arch-mips64/syscalls/__sched_getaffinity.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__sched_getaffinity) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__sched_getaffinity) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__set_tid_address.S b/libc/arch-mips64/syscalls/__set_tid_address.S index d08aa7b7e..cd966dd60 100644 --- a/libc/arch-mips64/syscalls/__set_tid_address.S +++ b/libc/arch-mips64/syscalls/__set_tid_address.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__set_tid_address) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__set_tid_address) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__set_tls.S b/libc/arch-mips64/syscalls/__set_tls.S index 430c5fbf2..cc981505f 100644 --- a/libc/arch-mips64/syscalls/__set_tls.S +++ b/libc/arch-mips64/syscalls/__set_tls.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__set_tls) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__set_tls) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__signalfd4.S b/libc/arch-mips64/syscalls/__signalfd4.S index 020013896..ea6eef1bd 100644 --- a/libc/arch-mips64/syscalls/__signalfd4.S +++ b/libc/arch-mips64/syscalls/__signalfd4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__signalfd4) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__signalfd4) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__socket.S b/libc/arch-mips64/syscalls/__socket.S index ac7586ab8..a49935983 100644 --- a/libc/arch-mips64/syscalls/__socket.S +++ b/libc/arch-mips64/syscalls/__socket.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__socket) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__socket) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__timer_create.S b/libc/arch-mips64/syscalls/__timer_create.S index 518207dbe..c66d8f906 100644 --- a/libc/arch-mips64/syscalls/__timer_create.S +++ b/libc/arch-mips64/syscalls/__timer_create.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_create) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__timer_create) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__timer_delete.S b/libc/arch-mips64/syscalls/__timer_delete.S index 4db1c8526..45cf5e875 100644 --- a/libc/arch-mips64/syscalls/__timer_delete.S +++ b/libc/arch-mips64/syscalls/__timer_delete.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_delete) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__timer_delete) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__timer_getoverrun.S b/libc/arch-mips64/syscalls/__timer_getoverrun.S index c5aa40f60..8a731606c 100644 --- a/libc/arch-mips64/syscalls/__timer_getoverrun.S +++ b/libc/arch-mips64/syscalls/__timer_getoverrun.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_getoverrun) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__timer_getoverrun) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__timer_gettime.S b/libc/arch-mips64/syscalls/__timer_gettime.S index 8bebdd82d..32ee5bfec 100644 --- a/libc/arch-mips64/syscalls/__timer_gettime.S +++ b/libc/arch-mips64/syscalls/__timer_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_gettime) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__timer_gettime) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__timer_settime.S b/libc/arch-mips64/syscalls/__timer_settime.S index 536c816d9..59764d869 100644 --- a/libc/arch-mips64/syscalls/__timer_settime.S +++ b/libc/arch-mips64/syscalls/__timer_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_settime) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__timer_settime) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/__waitid.S b/libc/arch-mips64/syscalls/__waitid.S index 28b99bca1..5ee090d2b 100644 --- a/libc/arch-mips64/syscalls/__waitid.S +++ b/libc/arch-mips64/syscalls/__waitid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__waitid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(__waitid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/_exit.S b/libc/arch-mips64/syscalls/_exit.S index 370960e82..da5a2f7d1 100644 --- a/libc/arch-mips64/syscalls/_exit.S +++ b/libc/arch-mips64/syscalls/_exit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(_exit) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(_exit) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/_flush_cache.S b/libc/arch-mips64/syscalls/_flush_cache.S index 997ccecb0..a9e484268 100644 --- a/libc/arch-mips64/syscalls/_flush_cache.S +++ b/libc/arch-mips64/syscalls/_flush_cache.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(_flush_cache) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(_flush_cache) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/acct.S b/libc/arch-mips64/syscalls/acct.S index 70bdd3ec0..ff728dcf3 100644 --- a/libc/arch-mips64/syscalls/acct.S +++ b/libc/arch-mips64/syscalls/acct.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(acct) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(acct) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/bind.S b/libc/arch-mips64/syscalls/bind.S index fab9b4243..9c2b5b8aa 100644 --- a/libc/arch-mips64/syscalls/bind.S +++ b/libc/arch-mips64/syscalls/bind.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(bind) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(bind) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/capget.S b/libc/arch-mips64/syscalls/capget.S index 6c1a13cc2..9d054385a 100644 --- a/libc/arch-mips64/syscalls/capget.S +++ b/libc/arch-mips64/syscalls/capget.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(capget) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(capget) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/capset.S b/libc/arch-mips64/syscalls/capset.S index da8e9e6dc..e947028ad 100644 --- a/libc/arch-mips64/syscalls/capset.S +++ b/libc/arch-mips64/syscalls/capset.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(capset) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(capset) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/chdir.S b/libc/arch-mips64/syscalls/chdir.S index 37f8f6923..14b22c97a 100644 --- a/libc/arch-mips64/syscalls/chdir.S +++ b/libc/arch-mips64/syscalls/chdir.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(chdir) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(chdir) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/chroot.S b/libc/arch-mips64/syscalls/chroot.S index 7dced37e5..e805f51d4 100644 --- a/libc/arch-mips64/syscalls/chroot.S +++ b/libc/arch-mips64/syscalls/chroot.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(chroot) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(chroot) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/clock_getres.S b/libc/arch-mips64/syscalls/clock_getres.S index 72ad1461a..41003a0a8 100644 --- a/libc/arch-mips64/syscalls/clock_getres.S +++ b/libc/arch-mips64/syscalls/clock_getres.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_getres) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(clock_getres) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/clock_gettime.S b/libc/arch-mips64/syscalls/clock_gettime.S index 431e6671f..08135607e 100644 --- a/libc/arch-mips64/syscalls/clock_gettime.S +++ b/libc/arch-mips64/syscalls/clock_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_gettime) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(clock_gettime) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/clock_nanosleep.S b/libc/arch-mips64/syscalls/clock_nanosleep.S index c0db78118..c958a10a2 100644 --- a/libc/arch-mips64/syscalls/clock_nanosleep.S +++ b/libc/arch-mips64/syscalls/clock_nanosleep.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_nanosleep) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(clock_nanosleep) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/clock_settime.S b/libc/arch-mips64/syscalls/clock_settime.S index c9a4a7950..77b6ae412 100644 --- a/libc/arch-mips64/syscalls/clock_settime.S +++ b/libc/arch-mips64/syscalls/clock_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_settime) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(clock_settime) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/close.S b/libc/arch-mips64/syscalls/close.S index ff093e449..5e237dd42 100644 --- a/libc/arch-mips64/syscalls/close.S +++ b/libc/arch-mips64/syscalls/close.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(close) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(close) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/delete_module.S b/libc/arch-mips64/syscalls/delete_module.S index 86c64d614..8396537d4 100644 --- a/libc/arch-mips64/syscalls/delete_module.S +++ b/libc/arch-mips64/syscalls/delete_module.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(delete_module) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(delete_module) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/dup.S b/libc/arch-mips64/syscalls/dup.S index 23aa5c01f..d1ca5e73b 100644 --- a/libc/arch-mips64/syscalls/dup.S +++ b/libc/arch-mips64/syscalls/dup.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(dup) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(dup) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/dup3.S b/libc/arch-mips64/syscalls/dup3.S index a5392dcb1..5601f3191 100644 --- a/libc/arch-mips64/syscalls/dup3.S +++ b/libc/arch-mips64/syscalls/dup3.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(dup3) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(dup3) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/epoll_create1.S b/libc/arch-mips64/syscalls/epoll_create1.S index c3219d4bd..11f1ceb05 100644 --- a/libc/arch-mips64/syscalls/epoll_create1.S +++ b/libc/arch-mips64/syscalls/epoll_create1.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(epoll_create1) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(epoll_create1) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/epoll_ctl.S b/libc/arch-mips64/syscalls/epoll_ctl.S index 9b740d02a..9eba605a7 100644 --- a/libc/arch-mips64/syscalls/epoll_ctl.S +++ b/libc/arch-mips64/syscalls/epoll_ctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(epoll_ctl) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(epoll_ctl) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/eventfd.S b/libc/arch-mips64/syscalls/eventfd.S index ea3a2c687..5cd63e40c 100644 --- a/libc/arch-mips64/syscalls/eventfd.S +++ b/libc/arch-mips64/syscalls/eventfd.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(eventfd) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(eventfd) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/execve.S b/libc/arch-mips64/syscalls/execve.S index af2c6d045..bcd5d6017 100644 --- a/libc/arch-mips64/syscalls/execve.S +++ b/libc/arch-mips64/syscalls/execve.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(execve) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(execve) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/faccessat.S b/libc/arch-mips64/syscalls/faccessat.S index c8ee9e5bc..18bb80062 100644 --- a/libc/arch-mips64/syscalls/faccessat.S +++ b/libc/arch-mips64/syscalls/faccessat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(faccessat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(faccessat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fallocate.S b/libc/arch-mips64/syscalls/fallocate.S index 9e7c89e04..c1ef0ed93 100644 --- a/libc/arch-mips64/syscalls/fallocate.S +++ b/libc/arch-mips64/syscalls/fallocate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fallocate) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fallocate) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fchdir.S b/libc/arch-mips64/syscalls/fchdir.S index 780a8a245..e05625cd9 100644 --- a/libc/arch-mips64/syscalls/fchdir.S +++ b/libc/arch-mips64/syscalls/fchdir.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchdir) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fchdir) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fchmod.S b/libc/arch-mips64/syscalls/fchmod.S index b9e7cab54..a877b781f 100644 --- a/libc/arch-mips64/syscalls/fchmod.S +++ b/libc/arch-mips64/syscalls/fchmod.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchmod) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fchmod) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fchmodat.S b/libc/arch-mips64/syscalls/fchmodat.S index ff04c8c3c..151492aa7 100644 --- a/libc/arch-mips64/syscalls/fchmodat.S +++ b/libc/arch-mips64/syscalls/fchmodat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchmodat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fchmodat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fchown.S b/libc/arch-mips64/syscalls/fchown.S index 97bd20883..5dc33c057 100644 --- a/libc/arch-mips64/syscalls/fchown.S +++ b/libc/arch-mips64/syscalls/fchown.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchown) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fchown) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fchownat.S b/libc/arch-mips64/syscalls/fchownat.S index 0e5635a07..f4cefe0fd 100644 --- a/libc/arch-mips64/syscalls/fchownat.S +++ b/libc/arch-mips64/syscalls/fchownat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchownat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fchownat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fcntl.S b/libc/arch-mips64/syscalls/fcntl.S index 325d9fd6a..dabc65b9e 100644 --- a/libc/arch-mips64/syscalls/fcntl.S +++ b/libc/arch-mips64/syscalls/fcntl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fcntl) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fcntl) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fdatasync.S b/libc/arch-mips64/syscalls/fdatasync.S index 8a714c31d..52be110bb 100644 --- a/libc/arch-mips64/syscalls/fdatasync.S +++ b/libc/arch-mips64/syscalls/fdatasync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fdatasync) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fdatasync) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fgetxattr.S b/libc/arch-mips64/syscalls/fgetxattr.S index 87a21ce01..44c248a38 100644 --- a/libc/arch-mips64/syscalls/fgetxattr.S +++ b/libc/arch-mips64/syscalls/fgetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fgetxattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fgetxattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/flistxattr.S b/libc/arch-mips64/syscalls/flistxattr.S index b430931c3..1d5b1b028 100644 --- a/libc/arch-mips64/syscalls/flistxattr.S +++ b/libc/arch-mips64/syscalls/flistxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(flistxattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(flistxattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/flock.S b/libc/arch-mips64/syscalls/flock.S index bc4c83589..d74a5db84 100644 --- a/libc/arch-mips64/syscalls/flock.S +++ b/libc/arch-mips64/syscalls/flock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(flock) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(flock) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fremovexattr.S b/libc/arch-mips64/syscalls/fremovexattr.S index 412122385..417be4af0 100644 --- a/libc/arch-mips64/syscalls/fremovexattr.S +++ b/libc/arch-mips64/syscalls/fremovexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fremovexattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fremovexattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fsetxattr.S b/libc/arch-mips64/syscalls/fsetxattr.S index 4180bd098..0ad1f9000 100644 --- a/libc/arch-mips64/syscalls/fsetxattr.S +++ b/libc/arch-mips64/syscalls/fsetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fsetxattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fsetxattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fstat64.S b/libc/arch-mips64/syscalls/fstat64.S index 03cbf6922..a14d51cb6 100644 --- a/libc/arch-mips64/syscalls/fstat64.S +++ b/libc/arch-mips64/syscalls/fstat64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstat64) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fstat64) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fstatat64.S b/libc/arch-mips64/syscalls/fstatat64.S index 55ae243b7..7888a432d 100644 --- a/libc/arch-mips64/syscalls/fstatat64.S +++ b/libc/arch-mips64/syscalls/fstatat64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstatat64) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fstatat64) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fstatfs64.S b/libc/arch-mips64/syscalls/fstatfs64.S index 5fb5d95a7..12e885cf1 100644 --- a/libc/arch-mips64/syscalls/fstatfs64.S +++ b/libc/arch-mips64/syscalls/fstatfs64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstatfs64) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fstatfs64) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/fsync.S b/libc/arch-mips64/syscalls/fsync.S index fa5de8752..7056e363c 100644 --- a/libc/arch-mips64/syscalls/fsync.S +++ b/libc/arch-mips64/syscalls/fsync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fsync) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(fsync) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/ftruncate.S b/libc/arch-mips64/syscalls/ftruncate.S index b605a3725..58b847b77 100644 --- a/libc/arch-mips64/syscalls/ftruncate.S +++ b/libc/arch-mips64/syscalls/ftruncate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(ftruncate) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(ftruncate) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getegid.S b/libc/arch-mips64/syscalls/getegid.S index 7ef8fe35c..439c6f00c 100644 --- a/libc/arch-mips64/syscalls/getegid.S +++ b/libc/arch-mips64/syscalls/getegid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getegid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getegid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/geteuid.S b/libc/arch-mips64/syscalls/geteuid.S index c21f0efd5..5619dc602 100644 --- a/libc/arch-mips64/syscalls/geteuid.S +++ b/libc/arch-mips64/syscalls/geteuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(geteuid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(geteuid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getgid.S b/libc/arch-mips64/syscalls/getgid.S index bd690dcb6..777be1a96 100644 --- a/libc/arch-mips64/syscalls/getgid.S +++ b/libc/arch-mips64/syscalls/getgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getgid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getgid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getgroups.S b/libc/arch-mips64/syscalls/getgroups.S index d7aded76b..93c4fa14b 100644 --- a/libc/arch-mips64/syscalls/getgroups.S +++ b/libc/arch-mips64/syscalls/getgroups.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getgroups) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getgroups) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getitimer.S b/libc/arch-mips64/syscalls/getitimer.S index a438faafd..fe78a97bf 100644 --- a/libc/arch-mips64/syscalls/getitimer.S +++ b/libc/arch-mips64/syscalls/getitimer.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getitimer) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getitimer) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getpeername.S b/libc/arch-mips64/syscalls/getpeername.S index bf40141fe..121f1a650 100644 --- a/libc/arch-mips64/syscalls/getpeername.S +++ b/libc/arch-mips64/syscalls/getpeername.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getpeername) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getpeername) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getpgid.S b/libc/arch-mips64/syscalls/getpgid.S index 739a6e2d8..19dc77fd2 100644 --- a/libc/arch-mips64/syscalls/getpgid.S +++ b/libc/arch-mips64/syscalls/getpgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getpgid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getpgid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getppid.S b/libc/arch-mips64/syscalls/getppid.S index e642a7984..d00f3093a 100644 --- a/libc/arch-mips64/syscalls/getppid.S +++ b/libc/arch-mips64/syscalls/getppid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getppid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getppid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getresgid.S b/libc/arch-mips64/syscalls/getresgid.S index d88516f1a..18cb5a18a 100644 --- a/libc/arch-mips64/syscalls/getresgid.S +++ b/libc/arch-mips64/syscalls/getresgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getresgid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getresgid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getresuid.S b/libc/arch-mips64/syscalls/getresuid.S index b43921151..c217bf725 100644 --- a/libc/arch-mips64/syscalls/getresuid.S +++ b/libc/arch-mips64/syscalls/getresuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getresuid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getresuid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getrlimit.S b/libc/arch-mips64/syscalls/getrlimit.S index 423bc0fa0..7576c1710 100644 --- a/libc/arch-mips64/syscalls/getrlimit.S +++ b/libc/arch-mips64/syscalls/getrlimit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getrlimit) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getrlimit) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getrusage.S b/libc/arch-mips64/syscalls/getrusage.S index 9f57b8424..4bf557e34 100644 --- a/libc/arch-mips64/syscalls/getrusage.S +++ b/libc/arch-mips64/syscalls/getrusage.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getrusage) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getrusage) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getsid.S b/libc/arch-mips64/syscalls/getsid.S index 125da4ed5..030c91df0 100644 --- a/libc/arch-mips64/syscalls/getsid.S +++ b/libc/arch-mips64/syscalls/getsid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getsid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getsockname.S b/libc/arch-mips64/syscalls/getsockname.S index 3481d652c..88a94268e 100644 --- a/libc/arch-mips64/syscalls/getsockname.S +++ b/libc/arch-mips64/syscalls/getsockname.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsockname) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getsockname) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getsockopt.S b/libc/arch-mips64/syscalls/getsockopt.S index 2e9b6d706..08ee634aa 100644 --- a/libc/arch-mips64/syscalls/getsockopt.S +++ b/libc/arch-mips64/syscalls/getsockopt.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsockopt) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getsockopt) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/gettimeofday.S b/libc/arch-mips64/syscalls/gettimeofday.S index 9bbbd288e..3a6d417e3 100644 --- a/libc/arch-mips64/syscalls/gettimeofday.S +++ b/libc/arch-mips64/syscalls/gettimeofday.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(gettimeofday) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(gettimeofday) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getuid.S b/libc/arch-mips64/syscalls/getuid.S index 4809a5a55..3d5f94081 100644 --- a/libc/arch-mips64/syscalls/getuid.S +++ b/libc/arch-mips64/syscalls/getuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getuid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getuid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/getxattr.S b/libc/arch-mips64/syscalls/getxattr.S index 7a7a4d4e7..1c443f293 100644 --- a/libc/arch-mips64/syscalls/getxattr.S +++ b/libc/arch-mips64/syscalls/getxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getxattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(getxattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/init_module.S b/libc/arch-mips64/syscalls/init_module.S index e46dedceb..3e2f07497 100644 --- a/libc/arch-mips64/syscalls/init_module.S +++ b/libc/arch-mips64/syscalls/init_module.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(init_module) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(init_module) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/inotify_add_watch.S b/libc/arch-mips64/syscalls/inotify_add_watch.S index 4a4fe5f11..bffdad82c 100644 --- a/libc/arch-mips64/syscalls/inotify_add_watch.S +++ b/libc/arch-mips64/syscalls/inotify_add_watch.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_add_watch) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(inotify_add_watch) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/inotify_init1.S b/libc/arch-mips64/syscalls/inotify_init1.S index 6ef6021a5..c70d101fd 100644 --- a/libc/arch-mips64/syscalls/inotify_init1.S +++ b/libc/arch-mips64/syscalls/inotify_init1.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_init1) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(inotify_init1) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/inotify_rm_watch.S b/libc/arch-mips64/syscalls/inotify_rm_watch.S index 10e239a0a..d8937871e 100644 --- a/libc/arch-mips64/syscalls/inotify_rm_watch.S +++ b/libc/arch-mips64/syscalls/inotify_rm_watch.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_rm_watch) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(inotify_rm_watch) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/kill.S b/libc/arch-mips64/syscalls/kill.S index f85a3ef8c..475b6156a 100644 --- a/libc/arch-mips64/syscalls/kill.S +++ b/libc/arch-mips64/syscalls/kill.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(kill) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(kill) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/klogctl.S b/libc/arch-mips64/syscalls/klogctl.S index 8e94b62f3..98b9f0ba9 100644 --- a/libc/arch-mips64/syscalls/klogctl.S +++ b/libc/arch-mips64/syscalls/klogctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(klogctl) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(klogctl) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/lgetxattr.S b/libc/arch-mips64/syscalls/lgetxattr.S index c5990ab67..55d7c4203 100644 --- a/libc/arch-mips64/syscalls/lgetxattr.S +++ b/libc/arch-mips64/syscalls/lgetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lgetxattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(lgetxattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/linkat.S b/libc/arch-mips64/syscalls/linkat.S index 88db867ea..df749eb01 100644 --- a/libc/arch-mips64/syscalls/linkat.S +++ b/libc/arch-mips64/syscalls/linkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(linkat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(linkat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/listen.S b/libc/arch-mips64/syscalls/listen.S index 4db878946..195cadeba 100644 --- a/libc/arch-mips64/syscalls/listen.S +++ b/libc/arch-mips64/syscalls/listen.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(listen) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(listen) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/listxattr.S b/libc/arch-mips64/syscalls/listxattr.S index 56b13f637..30b0f2b7d 100644 --- a/libc/arch-mips64/syscalls/listxattr.S +++ b/libc/arch-mips64/syscalls/listxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(listxattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(listxattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/llistxattr.S b/libc/arch-mips64/syscalls/llistxattr.S index d800f7f46..d3491163d 100644 --- a/libc/arch-mips64/syscalls/llistxattr.S +++ b/libc/arch-mips64/syscalls/llistxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(llistxattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(llistxattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/lremovexattr.S b/libc/arch-mips64/syscalls/lremovexattr.S index e05733f2e..db4e4d397 100644 --- a/libc/arch-mips64/syscalls/lremovexattr.S +++ b/libc/arch-mips64/syscalls/lremovexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lremovexattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(lremovexattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/lseek.S b/libc/arch-mips64/syscalls/lseek.S index 34533cfe1..5c92d7094 100644 --- a/libc/arch-mips64/syscalls/lseek.S +++ b/libc/arch-mips64/syscalls/lseek.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lseek) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(lseek) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/lsetxattr.S b/libc/arch-mips64/syscalls/lsetxattr.S index dea6add71..c161eb358 100644 --- a/libc/arch-mips64/syscalls/lsetxattr.S +++ b/libc/arch-mips64/syscalls/lsetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lsetxattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(lsetxattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/madvise.S b/libc/arch-mips64/syscalls/madvise.S index ab174e9ed..88f3830ec 100644 --- a/libc/arch-mips64/syscalls/madvise.S +++ b/libc/arch-mips64/syscalls/madvise.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(madvise) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(madvise) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/mincore.S b/libc/arch-mips64/syscalls/mincore.S index 349d2f6dc..695c9b27e 100644 --- a/libc/arch-mips64/syscalls/mincore.S +++ b/libc/arch-mips64/syscalls/mincore.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mincore) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(mincore) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/mkdirat.S b/libc/arch-mips64/syscalls/mkdirat.S index b395ba4ea..71cdfd19b 100644 --- a/libc/arch-mips64/syscalls/mkdirat.S +++ b/libc/arch-mips64/syscalls/mkdirat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mkdirat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(mkdirat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/mknodat.S b/libc/arch-mips64/syscalls/mknodat.S index c13d97942..9943e49f0 100644 --- a/libc/arch-mips64/syscalls/mknodat.S +++ b/libc/arch-mips64/syscalls/mknodat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mknodat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(mknodat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/mlock.S b/libc/arch-mips64/syscalls/mlock.S index 82338f3a9..081f12bd1 100644 --- a/libc/arch-mips64/syscalls/mlock.S +++ b/libc/arch-mips64/syscalls/mlock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mlock) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(mlock) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/mlockall.S b/libc/arch-mips64/syscalls/mlockall.S index b34cf81df..0e158f437 100644 --- a/libc/arch-mips64/syscalls/mlockall.S +++ b/libc/arch-mips64/syscalls/mlockall.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mlockall) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(mlockall) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/mmap.S b/libc/arch-mips64/syscalls/mmap.S index 814b745e2..393271ae9 100644 --- a/libc/arch-mips64/syscalls/mmap.S +++ b/libc/arch-mips64/syscalls/mmap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mmap) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(mmap) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/mount.S b/libc/arch-mips64/syscalls/mount.S index 3f42df5fb..50c754173 100644 --- a/libc/arch-mips64/syscalls/mount.S +++ b/libc/arch-mips64/syscalls/mount.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mount) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(mount) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/mprotect.S b/libc/arch-mips64/syscalls/mprotect.S index adf9a67c0..d755489c9 100644 --- a/libc/arch-mips64/syscalls/mprotect.S +++ b/libc/arch-mips64/syscalls/mprotect.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mprotect) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(mprotect) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/mremap.S b/libc/arch-mips64/syscalls/mremap.S index 70c8a8c3c..cf7f1ded8 100644 --- a/libc/arch-mips64/syscalls/mremap.S +++ b/libc/arch-mips64/syscalls/mremap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mremap) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(mremap) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/msync.S b/libc/arch-mips64/syscalls/msync.S index dced6e709..efe31c1fb 100644 --- a/libc/arch-mips64/syscalls/msync.S +++ b/libc/arch-mips64/syscalls/msync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(msync) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(msync) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/munlock.S b/libc/arch-mips64/syscalls/munlock.S index 075c0615c..44b930a3c 100644 --- a/libc/arch-mips64/syscalls/munlock.S +++ b/libc/arch-mips64/syscalls/munlock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munlock) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(munlock) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/munlockall.S b/libc/arch-mips64/syscalls/munlockall.S index 10ff2748e..ffeb5e11c 100644 --- a/libc/arch-mips64/syscalls/munlockall.S +++ b/libc/arch-mips64/syscalls/munlockall.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munlockall) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(munlockall) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/munmap.S b/libc/arch-mips64/syscalls/munmap.S index 5d0b0b0d4..cd0c05cc3 100644 --- a/libc/arch-mips64/syscalls/munmap.S +++ b/libc/arch-mips64/syscalls/munmap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munmap) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(munmap) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/nanosleep.S b/libc/arch-mips64/syscalls/nanosleep.S index a0c7d36ca..bdaf25612 100644 --- a/libc/arch-mips64/syscalls/nanosleep.S +++ b/libc/arch-mips64/syscalls/nanosleep.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(nanosleep) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(nanosleep) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/personality.S b/libc/arch-mips64/syscalls/personality.S index 326cf243f..6a12c95ac 100644 --- a/libc/arch-mips64/syscalls/personality.S +++ b/libc/arch-mips64/syscalls/personality.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(personality) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(personality) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/pipe2.S b/libc/arch-mips64/syscalls/pipe2.S index 8e207acd3..1b08a4533 100644 --- a/libc/arch-mips64/syscalls/pipe2.S +++ b/libc/arch-mips64/syscalls/pipe2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pipe2) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(pipe2) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/prctl.S b/libc/arch-mips64/syscalls/prctl.S index 9e805f456..61bb7c26f 100644 --- a/libc/arch-mips64/syscalls/prctl.S +++ b/libc/arch-mips64/syscalls/prctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(prctl) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(prctl) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/pread64.S b/libc/arch-mips64/syscalls/pread64.S index 3aa06203d..90e061237 100644 --- a/libc/arch-mips64/syscalls/pread64.S +++ b/libc/arch-mips64/syscalls/pread64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pread64) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(pread64) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/prlimit64.S b/libc/arch-mips64/syscalls/prlimit64.S index f767ac17d..5f0ba1de8 100644 --- a/libc/arch-mips64/syscalls/prlimit64.S +++ b/libc/arch-mips64/syscalls/prlimit64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(prlimit64) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(prlimit64) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/pwrite64.S b/libc/arch-mips64/syscalls/pwrite64.S index 8b3bcc0be..e34f8dba1 100644 --- a/libc/arch-mips64/syscalls/pwrite64.S +++ b/libc/arch-mips64/syscalls/pwrite64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pwrite64) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(pwrite64) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/read.S b/libc/arch-mips64/syscalls/read.S index ab687d161..74d39df8f 100644 --- a/libc/arch-mips64/syscalls/read.S +++ b/libc/arch-mips64/syscalls/read.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(read) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(read) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/readahead.S b/libc/arch-mips64/syscalls/readahead.S index 1d9b15b5e..ae511d9e9 100644 --- a/libc/arch-mips64/syscalls/readahead.S +++ b/libc/arch-mips64/syscalls/readahead.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readahead) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(readahead) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/readlinkat.S b/libc/arch-mips64/syscalls/readlinkat.S index 24da46bc3..473a9460e 100644 --- a/libc/arch-mips64/syscalls/readlinkat.S +++ b/libc/arch-mips64/syscalls/readlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readlinkat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(readlinkat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/readv.S b/libc/arch-mips64/syscalls/readv.S index 6aca131bd..daa800c64 100644 --- a/libc/arch-mips64/syscalls/readv.S +++ b/libc/arch-mips64/syscalls/readv.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readv) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(readv) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/recvfrom.S b/libc/arch-mips64/syscalls/recvfrom.S index b9fb03779..4c9b5fa4b 100644 --- a/libc/arch-mips64/syscalls/recvfrom.S +++ b/libc/arch-mips64/syscalls/recvfrom.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvfrom) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(recvfrom) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/recvmmsg.S b/libc/arch-mips64/syscalls/recvmmsg.S index b187cf097..817250c50 100644 --- a/libc/arch-mips64/syscalls/recvmmsg.S +++ b/libc/arch-mips64/syscalls/recvmmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvmmsg) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(recvmmsg) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/recvmsg.S b/libc/arch-mips64/syscalls/recvmsg.S index 49dbb4845..877899d09 100644 --- a/libc/arch-mips64/syscalls/recvmsg.S +++ b/libc/arch-mips64/syscalls/recvmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvmsg) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(recvmsg) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/removexattr.S b/libc/arch-mips64/syscalls/removexattr.S index 61d6da166..c9d8a0e48 100644 --- a/libc/arch-mips64/syscalls/removexattr.S +++ b/libc/arch-mips64/syscalls/removexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(removexattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(removexattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/renameat.S b/libc/arch-mips64/syscalls/renameat.S index f012fadaa..16b9333e7 100644 --- a/libc/arch-mips64/syscalls/renameat.S +++ b/libc/arch-mips64/syscalls/renameat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(renameat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(renameat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sched_get_priority_max.S b/libc/arch-mips64/syscalls/sched_get_priority_max.S index 264545b7e..67e26757e 100644 --- a/libc/arch-mips64/syscalls/sched_get_priority_max.S +++ b/libc/arch-mips64/syscalls/sched_get_priority_max.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_max) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sched_get_priority_max) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sched_get_priority_min.S b/libc/arch-mips64/syscalls/sched_get_priority_min.S index 4984abf3c..957f52383 100644 --- a/libc/arch-mips64/syscalls/sched_get_priority_min.S +++ b/libc/arch-mips64/syscalls/sched_get_priority_min.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_min) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sched_get_priority_min) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sched_getparam.S b/libc/arch-mips64/syscalls/sched_getparam.S index 2837fc8d9..77bb4eb98 100644 --- a/libc/arch-mips64/syscalls/sched_getparam.S +++ b/libc/arch-mips64/syscalls/sched_getparam.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_getparam) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sched_getparam) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sched_getscheduler.S b/libc/arch-mips64/syscalls/sched_getscheduler.S index 3f8dbe3a2..324fa2129 100644 --- a/libc/arch-mips64/syscalls/sched_getscheduler.S +++ b/libc/arch-mips64/syscalls/sched_getscheduler.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_getscheduler) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sched_getscheduler) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sched_rr_get_interval.S b/libc/arch-mips64/syscalls/sched_rr_get_interval.S index 80ea18e5a..30195540c 100644 --- a/libc/arch-mips64/syscalls/sched_rr_get_interval.S +++ b/libc/arch-mips64/syscalls/sched_rr_get_interval.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_rr_get_interval) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sched_rr_get_interval) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sched_setaffinity.S b/libc/arch-mips64/syscalls/sched_setaffinity.S index 843e06f23..15209025d 100644 --- a/libc/arch-mips64/syscalls/sched_setaffinity.S +++ b/libc/arch-mips64/syscalls/sched_setaffinity.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setaffinity) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sched_setaffinity) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sched_setparam.S b/libc/arch-mips64/syscalls/sched_setparam.S index 78435b199..a37b15c53 100644 --- a/libc/arch-mips64/syscalls/sched_setparam.S +++ b/libc/arch-mips64/syscalls/sched_setparam.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setparam) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sched_setparam) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sched_setscheduler.S b/libc/arch-mips64/syscalls/sched_setscheduler.S index 7f78cc737..ea4c6c41d 100644 --- a/libc/arch-mips64/syscalls/sched_setscheduler.S +++ b/libc/arch-mips64/syscalls/sched_setscheduler.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setscheduler) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sched_setscheduler) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sched_yield.S b/libc/arch-mips64/syscalls/sched_yield.S index f81b7ef67..5d86ea5cb 100644 --- a/libc/arch-mips64/syscalls/sched_yield.S +++ b/libc/arch-mips64/syscalls/sched_yield.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_yield) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sched_yield) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sendfile.S b/libc/arch-mips64/syscalls/sendfile.S index c3e80de0c..f33024241 100644 --- a/libc/arch-mips64/syscalls/sendfile.S +++ b/libc/arch-mips64/syscalls/sendfile.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendfile) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sendfile) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sendmmsg.S b/libc/arch-mips64/syscalls/sendmmsg.S index 40efcb671..4a8d855af 100644 --- a/libc/arch-mips64/syscalls/sendmmsg.S +++ b/libc/arch-mips64/syscalls/sendmmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendmmsg) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sendmmsg) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sendmsg.S b/libc/arch-mips64/syscalls/sendmsg.S index 9f9071754..519dce41d 100644 --- a/libc/arch-mips64/syscalls/sendmsg.S +++ b/libc/arch-mips64/syscalls/sendmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendmsg) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sendmsg) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sendto.S b/libc/arch-mips64/syscalls/sendto.S index 3ebfbae4c..84efc0921 100644 --- a/libc/arch-mips64/syscalls/sendto.S +++ b/libc/arch-mips64/syscalls/sendto.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendto) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sendto) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setfsgid.S b/libc/arch-mips64/syscalls/setfsgid.S index 9b360382c..db1bd7f80 100644 --- a/libc/arch-mips64/syscalls/setfsgid.S +++ b/libc/arch-mips64/syscalls/setfsgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setfsgid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setfsgid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setfsuid.S b/libc/arch-mips64/syscalls/setfsuid.S index e42601f39..4254b183e 100644 --- a/libc/arch-mips64/syscalls/setfsuid.S +++ b/libc/arch-mips64/syscalls/setfsuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setfsuid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setfsuid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setgid.S b/libc/arch-mips64/syscalls/setgid.S index 7ce85994d..166a6d6de 100644 --- a/libc/arch-mips64/syscalls/setgid.S +++ b/libc/arch-mips64/syscalls/setgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setgid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setgid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setgroups.S b/libc/arch-mips64/syscalls/setgroups.S index 2724068f4..24649f724 100644 --- a/libc/arch-mips64/syscalls/setgroups.S +++ b/libc/arch-mips64/syscalls/setgroups.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setgroups) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setgroups) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setitimer.S b/libc/arch-mips64/syscalls/setitimer.S index f5dcff0c6..5764573ca 100644 --- a/libc/arch-mips64/syscalls/setitimer.S +++ b/libc/arch-mips64/syscalls/setitimer.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setitimer) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setitimer) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setns.S b/libc/arch-mips64/syscalls/setns.S index cbe2e061a..6b6178f21 100644 --- a/libc/arch-mips64/syscalls/setns.S +++ b/libc/arch-mips64/syscalls/setns.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setns) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setns) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setpgid.S b/libc/arch-mips64/syscalls/setpgid.S index da4453215..233f78476 100644 --- a/libc/arch-mips64/syscalls/setpgid.S +++ b/libc/arch-mips64/syscalls/setpgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setpgid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setpgid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setpriority.S b/libc/arch-mips64/syscalls/setpriority.S index 150a5d4b7..d88a2ffa8 100644 --- a/libc/arch-mips64/syscalls/setpriority.S +++ b/libc/arch-mips64/syscalls/setpriority.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setpriority) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setpriority) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setregid.S b/libc/arch-mips64/syscalls/setregid.S index b80115cb4..c82b4fde5 100644 --- a/libc/arch-mips64/syscalls/setregid.S +++ b/libc/arch-mips64/syscalls/setregid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setregid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setregid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setresgid.S b/libc/arch-mips64/syscalls/setresgid.S index 0fbf302d1..90b293960 100644 --- a/libc/arch-mips64/syscalls/setresgid.S +++ b/libc/arch-mips64/syscalls/setresgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setresgid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setresgid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setresuid.S b/libc/arch-mips64/syscalls/setresuid.S index 89af745c3..501ac5d7a 100644 --- a/libc/arch-mips64/syscalls/setresuid.S +++ b/libc/arch-mips64/syscalls/setresuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setresuid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setresuid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setreuid.S b/libc/arch-mips64/syscalls/setreuid.S index 797091ff0..1b3203c84 100644 --- a/libc/arch-mips64/syscalls/setreuid.S +++ b/libc/arch-mips64/syscalls/setreuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setreuid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setreuid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setrlimit.S b/libc/arch-mips64/syscalls/setrlimit.S index 034f3dbfb..0e5e80e4d 100644 --- a/libc/arch-mips64/syscalls/setrlimit.S +++ b/libc/arch-mips64/syscalls/setrlimit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setrlimit) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setrlimit) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setsid.S b/libc/arch-mips64/syscalls/setsid.S index ef14ebaba..6d872d3b9 100644 --- a/libc/arch-mips64/syscalls/setsid.S +++ b/libc/arch-mips64/syscalls/setsid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setsid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setsid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setsockopt.S b/libc/arch-mips64/syscalls/setsockopt.S index 5c263bdf1..b2fc73627 100644 --- a/libc/arch-mips64/syscalls/setsockopt.S +++ b/libc/arch-mips64/syscalls/setsockopt.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setsockopt) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setsockopt) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/settimeofday.S b/libc/arch-mips64/syscalls/settimeofday.S index a73638ff7..9f1acfe39 100644 --- a/libc/arch-mips64/syscalls/settimeofday.S +++ b/libc/arch-mips64/syscalls/settimeofday.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(settimeofday) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(settimeofday) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setuid.S b/libc/arch-mips64/syscalls/setuid.S index 4321fae0c..dcd39ff10 100644 --- a/libc/arch-mips64/syscalls/setuid.S +++ b/libc/arch-mips64/syscalls/setuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setuid) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setuid) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/setxattr.S b/libc/arch-mips64/syscalls/setxattr.S index 58ccb5fdd..4a1b87ad2 100644 --- a/libc/arch-mips64/syscalls/setxattr.S +++ b/libc/arch-mips64/syscalls/setxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setxattr) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(setxattr) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/shutdown.S b/libc/arch-mips64/syscalls/shutdown.S index cdd6c786f..d65428803 100644 --- a/libc/arch-mips64/syscalls/shutdown.S +++ b/libc/arch-mips64/syscalls/shutdown.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(shutdown) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(shutdown) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sigaltstack.S b/libc/arch-mips64/syscalls/sigaltstack.S index a2e663cc8..92778c1d2 100644 --- a/libc/arch-mips64/syscalls/sigaltstack.S +++ b/libc/arch-mips64/syscalls/sigaltstack.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sigaltstack) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sigaltstack) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/socketpair.S b/libc/arch-mips64/syscalls/socketpair.S index 7be781467..8fbf7a89d 100644 --- a/libc/arch-mips64/syscalls/socketpair.S +++ b/libc/arch-mips64/syscalls/socketpair.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(socketpair) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(socketpair) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/splice.S b/libc/arch-mips64/syscalls/splice.S index efee6cd7d..ea745cf8f 100644 --- a/libc/arch-mips64/syscalls/splice.S +++ b/libc/arch-mips64/syscalls/splice.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(splice) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(splice) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/statfs64.S b/libc/arch-mips64/syscalls/statfs64.S index d3775229d..74351f7f5 100644 --- a/libc/arch-mips64/syscalls/statfs64.S +++ b/libc/arch-mips64/syscalls/statfs64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(statfs64) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(statfs64) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/swapoff.S b/libc/arch-mips64/syscalls/swapoff.S index b257b1e06..8c0048dd7 100644 --- a/libc/arch-mips64/syscalls/swapoff.S +++ b/libc/arch-mips64/syscalls/swapoff.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(swapoff) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(swapoff) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/swapon.S b/libc/arch-mips64/syscalls/swapon.S index e18ff4c26..e8f6ff283 100644 --- a/libc/arch-mips64/syscalls/swapon.S +++ b/libc/arch-mips64/syscalls/swapon.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(swapon) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(swapon) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/symlinkat.S b/libc/arch-mips64/syscalls/symlinkat.S index 560bf0db8..592b8e219 100644 --- a/libc/arch-mips64/syscalls/symlinkat.S +++ b/libc/arch-mips64/syscalls/symlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(symlinkat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(symlinkat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sync.S b/libc/arch-mips64/syscalls/sync.S index 240a6d483..8997c1b26 100644 --- a/libc/arch-mips64/syscalls/sync.S +++ b/libc/arch-mips64/syscalls/sync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sync) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sync) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/sysinfo.S b/libc/arch-mips64/syscalls/sysinfo.S index 6b07be3e5..a54e1581e 100644 --- a/libc/arch-mips64/syscalls/sysinfo.S +++ b/libc/arch-mips64/syscalls/sysinfo.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sysinfo) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(sysinfo) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/tee.S b/libc/arch-mips64/syscalls/tee.S index 0115f714e..99cf84bd8 100644 --- a/libc/arch-mips64/syscalls/tee.S +++ b/libc/arch-mips64/syscalls/tee.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(tee) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(tee) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/tgkill.S b/libc/arch-mips64/syscalls/tgkill.S index bf30a8d7d..f37f792ed 100644 --- a/libc/arch-mips64/syscalls/tgkill.S +++ b/libc/arch-mips64/syscalls/tgkill.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(tgkill) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(tgkill) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/timerfd_create.S b/libc/arch-mips64/syscalls/timerfd_create.S index e65874f60..0e53a15c3 100644 --- a/libc/arch-mips64/syscalls/timerfd_create.S +++ b/libc/arch-mips64/syscalls/timerfd_create.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_create) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(timerfd_create) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/timerfd_gettime.S b/libc/arch-mips64/syscalls/timerfd_gettime.S index a8435986e..26d68328d 100644 --- a/libc/arch-mips64/syscalls/timerfd_gettime.S +++ b/libc/arch-mips64/syscalls/timerfd_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_gettime) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(timerfd_gettime) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/timerfd_settime.S b/libc/arch-mips64/syscalls/timerfd_settime.S index 8c5994f72..b06290eaa 100644 --- a/libc/arch-mips64/syscalls/timerfd_settime.S +++ b/libc/arch-mips64/syscalls/timerfd_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_settime) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(timerfd_settime) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/times.S b/libc/arch-mips64/syscalls/times.S index ff504e715..fa7f64f22 100644 --- a/libc/arch-mips64/syscalls/times.S +++ b/libc/arch-mips64/syscalls/times.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(times) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(times) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/truncate.S b/libc/arch-mips64/syscalls/truncate.S index 3fc06a2a1..fb3b7eb5a 100644 --- a/libc/arch-mips64/syscalls/truncate.S +++ b/libc/arch-mips64/syscalls/truncate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(truncate) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(truncate) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/umask.S b/libc/arch-mips64/syscalls/umask.S index 9e6c910fe..934903016 100644 --- a/libc/arch-mips64/syscalls/umask.S +++ b/libc/arch-mips64/syscalls/umask.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(umask) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(umask) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/umount2.S b/libc/arch-mips64/syscalls/umount2.S index f8d19966f..cc9ad16f2 100644 --- a/libc/arch-mips64/syscalls/umount2.S +++ b/libc/arch-mips64/syscalls/umount2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(umount2) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(umount2) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/uname.S b/libc/arch-mips64/syscalls/uname.S index ce93f08ff..16157da61 100644 --- a/libc/arch-mips64/syscalls/uname.S +++ b/libc/arch-mips64/syscalls/uname.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(uname) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(uname) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/unlinkat.S b/libc/arch-mips64/syscalls/unlinkat.S index 870e8d7a5..4b11679c6 100644 --- a/libc/arch-mips64/syscalls/unlinkat.S +++ b/libc/arch-mips64/syscalls/unlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(unlinkat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(unlinkat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/unshare.S b/libc/arch-mips64/syscalls/unshare.S index 231c29adc..2c82fea11 100644 --- a/libc/arch-mips64/syscalls/unshare.S +++ b/libc/arch-mips64/syscalls/unshare.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(unshare) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(unshare) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/utimensat.S b/libc/arch-mips64/syscalls/utimensat.S index 4b4243e0e..48da938ee 100644 --- a/libc/arch-mips64/syscalls/utimensat.S +++ b/libc/arch-mips64/syscalls/utimensat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(utimensat) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(utimensat) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/vmsplice.S b/libc/arch-mips64/syscalls/vmsplice.S index f85400419..3bcae7485 100644 --- a/libc/arch-mips64/syscalls/vmsplice.S +++ b/libc/arch-mips64/syscalls/vmsplice.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(vmsplice) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(vmsplice) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/wait4.S b/libc/arch-mips64/syscalls/wait4.S index 2d2b4876f..f9c39743b 100644 --- a/libc/arch-mips64/syscalls/wait4.S +++ b/libc/arch-mips64/syscalls/wait4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(wait4) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(wait4) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/write.S b/libc/arch-mips64/syscalls/write.S index f603fb541..ef9b19e8b 100644 --- a/libc/arch-mips64/syscalls/write.S +++ b/libc/arch-mips64/syscalls/write.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(write) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(write) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-mips64/syscalls/writev.S b/libc/arch-mips64/syscalls/writev.S index 032e749d3..d103d7179 100644 --- a/libc/arch-mips64/syscalls/writev.S +++ b/libc/arch-mips64/syscalls/writev.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(writev) .set push .set noreorder @@ -19,7 +17,7 @@ ENTRY(writev) nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 diff --git a/libc/arch-x86/bionic/__bionic_clone.S b/libc/arch-x86/bionic/__bionic_clone.S index 917dc6883..ef78aeef7 100644 --- a/libc/arch-x86/bionic/__bionic_clone.S +++ b/libc/arch-x86/bionic/__bionic_clone.S @@ -32,7 +32,7 @@ ENTRY(__bionic_clone) # An error occurred, so set errno and return -1. negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp jmp .L_bc_return diff --git a/libc/arch-x86/bionic/syscall.S b/libc/arch-x86/bionic/syscall.S index 8e76c4ee7..f85ec3904 100644 --- a/libc/arch-x86/bionic/syscall.S +++ b/libc/arch-x86/bionic/syscall.S @@ -38,7 +38,7 @@ ENTRY(syscall) # Yes, so set errno. negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: # Restore the callee save registers. diff --git a/libc/arch-x86/bionic/vfork.S b/libc/arch-x86/bionic/vfork.S index ffa6b16aa..6c0291088 100644 --- a/libc/arch-x86/bionic/vfork.S +++ b/libc/arch-x86/bionic/vfork.S @@ -38,7 +38,7 @@ ENTRY(vfork) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal 1: jmp *%ecx // Jump to the stored return address. END(vfork) diff --git a/libc/arch-x86/syscalls/__accept4.S b/libc/arch-x86/syscalls/__accept4.S index c28f211ff..7b16dd488 100644 --- a/libc/arch-x86/syscalls/__accept4.S +++ b/libc/arch-x86/syscalls/__accept4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__accept4) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(__accept4) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/__brk.S b/libc/arch-x86/syscalls/__brk.S index c5702cfec..22acdad3a 100644 --- a/libc/arch-x86/syscalls/__brk.S +++ b/libc/arch-x86/syscalls/__brk.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__brk) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(__brk) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/__connect.S b/libc/arch-x86/syscalls/__connect.S index 4f845b734..475d452be 100644 --- a/libc/arch-x86/syscalls/__connect.S +++ b/libc/arch-x86/syscalls/__connect.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__connect) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(__connect) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/__epoll_pwait.S b/libc/arch-x86/syscalls/__epoll_pwait.S index c7acb2b83..171caa55b 100644 --- a/libc/arch-x86/syscalls/__epoll_pwait.S +++ b/libc/arch-x86/syscalls/__epoll_pwait.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__epoll_pwait) pushl %ebx .cfi_def_cfa_offset 8 @@ -35,7 +33,7 @@ ENTRY(__epoll_pwait) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebp diff --git a/libc/arch-x86/syscalls/__exit.S b/libc/arch-x86/syscalls/__exit.S index bf76e0479..8cf366329 100644 --- a/libc/arch-x86/syscalls/__exit.S +++ b/libc/arch-x86/syscalls/__exit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__exit) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(__exit) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/__fcntl64.S b/libc/arch-x86/syscalls/__fcntl64.S index 7c41c8858..d900a52d8 100644 --- a/libc/arch-x86/syscalls/__fcntl64.S +++ b/libc/arch-x86/syscalls/__fcntl64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__fcntl64) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(__fcntl64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/__fstatfs64.S b/libc/arch-x86/syscalls/__fstatfs64.S index b182ae368..9b44743dd 100644 --- a/libc/arch-x86/syscalls/__fstatfs64.S +++ b/libc/arch-x86/syscalls/__fstatfs64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__fstatfs64) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(__fstatfs64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/__getcpu.S b/libc/arch-x86/syscalls/__getcpu.S index 4cdbafac6..bb4c41fdc 100644 --- a/libc/arch-x86/syscalls/__getcpu.S +++ b/libc/arch-x86/syscalls/__getcpu.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getcpu) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(__getcpu) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/__getcwd.S b/libc/arch-x86/syscalls/__getcwd.S index f5b9b9c71..8decd99ab 100644 --- a/libc/arch-x86/syscalls/__getcwd.S +++ b/libc/arch-x86/syscalls/__getcwd.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getcwd) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(__getcwd) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/__getdents64.S b/libc/arch-x86/syscalls/__getdents64.S index 0ff217d17..5190a6834 100644 --- a/libc/arch-x86/syscalls/__getdents64.S +++ b/libc/arch-x86/syscalls/__getdents64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getdents64) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(__getdents64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/__getpid.S b/libc/arch-x86/syscalls/__getpid.S index 6a3602ebd..197202c4d 100644 --- a/libc/arch-x86/syscalls/__getpid.S +++ b/libc/arch-x86/syscalls/__getpid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getpid) movl $__NR_getpid, %eax int $0x80 @@ -11,7 +9,7 @@ ENTRY(__getpid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: ret diff --git a/libc/arch-x86/syscalls/__getpriority.S b/libc/arch-x86/syscalls/__getpriority.S index 6a94f4381..dd5591f47 100644 --- a/libc/arch-x86/syscalls/__getpriority.S +++ b/libc/arch-x86/syscalls/__getpriority.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getpriority) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(__getpriority) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/__ioctl.S b/libc/arch-x86/syscalls/__ioctl.S index edb990a04..b6ee9f2ed 100644 --- a/libc/arch-x86/syscalls/__ioctl.S +++ b/libc/arch-x86/syscalls/__ioctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ioctl) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(__ioctl) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/__llseek.S b/libc/arch-x86/syscalls/__llseek.S index db3910643..5cc907aa8 100644 --- a/libc/arch-x86/syscalls/__llseek.S +++ b/libc/arch-x86/syscalls/__llseek.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__llseek) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(__llseek) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/__mmap2.S b/libc/arch-x86/syscalls/__mmap2.S index 5c8f2a31d..08314c81b 100644 --- a/libc/arch-x86/syscalls/__mmap2.S +++ b/libc/arch-x86/syscalls/__mmap2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__mmap2) pushl %ebx .cfi_def_cfa_offset 8 @@ -35,7 +33,7 @@ ENTRY(__mmap2) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebp diff --git a/libc/arch-x86/syscalls/__openat.S b/libc/arch-x86/syscalls/__openat.S index 87687e569..4c1170991 100644 --- a/libc/arch-x86/syscalls/__openat.S +++ b/libc/arch-x86/syscalls/__openat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__openat) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(__openat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/__ppoll.S b/libc/arch-x86/syscalls/__ppoll.S index e48f84123..2a1f76e3e 100644 --- a/libc/arch-x86/syscalls/__ppoll.S +++ b/libc/arch-x86/syscalls/__ppoll.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ppoll) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(__ppoll) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/__pselect6.S b/libc/arch-x86/syscalls/__pselect6.S index 53edb8ca1..8ff102ad3 100644 --- a/libc/arch-x86/syscalls/__pselect6.S +++ b/libc/arch-x86/syscalls/__pselect6.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__pselect6) pushl %ebx .cfi_def_cfa_offset 8 @@ -35,7 +33,7 @@ ENTRY(__pselect6) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebp diff --git a/libc/arch-x86/syscalls/__ptrace.S b/libc/arch-x86/syscalls/__ptrace.S index 9d1e460ed..d982cec16 100644 --- a/libc/arch-x86/syscalls/__ptrace.S +++ b/libc/arch-x86/syscalls/__ptrace.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ptrace) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(__ptrace) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/__reboot.S b/libc/arch-x86/syscalls/__reboot.S index 3ef78bb08..3d169bf7f 100644 --- a/libc/arch-x86/syscalls/__reboot.S +++ b/libc/arch-x86/syscalls/__reboot.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__reboot) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(__reboot) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/__rt_sigaction.S b/libc/arch-x86/syscalls/__rt_sigaction.S index 1ce7ef96b..59c388208 100644 --- a/libc/arch-x86/syscalls/__rt_sigaction.S +++ b/libc/arch-x86/syscalls/__rt_sigaction.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigaction) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(__rt_sigaction) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/__rt_sigpending.S b/libc/arch-x86/syscalls/__rt_sigpending.S index a4cb3c1ec..9c6a10649 100644 --- a/libc/arch-x86/syscalls/__rt_sigpending.S +++ b/libc/arch-x86/syscalls/__rt_sigpending.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigpending) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(__rt_sigpending) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/__rt_sigprocmask.S b/libc/arch-x86/syscalls/__rt_sigprocmask.S index 9d8e90d0a..9b1532f10 100644 --- a/libc/arch-x86/syscalls/__rt_sigprocmask.S +++ b/libc/arch-x86/syscalls/__rt_sigprocmask.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigprocmask) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(__rt_sigprocmask) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/__rt_sigsuspend.S b/libc/arch-x86/syscalls/__rt_sigsuspend.S index e0d0c3dd1..b05acd8bc 100644 --- a/libc/arch-x86/syscalls/__rt_sigsuspend.S +++ b/libc/arch-x86/syscalls/__rt_sigsuspend.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigsuspend) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(__rt_sigsuspend) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/__rt_sigtimedwait.S b/libc/arch-x86/syscalls/__rt_sigtimedwait.S index 091c1a721..14cb70f5f 100644 --- a/libc/arch-x86/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-x86/syscalls/__rt_sigtimedwait.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigtimedwait) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(__rt_sigtimedwait) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/__sched_getaffinity.S b/libc/arch-x86/syscalls/__sched_getaffinity.S index 2c278db3d..0b0a97070 100644 --- a/libc/arch-x86/syscalls/__sched_getaffinity.S +++ b/libc/arch-x86/syscalls/__sched_getaffinity.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__sched_getaffinity) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(__sched_getaffinity) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/__set_thread_area.S b/libc/arch-x86/syscalls/__set_thread_area.S index 29e12388d..8cd68804e 100644 --- a/libc/arch-x86/syscalls/__set_thread_area.S +++ b/libc/arch-x86/syscalls/__set_thread_area.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__set_thread_area) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(__set_thread_area) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/__set_tid_address.S b/libc/arch-x86/syscalls/__set_tid_address.S index 35174427f..08acce959 100644 --- a/libc/arch-x86/syscalls/__set_tid_address.S +++ b/libc/arch-x86/syscalls/__set_tid_address.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__set_tid_address) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(__set_tid_address) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/__sigaction.S b/libc/arch-x86/syscalls/__sigaction.S index 0a3e77e10..02382479a 100644 --- a/libc/arch-x86/syscalls/__sigaction.S +++ b/libc/arch-x86/syscalls/__sigaction.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__sigaction) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(__sigaction) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/__signalfd4.S b/libc/arch-x86/syscalls/__signalfd4.S index acfced5c9..02ddc7333 100644 --- a/libc/arch-x86/syscalls/__signalfd4.S +++ b/libc/arch-x86/syscalls/__signalfd4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__signalfd4) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(__signalfd4) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/__socket.S b/libc/arch-x86/syscalls/__socket.S index 59988f3d0..75952eed1 100644 --- a/libc/arch-x86/syscalls/__socket.S +++ b/libc/arch-x86/syscalls/__socket.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__socket) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(__socket) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/__statfs64.S b/libc/arch-x86/syscalls/__statfs64.S index 63d866e87..b9bccb02a 100644 --- a/libc/arch-x86/syscalls/__statfs64.S +++ b/libc/arch-x86/syscalls/__statfs64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__statfs64) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(__statfs64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/__timer_create.S b/libc/arch-x86/syscalls/__timer_create.S index 1265aa662..b22f40853 100644 --- a/libc/arch-x86/syscalls/__timer_create.S +++ b/libc/arch-x86/syscalls/__timer_create.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_create) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(__timer_create) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/__timer_delete.S b/libc/arch-x86/syscalls/__timer_delete.S index bc1fbc570..d77ae3e29 100644 --- a/libc/arch-x86/syscalls/__timer_delete.S +++ b/libc/arch-x86/syscalls/__timer_delete.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_delete) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(__timer_delete) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/__timer_getoverrun.S b/libc/arch-x86/syscalls/__timer_getoverrun.S index 2a8de1e51..f21b08f6c 100644 --- a/libc/arch-x86/syscalls/__timer_getoverrun.S +++ b/libc/arch-x86/syscalls/__timer_getoverrun.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_getoverrun) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(__timer_getoverrun) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/__timer_gettime.S b/libc/arch-x86/syscalls/__timer_gettime.S index 9edd15a13..73c853958 100644 --- a/libc/arch-x86/syscalls/__timer_gettime.S +++ b/libc/arch-x86/syscalls/__timer_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_gettime) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(__timer_gettime) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/__timer_settime.S b/libc/arch-x86/syscalls/__timer_settime.S index 4bb0790b9..1a6a8ec2c 100644 --- a/libc/arch-x86/syscalls/__timer_settime.S +++ b/libc/arch-x86/syscalls/__timer_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_settime) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(__timer_settime) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/__waitid.S b/libc/arch-x86/syscalls/__waitid.S index 331baf561..2061abc7e 100644 --- a/libc/arch-x86/syscalls/__waitid.S +++ b/libc/arch-x86/syscalls/__waitid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__waitid) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(__waitid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/_exit.S b/libc/arch-x86/syscalls/_exit.S index 0da6e7986..8528ee415 100644 --- a/libc/arch-x86/syscalls/_exit.S +++ b/libc/arch-x86/syscalls/_exit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(_exit) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(_exit) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/acct.S b/libc/arch-x86/syscalls/acct.S index 34a23a46e..d831771de 100644 --- a/libc/arch-x86/syscalls/acct.S +++ b/libc/arch-x86/syscalls/acct.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(acct) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(acct) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/bind.S b/libc/arch-x86/syscalls/bind.S index 1d4531906..9ef817ec9 100644 --- a/libc/arch-x86/syscalls/bind.S +++ b/libc/arch-x86/syscalls/bind.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(bind) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(bind) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/capget.S b/libc/arch-x86/syscalls/capget.S index 82b5b73df..81c24e88b 100644 --- a/libc/arch-x86/syscalls/capget.S +++ b/libc/arch-x86/syscalls/capget.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(capget) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(capget) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/capset.S b/libc/arch-x86/syscalls/capset.S index 79e874796..4e311e961 100644 --- a/libc/arch-x86/syscalls/capset.S +++ b/libc/arch-x86/syscalls/capset.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(capset) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(capset) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/chdir.S b/libc/arch-x86/syscalls/chdir.S index 98bdf37ea..2226a1aae 100644 --- a/libc/arch-x86/syscalls/chdir.S +++ b/libc/arch-x86/syscalls/chdir.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(chdir) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(chdir) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/chroot.S b/libc/arch-x86/syscalls/chroot.S index 978eec7d6..95ed0b5d4 100644 --- a/libc/arch-x86/syscalls/chroot.S +++ b/libc/arch-x86/syscalls/chroot.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(chroot) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(chroot) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/clock_getres.S b/libc/arch-x86/syscalls/clock_getres.S index c93a27927..9501799f7 100644 --- a/libc/arch-x86/syscalls/clock_getres.S +++ b/libc/arch-x86/syscalls/clock_getres.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_getres) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(clock_getres) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/clock_gettime.S b/libc/arch-x86/syscalls/clock_gettime.S index 9c5c2407e..0875cfbd9 100644 --- a/libc/arch-x86/syscalls/clock_gettime.S +++ b/libc/arch-x86/syscalls/clock_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_gettime) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(clock_gettime) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/clock_nanosleep.S b/libc/arch-x86/syscalls/clock_nanosleep.S index edadec219..5e2cc0313 100644 --- a/libc/arch-x86/syscalls/clock_nanosleep.S +++ b/libc/arch-x86/syscalls/clock_nanosleep.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_nanosleep) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(clock_nanosleep) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/clock_settime.S b/libc/arch-x86/syscalls/clock_settime.S index 41012d0af..96fafed1d 100644 --- a/libc/arch-x86/syscalls/clock_settime.S +++ b/libc/arch-x86/syscalls/clock_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_settime) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(clock_settime) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/close.S b/libc/arch-x86/syscalls/close.S index b73c4b400..f6cce62cf 100644 --- a/libc/arch-x86/syscalls/close.S +++ b/libc/arch-x86/syscalls/close.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(close) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(close) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/delete_module.S b/libc/arch-x86/syscalls/delete_module.S index 73a51283d..58b8d6bf3 100644 --- a/libc/arch-x86/syscalls/delete_module.S +++ b/libc/arch-x86/syscalls/delete_module.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(delete_module) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(delete_module) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/dup.S b/libc/arch-x86/syscalls/dup.S index f8e8772b5..0fd9cceb3 100644 --- a/libc/arch-x86/syscalls/dup.S +++ b/libc/arch-x86/syscalls/dup.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(dup) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(dup) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/dup3.S b/libc/arch-x86/syscalls/dup3.S index 1203e6453..8348660c9 100644 --- a/libc/arch-x86/syscalls/dup3.S +++ b/libc/arch-x86/syscalls/dup3.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(dup3) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(dup3) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/epoll_create1.S b/libc/arch-x86/syscalls/epoll_create1.S index 6384b926b..0fcd09c2c 100644 --- a/libc/arch-x86/syscalls/epoll_create1.S +++ b/libc/arch-x86/syscalls/epoll_create1.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(epoll_create1) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(epoll_create1) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/epoll_ctl.S b/libc/arch-x86/syscalls/epoll_ctl.S index cdc880e75..092c1e09a 100644 --- a/libc/arch-x86/syscalls/epoll_ctl.S +++ b/libc/arch-x86/syscalls/epoll_ctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(epoll_ctl) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(epoll_ctl) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/eventfd.S b/libc/arch-x86/syscalls/eventfd.S index fe859672e..cc165e591 100644 --- a/libc/arch-x86/syscalls/eventfd.S +++ b/libc/arch-x86/syscalls/eventfd.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(eventfd) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(eventfd) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/execve.S b/libc/arch-x86/syscalls/execve.S index a897c42d0..e1c025341 100644 --- a/libc/arch-x86/syscalls/execve.S +++ b/libc/arch-x86/syscalls/execve.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(execve) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(execve) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/faccessat.S b/libc/arch-x86/syscalls/faccessat.S index 4ac3e2a59..9d522311b 100644 --- a/libc/arch-x86/syscalls/faccessat.S +++ b/libc/arch-x86/syscalls/faccessat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(faccessat) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(faccessat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/fallocate64.S b/libc/arch-x86/syscalls/fallocate64.S index e1dfa085a..e2a7c3eb7 100644 --- a/libc/arch-x86/syscalls/fallocate64.S +++ b/libc/arch-x86/syscalls/fallocate64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fallocate64) pushl %ebx .cfi_def_cfa_offset 8 @@ -35,7 +33,7 @@ ENTRY(fallocate64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebp diff --git a/libc/arch-x86/syscalls/fchdir.S b/libc/arch-x86/syscalls/fchdir.S index af43acb0d..c40c2c1c8 100644 --- a/libc/arch-x86/syscalls/fchdir.S +++ b/libc/arch-x86/syscalls/fchdir.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchdir) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(fchdir) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/fchmod.S b/libc/arch-x86/syscalls/fchmod.S index 5c5835990..37851ff47 100644 --- a/libc/arch-x86/syscalls/fchmod.S +++ b/libc/arch-x86/syscalls/fchmod.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchmod) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(fchmod) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/fchmodat.S b/libc/arch-x86/syscalls/fchmodat.S index aed8d2910..f5155120d 100644 --- a/libc/arch-x86/syscalls/fchmodat.S +++ b/libc/arch-x86/syscalls/fchmodat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchmodat) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(fchmodat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/fchown.S b/libc/arch-x86/syscalls/fchown.S index da80251d1..1a4f74940 100644 --- a/libc/arch-x86/syscalls/fchown.S +++ b/libc/arch-x86/syscalls/fchown.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchown) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(fchown) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/fchownat.S b/libc/arch-x86/syscalls/fchownat.S index 851424370..c2b358e64 100644 --- a/libc/arch-x86/syscalls/fchownat.S +++ b/libc/arch-x86/syscalls/fchownat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchownat) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(fchownat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/fdatasync.S b/libc/arch-x86/syscalls/fdatasync.S index fc2c16332..debd4e322 100644 --- a/libc/arch-x86/syscalls/fdatasync.S +++ b/libc/arch-x86/syscalls/fdatasync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fdatasync) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(fdatasync) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/fgetxattr.S b/libc/arch-x86/syscalls/fgetxattr.S index 767a675ab..1eff93172 100644 --- a/libc/arch-x86/syscalls/fgetxattr.S +++ b/libc/arch-x86/syscalls/fgetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fgetxattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(fgetxattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/flistxattr.S b/libc/arch-x86/syscalls/flistxattr.S index dbb49779c..fc81a374c 100644 --- a/libc/arch-x86/syscalls/flistxattr.S +++ b/libc/arch-x86/syscalls/flistxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(flistxattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(flistxattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/flock.S b/libc/arch-x86/syscalls/flock.S index b4b748e82..0fc76a8fc 100644 --- a/libc/arch-x86/syscalls/flock.S +++ b/libc/arch-x86/syscalls/flock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(flock) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(flock) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/fremovexattr.S b/libc/arch-x86/syscalls/fremovexattr.S index c34cbc4a8..2053a9a9b 100644 --- a/libc/arch-x86/syscalls/fremovexattr.S +++ b/libc/arch-x86/syscalls/fremovexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fremovexattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(fremovexattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/fsetxattr.S b/libc/arch-x86/syscalls/fsetxattr.S index 5593dca70..7af0ef02a 100644 --- a/libc/arch-x86/syscalls/fsetxattr.S +++ b/libc/arch-x86/syscalls/fsetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fsetxattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(fsetxattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/fstat64.S b/libc/arch-x86/syscalls/fstat64.S index 2e29ae5f8..fc1623320 100644 --- a/libc/arch-x86/syscalls/fstat64.S +++ b/libc/arch-x86/syscalls/fstat64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstat64) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(fstat64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/fstatat64.S b/libc/arch-x86/syscalls/fstatat64.S index 72922cbfe..a3697e623 100644 --- a/libc/arch-x86/syscalls/fstatat64.S +++ b/libc/arch-x86/syscalls/fstatat64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstatat64) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(fstatat64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/fsync.S b/libc/arch-x86/syscalls/fsync.S index af10e9ad2..b19a3abaa 100644 --- a/libc/arch-x86/syscalls/fsync.S +++ b/libc/arch-x86/syscalls/fsync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fsync) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(fsync) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/ftruncate.S b/libc/arch-x86/syscalls/ftruncate.S index 734398559..78d1e184f 100644 --- a/libc/arch-x86/syscalls/ftruncate.S +++ b/libc/arch-x86/syscalls/ftruncate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(ftruncate) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(ftruncate) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/ftruncate64.S b/libc/arch-x86/syscalls/ftruncate64.S index 47b925b84..723344725 100644 --- a/libc/arch-x86/syscalls/ftruncate64.S +++ b/libc/arch-x86/syscalls/ftruncate64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(ftruncate64) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(ftruncate64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/getegid.S b/libc/arch-x86/syscalls/getegid.S index bc21b5a35..729b7ad0c 100644 --- a/libc/arch-x86/syscalls/getegid.S +++ b/libc/arch-x86/syscalls/getegid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getegid) movl $__NR_getegid32, %eax int $0x80 @@ -11,7 +9,7 @@ ENTRY(getegid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: ret diff --git a/libc/arch-x86/syscalls/geteuid.S b/libc/arch-x86/syscalls/geteuid.S index 469f9c9ad..dcc76b1ff 100644 --- a/libc/arch-x86/syscalls/geteuid.S +++ b/libc/arch-x86/syscalls/geteuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(geteuid) movl $__NR_geteuid32, %eax int $0x80 @@ -11,7 +9,7 @@ ENTRY(geteuid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: ret diff --git a/libc/arch-x86/syscalls/getgid.S b/libc/arch-x86/syscalls/getgid.S index 6b15674b7..b36a2c939 100644 --- a/libc/arch-x86/syscalls/getgid.S +++ b/libc/arch-x86/syscalls/getgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getgid) movl $__NR_getgid32, %eax int $0x80 @@ -11,7 +9,7 @@ ENTRY(getgid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: ret diff --git a/libc/arch-x86/syscalls/getgroups.S b/libc/arch-x86/syscalls/getgroups.S index a7aa1b2af..0a5de355e 100644 --- a/libc/arch-x86/syscalls/getgroups.S +++ b/libc/arch-x86/syscalls/getgroups.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getgroups) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(getgroups) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/getitimer.S b/libc/arch-x86/syscalls/getitimer.S index 1b424a33b..a0cb761cc 100644 --- a/libc/arch-x86/syscalls/getitimer.S +++ b/libc/arch-x86/syscalls/getitimer.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getitimer) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(getitimer) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/getpeername.S b/libc/arch-x86/syscalls/getpeername.S index 94b43fbcc..6773e6adc 100644 --- a/libc/arch-x86/syscalls/getpeername.S +++ b/libc/arch-x86/syscalls/getpeername.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getpeername) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(getpeername) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/getpgid.S b/libc/arch-x86/syscalls/getpgid.S index 7d7149e46..f702cfdcd 100644 --- a/libc/arch-x86/syscalls/getpgid.S +++ b/libc/arch-x86/syscalls/getpgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getpgid) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(getpgid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/getppid.S b/libc/arch-x86/syscalls/getppid.S index 3103ed2d6..edbe38407 100644 --- a/libc/arch-x86/syscalls/getppid.S +++ b/libc/arch-x86/syscalls/getppid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getppid) movl $__NR_getppid, %eax int $0x80 @@ -11,7 +9,7 @@ ENTRY(getppid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: ret diff --git a/libc/arch-x86/syscalls/getresgid.S b/libc/arch-x86/syscalls/getresgid.S index 2f03a03c9..9f1a9dd41 100644 --- a/libc/arch-x86/syscalls/getresgid.S +++ b/libc/arch-x86/syscalls/getresgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getresgid) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(getresgid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/getresuid.S b/libc/arch-x86/syscalls/getresuid.S index d6fe91560..61e13702c 100644 --- a/libc/arch-x86/syscalls/getresuid.S +++ b/libc/arch-x86/syscalls/getresuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getresuid) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(getresuid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/getrlimit.S b/libc/arch-x86/syscalls/getrlimit.S index 4587a2e35..c3acff35e 100644 --- a/libc/arch-x86/syscalls/getrlimit.S +++ b/libc/arch-x86/syscalls/getrlimit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getrlimit) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(getrlimit) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/getrusage.S b/libc/arch-x86/syscalls/getrusage.S index 4b2e38b3a..0d715cd3c 100644 --- a/libc/arch-x86/syscalls/getrusage.S +++ b/libc/arch-x86/syscalls/getrusage.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getrusage) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(getrusage) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/getsid.S b/libc/arch-x86/syscalls/getsid.S index eac9f2c4b..e142c0540 100644 --- a/libc/arch-x86/syscalls/getsid.S +++ b/libc/arch-x86/syscalls/getsid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsid) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(getsid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/getsockname.S b/libc/arch-x86/syscalls/getsockname.S index 738fa6d44..6050190b5 100644 --- a/libc/arch-x86/syscalls/getsockname.S +++ b/libc/arch-x86/syscalls/getsockname.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsockname) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(getsockname) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/getsockopt.S b/libc/arch-x86/syscalls/getsockopt.S index f8338f503..aec40cff9 100644 --- a/libc/arch-x86/syscalls/getsockopt.S +++ b/libc/arch-x86/syscalls/getsockopt.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsockopt) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(getsockopt) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/gettimeofday.S b/libc/arch-x86/syscalls/gettimeofday.S index 96c1e111d..a508c14a4 100644 --- a/libc/arch-x86/syscalls/gettimeofday.S +++ b/libc/arch-x86/syscalls/gettimeofday.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(gettimeofday) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(gettimeofday) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/getuid.S b/libc/arch-x86/syscalls/getuid.S index cde5da8b6..cc6288418 100644 --- a/libc/arch-x86/syscalls/getuid.S +++ b/libc/arch-x86/syscalls/getuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getuid) movl $__NR_getuid32, %eax int $0x80 @@ -11,7 +9,7 @@ ENTRY(getuid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: ret diff --git a/libc/arch-x86/syscalls/getxattr.S b/libc/arch-x86/syscalls/getxattr.S index 7679cbf1c..a2cf1377b 100644 --- a/libc/arch-x86/syscalls/getxattr.S +++ b/libc/arch-x86/syscalls/getxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getxattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(getxattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/init_module.S b/libc/arch-x86/syscalls/init_module.S index 02e55f0e2..1d0f111a5 100644 --- a/libc/arch-x86/syscalls/init_module.S +++ b/libc/arch-x86/syscalls/init_module.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(init_module) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(init_module) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/inotify_add_watch.S b/libc/arch-x86/syscalls/inotify_add_watch.S index 74a59f358..8cadc6e99 100644 --- a/libc/arch-x86/syscalls/inotify_add_watch.S +++ b/libc/arch-x86/syscalls/inotify_add_watch.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_add_watch) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(inotify_add_watch) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/inotify_init1.S b/libc/arch-x86/syscalls/inotify_init1.S index de714c962..23671e032 100644 --- a/libc/arch-x86/syscalls/inotify_init1.S +++ b/libc/arch-x86/syscalls/inotify_init1.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_init1) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(inotify_init1) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/inotify_rm_watch.S b/libc/arch-x86/syscalls/inotify_rm_watch.S index 3edc152c4..c246c0077 100644 --- a/libc/arch-x86/syscalls/inotify_rm_watch.S +++ b/libc/arch-x86/syscalls/inotify_rm_watch.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_rm_watch) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(inotify_rm_watch) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/kill.S b/libc/arch-x86/syscalls/kill.S index 0cf38a9e7..edc9cdea1 100644 --- a/libc/arch-x86/syscalls/kill.S +++ b/libc/arch-x86/syscalls/kill.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(kill) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(kill) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/klogctl.S b/libc/arch-x86/syscalls/klogctl.S index 52b04e132..5de9a31ec 100644 --- a/libc/arch-x86/syscalls/klogctl.S +++ b/libc/arch-x86/syscalls/klogctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(klogctl) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(klogctl) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/lgetxattr.S b/libc/arch-x86/syscalls/lgetxattr.S index 8c2eb473c..55697a0b0 100644 --- a/libc/arch-x86/syscalls/lgetxattr.S +++ b/libc/arch-x86/syscalls/lgetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lgetxattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(lgetxattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/linkat.S b/libc/arch-x86/syscalls/linkat.S index 56b8368ec..8b2646d59 100644 --- a/libc/arch-x86/syscalls/linkat.S +++ b/libc/arch-x86/syscalls/linkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(linkat) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(linkat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/listen.S b/libc/arch-x86/syscalls/listen.S index 2c8cc7685..8ae41860d 100644 --- a/libc/arch-x86/syscalls/listen.S +++ b/libc/arch-x86/syscalls/listen.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(listen) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(listen) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/listxattr.S b/libc/arch-x86/syscalls/listxattr.S index f43ab3cd5..a73dc1adb 100644 --- a/libc/arch-x86/syscalls/listxattr.S +++ b/libc/arch-x86/syscalls/listxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(listxattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(listxattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/llistxattr.S b/libc/arch-x86/syscalls/llistxattr.S index d32652678..63d4489dc 100644 --- a/libc/arch-x86/syscalls/llistxattr.S +++ b/libc/arch-x86/syscalls/llistxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(llistxattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(llistxattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/lremovexattr.S b/libc/arch-x86/syscalls/lremovexattr.S index b4f4817bb..42c7e0fd9 100644 --- a/libc/arch-x86/syscalls/lremovexattr.S +++ b/libc/arch-x86/syscalls/lremovexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lremovexattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(lremovexattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/lseek.S b/libc/arch-x86/syscalls/lseek.S index 1115be867..bfe9e6315 100644 --- a/libc/arch-x86/syscalls/lseek.S +++ b/libc/arch-x86/syscalls/lseek.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lseek) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(lseek) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/lsetxattr.S b/libc/arch-x86/syscalls/lsetxattr.S index fc62cdd20..f36fc6a4d 100644 --- a/libc/arch-x86/syscalls/lsetxattr.S +++ b/libc/arch-x86/syscalls/lsetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lsetxattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(lsetxattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/madvise.S b/libc/arch-x86/syscalls/madvise.S index 1de44560a..b69f5d456 100644 --- a/libc/arch-x86/syscalls/madvise.S +++ b/libc/arch-x86/syscalls/madvise.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(madvise) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(madvise) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/mincore.S b/libc/arch-x86/syscalls/mincore.S index 118063cb1..6d1df67ab 100644 --- a/libc/arch-x86/syscalls/mincore.S +++ b/libc/arch-x86/syscalls/mincore.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mincore) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(mincore) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/mkdirat.S b/libc/arch-x86/syscalls/mkdirat.S index 6969d2a5f..5b6ae18cc 100644 --- a/libc/arch-x86/syscalls/mkdirat.S +++ b/libc/arch-x86/syscalls/mkdirat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mkdirat) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(mkdirat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/mknodat.S b/libc/arch-x86/syscalls/mknodat.S index 6c743d278..b19d972a9 100644 --- a/libc/arch-x86/syscalls/mknodat.S +++ b/libc/arch-x86/syscalls/mknodat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mknodat) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(mknodat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/mlock.S b/libc/arch-x86/syscalls/mlock.S index 5ec799e7a..517e5a56d 100644 --- a/libc/arch-x86/syscalls/mlock.S +++ b/libc/arch-x86/syscalls/mlock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mlock) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(mlock) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/mlockall.S b/libc/arch-x86/syscalls/mlockall.S index 72a8da597..756ca1689 100644 --- a/libc/arch-x86/syscalls/mlockall.S +++ b/libc/arch-x86/syscalls/mlockall.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mlockall) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(mlockall) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/mount.S b/libc/arch-x86/syscalls/mount.S index 1e06b8e30..0537528a6 100644 --- a/libc/arch-x86/syscalls/mount.S +++ b/libc/arch-x86/syscalls/mount.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mount) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(mount) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/mprotect.S b/libc/arch-x86/syscalls/mprotect.S index 11037c3ef..1ba186c04 100644 --- a/libc/arch-x86/syscalls/mprotect.S +++ b/libc/arch-x86/syscalls/mprotect.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mprotect) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(mprotect) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/mremap.S b/libc/arch-x86/syscalls/mremap.S index b7f96ff84..869ef5de9 100644 --- a/libc/arch-x86/syscalls/mremap.S +++ b/libc/arch-x86/syscalls/mremap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mremap) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(mremap) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/msync.S b/libc/arch-x86/syscalls/msync.S index e2549f768..81bd5982d 100644 --- a/libc/arch-x86/syscalls/msync.S +++ b/libc/arch-x86/syscalls/msync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(msync) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(msync) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/munlock.S b/libc/arch-x86/syscalls/munlock.S index 6b79e9910..67ca3fe7f 100644 --- a/libc/arch-x86/syscalls/munlock.S +++ b/libc/arch-x86/syscalls/munlock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munlock) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(munlock) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/munlockall.S b/libc/arch-x86/syscalls/munlockall.S index 96e238b1e..bf0bfa1fe 100644 --- a/libc/arch-x86/syscalls/munlockall.S +++ b/libc/arch-x86/syscalls/munlockall.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munlockall) movl $__NR_munlockall, %eax int $0x80 @@ -11,7 +9,7 @@ ENTRY(munlockall) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: ret diff --git a/libc/arch-x86/syscalls/munmap.S b/libc/arch-x86/syscalls/munmap.S index a77a77746..272cb5251 100644 --- a/libc/arch-x86/syscalls/munmap.S +++ b/libc/arch-x86/syscalls/munmap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munmap) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(munmap) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/nanosleep.S b/libc/arch-x86/syscalls/nanosleep.S index 444aa7e94..5c46a4a70 100644 --- a/libc/arch-x86/syscalls/nanosleep.S +++ b/libc/arch-x86/syscalls/nanosleep.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(nanosleep) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(nanosleep) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/personality.S b/libc/arch-x86/syscalls/personality.S index 5344e1cc1..d60ced1db 100644 --- a/libc/arch-x86/syscalls/personality.S +++ b/libc/arch-x86/syscalls/personality.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(personality) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(personality) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/pipe2.S b/libc/arch-x86/syscalls/pipe2.S index 62665a05a..ee49ff84a 100644 --- a/libc/arch-x86/syscalls/pipe2.S +++ b/libc/arch-x86/syscalls/pipe2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pipe2) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(pipe2) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/prctl.S b/libc/arch-x86/syscalls/prctl.S index 28e84d8e2..496591e6a 100644 --- a/libc/arch-x86/syscalls/prctl.S +++ b/libc/arch-x86/syscalls/prctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(prctl) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(prctl) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/pread64.S b/libc/arch-x86/syscalls/pread64.S index e7502b94c..42e54ec1a 100644 --- a/libc/arch-x86/syscalls/pread64.S +++ b/libc/arch-x86/syscalls/pread64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pread64) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(pread64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/prlimit64.S b/libc/arch-x86/syscalls/prlimit64.S index 2ca8b233b..07b5585c7 100644 --- a/libc/arch-x86/syscalls/prlimit64.S +++ b/libc/arch-x86/syscalls/prlimit64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(prlimit64) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(prlimit64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/pwrite64.S b/libc/arch-x86/syscalls/pwrite64.S index b798a8e22..d5c9b31a9 100644 --- a/libc/arch-x86/syscalls/pwrite64.S +++ b/libc/arch-x86/syscalls/pwrite64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pwrite64) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(pwrite64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/read.S b/libc/arch-x86/syscalls/read.S index 483c5ef96..c10a83bdd 100644 --- a/libc/arch-x86/syscalls/read.S +++ b/libc/arch-x86/syscalls/read.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(read) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(read) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/readahead.S b/libc/arch-x86/syscalls/readahead.S index b1e0870e9..1c0ccfc45 100644 --- a/libc/arch-x86/syscalls/readahead.S +++ b/libc/arch-x86/syscalls/readahead.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readahead) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(readahead) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/readlinkat.S b/libc/arch-x86/syscalls/readlinkat.S index a06ae73a6..4a24c2cac 100644 --- a/libc/arch-x86/syscalls/readlinkat.S +++ b/libc/arch-x86/syscalls/readlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readlinkat) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(readlinkat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/readv.S b/libc/arch-x86/syscalls/readv.S index a0b46b886..c18c1b115 100644 --- a/libc/arch-x86/syscalls/readv.S +++ b/libc/arch-x86/syscalls/readv.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readv) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(readv) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/recvfrom.S b/libc/arch-x86/syscalls/recvfrom.S index 86f12c0c5..88c9d0a43 100644 --- a/libc/arch-x86/syscalls/recvfrom.S +++ b/libc/arch-x86/syscalls/recvfrom.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvfrom) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(recvfrom) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/recvmmsg.S b/libc/arch-x86/syscalls/recvmmsg.S index f77f7942b..09404d46a 100644 --- a/libc/arch-x86/syscalls/recvmmsg.S +++ b/libc/arch-x86/syscalls/recvmmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvmmsg) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(recvmmsg) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/recvmsg.S b/libc/arch-x86/syscalls/recvmsg.S index 5d25d7a60..6cfcd63f1 100644 --- a/libc/arch-x86/syscalls/recvmsg.S +++ b/libc/arch-x86/syscalls/recvmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvmsg) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(recvmsg) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/removexattr.S b/libc/arch-x86/syscalls/removexattr.S index cbbdf4ee7..b067a9f2c 100644 --- a/libc/arch-x86/syscalls/removexattr.S +++ b/libc/arch-x86/syscalls/removexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(removexattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(removexattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/renameat.S b/libc/arch-x86/syscalls/renameat.S index e424daff5..bb2181ee3 100644 --- a/libc/arch-x86/syscalls/renameat.S +++ b/libc/arch-x86/syscalls/renameat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(renameat) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(renameat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/sched_get_priority_max.S b/libc/arch-x86/syscalls/sched_get_priority_max.S index eee6f922f..be66cfb15 100644 --- a/libc/arch-x86/syscalls/sched_get_priority_max.S +++ b/libc/arch-x86/syscalls/sched_get_priority_max.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_max) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(sched_get_priority_max) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/sched_get_priority_min.S b/libc/arch-x86/syscalls/sched_get_priority_min.S index 0edcab130..8dde67b4c 100644 --- a/libc/arch-x86/syscalls/sched_get_priority_min.S +++ b/libc/arch-x86/syscalls/sched_get_priority_min.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_min) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(sched_get_priority_min) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/sched_getparam.S b/libc/arch-x86/syscalls/sched_getparam.S index 9a4ebbd4f..d0551efb5 100644 --- a/libc/arch-x86/syscalls/sched_getparam.S +++ b/libc/arch-x86/syscalls/sched_getparam.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_getparam) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(sched_getparam) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/sched_getscheduler.S b/libc/arch-x86/syscalls/sched_getscheduler.S index 19a925e77..5b7c8179a 100644 --- a/libc/arch-x86/syscalls/sched_getscheduler.S +++ b/libc/arch-x86/syscalls/sched_getscheduler.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_getscheduler) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(sched_getscheduler) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/sched_rr_get_interval.S b/libc/arch-x86/syscalls/sched_rr_get_interval.S index c2592a9ae..073f3c715 100644 --- a/libc/arch-x86/syscalls/sched_rr_get_interval.S +++ b/libc/arch-x86/syscalls/sched_rr_get_interval.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_rr_get_interval) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(sched_rr_get_interval) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/sched_setaffinity.S b/libc/arch-x86/syscalls/sched_setaffinity.S index 4a0ac86d1..79ec11393 100644 --- a/libc/arch-x86/syscalls/sched_setaffinity.S +++ b/libc/arch-x86/syscalls/sched_setaffinity.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setaffinity) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(sched_setaffinity) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/sched_setparam.S b/libc/arch-x86/syscalls/sched_setparam.S index a99c0de0f..970747dea 100644 --- a/libc/arch-x86/syscalls/sched_setparam.S +++ b/libc/arch-x86/syscalls/sched_setparam.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setparam) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(sched_setparam) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/sched_setscheduler.S b/libc/arch-x86/syscalls/sched_setscheduler.S index dbfd01e5f..da50aaf01 100644 --- a/libc/arch-x86/syscalls/sched_setscheduler.S +++ b/libc/arch-x86/syscalls/sched_setscheduler.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setscheduler) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(sched_setscheduler) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/sched_yield.S b/libc/arch-x86/syscalls/sched_yield.S index 87ebaf9c6..e3878e33a 100644 --- a/libc/arch-x86/syscalls/sched_yield.S +++ b/libc/arch-x86/syscalls/sched_yield.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_yield) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(sched_yield) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/sendfile.S b/libc/arch-x86/syscalls/sendfile.S index 58433fb32..c5f9a2d19 100644 --- a/libc/arch-x86/syscalls/sendfile.S +++ b/libc/arch-x86/syscalls/sendfile.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendfile) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(sendfile) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/sendfile64.S b/libc/arch-x86/syscalls/sendfile64.S index 97c714614..bc5d0dd19 100644 --- a/libc/arch-x86/syscalls/sendfile64.S +++ b/libc/arch-x86/syscalls/sendfile64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendfile64) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(sendfile64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/sendmmsg.S b/libc/arch-x86/syscalls/sendmmsg.S index 3c359eeb7..784c6b603 100644 --- a/libc/arch-x86/syscalls/sendmmsg.S +++ b/libc/arch-x86/syscalls/sendmmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendmmsg) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(sendmmsg) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/sendmsg.S b/libc/arch-x86/syscalls/sendmsg.S index 51288cc4c..bf0d1fb60 100644 --- a/libc/arch-x86/syscalls/sendmsg.S +++ b/libc/arch-x86/syscalls/sendmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendmsg) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(sendmsg) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/sendto.S b/libc/arch-x86/syscalls/sendto.S index 4b77f2479..b39eaf053 100644 --- a/libc/arch-x86/syscalls/sendto.S +++ b/libc/arch-x86/syscalls/sendto.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendto) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(sendto) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/setfsgid.S b/libc/arch-x86/syscalls/setfsgid.S index a8160c3f1..dc81f7227 100644 --- a/libc/arch-x86/syscalls/setfsgid.S +++ b/libc/arch-x86/syscalls/setfsgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setfsgid) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(setfsgid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/setfsuid.S b/libc/arch-x86/syscalls/setfsuid.S index abcf0b3bd..fdf785009 100644 --- a/libc/arch-x86/syscalls/setfsuid.S +++ b/libc/arch-x86/syscalls/setfsuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setfsuid) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(setfsuid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/setgid.S b/libc/arch-x86/syscalls/setgid.S index 47c011e4d..ce6ee266f 100644 --- a/libc/arch-x86/syscalls/setgid.S +++ b/libc/arch-x86/syscalls/setgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setgid) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(setgid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/setgroups.S b/libc/arch-x86/syscalls/setgroups.S index 7a5891083..7e46ad010 100644 --- a/libc/arch-x86/syscalls/setgroups.S +++ b/libc/arch-x86/syscalls/setgroups.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setgroups) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(setgroups) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/setitimer.S b/libc/arch-x86/syscalls/setitimer.S index e87a26e0d..370ab5e8e 100644 --- a/libc/arch-x86/syscalls/setitimer.S +++ b/libc/arch-x86/syscalls/setitimer.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setitimer) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(setitimer) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/setns.S b/libc/arch-x86/syscalls/setns.S index 75f23faf7..736df5912 100644 --- a/libc/arch-x86/syscalls/setns.S +++ b/libc/arch-x86/syscalls/setns.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setns) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(setns) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/setpgid.S b/libc/arch-x86/syscalls/setpgid.S index c20b7897b..0bff10a6c 100644 --- a/libc/arch-x86/syscalls/setpgid.S +++ b/libc/arch-x86/syscalls/setpgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setpgid) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(setpgid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/setpriority.S b/libc/arch-x86/syscalls/setpriority.S index 4606c23fb..4233871b6 100644 --- a/libc/arch-x86/syscalls/setpriority.S +++ b/libc/arch-x86/syscalls/setpriority.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setpriority) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(setpriority) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/setregid.S b/libc/arch-x86/syscalls/setregid.S index ff6cf36d6..a56ccfd25 100644 --- a/libc/arch-x86/syscalls/setregid.S +++ b/libc/arch-x86/syscalls/setregid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setregid) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(setregid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/setresgid.S b/libc/arch-x86/syscalls/setresgid.S index a4846aef7..229983103 100644 --- a/libc/arch-x86/syscalls/setresgid.S +++ b/libc/arch-x86/syscalls/setresgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setresgid) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(setresgid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/setresuid.S b/libc/arch-x86/syscalls/setresuid.S index 6ed0fadc8..8624e157c 100644 --- a/libc/arch-x86/syscalls/setresuid.S +++ b/libc/arch-x86/syscalls/setresuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setresuid) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(setresuid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/setreuid.S b/libc/arch-x86/syscalls/setreuid.S index 57d75409c..9f6e11776 100644 --- a/libc/arch-x86/syscalls/setreuid.S +++ b/libc/arch-x86/syscalls/setreuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setreuid) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(setreuid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/setrlimit.S b/libc/arch-x86/syscalls/setrlimit.S index 9ca613417..20246882c 100644 --- a/libc/arch-x86/syscalls/setrlimit.S +++ b/libc/arch-x86/syscalls/setrlimit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setrlimit) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(setrlimit) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/setsid.S b/libc/arch-x86/syscalls/setsid.S index 5c933b3ce..dda6ad800 100644 --- a/libc/arch-x86/syscalls/setsid.S +++ b/libc/arch-x86/syscalls/setsid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setsid) movl $__NR_setsid, %eax int $0x80 @@ -11,7 +9,7 @@ ENTRY(setsid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: ret diff --git a/libc/arch-x86/syscalls/setsockopt.S b/libc/arch-x86/syscalls/setsockopt.S index f002344df..29e73bbf2 100644 --- a/libc/arch-x86/syscalls/setsockopt.S +++ b/libc/arch-x86/syscalls/setsockopt.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setsockopt) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(setsockopt) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/settimeofday.S b/libc/arch-x86/syscalls/settimeofday.S index b35791d72..4a861ab20 100644 --- a/libc/arch-x86/syscalls/settimeofday.S +++ b/libc/arch-x86/syscalls/settimeofday.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(settimeofday) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(settimeofday) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/setuid.S b/libc/arch-x86/syscalls/setuid.S index f5b83150e..048e0c1dd 100644 --- a/libc/arch-x86/syscalls/setuid.S +++ b/libc/arch-x86/syscalls/setuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setuid) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(setuid) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/setxattr.S b/libc/arch-x86/syscalls/setxattr.S index 24eb2c419..1e87bf04e 100644 --- a/libc/arch-x86/syscalls/setxattr.S +++ b/libc/arch-x86/syscalls/setxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setxattr) pushl %ebx .cfi_def_cfa_offset 8 @@ -31,7 +29,7 @@ ENTRY(setxattr) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edi diff --git a/libc/arch-x86/syscalls/shutdown.S b/libc/arch-x86/syscalls/shutdown.S index e5497e6dc..f224fc681 100644 --- a/libc/arch-x86/syscalls/shutdown.S +++ b/libc/arch-x86/syscalls/shutdown.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(shutdown) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(shutdown) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/sigaltstack.S b/libc/arch-x86/syscalls/sigaltstack.S index 150e3986d..875ef8c47 100644 --- a/libc/arch-x86/syscalls/sigaltstack.S +++ b/libc/arch-x86/syscalls/sigaltstack.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sigaltstack) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(sigaltstack) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/socketpair.S b/libc/arch-x86/syscalls/socketpair.S index f2188e3e6..4c5154e4d 100644 --- a/libc/arch-x86/syscalls/socketpair.S +++ b/libc/arch-x86/syscalls/socketpair.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(socketpair) pushl %ebx .cfi_def_cfa_offset 8 @@ -20,7 +18,7 @@ ENTRY(socketpair) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/splice.S b/libc/arch-x86/syscalls/splice.S index 38d9ddf1d..1dc90373d 100644 --- a/libc/arch-x86/syscalls/splice.S +++ b/libc/arch-x86/syscalls/splice.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(splice) pushl %ebx .cfi_def_cfa_offset 8 @@ -35,7 +33,7 @@ ENTRY(splice) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebp diff --git a/libc/arch-x86/syscalls/swapoff.S b/libc/arch-x86/syscalls/swapoff.S index a0cbc0e27..078852944 100644 --- a/libc/arch-x86/syscalls/swapoff.S +++ b/libc/arch-x86/syscalls/swapoff.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(swapoff) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(swapoff) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/swapon.S b/libc/arch-x86/syscalls/swapon.S index 5a2bc9499..1070d8eae 100644 --- a/libc/arch-x86/syscalls/swapon.S +++ b/libc/arch-x86/syscalls/swapon.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(swapon) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(swapon) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/symlinkat.S b/libc/arch-x86/syscalls/symlinkat.S index 7d7a9da9b..e7fe69e2e 100644 --- a/libc/arch-x86/syscalls/symlinkat.S +++ b/libc/arch-x86/syscalls/symlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(symlinkat) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(symlinkat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/sync.S b/libc/arch-x86/syscalls/sync.S index 423c01dce..252c6662b 100644 --- a/libc/arch-x86/syscalls/sync.S +++ b/libc/arch-x86/syscalls/sync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sync) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(sync) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/sysinfo.S b/libc/arch-x86/syscalls/sysinfo.S index 08707616a..f59a0c36d 100644 --- a/libc/arch-x86/syscalls/sysinfo.S +++ b/libc/arch-x86/syscalls/sysinfo.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sysinfo) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(sysinfo) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/tee.S b/libc/arch-x86/syscalls/tee.S index 85ff3cc5c..b47c4600e 100644 --- a/libc/arch-x86/syscalls/tee.S +++ b/libc/arch-x86/syscalls/tee.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(tee) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(tee) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/tgkill.S b/libc/arch-x86/syscalls/tgkill.S index aab80e169..7a43a01a8 100644 --- a/libc/arch-x86/syscalls/tgkill.S +++ b/libc/arch-x86/syscalls/tgkill.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(tgkill) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(tgkill) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/timerfd_create.S b/libc/arch-x86/syscalls/timerfd_create.S index f1bef4cb6..ad099a5dd 100644 --- a/libc/arch-x86/syscalls/timerfd_create.S +++ b/libc/arch-x86/syscalls/timerfd_create.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_create) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(timerfd_create) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/timerfd_gettime.S b/libc/arch-x86/syscalls/timerfd_gettime.S index d7ec28f2e..c679b7c53 100644 --- a/libc/arch-x86/syscalls/timerfd_gettime.S +++ b/libc/arch-x86/syscalls/timerfd_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_gettime) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(timerfd_gettime) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/timerfd_settime.S b/libc/arch-x86/syscalls/timerfd_settime.S index 7e03edb9d..4e889ead7 100644 --- a/libc/arch-x86/syscalls/timerfd_settime.S +++ b/libc/arch-x86/syscalls/timerfd_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_settime) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(timerfd_settime) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/times.S b/libc/arch-x86/syscalls/times.S index 6a14cff0e..0ba0b6fab 100644 --- a/libc/arch-x86/syscalls/times.S +++ b/libc/arch-x86/syscalls/times.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(times) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(times) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/truncate.S b/libc/arch-x86/syscalls/truncate.S index 33ce47f92..31fec1738 100644 --- a/libc/arch-x86/syscalls/truncate.S +++ b/libc/arch-x86/syscalls/truncate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(truncate) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(truncate) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/truncate64.S b/libc/arch-x86/syscalls/truncate64.S index 2168eb426..45e24d043 100644 --- a/libc/arch-x86/syscalls/truncate64.S +++ b/libc/arch-x86/syscalls/truncate64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(truncate64) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(truncate64) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/umask.S b/libc/arch-x86/syscalls/umask.S index 03bee20c9..9b4d3c7f5 100644 --- a/libc/arch-x86/syscalls/umask.S +++ b/libc/arch-x86/syscalls/umask.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(umask) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(umask) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/umount2.S b/libc/arch-x86/syscalls/umount2.S index 9701e0399..13757ab3f 100644 --- a/libc/arch-x86/syscalls/umount2.S +++ b/libc/arch-x86/syscalls/umount2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(umount2) pushl %ebx .cfi_def_cfa_offset 8 @@ -19,7 +17,7 @@ ENTRY(umount2) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ecx diff --git a/libc/arch-x86/syscalls/uname.S b/libc/arch-x86/syscalls/uname.S index 6de3b413e..dab7e0d32 100644 --- a/libc/arch-x86/syscalls/uname.S +++ b/libc/arch-x86/syscalls/uname.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(uname) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(uname) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/unlinkat.S b/libc/arch-x86/syscalls/unlinkat.S index 93ea20183..6faf71e7f 100644 --- a/libc/arch-x86/syscalls/unlinkat.S +++ b/libc/arch-x86/syscalls/unlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(unlinkat) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(unlinkat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/unshare.S b/libc/arch-x86/syscalls/unshare.S index 9d1146690..b724798c2 100644 --- a/libc/arch-x86/syscalls/unshare.S +++ b/libc/arch-x86/syscalls/unshare.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(unshare) pushl %ebx .cfi_def_cfa_offset 8 @@ -15,7 +13,7 @@ ENTRY(unshare) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %ebx diff --git a/libc/arch-x86/syscalls/utimensat.S b/libc/arch-x86/syscalls/utimensat.S index 62e15256c..07eca45ad 100644 --- a/libc/arch-x86/syscalls/utimensat.S +++ b/libc/arch-x86/syscalls/utimensat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(utimensat) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(utimensat) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/vmsplice.S b/libc/arch-x86/syscalls/vmsplice.S index 470763544..f12cc6591 100644 --- a/libc/arch-x86/syscalls/vmsplice.S +++ b/libc/arch-x86/syscalls/vmsplice.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(vmsplice) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(vmsplice) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/wait4.S b/libc/arch-x86/syscalls/wait4.S index 137b721e8..bed7c401e 100644 --- a/libc/arch-x86/syscalls/wait4.S +++ b/libc/arch-x86/syscalls/wait4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(wait4) pushl %ebx .cfi_def_cfa_offset 8 @@ -27,7 +25,7 @@ ENTRY(wait4) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %esi diff --git a/libc/arch-x86/syscalls/write.S b/libc/arch-x86/syscalls/write.S index 2f040b21f..e14720886 100644 --- a/libc/arch-x86/syscalls/write.S +++ b/libc/arch-x86/syscalls/write.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(write) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(write) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86/syscalls/writev.S b/libc/arch-x86/syscalls/writev.S index 2840eead9..07ba7b55b 100644 --- a/libc/arch-x86/syscalls/writev.S +++ b/libc/arch-x86/syscalls/writev.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(writev) pushl %ebx .cfi_def_cfa_offset 8 @@ -23,7 +21,7 @@ ENTRY(writev) jb 1f negl %eax pushl %eax - call __set_errno + call __set_errno_internal addl $4, %esp 1: popl %edx diff --git a/libc/arch-x86_64/bionic/__bionic_clone.S b/libc/arch-x86_64/bionic/__bionic_clone.S index e0ce5a6b8..0c73e5fd0 100644 --- a/libc/arch-x86_64/bionic/__bionic_clone.S +++ b/libc/arch-x86_64/bionic/__bionic_clone.S @@ -54,7 +54,7 @@ ENTRY(__bionic_clone) # An error occurred, set errno and return -1. negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal ret .L_bc_child: diff --git a/libc/arch-x86_64/bionic/syscall.S b/libc/arch-x86_64/bionic/syscall.S index d5694cb57..87939ba35 100644 --- a/libc/arch-x86_64/bionic/syscall.S +++ b/libc/arch-x86_64/bionic/syscall.S @@ -57,7 +57,7 @@ ENTRY(syscall) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(syscall) diff --git a/libc/arch-x86_64/bionic/vfork.S b/libc/arch-x86_64/bionic/vfork.S index 7c14cc0d9..129f1dbd2 100644 --- a/libc/arch-x86_64/bionic/vfork.S +++ b/libc/arch-x86_64/bionic/vfork.S @@ -39,7 +39,7 @@ ENTRY(vfork) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(vfork) diff --git a/libc/arch-x86_64/syscalls/__accept4.S b/libc/arch-x86_64/syscalls/__accept4.S index 774cdd584..aa5beba40 100644 --- a/libc/arch-x86_64/syscalls/__accept4.S +++ b/libc/arch-x86_64/syscalls/__accept4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__accept4) movq %rcx, %r10 movl $__NR_accept4, %eax @@ -12,7 +10,7 @@ ENTRY(__accept4) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__accept4) diff --git a/libc/arch-x86_64/syscalls/__arch_prctl.S b/libc/arch-x86_64/syscalls/__arch_prctl.S index c0dad45d9..0a604f432 100644 --- a/libc/arch-x86_64/syscalls/__arch_prctl.S +++ b/libc/arch-x86_64/syscalls/__arch_prctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__arch_prctl) movl $__NR_arch_prctl, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__arch_prctl) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__arch_prctl) diff --git a/libc/arch-x86_64/syscalls/__brk.S b/libc/arch-x86_64/syscalls/__brk.S index df942a1d5..b6c0f2ff8 100644 --- a/libc/arch-x86_64/syscalls/__brk.S +++ b/libc/arch-x86_64/syscalls/__brk.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__brk) movl $__NR_brk, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__brk) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__brk) diff --git a/libc/arch-x86_64/syscalls/__clock_gettime.S b/libc/arch-x86_64/syscalls/__clock_gettime.S index 6c11fb634..ccacdb22d 100644 --- a/libc/arch-x86_64/syscalls/__clock_gettime.S +++ b/libc/arch-x86_64/syscalls/__clock_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__clock_gettime) movl $__NR_clock_gettime, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__clock_gettime) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__clock_gettime) diff --git a/libc/arch-x86_64/syscalls/__connect.S b/libc/arch-x86_64/syscalls/__connect.S index 05a82022f..d7531ad69 100644 --- a/libc/arch-x86_64/syscalls/__connect.S +++ b/libc/arch-x86_64/syscalls/__connect.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__connect) movl $__NR_connect, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__connect) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__connect) diff --git a/libc/arch-x86_64/syscalls/__epoll_pwait.S b/libc/arch-x86_64/syscalls/__epoll_pwait.S index b0aee80ac..b486c4abc 100644 --- a/libc/arch-x86_64/syscalls/__epoll_pwait.S +++ b/libc/arch-x86_64/syscalls/__epoll_pwait.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__epoll_pwait) movq %rcx, %r10 movl $__NR_epoll_pwait, %eax @@ -12,7 +10,7 @@ ENTRY(__epoll_pwait) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__epoll_pwait) diff --git a/libc/arch-x86_64/syscalls/__exit.S b/libc/arch-x86_64/syscalls/__exit.S index e552f0415..99b11fc83 100644 --- a/libc/arch-x86_64/syscalls/__exit.S +++ b/libc/arch-x86_64/syscalls/__exit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__exit) movl $__NR_exit, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__exit) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__exit) diff --git a/libc/arch-x86_64/syscalls/__getcpu.S b/libc/arch-x86_64/syscalls/__getcpu.S index c415fd7df..3903e9f3c 100644 --- a/libc/arch-x86_64/syscalls/__getcpu.S +++ b/libc/arch-x86_64/syscalls/__getcpu.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getcpu) movl $__NR_getcpu, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__getcpu) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__getcpu) diff --git a/libc/arch-x86_64/syscalls/__getcwd.S b/libc/arch-x86_64/syscalls/__getcwd.S index 1ea565161..d39c1d788 100644 --- a/libc/arch-x86_64/syscalls/__getcwd.S +++ b/libc/arch-x86_64/syscalls/__getcwd.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getcwd) movl $__NR_getcwd, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__getcwd) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__getcwd) diff --git a/libc/arch-x86_64/syscalls/__getdents64.S b/libc/arch-x86_64/syscalls/__getdents64.S index 42c130c16..b5eb94313 100644 --- a/libc/arch-x86_64/syscalls/__getdents64.S +++ b/libc/arch-x86_64/syscalls/__getdents64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getdents64) movl $__NR_getdents64, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__getdents64) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__getdents64) diff --git a/libc/arch-x86_64/syscalls/__getpid.S b/libc/arch-x86_64/syscalls/__getpid.S index ae6bb49db..ec4316eeb 100644 --- a/libc/arch-x86_64/syscalls/__getpid.S +++ b/libc/arch-x86_64/syscalls/__getpid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getpid) movl $__NR_getpid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__getpid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__getpid) diff --git a/libc/arch-x86_64/syscalls/__getpriority.S b/libc/arch-x86_64/syscalls/__getpriority.S index c82b00887..7c618a14b 100644 --- a/libc/arch-x86_64/syscalls/__getpriority.S +++ b/libc/arch-x86_64/syscalls/__getpriority.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__getpriority) movl $__NR_getpriority, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__getpriority) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__getpriority) diff --git a/libc/arch-x86_64/syscalls/__gettimeofday.S b/libc/arch-x86_64/syscalls/__gettimeofday.S index e4b240930..69b9b6ec7 100644 --- a/libc/arch-x86_64/syscalls/__gettimeofday.S +++ b/libc/arch-x86_64/syscalls/__gettimeofday.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__gettimeofday) movl $__NR_gettimeofday, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__gettimeofday) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__gettimeofday) diff --git a/libc/arch-x86_64/syscalls/__ioctl.S b/libc/arch-x86_64/syscalls/__ioctl.S index aa2f53869..0eb34f048 100644 --- a/libc/arch-x86_64/syscalls/__ioctl.S +++ b/libc/arch-x86_64/syscalls/__ioctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ioctl) movl $__NR_ioctl, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__ioctl) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__ioctl) diff --git a/libc/arch-x86_64/syscalls/__openat.S b/libc/arch-x86_64/syscalls/__openat.S index e7f5dc4c3..14f53ca97 100644 --- a/libc/arch-x86_64/syscalls/__openat.S +++ b/libc/arch-x86_64/syscalls/__openat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__openat) movq %rcx, %r10 movl $__NR_openat, %eax @@ -12,7 +10,7 @@ ENTRY(__openat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__openat) diff --git a/libc/arch-x86_64/syscalls/__ppoll.S b/libc/arch-x86_64/syscalls/__ppoll.S index eb741ce87..82b97dda3 100644 --- a/libc/arch-x86_64/syscalls/__ppoll.S +++ b/libc/arch-x86_64/syscalls/__ppoll.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ppoll) movq %rcx, %r10 movl $__NR_ppoll, %eax @@ -12,7 +10,7 @@ ENTRY(__ppoll) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__ppoll) diff --git a/libc/arch-x86_64/syscalls/__pselect6.S b/libc/arch-x86_64/syscalls/__pselect6.S index 75ea416dc..c11d8149b 100644 --- a/libc/arch-x86_64/syscalls/__pselect6.S +++ b/libc/arch-x86_64/syscalls/__pselect6.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__pselect6) movq %rcx, %r10 movl $__NR_pselect6, %eax @@ -12,7 +10,7 @@ ENTRY(__pselect6) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__pselect6) diff --git a/libc/arch-x86_64/syscalls/__ptrace.S b/libc/arch-x86_64/syscalls/__ptrace.S index 45724e48d..729e00767 100644 --- a/libc/arch-x86_64/syscalls/__ptrace.S +++ b/libc/arch-x86_64/syscalls/__ptrace.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__ptrace) movq %rcx, %r10 movl $__NR_ptrace, %eax @@ -12,7 +10,7 @@ ENTRY(__ptrace) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__ptrace) diff --git a/libc/arch-x86_64/syscalls/__reboot.S b/libc/arch-x86_64/syscalls/__reboot.S index bbff3f205..b462dc709 100644 --- a/libc/arch-x86_64/syscalls/__reboot.S +++ b/libc/arch-x86_64/syscalls/__reboot.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__reboot) movq %rcx, %r10 movl $__NR_reboot, %eax @@ -12,7 +10,7 @@ ENTRY(__reboot) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__reboot) diff --git a/libc/arch-x86_64/syscalls/__rt_sigaction.S b/libc/arch-x86_64/syscalls/__rt_sigaction.S index 7ce3d8c41..17c599597 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigaction.S +++ b/libc/arch-x86_64/syscalls/__rt_sigaction.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigaction) movq %rcx, %r10 movl $__NR_rt_sigaction, %eax @@ -12,7 +10,7 @@ ENTRY(__rt_sigaction) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__rt_sigaction) diff --git a/libc/arch-x86_64/syscalls/__rt_sigpending.S b/libc/arch-x86_64/syscalls/__rt_sigpending.S index 78c10edab..b5b81bbbb 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigpending.S +++ b/libc/arch-x86_64/syscalls/__rt_sigpending.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigpending) movl $__NR_rt_sigpending, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__rt_sigpending) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__rt_sigpending) diff --git a/libc/arch-x86_64/syscalls/__rt_sigprocmask.S b/libc/arch-x86_64/syscalls/__rt_sigprocmask.S index bf2841c1a..e8b3f2a4e 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigprocmask.S +++ b/libc/arch-x86_64/syscalls/__rt_sigprocmask.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigprocmask) movq %rcx, %r10 movl $__NR_rt_sigprocmask, %eax @@ -12,7 +10,7 @@ ENTRY(__rt_sigprocmask) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__rt_sigprocmask) diff --git a/libc/arch-x86_64/syscalls/__rt_sigsuspend.S b/libc/arch-x86_64/syscalls/__rt_sigsuspend.S index a82b0528a..f6366a22f 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigsuspend.S +++ b/libc/arch-x86_64/syscalls/__rt_sigsuspend.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigsuspend) movl $__NR_rt_sigsuspend, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__rt_sigsuspend) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__rt_sigsuspend) diff --git a/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S b/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S index aceacb2dd..9bcb81155 100644 --- a/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S +++ b/libc/arch-x86_64/syscalls/__rt_sigtimedwait.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__rt_sigtimedwait) movq %rcx, %r10 movl $__NR_rt_sigtimedwait, %eax @@ -12,7 +10,7 @@ ENTRY(__rt_sigtimedwait) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__rt_sigtimedwait) diff --git a/libc/arch-x86_64/syscalls/__sched_getaffinity.S b/libc/arch-x86_64/syscalls/__sched_getaffinity.S index fd1f6075b..0ca6818aa 100644 --- a/libc/arch-x86_64/syscalls/__sched_getaffinity.S +++ b/libc/arch-x86_64/syscalls/__sched_getaffinity.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__sched_getaffinity) movl $__NR_sched_getaffinity, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__sched_getaffinity) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__sched_getaffinity) diff --git a/libc/arch-x86_64/syscalls/__set_tid_address.S b/libc/arch-x86_64/syscalls/__set_tid_address.S index 7e5226d75..3dad6600e 100644 --- a/libc/arch-x86_64/syscalls/__set_tid_address.S +++ b/libc/arch-x86_64/syscalls/__set_tid_address.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__set_tid_address) movl $__NR_set_tid_address, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__set_tid_address) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__set_tid_address) diff --git a/libc/arch-x86_64/syscalls/__signalfd4.S b/libc/arch-x86_64/syscalls/__signalfd4.S index d27f63c42..b44bfe5b8 100644 --- a/libc/arch-x86_64/syscalls/__signalfd4.S +++ b/libc/arch-x86_64/syscalls/__signalfd4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__signalfd4) movq %rcx, %r10 movl $__NR_signalfd4, %eax @@ -12,7 +10,7 @@ ENTRY(__signalfd4) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__signalfd4) diff --git a/libc/arch-x86_64/syscalls/__socket.S b/libc/arch-x86_64/syscalls/__socket.S index 3b573e857..0563d2ffb 100644 --- a/libc/arch-x86_64/syscalls/__socket.S +++ b/libc/arch-x86_64/syscalls/__socket.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__socket) movl $__NR_socket, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__socket) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__socket) diff --git a/libc/arch-x86_64/syscalls/__timer_create.S b/libc/arch-x86_64/syscalls/__timer_create.S index 920c9355f..cb955a46e 100644 --- a/libc/arch-x86_64/syscalls/__timer_create.S +++ b/libc/arch-x86_64/syscalls/__timer_create.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_create) movl $__NR_timer_create, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__timer_create) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__timer_create) diff --git a/libc/arch-x86_64/syscalls/__timer_delete.S b/libc/arch-x86_64/syscalls/__timer_delete.S index c76830e89..7abc7d8cb 100644 --- a/libc/arch-x86_64/syscalls/__timer_delete.S +++ b/libc/arch-x86_64/syscalls/__timer_delete.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_delete) movl $__NR_timer_delete, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__timer_delete) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__timer_delete) diff --git a/libc/arch-x86_64/syscalls/__timer_getoverrun.S b/libc/arch-x86_64/syscalls/__timer_getoverrun.S index e35ee9375..f2a0e24b4 100644 --- a/libc/arch-x86_64/syscalls/__timer_getoverrun.S +++ b/libc/arch-x86_64/syscalls/__timer_getoverrun.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_getoverrun) movl $__NR_timer_getoverrun, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__timer_getoverrun) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__timer_getoverrun) diff --git a/libc/arch-x86_64/syscalls/__timer_gettime.S b/libc/arch-x86_64/syscalls/__timer_gettime.S index 8bb41d9bc..62c2b4719 100644 --- a/libc/arch-x86_64/syscalls/__timer_gettime.S +++ b/libc/arch-x86_64/syscalls/__timer_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_gettime) movl $__NR_timer_gettime, %eax syscall @@ -11,7 +9,7 @@ ENTRY(__timer_gettime) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__timer_gettime) diff --git a/libc/arch-x86_64/syscalls/__timer_settime.S b/libc/arch-x86_64/syscalls/__timer_settime.S index 0eace4b7e..225fa8e37 100644 --- a/libc/arch-x86_64/syscalls/__timer_settime.S +++ b/libc/arch-x86_64/syscalls/__timer_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__timer_settime) movq %rcx, %r10 movl $__NR_timer_settime, %eax @@ -12,7 +10,7 @@ ENTRY(__timer_settime) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__timer_settime) diff --git a/libc/arch-x86_64/syscalls/__waitid.S b/libc/arch-x86_64/syscalls/__waitid.S index 47bf7b378..ff8a3c519 100644 --- a/libc/arch-x86_64/syscalls/__waitid.S +++ b/libc/arch-x86_64/syscalls/__waitid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(__waitid) movq %rcx, %r10 movl $__NR_waitid, %eax @@ -12,7 +10,7 @@ ENTRY(__waitid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(__waitid) diff --git a/libc/arch-x86_64/syscalls/_exit.S b/libc/arch-x86_64/syscalls/_exit.S index 06465c43d..c79091dd7 100644 --- a/libc/arch-x86_64/syscalls/_exit.S +++ b/libc/arch-x86_64/syscalls/_exit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(_exit) movl $__NR_exit_group, %eax syscall @@ -11,7 +9,7 @@ ENTRY(_exit) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(_exit) diff --git a/libc/arch-x86_64/syscalls/acct.S b/libc/arch-x86_64/syscalls/acct.S index 6bf59e37b..a73970787 100644 --- a/libc/arch-x86_64/syscalls/acct.S +++ b/libc/arch-x86_64/syscalls/acct.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(acct) movl $__NR_acct, %eax syscall @@ -11,7 +9,7 @@ ENTRY(acct) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(acct) diff --git a/libc/arch-x86_64/syscalls/bind.S b/libc/arch-x86_64/syscalls/bind.S index 4300c005f..e5bc263c1 100644 --- a/libc/arch-x86_64/syscalls/bind.S +++ b/libc/arch-x86_64/syscalls/bind.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(bind) movl $__NR_bind, %eax syscall @@ -11,7 +9,7 @@ ENTRY(bind) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(bind) diff --git a/libc/arch-x86_64/syscalls/capget.S b/libc/arch-x86_64/syscalls/capget.S index 8ce1846ee..9ce158362 100644 --- a/libc/arch-x86_64/syscalls/capget.S +++ b/libc/arch-x86_64/syscalls/capget.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(capget) movl $__NR_capget, %eax syscall @@ -11,7 +9,7 @@ ENTRY(capget) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(capget) diff --git a/libc/arch-x86_64/syscalls/capset.S b/libc/arch-x86_64/syscalls/capset.S index 3aff07c1a..27767565e 100644 --- a/libc/arch-x86_64/syscalls/capset.S +++ b/libc/arch-x86_64/syscalls/capset.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(capset) movl $__NR_capset, %eax syscall @@ -11,7 +9,7 @@ ENTRY(capset) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(capset) diff --git a/libc/arch-x86_64/syscalls/chdir.S b/libc/arch-x86_64/syscalls/chdir.S index f22b40d4e..269905c6a 100644 --- a/libc/arch-x86_64/syscalls/chdir.S +++ b/libc/arch-x86_64/syscalls/chdir.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(chdir) movl $__NR_chdir, %eax syscall @@ -11,7 +9,7 @@ ENTRY(chdir) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(chdir) diff --git a/libc/arch-x86_64/syscalls/chroot.S b/libc/arch-x86_64/syscalls/chroot.S index eb8a4633b..713b1b370 100644 --- a/libc/arch-x86_64/syscalls/chroot.S +++ b/libc/arch-x86_64/syscalls/chroot.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(chroot) movl $__NR_chroot, %eax syscall @@ -11,7 +9,7 @@ ENTRY(chroot) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(chroot) diff --git a/libc/arch-x86_64/syscalls/clock_getres.S b/libc/arch-x86_64/syscalls/clock_getres.S index 00b4ed67d..f65d12774 100644 --- a/libc/arch-x86_64/syscalls/clock_getres.S +++ b/libc/arch-x86_64/syscalls/clock_getres.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_getres) movl $__NR_clock_getres, %eax syscall @@ -11,7 +9,7 @@ ENTRY(clock_getres) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(clock_getres) diff --git a/libc/arch-x86_64/syscalls/clock_nanosleep.S b/libc/arch-x86_64/syscalls/clock_nanosleep.S index 8bc87ae44..2a79bddfe 100644 --- a/libc/arch-x86_64/syscalls/clock_nanosleep.S +++ b/libc/arch-x86_64/syscalls/clock_nanosleep.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_nanosleep) movq %rcx, %r10 movl $__NR_clock_nanosleep, %eax @@ -12,7 +10,7 @@ ENTRY(clock_nanosleep) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(clock_nanosleep) diff --git a/libc/arch-x86_64/syscalls/clock_settime.S b/libc/arch-x86_64/syscalls/clock_settime.S index 522577031..26070a467 100644 --- a/libc/arch-x86_64/syscalls/clock_settime.S +++ b/libc/arch-x86_64/syscalls/clock_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(clock_settime) movl $__NR_clock_settime, %eax syscall @@ -11,7 +9,7 @@ ENTRY(clock_settime) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(clock_settime) diff --git a/libc/arch-x86_64/syscalls/close.S b/libc/arch-x86_64/syscalls/close.S index 029d09ad6..8a7ada108 100644 --- a/libc/arch-x86_64/syscalls/close.S +++ b/libc/arch-x86_64/syscalls/close.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(close) movl $__NR_close, %eax syscall @@ -11,7 +9,7 @@ ENTRY(close) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(close) diff --git a/libc/arch-x86_64/syscalls/delete_module.S b/libc/arch-x86_64/syscalls/delete_module.S index fc146bb6c..63f17adbd 100644 --- a/libc/arch-x86_64/syscalls/delete_module.S +++ b/libc/arch-x86_64/syscalls/delete_module.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(delete_module) movl $__NR_delete_module, %eax syscall @@ -11,7 +9,7 @@ ENTRY(delete_module) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(delete_module) diff --git a/libc/arch-x86_64/syscalls/dup.S b/libc/arch-x86_64/syscalls/dup.S index 53f06b0ec..5016f7708 100644 --- a/libc/arch-x86_64/syscalls/dup.S +++ b/libc/arch-x86_64/syscalls/dup.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(dup) movl $__NR_dup, %eax syscall @@ -11,7 +9,7 @@ ENTRY(dup) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(dup) diff --git a/libc/arch-x86_64/syscalls/dup3.S b/libc/arch-x86_64/syscalls/dup3.S index fb99941ed..9abd1686a 100644 --- a/libc/arch-x86_64/syscalls/dup3.S +++ b/libc/arch-x86_64/syscalls/dup3.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(dup3) movl $__NR_dup3, %eax syscall @@ -11,7 +9,7 @@ ENTRY(dup3) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(dup3) diff --git a/libc/arch-x86_64/syscalls/epoll_create1.S b/libc/arch-x86_64/syscalls/epoll_create1.S index 6aa19157d..d1e4bfce5 100644 --- a/libc/arch-x86_64/syscalls/epoll_create1.S +++ b/libc/arch-x86_64/syscalls/epoll_create1.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(epoll_create1) movl $__NR_epoll_create1, %eax syscall @@ -11,7 +9,7 @@ ENTRY(epoll_create1) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(epoll_create1) diff --git a/libc/arch-x86_64/syscalls/epoll_ctl.S b/libc/arch-x86_64/syscalls/epoll_ctl.S index c9dda01b5..f429b962a 100644 --- a/libc/arch-x86_64/syscalls/epoll_ctl.S +++ b/libc/arch-x86_64/syscalls/epoll_ctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(epoll_ctl) movq %rcx, %r10 movl $__NR_epoll_ctl, %eax @@ -12,7 +10,7 @@ ENTRY(epoll_ctl) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(epoll_ctl) diff --git a/libc/arch-x86_64/syscalls/eventfd.S b/libc/arch-x86_64/syscalls/eventfd.S index ac7537f99..dcc510595 100644 --- a/libc/arch-x86_64/syscalls/eventfd.S +++ b/libc/arch-x86_64/syscalls/eventfd.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(eventfd) movl $__NR_eventfd2, %eax syscall @@ -11,7 +9,7 @@ ENTRY(eventfd) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(eventfd) diff --git a/libc/arch-x86_64/syscalls/execve.S b/libc/arch-x86_64/syscalls/execve.S index a699303fb..947baa49c 100644 --- a/libc/arch-x86_64/syscalls/execve.S +++ b/libc/arch-x86_64/syscalls/execve.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(execve) movl $__NR_execve, %eax syscall @@ -11,7 +9,7 @@ ENTRY(execve) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(execve) diff --git a/libc/arch-x86_64/syscalls/faccessat.S b/libc/arch-x86_64/syscalls/faccessat.S index 9426dd5d1..05a6e7863 100644 --- a/libc/arch-x86_64/syscalls/faccessat.S +++ b/libc/arch-x86_64/syscalls/faccessat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(faccessat) movq %rcx, %r10 movl $__NR_faccessat, %eax @@ -12,7 +10,7 @@ ENTRY(faccessat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(faccessat) diff --git a/libc/arch-x86_64/syscalls/fallocate.S b/libc/arch-x86_64/syscalls/fallocate.S index 91a2e6544..8307f7e7a 100644 --- a/libc/arch-x86_64/syscalls/fallocate.S +++ b/libc/arch-x86_64/syscalls/fallocate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fallocate) movq %rcx, %r10 movl $__NR_fallocate, %eax @@ -12,7 +10,7 @@ ENTRY(fallocate) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fallocate) diff --git a/libc/arch-x86_64/syscalls/fchdir.S b/libc/arch-x86_64/syscalls/fchdir.S index 01c503086..d005c14bb 100644 --- a/libc/arch-x86_64/syscalls/fchdir.S +++ b/libc/arch-x86_64/syscalls/fchdir.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchdir) movl $__NR_fchdir, %eax syscall @@ -11,7 +9,7 @@ ENTRY(fchdir) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fchdir) diff --git a/libc/arch-x86_64/syscalls/fchmod.S b/libc/arch-x86_64/syscalls/fchmod.S index 1f4d02b70..b35bd21ac 100644 --- a/libc/arch-x86_64/syscalls/fchmod.S +++ b/libc/arch-x86_64/syscalls/fchmod.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchmod) movl $__NR_fchmod, %eax syscall @@ -11,7 +9,7 @@ ENTRY(fchmod) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fchmod) diff --git a/libc/arch-x86_64/syscalls/fchmodat.S b/libc/arch-x86_64/syscalls/fchmodat.S index cee05e3d1..2d78d8e81 100644 --- a/libc/arch-x86_64/syscalls/fchmodat.S +++ b/libc/arch-x86_64/syscalls/fchmodat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchmodat) movq %rcx, %r10 movl $__NR_fchmodat, %eax @@ -12,7 +10,7 @@ ENTRY(fchmodat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fchmodat) diff --git a/libc/arch-x86_64/syscalls/fchown.S b/libc/arch-x86_64/syscalls/fchown.S index 1c439915c..d5bdc7192 100644 --- a/libc/arch-x86_64/syscalls/fchown.S +++ b/libc/arch-x86_64/syscalls/fchown.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchown) movl $__NR_fchown, %eax syscall @@ -11,7 +9,7 @@ ENTRY(fchown) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fchown) diff --git a/libc/arch-x86_64/syscalls/fchownat.S b/libc/arch-x86_64/syscalls/fchownat.S index 8f77888e1..ff05e9efa 100644 --- a/libc/arch-x86_64/syscalls/fchownat.S +++ b/libc/arch-x86_64/syscalls/fchownat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fchownat) movq %rcx, %r10 movl $__NR_fchownat, %eax @@ -12,7 +10,7 @@ ENTRY(fchownat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fchownat) diff --git a/libc/arch-x86_64/syscalls/fcntl.S b/libc/arch-x86_64/syscalls/fcntl.S index d415467a0..f28195b5f 100644 --- a/libc/arch-x86_64/syscalls/fcntl.S +++ b/libc/arch-x86_64/syscalls/fcntl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fcntl) movl $__NR_fcntl, %eax syscall @@ -11,7 +9,7 @@ ENTRY(fcntl) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fcntl) diff --git a/libc/arch-x86_64/syscalls/fdatasync.S b/libc/arch-x86_64/syscalls/fdatasync.S index 8ec419304..27239b95d 100644 --- a/libc/arch-x86_64/syscalls/fdatasync.S +++ b/libc/arch-x86_64/syscalls/fdatasync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fdatasync) movl $__NR_fdatasync, %eax syscall @@ -11,7 +9,7 @@ ENTRY(fdatasync) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fdatasync) diff --git a/libc/arch-x86_64/syscalls/fgetxattr.S b/libc/arch-x86_64/syscalls/fgetxattr.S index 9aacdbdb1..7762474f9 100644 --- a/libc/arch-x86_64/syscalls/fgetxattr.S +++ b/libc/arch-x86_64/syscalls/fgetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fgetxattr) movq %rcx, %r10 movl $__NR_fgetxattr, %eax @@ -12,7 +10,7 @@ ENTRY(fgetxattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fgetxattr) diff --git a/libc/arch-x86_64/syscalls/flistxattr.S b/libc/arch-x86_64/syscalls/flistxattr.S index 53c58d07a..aa02db1e2 100644 --- a/libc/arch-x86_64/syscalls/flistxattr.S +++ b/libc/arch-x86_64/syscalls/flistxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(flistxattr) movl $__NR_flistxattr, %eax syscall @@ -11,7 +9,7 @@ ENTRY(flistxattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(flistxattr) diff --git a/libc/arch-x86_64/syscalls/flock.S b/libc/arch-x86_64/syscalls/flock.S index fe57b47d1..1bc667858 100644 --- a/libc/arch-x86_64/syscalls/flock.S +++ b/libc/arch-x86_64/syscalls/flock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(flock) movl $__NR_flock, %eax syscall @@ -11,7 +9,7 @@ ENTRY(flock) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(flock) diff --git a/libc/arch-x86_64/syscalls/fremovexattr.S b/libc/arch-x86_64/syscalls/fremovexattr.S index c37cc9303..517094c85 100644 --- a/libc/arch-x86_64/syscalls/fremovexattr.S +++ b/libc/arch-x86_64/syscalls/fremovexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fremovexattr) movl $__NR_fremovexattr, %eax syscall @@ -11,7 +9,7 @@ ENTRY(fremovexattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fremovexattr) diff --git a/libc/arch-x86_64/syscalls/fsetxattr.S b/libc/arch-x86_64/syscalls/fsetxattr.S index cc3d7b7bf..97822c4c8 100644 --- a/libc/arch-x86_64/syscalls/fsetxattr.S +++ b/libc/arch-x86_64/syscalls/fsetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fsetxattr) movq %rcx, %r10 movl $__NR_fsetxattr, %eax @@ -12,7 +10,7 @@ ENTRY(fsetxattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fsetxattr) diff --git a/libc/arch-x86_64/syscalls/fstat64.S b/libc/arch-x86_64/syscalls/fstat64.S index dbc676010..de576682c 100644 --- a/libc/arch-x86_64/syscalls/fstat64.S +++ b/libc/arch-x86_64/syscalls/fstat64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstat64) movl $__NR_fstat, %eax syscall @@ -11,7 +9,7 @@ ENTRY(fstat64) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fstat64) diff --git a/libc/arch-x86_64/syscalls/fstatat64.S b/libc/arch-x86_64/syscalls/fstatat64.S index 28b91fa13..47785bb23 100644 --- a/libc/arch-x86_64/syscalls/fstatat64.S +++ b/libc/arch-x86_64/syscalls/fstatat64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstatat64) movq %rcx, %r10 movl $__NR_newfstatat, %eax @@ -12,7 +10,7 @@ ENTRY(fstatat64) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fstatat64) diff --git a/libc/arch-x86_64/syscalls/fstatfs64.S b/libc/arch-x86_64/syscalls/fstatfs64.S index 4b12afb05..f727350e1 100644 --- a/libc/arch-x86_64/syscalls/fstatfs64.S +++ b/libc/arch-x86_64/syscalls/fstatfs64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fstatfs64) movl $__NR_fstatfs, %eax syscall @@ -11,7 +9,7 @@ ENTRY(fstatfs64) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fstatfs64) diff --git a/libc/arch-x86_64/syscalls/fsync.S b/libc/arch-x86_64/syscalls/fsync.S index 820502e8c..e7ec6da7f 100644 --- a/libc/arch-x86_64/syscalls/fsync.S +++ b/libc/arch-x86_64/syscalls/fsync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(fsync) movl $__NR_fsync, %eax syscall @@ -11,7 +9,7 @@ ENTRY(fsync) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(fsync) diff --git a/libc/arch-x86_64/syscalls/ftruncate.S b/libc/arch-x86_64/syscalls/ftruncate.S index 0b1440301..0365368d1 100644 --- a/libc/arch-x86_64/syscalls/ftruncate.S +++ b/libc/arch-x86_64/syscalls/ftruncate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(ftruncate) movl $__NR_ftruncate, %eax syscall @@ -11,7 +9,7 @@ ENTRY(ftruncate) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(ftruncate) diff --git a/libc/arch-x86_64/syscalls/getegid.S b/libc/arch-x86_64/syscalls/getegid.S index 155d37ba4..84ba24081 100644 --- a/libc/arch-x86_64/syscalls/getegid.S +++ b/libc/arch-x86_64/syscalls/getegid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getegid) movl $__NR_getegid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getegid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getegid) diff --git a/libc/arch-x86_64/syscalls/geteuid.S b/libc/arch-x86_64/syscalls/geteuid.S index 9ffa3cd5d..18a991ab2 100644 --- a/libc/arch-x86_64/syscalls/geteuid.S +++ b/libc/arch-x86_64/syscalls/geteuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(geteuid) movl $__NR_geteuid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(geteuid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(geteuid) diff --git a/libc/arch-x86_64/syscalls/getgid.S b/libc/arch-x86_64/syscalls/getgid.S index d9c9da938..5e4b0efea 100644 --- a/libc/arch-x86_64/syscalls/getgid.S +++ b/libc/arch-x86_64/syscalls/getgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getgid) movl $__NR_getgid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getgid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getgid) diff --git a/libc/arch-x86_64/syscalls/getgroups.S b/libc/arch-x86_64/syscalls/getgroups.S index 9f0701a64..b5dd81c31 100644 --- a/libc/arch-x86_64/syscalls/getgroups.S +++ b/libc/arch-x86_64/syscalls/getgroups.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getgroups) movl $__NR_getgroups, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getgroups) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getgroups) diff --git a/libc/arch-x86_64/syscalls/getitimer.S b/libc/arch-x86_64/syscalls/getitimer.S index 2d764306b..c4bb1202a 100644 --- a/libc/arch-x86_64/syscalls/getitimer.S +++ b/libc/arch-x86_64/syscalls/getitimer.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getitimer) movl $__NR_getitimer, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getitimer) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getitimer) diff --git a/libc/arch-x86_64/syscalls/getpeername.S b/libc/arch-x86_64/syscalls/getpeername.S index b6de1833d..0b212be92 100644 --- a/libc/arch-x86_64/syscalls/getpeername.S +++ b/libc/arch-x86_64/syscalls/getpeername.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getpeername) movl $__NR_getpeername, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getpeername) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getpeername) diff --git a/libc/arch-x86_64/syscalls/getpgid.S b/libc/arch-x86_64/syscalls/getpgid.S index e321b6619..d1b0e8bf9 100644 --- a/libc/arch-x86_64/syscalls/getpgid.S +++ b/libc/arch-x86_64/syscalls/getpgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getpgid) movl $__NR_getpgid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getpgid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getpgid) diff --git a/libc/arch-x86_64/syscalls/getppid.S b/libc/arch-x86_64/syscalls/getppid.S index 4a238ade6..e1cfee024 100644 --- a/libc/arch-x86_64/syscalls/getppid.S +++ b/libc/arch-x86_64/syscalls/getppid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getppid) movl $__NR_getppid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getppid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getppid) diff --git a/libc/arch-x86_64/syscalls/getresgid.S b/libc/arch-x86_64/syscalls/getresgid.S index 4727d2972..0b7ea7a74 100644 --- a/libc/arch-x86_64/syscalls/getresgid.S +++ b/libc/arch-x86_64/syscalls/getresgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getresgid) movl $__NR_getresgid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getresgid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getresgid) diff --git a/libc/arch-x86_64/syscalls/getresuid.S b/libc/arch-x86_64/syscalls/getresuid.S index 1098d5646..0d7a05438 100644 --- a/libc/arch-x86_64/syscalls/getresuid.S +++ b/libc/arch-x86_64/syscalls/getresuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getresuid) movl $__NR_getresuid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getresuid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getresuid) diff --git a/libc/arch-x86_64/syscalls/getrlimit.S b/libc/arch-x86_64/syscalls/getrlimit.S index 60e5881bf..2d272a125 100644 --- a/libc/arch-x86_64/syscalls/getrlimit.S +++ b/libc/arch-x86_64/syscalls/getrlimit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getrlimit) movl $__NR_getrlimit, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getrlimit) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getrlimit) diff --git a/libc/arch-x86_64/syscalls/getrusage.S b/libc/arch-x86_64/syscalls/getrusage.S index 0eb017663..eef7fb8b4 100644 --- a/libc/arch-x86_64/syscalls/getrusage.S +++ b/libc/arch-x86_64/syscalls/getrusage.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getrusage) movl $__NR_getrusage, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getrusage) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getrusage) diff --git a/libc/arch-x86_64/syscalls/getsid.S b/libc/arch-x86_64/syscalls/getsid.S index 2543b1058..022f959dd 100644 --- a/libc/arch-x86_64/syscalls/getsid.S +++ b/libc/arch-x86_64/syscalls/getsid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsid) movl $__NR_getsid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getsid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getsid) diff --git a/libc/arch-x86_64/syscalls/getsockname.S b/libc/arch-x86_64/syscalls/getsockname.S index 17cd5eaf6..36fdcf75d 100644 --- a/libc/arch-x86_64/syscalls/getsockname.S +++ b/libc/arch-x86_64/syscalls/getsockname.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsockname) movl $__NR_getsockname, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getsockname) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getsockname) diff --git a/libc/arch-x86_64/syscalls/getsockopt.S b/libc/arch-x86_64/syscalls/getsockopt.S index 988a2cbcd..c1e11e7ce 100644 --- a/libc/arch-x86_64/syscalls/getsockopt.S +++ b/libc/arch-x86_64/syscalls/getsockopt.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getsockopt) movq %rcx, %r10 movl $__NR_getsockopt, %eax @@ -12,7 +10,7 @@ ENTRY(getsockopt) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getsockopt) diff --git a/libc/arch-x86_64/syscalls/getuid.S b/libc/arch-x86_64/syscalls/getuid.S index 9b7a1d9d6..93cd0f831 100644 --- a/libc/arch-x86_64/syscalls/getuid.S +++ b/libc/arch-x86_64/syscalls/getuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getuid) movl $__NR_getuid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(getuid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getuid) diff --git a/libc/arch-x86_64/syscalls/getxattr.S b/libc/arch-x86_64/syscalls/getxattr.S index 4d6aecf7a..01378b0a7 100644 --- a/libc/arch-x86_64/syscalls/getxattr.S +++ b/libc/arch-x86_64/syscalls/getxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(getxattr) movq %rcx, %r10 movl $__NR_getxattr, %eax @@ -12,7 +10,7 @@ ENTRY(getxattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(getxattr) diff --git a/libc/arch-x86_64/syscalls/init_module.S b/libc/arch-x86_64/syscalls/init_module.S index 2c5141458..c005de434 100644 --- a/libc/arch-x86_64/syscalls/init_module.S +++ b/libc/arch-x86_64/syscalls/init_module.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(init_module) movl $__NR_init_module, %eax syscall @@ -11,7 +9,7 @@ ENTRY(init_module) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(init_module) diff --git a/libc/arch-x86_64/syscalls/inotify_add_watch.S b/libc/arch-x86_64/syscalls/inotify_add_watch.S index da5aa36ee..edf2930ac 100644 --- a/libc/arch-x86_64/syscalls/inotify_add_watch.S +++ b/libc/arch-x86_64/syscalls/inotify_add_watch.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_add_watch) movl $__NR_inotify_add_watch, %eax syscall @@ -11,7 +9,7 @@ ENTRY(inotify_add_watch) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(inotify_add_watch) diff --git a/libc/arch-x86_64/syscalls/inotify_init1.S b/libc/arch-x86_64/syscalls/inotify_init1.S index 46e5014b9..b1580182f 100644 --- a/libc/arch-x86_64/syscalls/inotify_init1.S +++ b/libc/arch-x86_64/syscalls/inotify_init1.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_init1) movl $__NR_inotify_init1, %eax syscall @@ -11,7 +9,7 @@ ENTRY(inotify_init1) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(inotify_init1) diff --git a/libc/arch-x86_64/syscalls/inotify_rm_watch.S b/libc/arch-x86_64/syscalls/inotify_rm_watch.S index 5920c9df0..f2fc10e5a 100644 --- a/libc/arch-x86_64/syscalls/inotify_rm_watch.S +++ b/libc/arch-x86_64/syscalls/inotify_rm_watch.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(inotify_rm_watch) movl $__NR_inotify_rm_watch, %eax syscall @@ -11,7 +9,7 @@ ENTRY(inotify_rm_watch) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(inotify_rm_watch) diff --git a/libc/arch-x86_64/syscalls/kill.S b/libc/arch-x86_64/syscalls/kill.S index dff2da60f..fe93f34e6 100644 --- a/libc/arch-x86_64/syscalls/kill.S +++ b/libc/arch-x86_64/syscalls/kill.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(kill) movl $__NR_kill, %eax syscall @@ -11,7 +9,7 @@ ENTRY(kill) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(kill) diff --git a/libc/arch-x86_64/syscalls/klogctl.S b/libc/arch-x86_64/syscalls/klogctl.S index 8560d2819..fb2aca364 100644 --- a/libc/arch-x86_64/syscalls/klogctl.S +++ b/libc/arch-x86_64/syscalls/klogctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(klogctl) movl $__NR_syslog, %eax syscall @@ -11,7 +9,7 @@ ENTRY(klogctl) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(klogctl) diff --git a/libc/arch-x86_64/syscalls/lgetxattr.S b/libc/arch-x86_64/syscalls/lgetxattr.S index b4bc204bb..36202a212 100644 --- a/libc/arch-x86_64/syscalls/lgetxattr.S +++ b/libc/arch-x86_64/syscalls/lgetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lgetxattr) movq %rcx, %r10 movl $__NR_lgetxattr, %eax @@ -12,7 +10,7 @@ ENTRY(lgetxattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(lgetxattr) diff --git a/libc/arch-x86_64/syscalls/linkat.S b/libc/arch-x86_64/syscalls/linkat.S index 509b57949..d195e19a4 100644 --- a/libc/arch-x86_64/syscalls/linkat.S +++ b/libc/arch-x86_64/syscalls/linkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(linkat) movq %rcx, %r10 movl $__NR_linkat, %eax @@ -12,7 +10,7 @@ ENTRY(linkat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(linkat) diff --git a/libc/arch-x86_64/syscalls/listen.S b/libc/arch-x86_64/syscalls/listen.S index 6bd46a551..756b629dc 100644 --- a/libc/arch-x86_64/syscalls/listen.S +++ b/libc/arch-x86_64/syscalls/listen.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(listen) movl $__NR_listen, %eax syscall @@ -11,7 +9,7 @@ ENTRY(listen) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(listen) diff --git a/libc/arch-x86_64/syscalls/listxattr.S b/libc/arch-x86_64/syscalls/listxattr.S index 102518f11..d0b2112bc 100644 --- a/libc/arch-x86_64/syscalls/listxattr.S +++ b/libc/arch-x86_64/syscalls/listxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(listxattr) movl $__NR_listxattr, %eax syscall @@ -11,7 +9,7 @@ ENTRY(listxattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(listxattr) diff --git a/libc/arch-x86_64/syscalls/llistxattr.S b/libc/arch-x86_64/syscalls/llistxattr.S index 74d58a851..49fb9694c 100644 --- a/libc/arch-x86_64/syscalls/llistxattr.S +++ b/libc/arch-x86_64/syscalls/llistxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(llistxattr) movl $__NR_llistxattr, %eax syscall @@ -11,7 +9,7 @@ ENTRY(llistxattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(llistxattr) diff --git a/libc/arch-x86_64/syscalls/lremovexattr.S b/libc/arch-x86_64/syscalls/lremovexattr.S index 2566e3397..1e1bc30de 100644 --- a/libc/arch-x86_64/syscalls/lremovexattr.S +++ b/libc/arch-x86_64/syscalls/lremovexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lremovexattr) movl $__NR_lremovexattr, %eax syscall @@ -11,7 +9,7 @@ ENTRY(lremovexattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(lremovexattr) diff --git a/libc/arch-x86_64/syscalls/lseek.S b/libc/arch-x86_64/syscalls/lseek.S index 93e5f0c58..153b9352f 100644 --- a/libc/arch-x86_64/syscalls/lseek.S +++ b/libc/arch-x86_64/syscalls/lseek.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lseek) movl $__NR_lseek, %eax syscall @@ -11,7 +9,7 @@ ENTRY(lseek) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(lseek) diff --git a/libc/arch-x86_64/syscalls/lsetxattr.S b/libc/arch-x86_64/syscalls/lsetxattr.S index 905bd3b85..965ee0325 100644 --- a/libc/arch-x86_64/syscalls/lsetxattr.S +++ b/libc/arch-x86_64/syscalls/lsetxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(lsetxattr) movq %rcx, %r10 movl $__NR_lsetxattr, %eax @@ -12,7 +10,7 @@ ENTRY(lsetxattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(lsetxattr) diff --git a/libc/arch-x86_64/syscalls/madvise.S b/libc/arch-x86_64/syscalls/madvise.S index c565ca3b1..75d47f64f 100644 --- a/libc/arch-x86_64/syscalls/madvise.S +++ b/libc/arch-x86_64/syscalls/madvise.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(madvise) movl $__NR_madvise, %eax syscall @@ -11,7 +9,7 @@ ENTRY(madvise) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(madvise) diff --git a/libc/arch-x86_64/syscalls/mincore.S b/libc/arch-x86_64/syscalls/mincore.S index f8acdeb25..2d8a28a9d 100644 --- a/libc/arch-x86_64/syscalls/mincore.S +++ b/libc/arch-x86_64/syscalls/mincore.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mincore) movl $__NR_mincore, %eax syscall @@ -11,7 +9,7 @@ ENTRY(mincore) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(mincore) diff --git a/libc/arch-x86_64/syscalls/mkdirat.S b/libc/arch-x86_64/syscalls/mkdirat.S index b554d125d..8a7601334 100644 --- a/libc/arch-x86_64/syscalls/mkdirat.S +++ b/libc/arch-x86_64/syscalls/mkdirat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mkdirat) movl $__NR_mkdirat, %eax syscall @@ -11,7 +9,7 @@ ENTRY(mkdirat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(mkdirat) diff --git a/libc/arch-x86_64/syscalls/mknodat.S b/libc/arch-x86_64/syscalls/mknodat.S index dd6496a14..a8859d464 100644 --- a/libc/arch-x86_64/syscalls/mknodat.S +++ b/libc/arch-x86_64/syscalls/mknodat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mknodat) movq %rcx, %r10 movl $__NR_mknodat, %eax @@ -12,7 +10,7 @@ ENTRY(mknodat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(mknodat) diff --git a/libc/arch-x86_64/syscalls/mlock.S b/libc/arch-x86_64/syscalls/mlock.S index 78389e29b..d34b3ae31 100644 --- a/libc/arch-x86_64/syscalls/mlock.S +++ b/libc/arch-x86_64/syscalls/mlock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mlock) movl $__NR_mlock, %eax syscall @@ -11,7 +9,7 @@ ENTRY(mlock) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(mlock) diff --git a/libc/arch-x86_64/syscalls/mlockall.S b/libc/arch-x86_64/syscalls/mlockall.S index 3ac878a7f..31ccaa058 100644 --- a/libc/arch-x86_64/syscalls/mlockall.S +++ b/libc/arch-x86_64/syscalls/mlockall.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mlockall) movl $__NR_mlockall, %eax syscall @@ -11,7 +9,7 @@ ENTRY(mlockall) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(mlockall) diff --git a/libc/arch-x86_64/syscalls/mmap.S b/libc/arch-x86_64/syscalls/mmap.S index 44189a993..8aa4780f6 100644 --- a/libc/arch-x86_64/syscalls/mmap.S +++ b/libc/arch-x86_64/syscalls/mmap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mmap) movq %rcx, %r10 movl $__NR_mmap, %eax @@ -12,7 +10,7 @@ ENTRY(mmap) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(mmap) diff --git a/libc/arch-x86_64/syscalls/mount.S b/libc/arch-x86_64/syscalls/mount.S index 369e8df58..dcbd47399 100644 --- a/libc/arch-x86_64/syscalls/mount.S +++ b/libc/arch-x86_64/syscalls/mount.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mount) movq %rcx, %r10 movl $__NR_mount, %eax @@ -12,7 +10,7 @@ ENTRY(mount) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(mount) diff --git a/libc/arch-x86_64/syscalls/mprotect.S b/libc/arch-x86_64/syscalls/mprotect.S index 44888da2d..2ad4b250b 100644 --- a/libc/arch-x86_64/syscalls/mprotect.S +++ b/libc/arch-x86_64/syscalls/mprotect.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mprotect) movl $__NR_mprotect, %eax syscall @@ -11,7 +9,7 @@ ENTRY(mprotect) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(mprotect) diff --git a/libc/arch-x86_64/syscalls/mremap.S b/libc/arch-x86_64/syscalls/mremap.S index 74a05e24a..a6042cb6c 100644 --- a/libc/arch-x86_64/syscalls/mremap.S +++ b/libc/arch-x86_64/syscalls/mremap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(mremap) movq %rcx, %r10 movl $__NR_mremap, %eax @@ -12,7 +10,7 @@ ENTRY(mremap) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(mremap) diff --git a/libc/arch-x86_64/syscalls/msync.S b/libc/arch-x86_64/syscalls/msync.S index 1d0e785c2..099dbbf07 100644 --- a/libc/arch-x86_64/syscalls/msync.S +++ b/libc/arch-x86_64/syscalls/msync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(msync) movl $__NR_msync, %eax syscall @@ -11,7 +9,7 @@ ENTRY(msync) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(msync) diff --git a/libc/arch-x86_64/syscalls/munlock.S b/libc/arch-x86_64/syscalls/munlock.S index 17e368b89..bb5940ca7 100644 --- a/libc/arch-x86_64/syscalls/munlock.S +++ b/libc/arch-x86_64/syscalls/munlock.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munlock) movl $__NR_munlock, %eax syscall @@ -11,7 +9,7 @@ ENTRY(munlock) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(munlock) diff --git a/libc/arch-x86_64/syscalls/munlockall.S b/libc/arch-x86_64/syscalls/munlockall.S index 6bb7aa648..f9579dfdb 100644 --- a/libc/arch-x86_64/syscalls/munlockall.S +++ b/libc/arch-x86_64/syscalls/munlockall.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munlockall) movl $__NR_munlockall, %eax syscall @@ -11,7 +9,7 @@ ENTRY(munlockall) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(munlockall) diff --git a/libc/arch-x86_64/syscalls/munmap.S b/libc/arch-x86_64/syscalls/munmap.S index f423a6672..d1c580e44 100644 --- a/libc/arch-x86_64/syscalls/munmap.S +++ b/libc/arch-x86_64/syscalls/munmap.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(munmap) movl $__NR_munmap, %eax syscall @@ -11,7 +9,7 @@ ENTRY(munmap) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(munmap) diff --git a/libc/arch-x86_64/syscalls/nanosleep.S b/libc/arch-x86_64/syscalls/nanosleep.S index caa1ae685..b19f7f5ee 100644 --- a/libc/arch-x86_64/syscalls/nanosleep.S +++ b/libc/arch-x86_64/syscalls/nanosleep.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(nanosleep) movl $__NR_nanosleep, %eax syscall @@ -11,7 +9,7 @@ ENTRY(nanosleep) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(nanosleep) diff --git a/libc/arch-x86_64/syscalls/personality.S b/libc/arch-x86_64/syscalls/personality.S index a742dbf15..6937e4c51 100644 --- a/libc/arch-x86_64/syscalls/personality.S +++ b/libc/arch-x86_64/syscalls/personality.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(personality) movl $__NR_personality, %eax syscall @@ -11,7 +9,7 @@ ENTRY(personality) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(personality) diff --git a/libc/arch-x86_64/syscalls/pipe2.S b/libc/arch-x86_64/syscalls/pipe2.S index e34ca69be..d488c87ad 100644 --- a/libc/arch-x86_64/syscalls/pipe2.S +++ b/libc/arch-x86_64/syscalls/pipe2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pipe2) movl $__NR_pipe2, %eax syscall @@ -11,7 +9,7 @@ ENTRY(pipe2) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(pipe2) diff --git a/libc/arch-x86_64/syscalls/prctl.S b/libc/arch-x86_64/syscalls/prctl.S index b4cdaa50a..4f3d2ae68 100644 --- a/libc/arch-x86_64/syscalls/prctl.S +++ b/libc/arch-x86_64/syscalls/prctl.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(prctl) movq %rcx, %r10 movl $__NR_prctl, %eax @@ -12,7 +10,7 @@ ENTRY(prctl) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(prctl) diff --git a/libc/arch-x86_64/syscalls/pread64.S b/libc/arch-x86_64/syscalls/pread64.S index 1d042efc2..3aa56e595 100644 --- a/libc/arch-x86_64/syscalls/pread64.S +++ b/libc/arch-x86_64/syscalls/pread64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pread64) movq %rcx, %r10 movl $__NR_pread64, %eax @@ -12,7 +10,7 @@ ENTRY(pread64) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(pread64) diff --git a/libc/arch-x86_64/syscalls/prlimit64.S b/libc/arch-x86_64/syscalls/prlimit64.S index 52151a8f4..63ec492dd 100644 --- a/libc/arch-x86_64/syscalls/prlimit64.S +++ b/libc/arch-x86_64/syscalls/prlimit64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(prlimit64) movq %rcx, %r10 movl $__NR_prlimit64, %eax @@ -12,7 +10,7 @@ ENTRY(prlimit64) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(prlimit64) diff --git a/libc/arch-x86_64/syscalls/pwrite64.S b/libc/arch-x86_64/syscalls/pwrite64.S index 2fb0f16af..2779fb419 100644 --- a/libc/arch-x86_64/syscalls/pwrite64.S +++ b/libc/arch-x86_64/syscalls/pwrite64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(pwrite64) movq %rcx, %r10 movl $__NR_pwrite64, %eax @@ -12,7 +10,7 @@ ENTRY(pwrite64) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(pwrite64) diff --git a/libc/arch-x86_64/syscalls/read.S b/libc/arch-x86_64/syscalls/read.S index 3f2862e3b..df70e7fef 100644 --- a/libc/arch-x86_64/syscalls/read.S +++ b/libc/arch-x86_64/syscalls/read.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(read) movl $__NR_read, %eax syscall @@ -11,7 +9,7 @@ ENTRY(read) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(read) diff --git a/libc/arch-x86_64/syscalls/readahead.S b/libc/arch-x86_64/syscalls/readahead.S index df3aba168..38cb1c0b6 100644 --- a/libc/arch-x86_64/syscalls/readahead.S +++ b/libc/arch-x86_64/syscalls/readahead.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readahead) movl $__NR_readahead, %eax syscall @@ -11,7 +9,7 @@ ENTRY(readahead) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(readahead) diff --git a/libc/arch-x86_64/syscalls/readlinkat.S b/libc/arch-x86_64/syscalls/readlinkat.S index 554b8b6f2..9fd64e5a4 100644 --- a/libc/arch-x86_64/syscalls/readlinkat.S +++ b/libc/arch-x86_64/syscalls/readlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readlinkat) movq %rcx, %r10 movl $__NR_readlinkat, %eax @@ -12,7 +10,7 @@ ENTRY(readlinkat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(readlinkat) diff --git a/libc/arch-x86_64/syscalls/readv.S b/libc/arch-x86_64/syscalls/readv.S index 75d04e956..2510c5612 100644 --- a/libc/arch-x86_64/syscalls/readv.S +++ b/libc/arch-x86_64/syscalls/readv.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(readv) movl $__NR_readv, %eax syscall @@ -11,7 +9,7 @@ ENTRY(readv) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(readv) diff --git a/libc/arch-x86_64/syscalls/recvfrom.S b/libc/arch-x86_64/syscalls/recvfrom.S index 4ee56318c..6c0907884 100644 --- a/libc/arch-x86_64/syscalls/recvfrom.S +++ b/libc/arch-x86_64/syscalls/recvfrom.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvfrom) movq %rcx, %r10 movl $__NR_recvfrom, %eax @@ -12,7 +10,7 @@ ENTRY(recvfrom) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(recvfrom) diff --git a/libc/arch-x86_64/syscalls/recvmmsg.S b/libc/arch-x86_64/syscalls/recvmmsg.S index 327932547..78da69173 100644 --- a/libc/arch-x86_64/syscalls/recvmmsg.S +++ b/libc/arch-x86_64/syscalls/recvmmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvmmsg) movq %rcx, %r10 movl $__NR_recvmmsg, %eax @@ -12,7 +10,7 @@ ENTRY(recvmmsg) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(recvmmsg) diff --git a/libc/arch-x86_64/syscalls/recvmsg.S b/libc/arch-x86_64/syscalls/recvmsg.S index 7c186fd5b..945f17b1a 100644 --- a/libc/arch-x86_64/syscalls/recvmsg.S +++ b/libc/arch-x86_64/syscalls/recvmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(recvmsg) movl $__NR_recvmsg, %eax syscall @@ -11,7 +9,7 @@ ENTRY(recvmsg) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(recvmsg) diff --git a/libc/arch-x86_64/syscalls/removexattr.S b/libc/arch-x86_64/syscalls/removexattr.S index 909164729..9b476154e 100644 --- a/libc/arch-x86_64/syscalls/removexattr.S +++ b/libc/arch-x86_64/syscalls/removexattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(removexattr) movl $__NR_removexattr, %eax syscall @@ -11,7 +9,7 @@ ENTRY(removexattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(removexattr) diff --git a/libc/arch-x86_64/syscalls/renameat.S b/libc/arch-x86_64/syscalls/renameat.S index 7258712f7..3a94a75a8 100644 --- a/libc/arch-x86_64/syscalls/renameat.S +++ b/libc/arch-x86_64/syscalls/renameat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(renameat) movq %rcx, %r10 movl $__NR_renameat, %eax @@ -12,7 +10,7 @@ ENTRY(renameat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(renameat) diff --git a/libc/arch-x86_64/syscalls/sched_get_priority_max.S b/libc/arch-x86_64/syscalls/sched_get_priority_max.S index 604d6c89e..1a0da2386 100644 --- a/libc/arch-x86_64/syscalls/sched_get_priority_max.S +++ b/libc/arch-x86_64/syscalls/sched_get_priority_max.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_max) movl $__NR_sched_get_priority_max, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sched_get_priority_max) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sched_get_priority_max) diff --git a/libc/arch-x86_64/syscalls/sched_get_priority_min.S b/libc/arch-x86_64/syscalls/sched_get_priority_min.S index eaeb7654f..378587730 100644 --- a/libc/arch-x86_64/syscalls/sched_get_priority_min.S +++ b/libc/arch-x86_64/syscalls/sched_get_priority_min.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_get_priority_min) movl $__NR_sched_get_priority_min, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sched_get_priority_min) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sched_get_priority_min) diff --git a/libc/arch-x86_64/syscalls/sched_getparam.S b/libc/arch-x86_64/syscalls/sched_getparam.S index e269c7d0f..409b501b1 100644 --- a/libc/arch-x86_64/syscalls/sched_getparam.S +++ b/libc/arch-x86_64/syscalls/sched_getparam.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_getparam) movl $__NR_sched_getparam, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sched_getparam) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sched_getparam) diff --git a/libc/arch-x86_64/syscalls/sched_getscheduler.S b/libc/arch-x86_64/syscalls/sched_getscheduler.S index 0cf3b5403..520050468 100644 --- a/libc/arch-x86_64/syscalls/sched_getscheduler.S +++ b/libc/arch-x86_64/syscalls/sched_getscheduler.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_getscheduler) movl $__NR_sched_getscheduler, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sched_getscheduler) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sched_getscheduler) diff --git a/libc/arch-x86_64/syscalls/sched_rr_get_interval.S b/libc/arch-x86_64/syscalls/sched_rr_get_interval.S index 662a28c4a..276feb166 100644 --- a/libc/arch-x86_64/syscalls/sched_rr_get_interval.S +++ b/libc/arch-x86_64/syscalls/sched_rr_get_interval.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_rr_get_interval) movl $__NR_sched_rr_get_interval, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sched_rr_get_interval) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sched_rr_get_interval) diff --git a/libc/arch-x86_64/syscalls/sched_setaffinity.S b/libc/arch-x86_64/syscalls/sched_setaffinity.S index 79b43fd27..1fb87e5b0 100644 --- a/libc/arch-x86_64/syscalls/sched_setaffinity.S +++ b/libc/arch-x86_64/syscalls/sched_setaffinity.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setaffinity) movl $__NR_sched_setaffinity, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sched_setaffinity) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sched_setaffinity) diff --git a/libc/arch-x86_64/syscalls/sched_setparam.S b/libc/arch-x86_64/syscalls/sched_setparam.S index 871b49262..91ca83bd9 100644 --- a/libc/arch-x86_64/syscalls/sched_setparam.S +++ b/libc/arch-x86_64/syscalls/sched_setparam.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setparam) movl $__NR_sched_setparam, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sched_setparam) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sched_setparam) diff --git a/libc/arch-x86_64/syscalls/sched_setscheduler.S b/libc/arch-x86_64/syscalls/sched_setscheduler.S index 0dcb47d33..7fa499a57 100644 --- a/libc/arch-x86_64/syscalls/sched_setscheduler.S +++ b/libc/arch-x86_64/syscalls/sched_setscheduler.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_setscheduler) movl $__NR_sched_setscheduler, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sched_setscheduler) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sched_setscheduler) diff --git a/libc/arch-x86_64/syscalls/sched_yield.S b/libc/arch-x86_64/syscalls/sched_yield.S index 12de511fb..8eb10f648 100644 --- a/libc/arch-x86_64/syscalls/sched_yield.S +++ b/libc/arch-x86_64/syscalls/sched_yield.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sched_yield) movl $__NR_sched_yield, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sched_yield) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sched_yield) diff --git a/libc/arch-x86_64/syscalls/sendfile.S b/libc/arch-x86_64/syscalls/sendfile.S index 0255bf29f..117b0aad6 100644 --- a/libc/arch-x86_64/syscalls/sendfile.S +++ b/libc/arch-x86_64/syscalls/sendfile.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendfile) movq %rcx, %r10 movl $__NR_sendfile, %eax @@ -12,7 +10,7 @@ ENTRY(sendfile) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sendfile) diff --git a/libc/arch-x86_64/syscalls/sendmmsg.S b/libc/arch-x86_64/syscalls/sendmmsg.S index 47b2e3a75..cf4a78df8 100644 --- a/libc/arch-x86_64/syscalls/sendmmsg.S +++ b/libc/arch-x86_64/syscalls/sendmmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendmmsg) movq %rcx, %r10 movl $__NR_sendmmsg, %eax @@ -12,7 +10,7 @@ ENTRY(sendmmsg) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sendmmsg) diff --git a/libc/arch-x86_64/syscalls/sendmsg.S b/libc/arch-x86_64/syscalls/sendmsg.S index e9eecf6b6..84566b52c 100644 --- a/libc/arch-x86_64/syscalls/sendmsg.S +++ b/libc/arch-x86_64/syscalls/sendmsg.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendmsg) movl $__NR_sendmsg, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sendmsg) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sendmsg) diff --git a/libc/arch-x86_64/syscalls/sendto.S b/libc/arch-x86_64/syscalls/sendto.S index f8cc14935..be3bace64 100644 --- a/libc/arch-x86_64/syscalls/sendto.S +++ b/libc/arch-x86_64/syscalls/sendto.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sendto) movq %rcx, %r10 movl $__NR_sendto, %eax @@ -12,7 +10,7 @@ ENTRY(sendto) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sendto) diff --git a/libc/arch-x86_64/syscalls/setfsgid.S b/libc/arch-x86_64/syscalls/setfsgid.S index bfc9c5dd1..22a36b202 100644 --- a/libc/arch-x86_64/syscalls/setfsgid.S +++ b/libc/arch-x86_64/syscalls/setfsgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setfsgid) movl $__NR_setfsgid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setfsgid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setfsgid) diff --git a/libc/arch-x86_64/syscalls/setfsuid.S b/libc/arch-x86_64/syscalls/setfsuid.S index 2540a36a1..0bd0c97c6 100644 --- a/libc/arch-x86_64/syscalls/setfsuid.S +++ b/libc/arch-x86_64/syscalls/setfsuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setfsuid) movl $__NR_setfsuid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setfsuid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setfsuid) diff --git a/libc/arch-x86_64/syscalls/setgid.S b/libc/arch-x86_64/syscalls/setgid.S index 8f9ce5322..650f8e20c 100644 --- a/libc/arch-x86_64/syscalls/setgid.S +++ b/libc/arch-x86_64/syscalls/setgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setgid) movl $__NR_setgid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setgid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setgid) diff --git a/libc/arch-x86_64/syscalls/setgroups.S b/libc/arch-x86_64/syscalls/setgroups.S index 81023ab4b..c798c1480 100644 --- a/libc/arch-x86_64/syscalls/setgroups.S +++ b/libc/arch-x86_64/syscalls/setgroups.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setgroups) movl $__NR_setgroups, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setgroups) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setgroups) diff --git a/libc/arch-x86_64/syscalls/setitimer.S b/libc/arch-x86_64/syscalls/setitimer.S index 6882564b5..c5fabb22b 100644 --- a/libc/arch-x86_64/syscalls/setitimer.S +++ b/libc/arch-x86_64/syscalls/setitimer.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setitimer) movl $__NR_setitimer, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setitimer) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setitimer) diff --git a/libc/arch-x86_64/syscalls/setns.S b/libc/arch-x86_64/syscalls/setns.S index 15dc51c99..c2ae97d6c 100644 --- a/libc/arch-x86_64/syscalls/setns.S +++ b/libc/arch-x86_64/syscalls/setns.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setns) movl $__NR_setns, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setns) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setns) diff --git a/libc/arch-x86_64/syscalls/setpgid.S b/libc/arch-x86_64/syscalls/setpgid.S index 0cbb9a33a..4d4313c43 100644 --- a/libc/arch-x86_64/syscalls/setpgid.S +++ b/libc/arch-x86_64/syscalls/setpgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setpgid) movl $__NR_setpgid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setpgid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setpgid) diff --git a/libc/arch-x86_64/syscalls/setpriority.S b/libc/arch-x86_64/syscalls/setpriority.S index e2ee77581..3c508c32a 100644 --- a/libc/arch-x86_64/syscalls/setpriority.S +++ b/libc/arch-x86_64/syscalls/setpriority.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setpriority) movl $__NR_setpriority, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setpriority) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setpriority) diff --git a/libc/arch-x86_64/syscalls/setregid.S b/libc/arch-x86_64/syscalls/setregid.S index 1d53e4caa..181a8b903 100644 --- a/libc/arch-x86_64/syscalls/setregid.S +++ b/libc/arch-x86_64/syscalls/setregid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setregid) movl $__NR_setregid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setregid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setregid) diff --git a/libc/arch-x86_64/syscalls/setresgid.S b/libc/arch-x86_64/syscalls/setresgid.S index 7663cc68f..fe44786dd 100644 --- a/libc/arch-x86_64/syscalls/setresgid.S +++ b/libc/arch-x86_64/syscalls/setresgid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setresgid) movl $__NR_setresgid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setresgid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setresgid) diff --git a/libc/arch-x86_64/syscalls/setresuid.S b/libc/arch-x86_64/syscalls/setresuid.S index 96e691f52..58cd2ca10 100644 --- a/libc/arch-x86_64/syscalls/setresuid.S +++ b/libc/arch-x86_64/syscalls/setresuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setresuid) movl $__NR_setresuid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setresuid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setresuid) diff --git a/libc/arch-x86_64/syscalls/setreuid.S b/libc/arch-x86_64/syscalls/setreuid.S index 9ee7208d4..e25658b1e 100644 --- a/libc/arch-x86_64/syscalls/setreuid.S +++ b/libc/arch-x86_64/syscalls/setreuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setreuid) movl $__NR_setreuid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setreuid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setreuid) diff --git a/libc/arch-x86_64/syscalls/setrlimit.S b/libc/arch-x86_64/syscalls/setrlimit.S index 393a5c186..ef0306829 100644 --- a/libc/arch-x86_64/syscalls/setrlimit.S +++ b/libc/arch-x86_64/syscalls/setrlimit.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setrlimit) movl $__NR_setrlimit, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setrlimit) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setrlimit) diff --git a/libc/arch-x86_64/syscalls/setsid.S b/libc/arch-x86_64/syscalls/setsid.S index bed06c9e2..01d9269ce 100644 --- a/libc/arch-x86_64/syscalls/setsid.S +++ b/libc/arch-x86_64/syscalls/setsid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setsid) movl $__NR_setsid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setsid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setsid) diff --git a/libc/arch-x86_64/syscalls/setsockopt.S b/libc/arch-x86_64/syscalls/setsockopt.S index 3c12cd60e..629fdf0d5 100644 --- a/libc/arch-x86_64/syscalls/setsockopt.S +++ b/libc/arch-x86_64/syscalls/setsockopt.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setsockopt) movq %rcx, %r10 movl $__NR_setsockopt, %eax @@ -12,7 +10,7 @@ ENTRY(setsockopt) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setsockopt) diff --git a/libc/arch-x86_64/syscalls/settimeofday.S b/libc/arch-x86_64/syscalls/settimeofday.S index 317946a42..ac5b9b1b4 100644 --- a/libc/arch-x86_64/syscalls/settimeofday.S +++ b/libc/arch-x86_64/syscalls/settimeofday.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(settimeofday) movl $__NR_settimeofday, %eax syscall @@ -11,7 +9,7 @@ ENTRY(settimeofday) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(settimeofday) diff --git a/libc/arch-x86_64/syscalls/setuid.S b/libc/arch-x86_64/syscalls/setuid.S index 8da7d86fa..f335a76e8 100644 --- a/libc/arch-x86_64/syscalls/setuid.S +++ b/libc/arch-x86_64/syscalls/setuid.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setuid) movl $__NR_setuid, %eax syscall @@ -11,7 +9,7 @@ ENTRY(setuid) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setuid) diff --git a/libc/arch-x86_64/syscalls/setxattr.S b/libc/arch-x86_64/syscalls/setxattr.S index 2abaa7675..d7504231b 100644 --- a/libc/arch-x86_64/syscalls/setxattr.S +++ b/libc/arch-x86_64/syscalls/setxattr.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(setxattr) movq %rcx, %r10 movl $__NR_setxattr, %eax @@ -12,7 +10,7 @@ ENTRY(setxattr) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(setxattr) diff --git a/libc/arch-x86_64/syscalls/shutdown.S b/libc/arch-x86_64/syscalls/shutdown.S index b5840d74b..a030c97b8 100644 --- a/libc/arch-x86_64/syscalls/shutdown.S +++ b/libc/arch-x86_64/syscalls/shutdown.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(shutdown) movl $__NR_shutdown, %eax syscall @@ -11,7 +9,7 @@ ENTRY(shutdown) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(shutdown) diff --git a/libc/arch-x86_64/syscalls/sigaltstack.S b/libc/arch-x86_64/syscalls/sigaltstack.S index 2dd6aa4bf..71ce53745 100644 --- a/libc/arch-x86_64/syscalls/sigaltstack.S +++ b/libc/arch-x86_64/syscalls/sigaltstack.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sigaltstack) movl $__NR_sigaltstack, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sigaltstack) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sigaltstack) diff --git a/libc/arch-x86_64/syscalls/socketpair.S b/libc/arch-x86_64/syscalls/socketpair.S index cb32a8aff..dbcf50d23 100644 --- a/libc/arch-x86_64/syscalls/socketpair.S +++ b/libc/arch-x86_64/syscalls/socketpair.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(socketpair) movq %rcx, %r10 movl $__NR_socketpair, %eax @@ -12,7 +10,7 @@ ENTRY(socketpair) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(socketpair) diff --git a/libc/arch-x86_64/syscalls/splice.S b/libc/arch-x86_64/syscalls/splice.S index 351e1c7f9..1b2ec84ef 100644 --- a/libc/arch-x86_64/syscalls/splice.S +++ b/libc/arch-x86_64/syscalls/splice.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(splice) movq %rcx, %r10 movl $__NR_splice, %eax @@ -12,7 +10,7 @@ ENTRY(splice) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(splice) diff --git a/libc/arch-x86_64/syscalls/statfs64.S b/libc/arch-x86_64/syscalls/statfs64.S index 26c3d535f..16f6bdd6b 100644 --- a/libc/arch-x86_64/syscalls/statfs64.S +++ b/libc/arch-x86_64/syscalls/statfs64.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(statfs64) movl $__NR_statfs, %eax syscall @@ -11,7 +9,7 @@ ENTRY(statfs64) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(statfs64) diff --git a/libc/arch-x86_64/syscalls/swapoff.S b/libc/arch-x86_64/syscalls/swapoff.S index 1bf331c2b..df922a077 100644 --- a/libc/arch-x86_64/syscalls/swapoff.S +++ b/libc/arch-x86_64/syscalls/swapoff.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(swapoff) movl $__NR_swapoff, %eax syscall @@ -11,7 +9,7 @@ ENTRY(swapoff) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(swapoff) diff --git a/libc/arch-x86_64/syscalls/swapon.S b/libc/arch-x86_64/syscalls/swapon.S index 7405ccb9f..036b42213 100644 --- a/libc/arch-x86_64/syscalls/swapon.S +++ b/libc/arch-x86_64/syscalls/swapon.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(swapon) movl $__NR_swapon, %eax syscall @@ -11,7 +9,7 @@ ENTRY(swapon) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(swapon) diff --git a/libc/arch-x86_64/syscalls/symlinkat.S b/libc/arch-x86_64/syscalls/symlinkat.S index bea2da886..fdbced542 100644 --- a/libc/arch-x86_64/syscalls/symlinkat.S +++ b/libc/arch-x86_64/syscalls/symlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(symlinkat) movl $__NR_symlinkat, %eax syscall @@ -11,7 +9,7 @@ ENTRY(symlinkat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(symlinkat) diff --git a/libc/arch-x86_64/syscalls/sync.S b/libc/arch-x86_64/syscalls/sync.S index 97aa427e7..a4153fdab 100644 --- a/libc/arch-x86_64/syscalls/sync.S +++ b/libc/arch-x86_64/syscalls/sync.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sync) movl $__NR_sync, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sync) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sync) diff --git a/libc/arch-x86_64/syscalls/sysinfo.S b/libc/arch-x86_64/syscalls/sysinfo.S index de8fb8fb8..754ef61ec 100644 --- a/libc/arch-x86_64/syscalls/sysinfo.S +++ b/libc/arch-x86_64/syscalls/sysinfo.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(sysinfo) movl $__NR_sysinfo, %eax syscall @@ -11,7 +9,7 @@ ENTRY(sysinfo) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(sysinfo) diff --git a/libc/arch-x86_64/syscalls/tee.S b/libc/arch-x86_64/syscalls/tee.S index 41e2370c6..31d66dc84 100644 --- a/libc/arch-x86_64/syscalls/tee.S +++ b/libc/arch-x86_64/syscalls/tee.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(tee) movq %rcx, %r10 movl $__NR_tee, %eax @@ -12,7 +10,7 @@ ENTRY(tee) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(tee) diff --git a/libc/arch-x86_64/syscalls/tgkill.S b/libc/arch-x86_64/syscalls/tgkill.S index 00b2b42ee..9c46887ad 100644 --- a/libc/arch-x86_64/syscalls/tgkill.S +++ b/libc/arch-x86_64/syscalls/tgkill.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(tgkill) movl $__NR_tgkill, %eax syscall @@ -11,7 +9,7 @@ ENTRY(tgkill) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(tgkill) diff --git a/libc/arch-x86_64/syscalls/timerfd_create.S b/libc/arch-x86_64/syscalls/timerfd_create.S index eef3208f6..56b45e80b 100644 --- a/libc/arch-x86_64/syscalls/timerfd_create.S +++ b/libc/arch-x86_64/syscalls/timerfd_create.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_create) movl $__NR_timerfd_create, %eax syscall @@ -11,7 +9,7 @@ ENTRY(timerfd_create) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(timerfd_create) diff --git a/libc/arch-x86_64/syscalls/timerfd_gettime.S b/libc/arch-x86_64/syscalls/timerfd_gettime.S index 9f11c5af8..8c9b5d6ed 100644 --- a/libc/arch-x86_64/syscalls/timerfd_gettime.S +++ b/libc/arch-x86_64/syscalls/timerfd_gettime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_gettime) movl $__NR_timerfd_gettime, %eax syscall @@ -11,7 +9,7 @@ ENTRY(timerfd_gettime) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(timerfd_gettime) diff --git a/libc/arch-x86_64/syscalls/timerfd_settime.S b/libc/arch-x86_64/syscalls/timerfd_settime.S index 65a17e1ad..a524c0cbb 100644 --- a/libc/arch-x86_64/syscalls/timerfd_settime.S +++ b/libc/arch-x86_64/syscalls/timerfd_settime.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(timerfd_settime) movq %rcx, %r10 movl $__NR_timerfd_settime, %eax @@ -12,7 +10,7 @@ ENTRY(timerfd_settime) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(timerfd_settime) diff --git a/libc/arch-x86_64/syscalls/times.S b/libc/arch-x86_64/syscalls/times.S index 5ee21be78..89502bdce 100644 --- a/libc/arch-x86_64/syscalls/times.S +++ b/libc/arch-x86_64/syscalls/times.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(times) movl $__NR_times, %eax syscall @@ -11,7 +9,7 @@ ENTRY(times) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(times) diff --git a/libc/arch-x86_64/syscalls/truncate.S b/libc/arch-x86_64/syscalls/truncate.S index 2dc179306..2ecd05b6e 100644 --- a/libc/arch-x86_64/syscalls/truncate.S +++ b/libc/arch-x86_64/syscalls/truncate.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(truncate) movl $__NR_truncate, %eax syscall @@ -11,7 +9,7 @@ ENTRY(truncate) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(truncate) diff --git a/libc/arch-x86_64/syscalls/umask.S b/libc/arch-x86_64/syscalls/umask.S index ad102bd75..acd37e80d 100644 --- a/libc/arch-x86_64/syscalls/umask.S +++ b/libc/arch-x86_64/syscalls/umask.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(umask) movl $__NR_umask, %eax syscall @@ -11,7 +9,7 @@ ENTRY(umask) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(umask) diff --git a/libc/arch-x86_64/syscalls/umount2.S b/libc/arch-x86_64/syscalls/umount2.S index 31588de89..438aedb41 100644 --- a/libc/arch-x86_64/syscalls/umount2.S +++ b/libc/arch-x86_64/syscalls/umount2.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(umount2) movl $__NR_umount2, %eax syscall @@ -11,7 +9,7 @@ ENTRY(umount2) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(umount2) diff --git a/libc/arch-x86_64/syscalls/uname.S b/libc/arch-x86_64/syscalls/uname.S index ad2d8f456..6f077dfd2 100644 --- a/libc/arch-x86_64/syscalls/uname.S +++ b/libc/arch-x86_64/syscalls/uname.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(uname) movl $__NR_uname, %eax syscall @@ -11,7 +9,7 @@ ENTRY(uname) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(uname) diff --git a/libc/arch-x86_64/syscalls/unlinkat.S b/libc/arch-x86_64/syscalls/unlinkat.S index e6aac2e4a..80f0251dd 100644 --- a/libc/arch-x86_64/syscalls/unlinkat.S +++ b/libc/arch-x86_64/syscalls/unlinkat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(unlinkat) movl $__NR_unlinkat, %eax syscall @@ -11,7 +9,7 @@ ENTRY(unlinkat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(unlinkat) diff --git a/libc/arch-x86_64/syscalls/unshare.S b/libc/arch-x86_64/syscalls/unshare.S index 6594df025..8316d20f7 100644 --- a/libc/arch-x86_64/syscalls/unshare.S +++ b/libc/arch-x86_64/syscalls/unshare.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(unshare) movl $__NR_unshare, %eax syscall @@ -11,7 +9,7 @@ ENTRY(unshare) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(unshare) diff --git a/libc/arch-x86_64/syscalls/utimensat.S b/libc/arch-x86_64/syscalls/utimensat.S index 5eaac1b55..3e438261c 100644 --- a/libc/arch-x86_64/syscalls/utimensat.S +++ b/libc/arch-x86_64/syscalls/utimensat.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(utimensat) movq %rcx, %r10 movl $__NR_utimensat, %eax @@ -12,7 +10,7 @@ ENTRY(utimensat) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(utimensat) diff --git a/libc/arch-x86_64/syscalls/vmsplice.S b/libc/arch-x86_64/syscalls/vmsplice.S index 6f9e5d1b5..df775c6a0 100644 --- a/libc/arch-x86_64/syscalls/vmsplice.S +++ b/libc/arch-x86_64/syscalls/vmsplice.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(vmsplice) movq %rcx, %r10 movl $__NR_vmsplice, %eax @@ -12,7 +10,7 @@ ENTRY(vmsplice) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(vmsplice) diff --git a/libc/arch-x86_64/syscalls/wait4.S b/libc/arch-x86_64/syscalls/wait4.S index 141fe19fc..d392dc7dd 100644 --- a/libc/arch-x86_64/syscalls/wait4.S +++ b/libc/arch-x86_64/syscalls/wait4.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(wait4) movq %rcx, %r10 movl $__NR_wait4, %eax @@ -12,7 +10,7 @@ ENTRY(wait4) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(wait4) diff --git a/libc/arch-x86_64/syscalls/write.S b/libc/arch-x86_64/syscalls/write.S index 498fca71c..145c7930e 100644 --- a/libc/arch-x86_64/syscalls/write.S +++ b/libc/arch-x86_64/syscalls/write.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(write) movl $__NR_write, %eax syscall @@ -11,7 +9,7 @@ ENTRY(write) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(write) diff --git a/libc/arch-x86_64/syscalls/writev.S b/libc/arch-x86_64/syscalls/writev.S index ef80eb898..8f8956f22 100644 --- a/libc/arch-x86_64/syscalls/writev.S +++ b/libc/arch-x86_64/syscalls/writev.S @@ -2,8 +2,6 @@ #include - .hidden __set_errno - ENTRY(writev) movl $__NR_writev, %eax syscall @@ -11,7 +9,7 @@ ENTRY(writev) jb 1f negl %eax movl %eax, %edi - call __set_errno + call __set_errno_internal 1: ret END(writev) diff --git a/libc/bionic/__set_errno.cpp b/libc/bionic/__set_errno.cpp index 236aeacee..30df350ea 100644 --- a/libc/bionic/__set_errno.cpp +++ b/libc/bionic/__set_errno.cpp @@ -36,14 +36,20 @@ // system these are the same size, but on a 64-bit system they're not. // 'long' gives us 32-bit on 32-bit systems, 64-bit on 64-bit systems. -#if __LP64__ -extern "C" __LIBC_HIDDEN__ long __set_errno(int); -#else // __set_errno was mistakenly exposed in in the 32-bit NDK. -extern "C" long __set_errno(int); -#endif +// We need the extra level of indirection so that the .hidden directives +// in the system call stubs don't cause __set_errno to be hidden, breaking +// old NDK apps. -long __set_errno(int n) { +// This one is for internal use only and used by both LP32 and LP64 assembler. +extern "C" __LIBC_HIDDEN__ long __set_errno_internal(int n) { errno = n; return -1; } + +// This one exists for the LP32 NDK and is not present at all in LP64. +#if !defined(__LP64__) +extern "C" long __set_errno(int n) { + return __set_errno_internal(n); +} +#endif diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py index 316e05b03..e8ec63662 100755 --- a/libc/tools/gensyscalls.py +++ b/libc/tools/gensyscalls.py @@ -43,8 +43,6 @@ syscall_stub_header = "/* " + warning + " */\n" + \ """ #include - .hidden __set_errno - ENTRY(%(func)s) """ @@ -67,7 +65,7 @@ arm_eabi_call_default = syscall_stub_header + """\ cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(%(func)s) """ @@ -87,7 +85,7 @@ arm_eabi_call_long = syscall_stub_header + """\ cmn r0, #(MAX_ERRNO + 1) bxls lr neg r0, r0 - b __set_errno + b __set_errno_internal END(%(func)s) """ @@ -102,7 +100,7 @@ arm64_call = syscall_stub_header + """\ cmn x0, #(MAX_ERRNO + 1) cneg x0, x0, hi - b.hi __set_errno + b.hi __set_errno_internal ret END(%(func)s) @@ -123,7 +121,7 @@ mips_call = syscall_stub_header + """\ j ra nop 1: - la t9,__set_errno + la t9,__set_errno_internal j t9 nop .set reorder @@ -150,7 +148,7 @@ mips64_call = syscall_stub_header + """\ nop 2: .cpsetup ra, t1, 2b - LA t9,__set_errno + LA t9,__set_errno_internal .cpreturn j t9 move ra, t0 @@ -172,7 +170,7 @@ x86_call = """\ jb 1f negl %%eax pushl %%eax - call __set_errno + call __set_errno_internal addl $4, %%esp 1: """ @@ -194,7 +192,7 @@ x86_64_call = """\ jb 1f negl %%eax movl %%eax, %%edi - call __set_errno + call __set_errno_internal 1: ret END(%(func)s) From 33a73bfa0712c483830e4c9abbf4d6a0551478bf Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Mon, 8 Sep 2014 18:09:43 +0900 Subject: [PATCH 130/148] When comparing DNS server configs, also compare number of servers Bug: 16070602 Change-Id: I605f1cca50b08479ebcad290b3bd179f59be8a96 --- libc/dns/resolv/res_cache.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libc/dns/resolv/res_cache.c b/libc/dns/resolv/res_cache.c index 419b748d4..d68ec3bb0 100644 --- a/libc/dns/resolv/res_cache.c +++ b/libc/dns/resolv/res_cache.c @@ -1999,10 +1999,25 @@ _resolv_is_nameservers_equal_locked(struct resolv_cache_info* cache_info, { int i; char** ns; + int currentservers; int equal = 1; - // compare each name server against current name servers if (numservers > MAXNS) numservers = MAXNS; + + // Find out how many nameservers we had before. + currentservers = 0; + for (ns = cache_info->nameservers; *ns; ns++) + currentservers++; + + if (currentservers != numservers) + return 0; + + // Compare each name server against current name servers. + // TODO: this is incorrect if the list of current or previous nameservers + // contains duplicates. This does not really matter because the framework + // filters out duplicates, but we should probably fix it. It's also + // insensitive to the order of the nameservers; we should probably fix that + // too. for (i = 0; i < numservers && equal; i++) { ns = cache_info->nameservers; equal = 0; From 00008263782e484020420c606f7d145fe7d0a4d8 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 10 Sep 2014 17:39:00 -0700 Subject: [PATCH 131/148] Add posix_fadvise(3). Bug: 12449798 Change-Id: I07cbf3f670a0d1304b68148325a774f266b5c433 --- libc/Android.mk | 1 + libc/SYSCALLS.TXT | 6 +++ libc/arch-arm/syscalls/__arm_fadvise64_64.S | 22 +++++++++ libc/arch-arm64/syscalls/__fadvise64.S | 15 ++++++ libc/arch-mips/syscalls/__fadvise64.S | 19 ++++++++ libc/arch-mips64/syscalls/__fadvise64.S | 26 +++++++++++ libc/arch-x86/syscalls/__fadvise64.S | 46 +++++++++++++++++++ libc/arch-x86_64/syscalls/__fadvise64.S | 17 +++++++ libc/bionic/posix_fadvise.cpp | 51 +++++++++++++++++++++ libc/include/fcntl.h | 2 + tests/fcntl_test.cpp | 25 +++++++++- 11 files changed, 228 insertions(+), 2 deletions(-) create mode 100644 libc/arch-arm/syscalls/__arm_fadvise64_64.S create mode 100644 libc/arch-arm64/syscalls/__fadvise64.S create mode 100644 libc/arch-mips/syscalls/__fadvise64.S create mode 100644 libc/arch-mips64/syscalls/__fadvise64.S create mode 100644 libc/arch-x86/syscalls/__fadvise64.S create mode 100644 libc/arch-x86_64/syscalls/__fadvise64.S create mode 100644 libc/bionic/posix_fadvise.cpp diff --git a/libc/Android.mk b/libc/Android.mk index 50981718d..fd7c54f8e 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -144,6 +144,7 @@ libc_bionic_src_files := \ bionic/pause.cpp \ bionic/pipe.cpp \ bionic/poll.cpp \ + bionic/posix_fadvise.cpp \ bionic/posix_fallocate.cpp \ bionic/posix_timers.cpp \ bionic/pthread_atfork.cpp \ diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index 38ae8310a..3e380bdce 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -167,6 +167,12 @@ void* mmap|mmap64(void*, size_t, int, int, int, off_t) arm64,mips64,x86_64 int fallocate64:fallocate(int, int, off64_t, off64_t) arm,mips,x86 int fallocate|fallocate64(int, int, off_t, off_t) arm64,mips64,x86_64 +# posix_fadvise64 is awkward: arm has shuffled arguments, +# the POSIX functions don't set errno, and no architecture has posix_fadvise. +int __arm_fadvise64_64:arm_fadvise64_64(int, int, off64_t, off64_t) arm +int __fadvise64:fadvise64_64(int, off64_t, off64_t, int) mips,x86 +int __fadvise64:fadvise64(int, off64_t, off64_t, int) arm64,mips64,x86_64 + int __fstatfs64:fstatfs64(int, size_t, struct statfs*) arm,mips,x86 int fstatfs64|fstatfs:fstatfs(int, struct statfs*) arm64,mips64,x86_64 int __statfs64:statfs64(const char*, size_t, struct statfs*) arm,mips,x86 diff --git a/libc/arch-arm/syscalls/__arm_fadvise64_64.S b/libc/arch-arm/syscalls/__arm_fadvise64_64.S new file mode 100644 index 000000000..761c4d6ee --- /dev/null +++ b/libc/arch-arm/syscalls/__arm_fadvise64_64.S @@ -0,0 +1,22 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(__arm_fadvise64_64) + mov ip, sp + stmfd sp!, {r4, r5, r6, r7} + .cfi_def_cfa_offset 16 + .cfi_rel_offset r4, 0 + .cfi_rel_offset r5, 4 + .cfi_rel_offset r6, 8 + .cfi_rel_offset r7, 12 + ldmfd ip, {r4, r5, r6} + ldr r7, =__NR_arm_fadvise64_64 + swi #0 + ldmfd sp!, {r4, r5, r6, r7} + .cfi_def_cfa_offset 0 + cmn r0, #(MAX_ERRNO + 1) + bxls lr + neg r0, r0 + b __set_errno_internal +END(__arm_fadvise64_64) diff --git a/libc/arch-arm64/syscalls/__fadvise64.S b/libc/arch-arm64/syscalls/__fadvise64.S new file mode 100644 index 000000000..695d09438 --- /dev/null +++ b/libc/arch-arm64/syscalls/__fadvise64.S @@ -0,0 +1,15 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(__fadvise64) + mov x8, __NR_fadvise64 + svc #0 + + cmn x0, #(MAX_ERRNO + 1) + cneg x0, x0, hi + b.hi __set_errno_internal + + ret +END(__fadvise64) +.hidden __fadvise64 diff --git a/libc/arch-mips/syscalls/__fadvise64.S b/libc/arch-mips/syscalls/__fadvise64.S new file mode 100644 index 000000000..6d494a169 --- /dev/null +++ b/libc/arch-mips/syscalls/__fadvise64.S @@ -0,0 +1,19 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(__fadvise64) + .set noreorder + .cpload t9 + li v0, __NR_fadvise64_64 + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + la t9,__set_errno_internal + j t9 + nop + .set reorder +END(__fadvise64) diff --git a/libc/arch-mips64/syscalls/__fadvise64.S b/libc/arch-mips64/syscalls/__fadvise64.S new file mode 100644 index 000000000..90aceb08d --- /dev/null +++ b/libc/arch-mips64/syscalls/__fadvise64.S @@ -0,0 +1,26 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(__fadvise64) + .set push + .set noreorder + li v0, __NR_fadvise64 + syscall + bnez a3, 1f + move a0, v0 + j ra + nop +1: + move t0, ra + bal 2f + nop +2: + .cpsetup ra, t1, 2b + LA t9,__set_errno_internal + .cpreturn + j t9 + move ra, t0 + .set pop +END(__fadvise64) +.hidden __fadvise64 diff --git a/libc/arch-x86/syscalls/__fadvise64.S b/libc/arch-x86/syscalls/__fadvise64.S new file mode 100644 index 000000000..6e4298a17 --- /dev/null +++ b/libc/arch-x86/syscalls/__fadvise64.S @@ -0,0 +1,46 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(__fadvise64) + pushl %ebx + .cfi_def_cfa_offset 8 + .cfi_rel_offset ebx, 0 + pushl %ecx + .cfi_adjust_cfa_offset 4 + .cfi_rel_offset ecx, 0 + pushl %edx + .cfi_adjust_cfa_offset 4 + .cfi_rel_offset edx, 0 + pushl %esi + .cfi_adjust_cfa_offset 4 + .cfi_rel_offset esi, 0 + pushl %edi + .cfi_adjust_cfa_offset 4 + .cfi_rel_offset edi, 0 + pushl %ebp + .cfi_adjust_cfa_offset 4 + .cfi_rel_offset ebp, 0 + mov 28(%esp), %ebx + mov 32(%esp), %ecx + mov 36(%esp), %edx + mov 40(%esp), %esi + mov 44(%esp), %edi + mov 48(%esp), %ebp + movl $__NR_fadvise64_64, %eax + int $0x80 + cmpl $-MAX_ERRNO, %eax + jb 1f + negl %eax + pushl %eax + call __set_errno_internal + addl $4, %esp +1: + popl %ebp + popl %edi + popl %esi + popl %edx + popl %ecx + popl %ebx + ret +END(__fadvise64) diff --git a/libc/arch-x86_64/syscalls/__fadvise64.S b/libc/arch-x86_64/syscalls/__fadvise64.S new file mode 100644 index 000000000..8810d88d1 --- /dev/null +++ b/libc/arch-x86_64/syscalls/__fadvise64.S @@ -0,0 +1,17 @@ +/* Generated by gensyscalls.py. Do not edit. */ + +#include + +ENTRY(__fadvise64) + movq %rcx, %r10 + movl $__NR_fadvise64, %eax + syscall + cmpq $-MAX_ERRNO, %rax + jb 1f + negl %eax + movl %eax, %edi + call __set_errno_internal +1: + ret +END(__fadvise64) +.hidden __fadvise64 diff --git a/libc/bionic/posix_fadvise.cpp b/libc/bionic/posix_fadvise.cpp new file mode 100644 index 000000000..3a74af363 --- /dev/null +++ b/libc/bionic/posix_fadvise.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include "private/ErrnoRestorer.h" + +extern "C" int __arm_fadvise64_64(int, int, off64_t, off64_t); +extern "C" int __fadvise64(int, off64_t, off64_t, int); + +// No architecture actually has the 32-bit off_t system call. +int posix_fadvise(int fd, off_t offset, off_t length, int advice) { + return posix_fadvise64(fd, offset, length, advice); +} + +#if defined(__arm__) +int posix_fadvise64(int fd, off64_t offset, off64_t length, int advice) { + ErrnoRestorer errno_restorer; + return (__arm_fadvise64_64(fd, advice, offset, length) == 0) ? 0 : errno; +} +#else +int posix_fadvise64(int fd, off64_t offset, off64_t length, int advice) { + ErrnoRestorer errno_restorer; + return (__fadvise64(fd, offset, length, advice) == 0) ? 0 : errno; +} +#endif diff --git a/libc/include/fcntl.h b/libc/include/fcntl.h index 4450bb65f..8f89afbb4 100644 --- a/libc/include/fcntl.h +++ b/libc/include/fcntl.h @@ -72,6 +72,8 @@ extern int openat(int, const char*, int, ...); extern int openat64(int, const char*, int, ...); extern int open(const char*, int, ...); extern int open64(const char*, int, ...); +extern int posix_fadvise64(int, off64_t, off64_t, int); +extern int posix_fadvise(int, off_t, off_t, int); extern int posix_fallocate64(int, off64_t, off64_t); extern int posix_fallocate(int, off_t, off_t); extern ssize_t splice(int, off64_t*, int, off64_t*, size_t, unsigned int); diff --git a/tests/fcntl_test.cpp b/tests/fcntl_test.cpp index 5f2029569..3fd0a8cfb 100644 --- a/tests/fcntl_test.cpp +++ b/tests/fcntl_test.cpp @@ -70,10 +70,32 @@ TEST(fcntl, creat_creat64) { ASSERT_EQ(ENOENT, errno); } +TEST(fcntl, posix_fadvise) { + TemporaryFile tf; + errno = 0; + + EXPECT_EQ(EBADF, posix_fadvise(-1, 0, 0, POSIX_FADV_NORMAL)); + EXPECT_EQ(0, errno); + + EXPECT_EQ(EBADF, posix_fadvise64(-1, 0, 0, POSIX_FADV_NORMAL)); + EXPECT_EQ(0, errno); + + EXPECT_EQ(EINVAL, posix_fadvise(tf.fd, 0, 0, -1)); + EXPECT_EQ(0, errno); + + EXPECT_EQ(EINVAL, posix_fadvise64(tf.fd, 0, 0, -1)); + EXPECT_EQ(0, errno); + + EXPECT_EQ(0, posix_fadvise(tf.fd, 0, 0, POSIX_FADV_NORMAL)); + EXPECT_EQ(0, posix_fadvise64(tf.fd, 0, 0, POSIX_FADV_NORMAL)); +} + TEST(fcntl, fallocate_EINVAL) { TemporaryFile tf; -#if defined(__BIONIC__) + // fallocate/fallocate64 set errno. + // posix_fallocate/posix_fallocate64 return an errno value. + errno = 0; ASSERT_EQ(-1, fallocate(tf.fd, 0, 0, -1)); ASSERT_EQ(EINVAL, errno); @@ -81,7 +103,6 @@ TEST(fcntl, fallocate_EINVAL) { errno = 0; ASSERT_EQ(-1, fallocate64(tf.fd, 0, 0, -1)); ASSERT_EQ(EINVAL, errno); -#endif errno = 0; ASSERT_EQ(EINVAL, posix_fallocate(tf.fd, 0, -1)); From 9e833bf0cf2c5bc0e6b65e4d96aa4f2b33113771 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 11 Sep 2014 10:10:08 -0700 Subject: [PATCH 132/148] Fix mips __fadvise64.S build failure. Bug: 12449798 (cherry picked from commit 9990b3973bdfcda5419c06886215147a878222f1) Change-Id: Iba92e2aa262666a59fc38b870dfd9f4082eeb628 --- libc/SYSCALLS.TXT | 4 ++-- libc/arch-mips/syscalls/__fadvise64.S | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT index 3e380bdce..c3b7bab89 100644 --- a/libc/SYSCALLS.TXT +++ b/libc/SYSCALLS.TXT @@ -170,8 +170,8 @@ int fallocate|fallocate64(int, int, off_t, off_t) arm64,mips64,x86_64 # posix_fadvise64 is awkward: arm has shuffled arguments, # the POSIX functions don't set errno, and no architecture has posix_fadvise. int __arm_fadvise64_64:arm_fadvise64_64(int, int, off64_t, off64_t) arm -int __fadvise64:fadvise64_64(int, off64_t, off64_t, int) mips,x86 -int __fadvise64:fadvise64(int, off64_t, off64_t, int) arm64,mips64,x86_64 +int __fadvise64:fadvise64_64(int, off64_t, off64_t, int) x86 +int __fadvise64:fadvise64(int, off64_t, off64_t, int) arm64,mips,mips64,x86_64 int __fstatfs64:fstatfs64(int, size_t, struct statfs*) arm,mips,x86 int fstatfs64|fstatfs:fstatfs(int, struct statfs*) arm64,mips64,x86_64 diff --git a/libc/arch-mips/syscalls/__fadvise64.S b/libc/arch-mips/syscalls/__fadvise64.S index 6d494a169..abacbb2b7 100644 --- a/libc/arch-mips/syscalls/__fadvise64.S +++ b/libc/arch-mips/syscalls/__fadvise64.S @@ -5,7 +5,7 @@ ENTRY(__fadvise64) .set noreorder .cpload t9 - li v0, __NR_fadvise64_64 + li v0, __NR_fadvise64 syscall bnez a3, 1f move a0, v0 From 27efc48814b8153c55cbcd0af5d9add824816e69 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 11 Sep 2014 16:11:43 -0700 Subject: [PATCH 133/148] Add pthread_gettid_np and re-expose __get_thread for LP32. A lot of third-party code calls the private __get_thread symbol, often as part of a backport of bionic's pthread_rwlock implementation. Hopefully this will go away for LP64 (since you're guaranteed the real implementation there), but there are still APIs that take a tid and no way to convert between a pthread_t and a tid. pthread_gettid_np is a public API for that. To aid the transition, make __get_thread available again for LP32. Bug: 14079438 Change-Id: I43fabc7f1918250d31d4665ffa4ca352d0dbeac1 --- libc/Android.mk | 1 + libc/bionic/posix_timers.cpp | 3 +-- libc/bionic/pthread_gettid_np.cpp | 39 +++++++++++++++++++++++++++++++ libc/bionic/pthread_internal.h | 4 +++- libc/bionic/pthread_internals.cpp | 5 ---- libc/include/pthread.h | 2 ++ 6 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 libc/bionic/pthread_gettid_np.cpp diff --git a/libc/Android.mk b/libc/Android.mk index fd7c54f8e..9c5e785ae 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -156,6 +156,7 @@ libc_bionic_src_files := \ bionic/pthread_exit.cpp \ bionic/pthread_getcpuclockid.cpp \ bionic/pthread_getschedparam.cpp \ + bionic/pthread_gettid_np.cpp \ bionic/pthread_internals.cpp \ bionic/pthread_join.cpp \ bionic/pthread_key.cpp \ diff --git a/libc/bionic/posix_timers.cpp b/libc/bionic/posix_timers.cpp index 312bf9e59..7ad0ef1fb 100644 --- a/libc/bionic/posix_timers.cpp +++ b/libc/bionic/posix_timers.cpp @@ -28,7 +28,6 @@ #include "pthread_internal.h" #include "private/bionic_futex.h" -#include "private/bionic_pthread.h" #include "private/kernel_sigset_t.h" #include @@ -159,7 +158,7 @@ int timer_create(clockid_t clock_id, sigevent* evp, timer_t* timer_id) { sigevent se = *evp; se.sigev_signo = TIMER_SIGNAL; se.sigev_notify = SIGEV_THREAD_ID; - se.sigev_notify_thread_id = __pthread_gettid(timer->callback_thread); + se.sigev_notify_thread_id = pthread_gettid_np(timer->callback_thread); if (__timer_create(clock_id, &se, &timer->kernel_timer_id) == -1) { __timer_thread_stop(timer); return -1; diff --git a/libc/bionic/pthread_gettid_np.cpp b/libc/bionic/pthread_gettid_np.cpp new file mode 100644 index 000000000..f4663a739 --- /dev/null +++ b/libc/bionic/pthread_gettid_np.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "pthread_internal.h" +#include "private/bionic_pthread.h" + +pid_t pthread_gettid_np(pthread_t t) { + return reinterpret_cast(t)->tid; +} + +// TODO: move callers over to pthread_gettid_np and remove this. +pid_t __pthread_gettid(pthread_t t) { + return pthread_gettid_np(t); +} diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h index 7bcd758d1..a5b300220 100644 --- a/libc/bionic/pthread_internal.h +++ b/libc/bionic/pthread_internal.h @@ -98,7 +98,9 @@ __LIBC_HIDDEN__ int __init_thread(pthread_internal_t* thread, bool add_to_thread __LIBC_HIDDEN__ void __init_tls(pthread_internal_t* thread); __LIBC_HIDDEN__ void __init_alternate_signal_stack(pthread_internal_t*); __LIBC_HIDDEN__ void _pthread_internal_add(pthread_internal_t* thread); -__LIBC_HIDDEN__ pthread_internal_t* __get_thread(void); + +/* Various third-party apps contain a backport of our pthread_rwlock implementation that uses this. */ +extern "C" __LIBC64_HIDDEN__ pthread_internal_t* __get_thread(void); __LIBC_HIDDEN__ void pthread_key_clean_all(void); __LIBC_HIDDEN__ void _pthread_internal_remove_locked(pthread_internal_t* thread); diff --git a/libc/bionic/pthread_internals.cpp b/libc/bionic/pthread_internals.cpp index 8c5d9c7e9..4c08ba87b 100644 --- a/libc/bionic/pthread_internals.cpp +++ b/libc/bionic/pthread_internals.cpp @@ -29,7 +29,6 @@ #include "pthread_internal.h" #include "private/bionic_futex.h" -#include "private/bionic_pthread.h" #include "private/bionic_tls.h" #include "private/ScopedPthreadMutexLocker.h" @@ -69,10 +68,6 @@ pthread_internal_t* __get_thread(void) { return reinterpret_cast(__get_tls()[TLS_SLOT_THREAD_ID]); } -pid_t __pthread_gettid(pthread_t t) { - return reinterpret_cast(t)->tid; -} - // Initialize 'ts' with the difference between 'abstime' and the current time // according to 'clock'. Returns -1 if abstime already expired, or 0 otherwise. int __timespec_from_absolute(timespec* ts, const timespec* abstime, clockid_t clock) { diff --git a/libc/include/pthread.h b/libc/include/pthread.h index 29caafc6d..86a10051e 100644 --- a/libc/include/pthread.h +++ b/libc/include/pthread.h @@ -188,6 +188,8 @@ int pthread_getschedparam(pthread_t, int*, struct sched_param*) __nonnull((2, 3) void* pthread_getspecific(pthread_key_t); +pid_t pthread_gettid_np(pthread_t); + int pthread_join(pthread_t, void**); int pthread_key_create(pthread_key_t*, void (*)(void*)) __nonnull((1)); From 7e00b44e80d6e38b8ab86d0ebc86b666c0ac2ef6 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 11 Sep 2014 16:41:11 -0700 Subject: [PATCH 134/148] Expose __swsetup for LP32 binary compatibility. Bug: 17476127 Change-Id: I0ef1355ac913d782c268a638f88642d6cfc236c2 --- libc/stdio/local.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/libc/stdio/local.h b/libc/stdio/local.h index 4511a71da..d777deccb 100644 --- a/libc/stdio/local.h +++ b/libc/stdio/local.h @@ -41,20 +41,17 @@ #include "wcio.h" #include "fileext.h" -#if defined(__LP64__) /* * Android <= KitKat had getc/putc macros in that referred * to __srget/__swbuf, so those symbols need to be public for LP32 * but can be hidden for LP64. */ -__LIBC_HIDDEN__ int __srget(FILE*); -__LIBC_HIDDEN__ int __swbuf(int, FILE*); -__LIBC_HIDDEN__ int __srefill(FILE*); -#else -__LIBC_ABI_PUBLIC__ int __srget(FILE*); -__LIBC_ABI_PUBLIC__ int __swbuf(int, FILE*); -__LIBC_ABI_PUBLIC__ int __srefill(FILE*); -#endif +__LIBC64_HIDDEN__ int __srget(FILE*); +__LIBC64_HIDDEN__ int __swbuf(int, FILE*); +__LIBC64_HIDDEN__ int __srefill(FILE*); + +/* This was referenced by the apportable middleware for LP32. */ +__LIBC64_HIDDEN__ int __swsetup(FILE*); #pragma GCC visibility push(hidden) @@ -70,7 +67,6 @@ void _cleanup(void); void __smakebuf(FILE *); int __swhatbuf(FILE *, size_t *, int *); int _fwalk(int (*)(FILE *)); -int __swsetup(FILE *); int __sflags(const char *, int *); wint_t __fgetwc_unlock(FILE *); wint_t __ungetwc(wint_t, FILE *); From 027d2717d067c3706f22bf84dc1226ede7c1566d Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Sun, 14 Sep 2014 12:08:37 -0700 Subject: [PATCH 135/148] Pull input.h from v3.16.1 kernel headers. Bug: 17407564 Change-Id: Idcfc40a7254605280e3d5474c61ae1ab7b2b7b51 --- libc/kernel/uapi/linux/input.h | 263 +++++++++++++++++---------------- 1 file changed, 139 insertions(+), 124 deletions(-) diff --git a/libc/kernel/uapi/linux/input.h b/libc/kernel/uapi/linux/input.h index df3200c03..b9d5b2a7d 100644 --- a/libc/kernel/uapi/linux/input.h +++ b/libc/kernel/uapi/linux/input.h @@ -97,629 +97,644 @@ struct input_keymap_entry { #define INPUT_PROP_BUTTONPAD 0x02 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define INPUT_PROP_SEMI_MT 0x03 +#define INPUT_PROP_TOPBUTTONPAD 0x04 #define INPUT_PROP_MAX 0x1f #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) -#define EV_SYN 0x00 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EV_SYN 0x00 #define EV_KEY 0x01 #define EV_REL 0x02 #define EV_ABS 0x03 -#define EV_MSC 0x04 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EV_MSC 0x04 #define EV_SW 0x05 #define EV_LED 0x11 #define EV_SND 0x12 -#define EV_REP 0x14 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EV_REP 0x14 #define EV_FF 0x15 #define EV_PWR 0x16 #define EV_FF_STATUS 0x17 -#define EV_MAX 0x1f /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define EV_MAX 0x1f #define EV_CNT (EV_MAX+1) #define SYN_REPORT 0 #define SYN_CONFIG 1 -#define SYN_MT_REPORT 2 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define SYN_MT_REPORT 2 #define SYN_DROPPED 3 #define SYN_MAX 0xf #define SYN_CNT (SYN_MAX+1) -#define KEY_RESERVED 0 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_RESERVED 0 #define KEY_ESC 1 #define KEY_1 2 #define KEY_2 3 -#define KEY_3 4 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_3 4 #define KEY_4 5 #define KEY_5 6 #define KEY_6 7 -#define KEY_7 8 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_7 8 #define KEY_8 9 #define KEY_9 10 #define KEY_0 11 -#define KEY_MINUS 12 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_MINUS 12 #define KEY_EQUAL 13 #define KEY_BACKSPACE 14 #define KEY_TAB 15 -#define KEY_Q 16 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_Q 16 #define KEY_W 17 #define KEY_E 18 #define KEY_R 19 -#define KEY_T 20 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_T 20 #define KEY_Y 21 #define KEY_U 22 #define KEY_I 23 -#define KEY_O 24 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_O 24 #define KEY_P 25 #define KEY_LEFTBRACE 26 #define KEY_RIGHTBRACE 27 -#define KEY_ENTER 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_ENTER 28 #define KEY_LEFTCTRL 29 #define KEY_A 30 #define KEY_S 31 -#define KEY_D 32 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_D 32 #define KEY_F 33 #define KEY_G 34 #define KEY_H 35 -#define KEY_J 36 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_J 36 #define KEY_K 37 #define KEY_L 38 #define KEY_SEMICOLON 39 -#define KEY_APOSTROPHE 40 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_APOSTROPHE 40 #define KEY_GRAVE 41 #define KEY_LEFTSHIFT 42 #define KEY_BACKSLASH 43 -#define KEY_Z 44 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_Z 44 #define KEY_X 45 #define KEY_C 46 #define KEY_V 47 -#define KEY_B 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_B 48 #define KEY_N 49 #define KEY_M 50 #define KEY_COMMA 51 -#define KEY_DOT 52 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_DOT 52 #define KEY_SLASH 53 #define KEY_RIGHTSHIFT 54 #define KEY_KPASTERISK 55 -#define KEY_LEFTALT 56 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_LEFTALT 56 #define KEY_SPACE 57 #define KEY_CAPSLOCK 58 #define KEY_F1 59 -#define KEY_F2 60 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_F2 60 #define KEY_F3 61 #define KEY_F4 62 #define KEY_F5 63 -#define KEY_F6 64 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_F6 64 #define KEY_F7 65 #define KEY_F8 66 #define KEY_F9 67 -#define KEY_F10 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_F10 68 #define KEY_NUMLOCK 69 #define KEY_SCROLLLOCK 70 #define KEY_KP7 71 -#define KEY_KP8 72 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_KP8 72 #define KEY_KP9 73 #define KEY_KPMINUS 74 #define KEY_KP4 75 -#define KEY_KP5 76 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_KP5 76 #define KEY_KP6 77 #define KEY_KPPLUS 78 #define KEY_KP1 79 -#define KEY_KP2 80 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_KP2 80 #define KEY_KP3 81 #define KEY_KP0 82 #define KEY_KPDOT 83 -#define KEY_ZENKAKUHANKAKU 85 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_ZENKAKUHANKAKU 85 #define KEY_102ND 86 #define KEY_F11 87 #define KEY_F12 88 -#define KEY_RO 89 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_RO 89 #define KEY_KATAKANA 90 #define KEY_HIRAGANA 91 #define KEY_HENKAN 92 -#define KEY_KATAKANAHIRAGANA 93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_KATAKANAHIRAGANA 93 #define KEY_MUHENKAN 94 #define KEY_KPJPCOMMA 95 #define KEY_KPENTER 96 -#define KEY_RIGHTCTRL 97 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_RIGHTCTRL 97 #define KEY_KPSLASH 98 #define KEY_SYSRQ 99 #define KEY_RIGHTALT 100 -#define KEY_LINEFEED 101 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_LINEFEED 101 #define KEY_HOME 102 #define KEY_UP 103 #define KEY_PAGEUP 104 -#define KEY_LEFT 105 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_LEFT 105 #define KEY_RIGHT 106 #define KEY_END 107 #define KEY_DOWN 108 -#define KEY_PAGEDOWN 109 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_PAGEDOWN 109 #define KEY_INSERT 110 #define KEY_DELETE 111 #define KEY_MACRO 112 -#define KEY_MUTE 113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_MUTE 113 #define KEY_VOLUMEDOWN 114 #define KEY_VOLUMEUP 115 #define KEY_POWER 116 -#define KEY_KPEQUAL 117 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_KPEQUAL 117 #define KEY_KPPLUSMINUS 118 #define KEY_PAUSE 119 #define KEY_SCALE 120 -#define KEY_KPCOMMA 121 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_KPCOMMA 121 #define KEY_HANGEUL 122 #define KEY_HANGUEL KEY_HANGEUL #define KEY_HANJA 123 -#define KEY_YEN 124 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_YEN 124 #define KEY_LEFTMETA 125 #define KEY_RIGHTMETA 126 #define KEY_COMPOSE 127 -#define KEY_STOP 128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_STOP 128 #define KEY_AGAIN 129 #define KEY_PROPS 130 #define KEY_UNDO 131 -#define KEY_FRONT 132 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_FRONT 132 #define KEY_COPY 133 #define KEY_OPEN 134 #define KEY_PASTE 135 -#define KEY_FIND 136 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_FIND 136 #define KEY_CUT 137 #define KEY_HELP 138 #define KEY_MENU 139 -#define KEY_CALC 140 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_CALC 140 #define KEY_SETUP 141 #define KEY_SLEEP 142 #define KEY_WAKEUP 143 -#define KEY_FILE 144 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_FILE 144 #define KEY_SENDFILE 145 #define KEY_DELETEFILE 146 #define KEY_XFER 147 -#define KEY_PROG1 148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_PROG1 148 #define KEY_PROG2 149 #define KEY_WWW 150 #define KEY_MSDOS 151 -#define KEY_COFFEE 152 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_COFFEE 152 #define KEY_SCREENLOCK KEY_COFFEE #define KEY_DIRECTION 153 #define KEY_CYCLEWINDOWS 154 -#define KEY_MAIL 155 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_MAIL 155 #define KEY_BOOKMARKS 156 #define KEY_COMPUTER 157 #define KEY_BACK 158 -#define KEY_FORWARD 159 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_FORWARD 159 #define KEY_CLOSECD 160 #define KEY_EJECTCD 161 #define KEY_EJECTCLOSECD 162 -#define KEY_NEXTSONG 163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_NEXTSONG 163 #define KEY_PLAYPAUSE 164 #define KEY_PREVIOUSSONG 165 #define KEY_STOPCD 166 -#define KEY_RECORD 167 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_RECORD 167 #define KEY_REWIND 168 #define KEY_PHONE 169 #define KEY_ISO 170 -#define KEY_CONFIG 171 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_CONFIG 171 #define KEY_HOMEPAGE 172 #define KEY_REFRESH 173 #define KEY_EXIT 174 -#define KEY_MOVE 175 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_MOVE 175 #define KEY_EDIT 176 #define KEY_SCROLLUP 177 #define KEY_SCROLLDOWN 178 -#define KEY_KPLEFTPAREN 179 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_KPLEFTPAREN 179 #define KEY_KPRIGHTPAREN 180 #define KEY_NEW 181 #define KEY_REDO 182 -#define KEY_F13 183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_F13 183 #define KEY_F14 184 #define KEY_F15 185 #define KEY_F16 186 -#define KEY_F17 187 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_F17 187 #define KEY_F18 188 #define KEY_F19 189 #define KEY_F20 190 -#define KEY_F21 191 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_F21 191 #define KEY_F22 192 #define KEY_F23 193 #define KEY_F24 194 -#define KEY_PLAYCD 200 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_PLAYCD 200 #define KEY_PAUSECD 201 #define KEY_PROG3 202 #define KEY_PROG4 203 -#define KEY_DASHBOARD 204 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_DASHBOARD 204 #define KEY_SUSPEND 205 #define KEY_CLOSE 206 #define KEY_PLAY 207 -#define KEY_FASTFORWARD 208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_FASTFORWARD 208 #define KEY_BASSBOOST 209 #define KEY_PRINT 210 #define KEY_HP 211 -#define KEY_CAMERA 212 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_CAMERA 212 #define KEY_SOUND 213 #define KEY_QUESTION 214 #define KEY_EMAIL 215 -#define KEY_CHAT 216 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_CHAT 216 #define KEY_SEARCH 217 #define KEY_CONNECT 218 #define KEY_FINANCE 219 -#define KEY_SPORT 220 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_SPORT 220 #define KEY_SHOP 221 #define KEY_ALTERASE 222 #define KEY_CANCEL 223 -#define KEY_BRIGHTNESSDOWN 224 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_BRIGHTNESSDOWN 224 #define KEY_BRIGHTNESSUP 225 #define KEY_MEDIA 226 #define KEY_SWITCHVIDEOMODE 227 -#define KEY_KBDILLUMTOGGLE 228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_KBDILLUMTOGGLE 228 #define KEY_KBDILLUMDOWN 229 #define KEY_KBDILLUMUP 230 #define KEY_SEND 231 -#define KEY_REPLY 232 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_REPLY 232 #define KEY_FORWARDMAIL 233 #define KEY_SAVE 234 #define KEY_DOCUMENTS 235 -#define KEY_BATTERY 236 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_BATTERY 236 #define KEY_BLUETOOTH 237 #define KEY_WLAN 238 #define KEY_UWB 239 -#define KEY_UNKNOWN 240 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_UNKNOWN 240 #define KEY_VIDEO_NEXT 241 #define KEY_VIDEO_PREV 242 #define KEY_BRIGHTNESS_CYCLE 243 -#define KEY_BRIGHTNESS_ZERO 244 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_BRIGHTNESS_AUTO 244 +#define KEY_BRIGHTNESS_ZERO KEY_BRIGHTNESS_AUTO #define KEY_DISPLAY_OFF 245 #define KEY_WWAN 246 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_WIMAX KEY_WWAN #define KEY_RFKILL 247 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_MICMUTE 248 #define BTN_MISC 0x100 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_0 0x100 #define BTN_1 0x101 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_2 0x102 #define BTN_3 0x103 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_4 0x104 #define BTN_5 0x105 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_6 0x106 #define BTN_7 0x107 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_8 0x108 #define BTN_9 0x109 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_MOUSE 0x110 #define BTN_LEFT 0x110 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_RIGHT 0x111 #define BTN_MIDDLE 0x112 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_SIDE 0x113 #define BTN_EXTRA 0x114 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_FORWARD 0x115 #define BTN_BACK 0x116 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TASK 0x117 #define BTN_JOYSTICK 0x120 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TRIGGER 0x120 #define BTN_THUMB 0x121 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_THUMB2 0x122 #define BTN_TOP 0x123 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TOP2 0x124 #define BTN_PINKIE 0x125 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_BASE 0x126 #define BTN_BASE2 0x127 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_BASE3 0x128 #define BTN_BASE4 0x129 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_BASE5 0x12a #define BTN_BASE6 0x12b +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_DEAD 0x12f #define BTN_GAMEPAD 0x130 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_SOUTH 0x130 #define BTN_A BTN_SOUTH +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_EAST 0x131 #define BTN_B BTN_EAST -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_C 0x132 #define BTN_NORTH 0x133 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_X BTN_NORTH #define BTN_WEST 0x134 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_Y BTN_WEST #define BTN_Z 0x135 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TL 0x136 #define BTN_TR 0x137 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TL2 0x138 #define BTN_TR2 0x139 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_SELECT 0x13a #define BTN_START 0x13b -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_MODE 0x13c #define BTN_THUMBL 0x13d +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_THUMBR 0x13e #define BTN_DIGI 0x140 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TOOL_PEN 0x140 #define BTN_TOOL_RUBBER 0x141 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TOOL_BRUSH 0x142 #define BTN_TOOL_PENCIL 0x143 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TOOL_AIRBRUSH 0x144 #define BTN_TOOL_FINGER 0x145 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TOOL_MOUSE 0x146 #define BTN_TOOL_LENS 0x147 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TOOL_QUINTTAP 0x148 #define BTN_TOUCH 0x14a +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_STYLUS 0x14b #define BTN_STYLUS2 0x14c -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TOOL_DOUBLETAP 0x14d #define BTN_TOOL_TRIPLETAP 0x14e +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TOOL_QUADTAP 0x14f #define BTN_WHEEL 0x150 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_GEAR_DOWN 0x150 #define BTN_GEAR_UP 0x151 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_OK 0x160 #define KEY_SELECT 0x161 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_GOTO 0x162 #define KEY_CLEAR 0x163 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_POWER2 0x164 #define KEY_OPTION 0x165 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_INFO 0x166 #define KEY_TIME 0x167 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_VENDOR 0x168 #define KEY_ARCHIVE 0x169 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_PROGRAM 0x16a #define KEY_CHANNEL 0x16b +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FAVORITES 0x16c #define KEY_EPG 0x16d -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_PVR 0x16e #define KEY_MHP 0x16f +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_LANGUAGE 0x170 #define KEY_TITLE 0x171 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_SUBTITLE 0x172 #define KEY_ANGLE 0x173 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_ZOOM 0x174 #define KEY_MODE 0x175 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_KEYBOARD 0x176 #define KEY_SCREEN 0x177 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_PC 0x178 #define KEY_TV 0x179 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_TV2 0x17a #define KEY_VCR 0x17b +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_VCR2 0x17c #define KEY_SAT 0x17d -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_SAT2 0x17e #define KEY_CD 0x17f +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_TAPE 0x180 #define KEY_RADIO 0x181 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_TUNER 0x182 #define KEY_PLAYER 0x183 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_TEXT 0x184 #define KEY_DVD 0x185 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_AUX 0x186 #define KEY_MP3 0x187 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_AUDIO 0x188 #define KEY_VIDEO 0x189 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_DIRECTORY 0x18a #define KEY_LIST 0x18b +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_MEMO 0x18c #define KEY_CALENDAR 0x18d -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_RED 0x18e #define KEY_GREEN 0x18f +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_YELLOW 0x190 #define KEY_BLUE 0x191 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_CHANNELUP 0x192 #define KEY_CHANNELDOWN 0x193 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FIRST 0x194 #define KEY_LAST 0x195 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_AB 0x196 #define KEY_NEXT 0x197 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_RESTART 0x198 #define KEY_SLOW 0x199 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_SHUFFLE 0x19a #define KEY_BREAK 0x19b +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_PREVIOUS 0x19c #define KEY_DIGITS 0x19d -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_TEEN 0x19e #define KEY_TWEN 0x19f +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_VIDEOPHONE 0x1a0 #define KEY_GAMES 0x1a1 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_ZOOMIN 0x1a2 #define KEY_ZOOMOUT 0x1a3 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_ZOOMRESET 0x1a4 #define KEY_WORDPROCESSOR 0x1a5 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_EDITOR 0x1a6 #define KEY_SPREADSHEET 0x1a7 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_GRAPHICSEDITOR 0x1a8 #define KEY_PRESENTATION 0x1a9 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_DATABASE 0x1aa #define KEY_NEWS 0x1ab +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_VOICEMAIL 0x1ac #define KEY_ADDRESSBOOK 0x1ad -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_MESSENGER 0x1ae #define KEY_DISPLAYTOGGLE 0x1af +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_BRIGHTNESS_TOGGLE KEY_DISPLAYTOGGLE #define KEY_SPELLCHECK 0x1b0 #define KEY_LOGOFF 0x1b1 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_DOLLAR 0x1b2 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_EURO 0x1b3 #define KEY_FRAMEBACK 0x1b4 #define KEY_FRAMEFORWARD 0x1b5 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_CONTEXT_MENU 0x1b6 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_MEDIA_REPEAT 0x1b7 #define KEY_10CHANNELSUP 0x1b8 #define KEY_10CHANNELSDOWN 0x1b9 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_IMAGES 0x1ba +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_DEL_EOL 0x1c0 #define KEY_DEL_EOS 0x1c1 #define KEY_INS_LINE 0x1c2 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_DEL_LINE 0x1c3 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN 0x1d0 #define KEY_FN_ESC 0x1d1 #define KEY_FN_F1 0x1d2 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN_F2 0x1d3 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN_F3 0x1d4 #define KEY_FN_F4 0x1d5 #define KEY_FN_F5 0x1d6 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN_F6 0x1d7 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN_F7 0x1d8 #define KEY_FN_F8 0x1d9 #define KEY_FN_F9 0x1da -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN_F10 0x1db +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN_F11 0x1dc #define KEY_FN_F12 0x1dd #define KEY_FN_1 0x1de -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN_2 0x1df +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN_D 0x1e0 #define KEY_FN_E 0x1e1 #define KEY_FN_F 0x1e2 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN_S 0x1e3 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_FN_B 0x1e4 #define KEY_BRL_DOT1 0x1f1 #define KEY_BRL_DOT2 0x1f2 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_BRL_DOT3 0x1f3 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_BRL_DOT4 0x1f4 #define KEY_BRL_DOT5 0x1f5 #define KEY_BRL_DOT6 0x1f6 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_BRL_DOT7 0x1f7 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_BRL_DOT8 0x1f8 #define KEY_BRL_DOT9 0x1f9 #define KEY_BRL_DOT10 0x1fa -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_NUMERIC_0 0x200 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_NUMERIC_1 0x201 #define KEY_NUMERIC_2 0x202 #define KEY_NUMERIC_3 0x203 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_NUMERIC_4 0x204 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_NUMERIC_5 0x205 #define KEY_NUMERIC_6 0x206 #define KEY_NUMERIC_7 0x207 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_NUMERIC_8 0x208 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_NUMERIC_9 0x209 #define KEY_NUMERIC_STAR 0x20a #define KEY_NUMERIC_POUND 0x20b -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_CAMERA_FOCUS 0x210 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_WPS_BUTTON 0x211 #define KEY_TOUCHPAD_TOGGLE 0x212 #define KEY_TOUCHPAD_ON 0x213 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_TOUCHPAD_OFF 0x214 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_CAMERA_ZOOMIN 0x215 #define KEY_CAMERA_ZOOMOUT 0x216 #define KEY_CAMERA_UP 0x217 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_CAMERA_DOWN 0x218 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_CAMERA_LEFT 0x219 #define KEY_CAMERA_RIGHT 0x21a #define KEY_ATTENDANT_ON 0x21b -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_ATTENDANT_OFF 0x21c +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define KEY_ATTENDANT_TOGGLE 0x21d #define KEY_LIGHTS_TOGGLE 0x21e #define BTN_DPAD_UP 0x220 -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_DPAD_DOWN 0x221 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_DPAD_LEFT 0x222 #define BTN_DPAD_RIGHT 0x223 #define KEY_ALS_TOGGLE 0x230 +#define KEY_BUTTONCONFIG 0x240 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_TASKMANAGER 0x241 +#define KEY_JOURNAL 0x242 +#define KEY_CONTROLPANEL 0x243 +#define KEY_APPSELECT 0x244 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define KEY_SCREENSAVER 0x245 +#define KEY_VOICECOMMAND 0x246 +#define KEY_BRIGHTNESS_MIN 0x250 +#define KEY_BRIGHTNESS_MAX 0x251 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ #define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0 From 9e87f2f876243225deef37645ddceaa5d225cb41 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 17 Sep 2014 14:59:24 -0700 Subject: [PATCH 136/148] Revert "Revert "Added a bionic systrace class and tracing to pthread_mutex.cpp."" This reverts commit 26c1420fbb68916d66a8621b5efe8bb25cfdad7b. --- libc/Android.mk | 1 + libc/bionic/bionic_systrace.cpp | 107 ++++++++++++++++++++++++++++++++ libc/bionic/pthread_mutex.cpp | 12 ++++ libc/private/bionic_systrace.h | 35 +++++++++++ 4 files changed, 155 insertions(+) create mode 100644 libc/bionic/bionic_systrace.cpp create mode 100644 libc/private/bionic_systrace.h diff --git a/libc/Android.mk b/libc/Android.mk index 5052cb10d..5f5add22b 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -89,6 +89,7 @@ libc_bionic_src_files := \ bionic/access.cpp \ bionic/assert.cpp \ bionic/atof.cpp \ + bionic/bionic_systrace.cpp \ bionic/bionic_time_conversions.cpp \ bionic/brk.cpp \ bionic/c16rtomb.cpp \ diff --git a/libc/bionic/bionic_systrace.cpp b/libc/bionic/bionic_systrace.cpp new file mode 100644 index 000000000..b8e892e72 --- /dev/null +++ b/libc/bionic/bionic_systrace.cpp @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "private/bionic_systrace.h" +#include "private/libc_logging.h" + +#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ +#include + +#define WRITE_OFFSET 32 + +static const prop_info* g_pinfo = NULL; +static uint32_t g_serial = -1; +static uint64_t g_tags = 0; +static int g_trace_marker_fd = -1; + +static bool should_trace() { + // If g_pinfo is null, this means that systrace hasn't been run and it's safe to + // assume that no trace writing will need to take place. However, to avoid running + // this costly find check each time, we set it to a non-tracing value so that next + // time, it will just check the serial to see if the value has been changed. + // this function also deals with the bootup case, during which the call to property + // set will fail if the property server hasn't yet started. + if (g_pinfo == NULL) { + g_pinfo = __system_property_find("debug.atrace.tags.enableflags"); + if (g_pinfo == NULL) { + __system_property_set("debug.atrace.tags.enableflags", "0"); + g_pinfo = __system_property_find("debug.atrace.tags.enableflags"); + if (g_pinfo == NULL) { + return false; + } + } + } + + // Find out which tags have been enabled on the command line and set + // the value of tags accordingly. If the value of the property changes, + // the serial will also change, so the costly system_property_read function + // can be avoided by calling the much cheaper system_property_serial + // first. The values within pinfo may change, but its location is guaranteed + // not to move. + const uint32_t cur_serial = __system_property_serial(g_pinfo); + if (cur_serial != g_serial) { + g_serial = cur_serial; + char value[PROP_VALUE_MAX]; + __system_property_read(g_pinfo, 0, value); + g_tags = strtoull(value, NULL, 0); + } + + // Finally, verify that this tag value enables bionic tracing. + return ((g_tags & ATRACE_TAG_BIONIC) != 0); +} + +ScopedTrace::ScopedTrace(const char* message) { + if (!should_trace()) { + return; + } + + if (g_trace_marker_fd == -1) { + g_trace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_WRONLY | O_CLOEXEC); + if (g_trace_marker_fd == -1) { + __libc_fatal("Could not open kernel trace file: %s\n", strerror(errno)); + } + } + + // If bionic tracing has been enabled, then write the message to the + // kernel trace_marker. + int length = strlen(message); + char buf[length + WRITE_OFFSET]; + size_t len = snprintf(buf, length + WRITE_OFFSET, "B|%d|%s", getpid(), message); + ssize_t wbytes = TEMP_FAILURE_RETRY(write(g_trace_marker_fd, buf, len)); + + // Error while writing + if (static_cast(wbytes) != len) { + __libc_fatal("Could not write to kernel trace file: %s\n", strerror(errno)); + } +} + +ScopedTrace::~ScopedTrace() { + if (!should_trace()) { + return; + } + + ssize_t wbytes = TEMP_FAILURE_RETRY(write(g_trace_marker_fd, "E", 1)); + + // Error while writing + if (static_cast(wbytes) != 1) { + __libc_fatal("Could not write to kernel trace file: %s\n", strerror(errno)); + } +} diff --git a/libc/bionic/pthread_mutex.cpp b/libc/bionic/pthread_mutex.cpp index 546166166..e00ffb437 100644 --- a/libc/bionic/pthread_mutex.cpp +++ b/libc/bionic/pthread_mutex.cpp @@ -39,6 +39,8 @@ #include "private/bionic_futex.h" #include "private/bionic_tls.h" +#include "private/bionic_systrace.h" + extern void pthread_debug_mutex_lock_check(pthread_mutex_t *mutex); extern void pthread_debug_mutex_unlock_check(pthread_mutex_t *mutex); @@ -333,6 +335,10 @@ static inline void _normal_lock(pthread_mutex_t* mutex, int shared) { * that the mutex is in state 2 when we go to sleep on it, which * guarantees a wake-up call. */ + + ScopedTrace trace("Contending for pthread mutex"); + + while (__bionic_swap(locked_contended, &mutex->value) != unlocked) { __futex_wait_ex(&mutex->value, shared, locked_contended, NULL); } @@ -473,6 +479,8 @@ int pthread_mutex_lock(pthread_mutex_t* mutex) { mvalue = mutex->value; } + ScopedTrace trace("Contending for pthread mutex"); + for (;;) { int newval; @@ -626,6 +634,8 @@ static int __pthread_mutex_timedlock(pthread_mutex_t* mutex, const timespec* abs return 0; } + ScopedTrace trace("Contending for timed pthread mutex"); + // Loop while needed. while (__bionic_swap(locked_contended, &mutex->value) != unlocked) { if (__timespec_from_absolute(&ts, abs_timeout, clock) < 0) { @@ -658,6 +668,8 @@ static int __pthread_mutex_timedlock(pthread_mutex_t* mutex, const timespec* abs mvalue = mutex->value; } + ScopedTrace trace("Contending for timed pthread mutex"); + while (true) { // If the value is 'unlocked', try to acquire it directly. // NOTE: put state to 2 since we know there is contention. diff --git a/libc/private/bionic_systrace.h b/libc/private/bionic_systrace.h new file mode 100644 index 000000000..ad9ff7f71 --- /dev/null +++ b/libc/private/bionic_systrace.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BIONIC_SYSTRACE_H +#define BIONIC_SYSTRACE_H + +#include "bionic_macros.h" + +// Tracing class for bionic. To begin a trace at a specified point: +// ScopedTrace("Trace message"); +// The trace will end when the contructor goes out of scope. + +class ScopedTrace { + public: + explicit ScopedTrace(const char* message); + ~ScopedTrace(); + + private: + DISALLOW_COPY_AND_ASSIGN(ScopedTrace); +}; + +#endif From ebb6b4a4d3fab87800b912c9d6ea917f5359f8af Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 13 Aug 2014 11:25:01 -0700 Subject: [PATCH 137/148] Hide ScopedTrace. (cherry-pick of f2c1e7ee78a167ff323b9f45d20532d064d6778d.) Bug: 11156955 Change-Id: I6cddc868d1c6503e30f1ffcf460f45670631d64a --- libc/private/bionic_systrace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/private/bionic_systrace.h b/libc/private/bionic_systrace.h index ad9ff7f71..0b4560f92 100644 --- a/libc/private/bionic_systrace.h +++ b/libc/private/bionic_systrace.h @@ -23,7 +23,7 @@ // ScopedTrace("Trace message"); // The trace will end when the contructor goes out of scope. -class ScopedTrace { +class __LIBC_HIDDEN__ ScopedTrace { public: explicit ScopedTrace(const char* message); ~ScopedTrace(); From 21ce3f506f3b54e4f57a37847375cef9f8aff57f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 26 Aug 2014 16:20:59 -0700 Subject: [PATCH 138/148] More cases where libc should use O_CLOEXEC. Change-Id: Idfa111aeebc5deca2399dae919e8b72eb54c23c0 (cherry picked from commit f73183f1a34df22b62a3d0bbf82e18d5797c9cde) --- libc/bionic/bionic_systrace.cpp | 2 +- libc/bionic/dirent.cpp | 2 +- libc/bionic/malloc_debug_qemu.cpp | 2 +- libc/bionic/pthread_setname_np.cpp | 2 +- libc/bionic/system_properties.cpp | 21 ++------------------- 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/libc/bionic/bionic_systrace.cpp b/libc/bionic/bionic_systrace.cpp index b8e892e72..f5be41553 100644 --- a/libc/bionic/bionic_systrace.cpp +++ b/libc/bionic/bionic_systrace.cpp @@ -74,7 +74,7 @@ ScopedTrace::ScopedTrace(const char* message) { } if (g_trace_marker_fd == -1) { - g_trace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_WRONLY | O_CLOEXEC); + g_trace_marker_fd = open("/sys/kernel/debug/tracing/trace_marker", O_CLOEXEC | O_WRONLY); if (g_trace_marker_fd == -1) { __libc_fatal("Could not open kernel trace file: %s\n", strerror(errno)); } diff --git a/libc/bionic/dirent.cpp b/libc/bionic/dirent.cpp index 7abc7f3ec..5e1c7a565 100644 --- a/libc/bionic/dirent.cpp +++ b/libc/bionic/dirent.cpp @@ -78,7 +78,7 @@ DIR* fdopendir(int fd) { } DIR* opendir(const char* path) { - int fd = open(path, O_RDONLY | O_DIRECTORY); + int fd = open(path, O_CLOEXEC | O_DIRECTORY | O_RDONLY); return (fd != -1) ? __allocate_DIR(fd) : NULL; } diff --git a/libc/bionic/malloc_debug_qemu.cpp b/libc/bionic/malloc_debug_qemu.cpp index b3b604d86..2f4949b12 100644 --- a/libc/bionic/malloc_debug_qemu.cpp +++ b/libc/bionic/malloc_debug_qemu.cpp @@ -606,7 +606,7 @@ extern "C" bool malloc_debug_initialize(HashTable*, const MallocDebug* malloc_di * the memory mapped spaces into writes to an I/O port that emulator * "listens to" on the other end. Note that until we open and map that * device, logging to emulator's stdout will not be available. */ - int fd = open("/dev/qemu_trace", O_RDWR); + int fd = open("/dev/qemu_trace", O_CLOEXEC | O_RDWR); if (fd < 0) { error_log("Unable to open /dev/qemu_trace"); return false; diff --git a/libc/bionic/pthread_setname_np.cpp b/libc/bionic/pthread_setname_np.cpp index 1ddf81044..7b2fa6b0a 100644 --- a/libc/bionic/pthread_setname_np.cpp +++ b/libc/bionic/pthread_setname_np.cpp @@ -67,7 +67,7 @@ int pthread_setname_np(pthread_t t, const char* thread_name) { } char comm_name[sizeof(TASK_COMM_FMT) + 8]; snprintf(comm_name, sizeof(comm_name), TASK_COMM_FMT, tid); - int fd = open(comm_name, O_WRONLY); + int fd = open(comm_name, O_CLOEXEC | O_WRONLY); if (fd == -1) { return errno; } diff --git a/libc/bionic/system_properties.cpp b/libc/bionic/system_properties.cpp index ad69cf5f9..411d6bf34 100644 --- a/libc/bionic/system_properties.cpp +++ b/libc/bionic/system_properties.cpp @@ -201,14 +201,6 @@ static int map_prop_area_rw() return -1; } - // TODO: Is this really required ? Does android run on any kernels that - // don't support O_CLOEXEC ? - const int ret = fcntl(fd, F_SETFD, FD_CLOEXEC); - if (ret < 0) { - close(fd); - return -1; - } - if (ftruncate(fd, PA_SIZE) < 0) { close(fd); return -1; @@ -271,18 +263,9 @@ static int map_fd_ro(const int fd) { static int map_prop_area() { - int fd(open(property_filename, O_RDONLY | O_NOFOLLOW | O_CLOEXEC)); - if (fd >= 0) { - /* For old kernels that don't support O_CLOEXEC */ - const int ret = fcntl(fd, F_SETFD, FD_CLOEXEC); - if (ret < 0) { - close(fd); - return -1; - } - } - + int fd = open(property_filename, O_CLOEXEC | O_NOFOLLOW | O_RDONLY); bool close_fd = true; - if ((fd < 0) && (errno == ENOENT)) { + if (fd == -1 && errno == ENOENT) { /* * For backwards compatibility, if the file doesn't * exist, we use the environment to get the file descriptor. From 8fa377eb6afdea4b03b6a0d112471f7ee988fb96 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 17 Sep 2014 15:25:35 -0700 Subject: [PATCH 139/148] Fix an unintended difference between aosp/master and lmp-dev-plus-aosp. Whitespace difference presumably introduced while fixing a merge conflict. Bug: 17549448 Change-Id: If688330bf1dbaed23ba687d843d9744d6261023b --- libc/Android.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libc/Android.mk b/libc/Android.mk index 5f5add22b..56e98768b 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -865,8 +865,7 @@ LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_MODULE := libc_cxa -# GCC refuses to hide new/delete -LOCAL_CLANG := true +LOCAL_CLANG := true # GCC refuses to hide new/delete LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SYSTEM_SHARED_LIBRARIES := From 086bb382db3de7459bc5fad6bb1c257ca331b0e8 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 23 Sep 2014 15:32:24 -0700 Subject: [PATCH 140/148] Fix incorrect parameter types for locale funcs. strtoll(3), strtoull(3), wcstoll(3), and wcstoull(3) all take an _int_ as a base, not a size_t. This is an ABI compatibility issue. Bug: 17628622 Change-Id: I17f8eead34ce2112005899fc30162067573023ec (cherry picked from commit 3c5037f1b3b747e79d17a5f717d9f9c365132d33) --- libc/bionic/strtoll_l.cpp | 2 +- libc/bionic/strtoull_l.cpp | 2 +- libc/bionic/wchar.cpp | 4 ++-- libc/include/stdlib.h | 4 ++-- libc/include/wchar.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libc/bionic/strtoll_l.cpp b/libc/bionic/strtoll_l.cpp index 05fb76083..47b126e05 100644 --- a/libc/bionic/strtoll_l.cpp +++ b/libc/bionic/strtoll_l.cpp @@ -28,6 +28,6 @@ #include -long long strtoll_l(const char *nptr, char **endptr, size_t base, locale_t) { +long long strtoll_l(const char *nptr, char **endptr, int base, locale_t) { return strtoll(nptr, endptr, base); } diff --git a/libc/bionic/strtoull_l.cpp b/libc/bionic/strtoull_l.cpp index ba0bc6ad4..398ba0e94 100644 --- a/libc/bionic/strtoull_l.cpp +++ b/libc/bionic/strtoull_l.cpp @@ -28,7 +28,7 @@ #include -unsigned long long strtoull_l(const char *nptr, char **endptr, size_t base, +unsigned long long strtoull_l(const char *nptr, char **endptr, int base, locale_t) { return strtoull(nptr, endptr, base); } diff --git a/libc/bionic/wchar.cpp b/libc/bionic/wchar.cpp index 524ba07e7..e0879b9df 100644 --- a/libc/bionic/wchar.cpp +++ b/libc/bionic/wchar.cpp @@ -230,13 +230,13 @@ size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t n, locale_t) { return wcsxfrm(dest, src, n); } -long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr, size_t base, +long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) { return wcstoll(nptr, endptr, base); } unsigned long long wcstoull_l(const wchar_t *nptr, wchar_t **endptr, - size_t base, locale_t) { + int base, locale_t) { return wcstoull(nptr, endptr, base); } diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index 52f71dd47..52f371b68 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -76,8 +76,8 @@ extern float strtof(const char*, char**) __LIBC_ABI_PUBLIC__; extern long double strtold(const char*, char**) __LIBC_ABI_PUBLIC__; extern long double strtold_l(const char *, char **, locale_t) __LIBC_ABI_PUBLIC__; -extern long long strtoll_l(const char *, char **, size_t, locale_t) __LIBC_ABI_PUBLIC__; -extern unsigned long long strtoull_l(const char *, char **, size_t, locale_t) __LIBC_ABI_PUBLIC__; +extern long long strtoll_l(const char *, char **, int, locale_t) __LIBC_ABI_PUBLIC__; +extern unsigned long long strtoull_l(const char *, char **, int, locale_t) __LIBC_ABI_PUBLIC__; extern int atoi(const char*) __purefunc; extern long atol(const char*) __purefunc; diff --git a/libc/include/wchar.h b/libc/include/wchar.h index 1898c7e93..e0e5c82fe 100644 --- a/libc/include/wchar.h +++ b/libc/include/wchar.h @@ -151,8 +151,8 @@ extern wchar_t *wmemset(wchar_t *, wchar_t, size_t); extern int wprintf(const wchar_t *, ...); extern int wscanf(const wchar_t *, ...); -extern long long wcstoll_l(const wchar_t *, wchar_t **, size_t, locale_t); -extern unsigned long long wcstoull_l(const wchar_t *, wchar_t **, size_t, locale_t); +extern long long wcstoll_l(const wchar_t *, wchar_t **, int, locale_t); +extern unsigned long long wcstoull_l(const wchar_t *, wchar_t **, int, locale_t); extern long double wcstold_l(const wchar_t *, wchar_t **, locale_t ); extern int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); From 6c69afdb6ddd56e011b59e3060f12a5bdffb5f5c Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 24 Sep 2014 16:01:18 -0700 Subject: [PATCH 141/148] Fix sys_stat.mkfifo when not run as root. It's not allowed for a shell user to create a fifo in /data/local/tmp. Make the test do nothing if not run as root. Bug: 17646702 Change-Id: I932262fa233eae8b5dd607a2398a47c50a208701 --- tests/sys_stat_test.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/sys_stat_test.cpp b/tests/sys_stat_test.cpp index a57a706e5..64049ab61 100644 --- a/tests/sys_stat_test.cpp +++ b/tests/sys_stat_test.cpp @@ -56,18 +56,22 @@ TEST(sys_stat, futimens_EBADF) { } TEST(sys_stat, mkfifo) { - // Racy but probably sufficient way to get a suitable filename. - std::string path; - { - TemporaryFile tf; - path = tf.filename; - } + if (getuid() == 0) { + // Racy but probably sufficient way to get a suitable filename. + std::string path; + { + TemporaryFile tf; + path = tf.filename; + } - ASSERT_EQ(0, mkfifo(path.c_str(), 0666)); - struct stat sb; - ASSERT_EQ(0, stat(path.c_str(), &sb)); - ASSERT_TRUE(S_ISFIFO(sb.st_mode)); - unlink(path.c_str()); + ASSERT_EQ(0, mkfifo(path.c_str(), 0666)); + struct stat sb; + ASSERT_EQ(0, stat(path.c_str(), &sb)); + ASSERT_TRUE(S_ISFIFO(sb.st_mode)); + unlink(path.c_str()); + } else { + GTEST_LOG_(INFO) << "This test only performs a test when run as root."; + } } TEST(sys_stat, stat64_lstat64_fstat64) { From 5def2f5aecd968e4022b0afbe4441fa7ba3e7c7e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 24 Sep 2014 17:20:53 -0700 Subject: [PATCH 142/148] Re-expose more stdio implementation details for LP32. Keeps a variety of apps running. Bug: 17047819 Change-Id: I55882ec95f2b59a5df76e5a89c23aa315609e01d --- libc/stdio/glue.h | 7 ++----- libc/stdio/local.h | 14 +++++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/libc/stdio/glue.h b/libc/stdio/glue.h index 81f83fc01..4ead20a81 100644 --- a/libc/stdio/glue.h +++ b/libc/stdio/glue.h @@ -42,8 +42,5 @@ struct glue { FILE *iobs; }; -#pragma GCC visibility push(hidden) - -extern struct glue __sglue; - -#pragma GCC visibility pop +/* This was referenced by a couple of different pieces of middleware and the Crystax NDK. */ +__LIBC64_HIDDEN__ extern struct glue __sglue; diff --git a/libc/stdio/local.h b/libc/stdio/local.h index d777deccb..eb848338d 100644 --- a/libc/stdio/local.h +++ b/libc/stdio/local.h @@ -53,21 +53,24 @@ __LIBC64_HIDDEN__ int __srefill(FILE*); /* This was referenced by the apportable middleware for LP32. */ __LIBC64_HIDDEN__ int __swsetup(FILE*); +/* These were referenced by a couple of different pieces of middleware and the Crystax NDK. */ +__LIBC64_HIDDEN__ extern int __sdidinit; +__LIBC64_HIDDEN__ int __sflags(const char*, int*); +__LIBC64_HIDDEN__ FILE* __sfp(void); +__LIBC64_HIDDEN__ void __sinit(void); +__LIBC64_HIDDEN__ void __smakebuf(FILE*); + #pragma GCC visibility push(hidden) int __sflush(FILE *); int __sflush_locked(FILE *); -FILE *__sfp(void); int __sread(void *, char *, int); int __swrite(void *, const char *, int); fpos_t __sseek(void *, fpos_t, int); int __sclose(void *); -void __sinit(void); void _cleanup(void); -void __smakebuf(FILE *); int __swhatbuf(FILE *, size_t *, int *); int _fwalk(int (*)(FILE *)); -int __sflags(const char *, int *); wint_t __fgetwc_unlock(FILE *); wint_t __ungetwc(wint_t, FILE *); int __vfprintf(FILE *, const char *, __va_list); @@ -76,7 +79,6 @@ int __vfwprintf(FILE * __restrict, const wchar_t * __restrict, __va_list); int __vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list); extern void __atexit_register_cleanup(void (*)(void)); -extern int __sdidinit; /* * Return true if the given FILE cannot be written now. @@ -114,8 +116,6 @@ extern int __sdidinit; #define NO_PRINTF_PERCENT_N /* OpenBSD exposes these in , but we only want them exposed to the implementation. */ -int __srget(FILE*); -int __swbuf(int, FILE*); #define __sfeof(p) (((p)->_flags & __SEOF) != 0) #define __sferror(p) (((p)->_flags & __SERR) != 0) #define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) From ea9800e98598c71fe76c4e2a0d0498b6bd490a83 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 12 Sep 2014 16:33:37 -0700 Subject: [PATCH 143/148] Explain why clock(3) isn't broken. Bug: 17441123 Bug: 17814435 (cherry picked from commit f83c208b82c78dad07f4065f63bdd354f5ef9951) Change-Id: I2065afe73b79a8d86404edee16e983625d902cdc --- libc/bionic/clock.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libc/bionic/clock.cpp b/libc/bionic/clock.cpp index 98f71afc3..a2636c67c 100644 --- a/libc/bionic/clock.cpp +++ b/libc/bionic/clock.cpp @@ -34,5 +34,8 @@ clock_t clock() { tms t; times(&t); + // Although times(2) and clock(3) both use the type clock_t, the units are + // different. For times(2) it's pure clock ticks, but for clock(3) the unit + // is CLOCKS_PER_SEC, so we need to scale appropriately. return (t.tms_utime + t.tms_stime) * (CLOCKS_PER_SEC / sysconf(_SC_CLK_TCK)); } From a508714800242b294291060641ed35d719bdc857 Mon Sep 17 00:00:00 2001 From: Alex Van Brunt Date: Fri, 26 Sep 2014 13:32:47 -0700 Subject: [PATCH 144/148] Reimplement clock(3) using clock_gettime(3) Unlike times(), clock_gettime() is implemented as a vDSO on many architectures. So, using clock_gettime() will return a more accurate time and do so with less overhead because it does have the overhead of calling into the kernel. It is also significantly more accurate because it measures the actual time in nanoseconds rather than the number of ticks (typically 1 millisecond or more). Bug: 17814435 (cherry picked from commit 8d0b2dbf2154d5da17ff09b1d4f864d281362ad2) Change-Id: Id4945d9f387330518f78669809639952e9227ed9 --- libc/bionic/clock.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libc/bionic/clock.cpp b/libc/bionic/clock.cpp index a2636c67c..5bd32f9c9 100644 --- a/libc/bionic/clock.cpp +++ b/libc/bionic/clock.cpp @@ -30,12 +30,13 @@ #include #include +#define NS_PER_S 1000000000 // No "private/bionic_constants.h" in lmp-dev. + // http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock.html clock_t clock() { - tms t; - times(&t); - // Although times(2) and clock(3) both use the type clock_t, the units are - // different. For times(2) it's pure clock ticks, but for clock(3) the unit - // is CLOCKS_PER_SEC, so we need to scale appropriately. - return (t.tms_utime + t.tms_stime) * (CLOCKS_PER_SEC / sysconf(_SC_CLK_TCK)); + timespec ts; + if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == -1) { + return -1; + } + return (ts.tv_sec * CLOCKS_PER_SEC) + (ts.tv_nsec / (NS_PER_S / CLOCKS_PER_SEC)); } From d11eac3455a059a092ceee92eda9905e1d661e94 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Mon, 6 Oct 2014 15:11:28 -0700 Subject: [PATCH 145/148] Force export symbols on all x86 variants in libc. For silvermont, the __popcountsi2 symbol does not get exported by libc. But for atom, this symbol is exported. Since we already exported this symbol for previous releases, it's better to just follow through and force the export, but only for 32 bit. x86 64 bit will not export this symbol. Bug: 17681440 Change-Id: I6c62245f0960910f64baaaf6d9d090bf3ea5f435 --- libc/arch-x86/bionic/libgcc_compat.c | 15 +++++++++++++++ libc/arch-x86/x86.mk | 1 + libc/tools/genlibgcc_compat.py | 11 ++++++----- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 libc/arch-x86/bionic/libgcc_compat.c diff --git a/libc/arch-x86/bionic/libgcc_compat.c b/libc/arch-x86/bionic/libgcc_compat.c new file mode 100644 index 000000000..c7232638f --- /dev/null +++ b/libc/arch-x86/bionic/libgcc_compat.c @@ -0,0 +1,15 @@ +/* Generated by genlibgcc_compat.py */ + +extern char __divdi3; +extern char __moddi3; +extern char __popcountsi2; +extern char __udivdi3; +extern char __umoddi3; + +void* __bionic_libgcc_compat_symbols[] = { + &__divdi3, + &__moddi3, + &__popcountsi2, + &__udivdi3, + &__umoddi3, +}; diff --git a/libc/arch-x86/x86.mk b/libc/arch-x86/x86.mk index a14154866..2a0609dde 100644 --- a/libc/arch-x86/x86.mk +++ b/libc/arch-x86/x86.mk @@ -25,6 +25,7 @@ libc_bionic_src_files_x86 := \ libc_bionic_src_files_x86 += \ arch-x86/bionic/__bionic_clone.S \ arch-x86/bionic/_exit_with_stack_teardown.S \ + arch-x86/bionic/libgcc_compat.c \ arch-x86/bionic/_setjmp.S \ arch-x86/bionic/setjmp.S \ arch-x86/bionic/__set_tls.c \ diff --git a/libc/tools/genlibgcc_compat.py b/libc/tools/genlibgcc_compat.py index cb5c3b38e..628bf9217 100755 --- a/libc/tools/genlibgcc_compat.py +++ b/libc/tools/genlibgcc_compat.py @@ -76,9 +76,6 @@ libgcc_compat_header = "/* Generated by genlibgcc_compat.py */\n\n" class Generator: def process(self): android_build_top_path = os.environ["ANDROID_BUILD_TOP"] - build_path = android_build_top_path + "/bionic/libc" - file_name = "libgcc_compat.c" - file_path = build_path + "/arch-arm/bionic/" + file_name print "* ANDROID_BUILD_TOP=" + android_build_top_path @@ -86,8 +83,12 @@ class Generator: arch = subprocess.check_output(["CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core make --no-print-directory -f build/core/config.mk dumpvar-TARGET_ARCH"], cwd=android_build_top_path, shell=True).strip() - if arch != 'arm': - sys.exit("Error: Invalid TARGET_ARCH='" + arch + "' expecting 'arm'") + if arch != 'arm' and arch != 'x86': + sys.exit("Error: Invalid TARGET_ARCH='" + arch + "' expecting 'arm' or 'x86'") + + build_path = android_build_top_path + "/bionic/libc" + file_name = "libgcc_compat.c" + file_path = build_path + "/arch-" + arch + "/bionic/" + file_name build_output_file_path = tempfile.mkstemp()[1] From 1543fdf616ddebee7819214437527f380e5c743b Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 7 Oct 2014 16:02:11 -0700 Subject: [PATCH 146/148] Work around a bug in Immersion's libImmEmulatorJ.so. This library calls pthread_mutex_lock and pthread_mutex_unlock with a NULL pthread_mutex_t*. This gives them (and their users) one release to fix things. Bug: 17443936 (cherry picked from commit 7d3f553f989f830976efa92ddc3c84661d4d42aa) Change-Id: Ie26bbecd3a74d61113b51c18832872499b97ee86 (cherry picked from commit b5e7eba6d1b97e471996fcfe7dbde7cbba7512ef) --- libc/bionic/pthread_mutex.cpp | 12 ++++++++++++ libc/include/pthread.h | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/libc/bionic/pthread_mutex.cpp b/libc/bionic/pthread_mutex.cpp index 546166166..ae2557f08 100644 --- a/libc/bionic/pthread_mutex.cpp +++ b/libc/bionic/pthread_mutex.cpp @@ -440,6 +440,12 @@ static inline __always_inline int _recursive_increment(pthread_mutex_t* mutex, i } int pthread_mutex_lock(pthread_mutex_t* mutex) { +#if !defined(__LP64__) + if (mutex == NULL) { + return EINVAL; + } +#endif + int mvalue, mtype, tid, shared; mvalue = mutex->value; @@ -516,6 +522,12 @@ int pthread_mutex_lock(pthread_mutex_t* mutex) { } int pthread_mutex_unlock(pthread_mutex_t* mutex) { +#if !defined(__LP64__) + if (mutex == NULL) { + return EINVAL; + } +#endif + int mvalue, mtype, tid, shared; mvalue = mutex->value; diff --git a/libc/include/pthread.h b/libc/include/pthread.h index 86a10051e..c32890b03 100644 --- a/libc/include/pthread.h +++ b/libc/include/pthread.h @@ -206,10 +206,10 @@ int pthread_mutexattr_settype(pthread_mutexattr_t*, int) __nonnull((1)); int pthread_mutex_destroy(pthread_mutex_t*) __nonnull((1)); int pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*) __nonnull((1)); -int pthread_mutex_lock(pthread_mutex_t*) __nonnull((1)); +int pthread_mutex_lock(pthread_mutex_t*) /* __nonnull((1)) */; int pthread_mutex_timedlock(pthread_mutex_t*, const struct timespec*) __nonnull((1, 2)); int pthread_mutex_trylock(pthread_mutex_t*) __nonnull((1)); -int pthread_mutex_unlock(pthread_mutex_t*) __nonnull((1)); +int pthread_mutex_unlock(pthread_mutex_t*) /* __nonnull((1)) */; int pthread_once(pthread_once_t*, void (*)(void)) __nonnull((1, 2)); From c9734d24d92f4737f5ab3808c77d816a1b084582 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 8 Oct 2014 22:48:20 -0700 Subject: [PATCH 147/148] Re-add dlmalloc for 32 bit. It turns out that appportable has a version that calls dlmalloc directly. Re-add the dlmalloc symbol for 32 bit only as a compatibility shim that calls malloc. Bug: 17881362 Change-Id: I8f20963b0b8d323489dc083e4063779e0d1d7447 --- libc/bionic/dlmalloc.h | 9 ++++++--- libc/bionic/ndk_cruft.cpp | 6 ++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libc/bionic/dlmalloc.h b/libc/bionic/dlmalloc.h index ef7881436..2f53c1bc4 100644 --- a/libc/bionic/dlmalloc.h +++ b/libc/bionic/dlmalloc.h @@ -34,11 +34,14 @@ #define malloc_getpagesize getpagesize() -/* dlmalloc_usable_size was exposed in the NDK, so change the name - * of the function on 32 bit architectures. - */ #if !defined(__LP64__) +/* dlmalloc_usable_size and dlmalloc were exposed in the NDK and some + * apps actually used them. Rename these functions out of the way + * for 32 bit architectures so that ndk_cruft.cpp can expose + * compatibility shims with these names. + */ #define dlmalloc_usable_size dlmalloc_usable_size_real +#define dlmalloc dlmalloc_real #endif /* Export two symbols used by the VM. */ diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index 829e8f3b6..760081717 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -320,4 +320,10 @@ extern "C" size_t dlmalloc_usable_size(void* ptr) { return malloc_usable_size(ptr); } +// Older versions of appportable used dlmalloc directly instead of malloc, +// so export this compatibility shim that simply calls malloc. +extern "C" void* dlmalloc(size_t size) { + return malloc(size); +} + #endif From c891e24073830e07ba7373dee554ff2c70e1d313 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 9 Oct 2014 18:31:01 -0700 Subject: [PATCH 148/148] Add back symbols to fix Greed for Glory franchise. Bug: 17813018 Change-Id: Id939426ee5303117b9601e7915fcfec5024fc621 --- libc/stdio/local.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libc/stdio/local.h b/libc/stdio/local.h index eb848338d..13188ee1b 100644 --- a/libc/stdio/local.h +++ b/libc/stdio/local.h @@ -60,17 +60,19 @@ __LIBC64_HIDDEN__ FILE* __sfp(void); __LIBC64_HIDDEN__ void __sinit(void); __LIBC64_HIDDEN__ void __smakebuf(FILE*); +/* These are referenced by the Greed for Glory franchise. */ +__LIBC64_HIDDEN__ int __sflush(FILE *); +__LIBC64_HIDDEN__ int __sread(void *, char *, int); +__LIBC64_HIDDEN__ int __swrite(void *, const char *, int); +__LIBC64_HIDDEN__ fpos_t __sseek(void *, fpos_t, int); +__LIBC64_HIDDEN__ int __sclose(void *); +__LIBC64_HIDDEN__ int _fwalk(int (*)(FILE *)); + #pragma GCC visibility push(hidden) -int __sflush(FILE *); int __sflush_locked(FILE *); -int __sread(void *, char *, int); -int __swrite(void *, const char *, int); -fpos_t __sseek(void *, fpos_t, int); -int __sclose(void *); void _cleanup(void); int __swhatbuf(FILE *, size_t *, int *); -int _fwalk(int (*)(FILE *)); wint_t __fgetwc_unlock(FILE *); wint_t __ungetwc(wint_t, FILE *); int __vfprintf(FILE *, const char *, __va_list);