diff options
99 files changed, 150 insertions, 1261 deletions
diff --git a/libc/sysdeps/linux/arc/clone.S b/libc/sysdeps/linux/arc/clone.S index 3942b88f7..c2ce906c9 100644 --- a/libc/sysdeps/linux/arc/clone.S +++ b/libc/sysdeps/linux/arc/clone.S @@ -61,20 +61,9 @@ ENTRY(clone) ; Setup TP register (since kernel doesn't do that) and.f 0, r12, CLONE_SETTLS bz .Lnext_clone_quirk - SET_TP r9 + mov r25, r9 .Lnext_clone_quirk: -#ifdef RESET_PID - bbit1 r12, 16, .Lgo_thread ; CLONE_THREAD = (1 << 16) - - mov r8, __NR_getpid - ARC_TRAP_INSN ; r0 has PID - THREAD_SELF r1 ; Get to struct pthread (just before TCB) - st r0, [r1, PTHREAD_PID] - st r0, [r1, PTHREAD_TID] - -.Lgo_thread: -#endif #endif ; child jumps off to @fn with @arg as argument, and returns here jl.d [r10] diff --git a/libc/sysdeps/linux/arc/vfork.S b/libc/sysdeps/linux/arc/vfork.S index 573a29f26..11959b66b 100644 --- a/libc/sysdeps/linux/arc/vfork.S +++ b/libc/sysdeps/linux/arc/vfork.S @@ -16,25 +16,12 @@ #define CLONE_FLAGS_FOR_VFORK (CLONE_VM|CLONE_VFORK|SIGCHLD) ENTRY(__vfork) -#ifdef SAVE_PID - THREAD_SELF r1 ; Get to struct pthread (just before TCB) - ld r2, [r1, PTHREAD_PID] - neg.f r3, r2 - bset.z r3, r3, 31 - st r3, [r1, PTHREAD_PID] -#endif mov r0, CLONE_FLAGS_FOR_VFORK mov_s r1, sp mov r8, __NR_clone ARC_TRAP_INSN cmp r0, 0 -#ifdef RESTORE_PID - bz 1f ; child continues - THREAD_SELF r1 ; Get to struct pthread (just before TCB) - st r2, [r1, PTHREAD_PID] -1: -#endif jge [blink] ; pid >=0 return, else detour via tailcall to errno b __syscall_error diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S index 0b293ecb7..b156e932b 100644 --- a/libc/sysdeps/linux/arm/clone.S +++ b/libc/sysdeps/linux/arm/clone.S @@ -110,9 +110,6 @@ __clone: @ do the system call @ get flags mov r0, r2 -#ifdef RESET_PID - mov ip, r2 -#endif @ new sp is already in r1 push {r4, r7} cfi_adjust_cfa_offset (8) @@ -138,21 +135,6 @@ PSEUDO_END (__clone) 1: .fnstart .cantunwind -#ifdef RESET_PID - tst ip, #CLONE_THREAD - bne 3f - GET_TLS (lr) - mov r1, r0 - tst ip, #CLONE_VM - ldr r7, =SYS_ify(getpid) - ite ne - movne r0, #-1 - swieq 0x0 - NEGOFF_ADJ_BASE (r1, TID_OFFSET) - str r0, NEGOFF_OFF1 (r1, TID_OFFSET) - str r0, NEGOFF_OFF2 (r1, PID_OFFSET, TID_OFFSET) -3: -#endif @ pick the function arg and call address off the stack and execute ldr r0, [sp, #4] mov lr, pc diff --git a/libc/sysdeps/linux/arm/vfork.S b/libc/sysdeps/linux/arm/vfork.S index 221a90c40..455b2f8d9 100644 --- a/libc/sysdeps/linux/arm/vfork.S +++ b/libc/sysdeps/linux/arm/vfork.S @@ -13,15 +13,6 @@ #include <bits/errno.h> #include <sys/syscall.h> -#ifndef SAVE_PID -#define SAVE_PID -#endif - -#ifndef RESTORE_PID -#define RESTORE_PID -#endif - - #ifdef __NR_fork .text .global __vfork @@ -33,9 +24,7 @@ .thumb_func __vfork: #ifdef __NR_vfork - SAVE_PID DO_CALL (vfork) - RESTORE_PID ldr r1, =0xfffff000 cmp r0, r1 bcs 1f @@ -69,9 +58,7 @@ __error: __vfork: #ifdef __NR_vfork - SAVE_PID DO_CALL (vfork) - RESTORE_PID cmn r0, #4096 IT(t, cc) BXC(cc, lr) diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h index 0b3632063..e0195e405 100644 --- a/libc/sysdeps/linux/common/bits/kernel-features.h +++ b/libc/sysdeps/linux/common/bits/kernel-features.h @@ -375,13 +375,6 @@ # define __ASSUME_AT_SECURE 1 #endif -/* Starting with the 2.5.75 kernel the kernel fills in the correct value - in the si_pid field passed as part of the siginfo_t struct to signal - handlers. */ -#if __LINUX_KERNEL_VERSION >= 132427 -# define __ASSUME_CORRECT_SI_PID 1 -#endif - /* The utimes syscall has been available for some architectures forever. For x86 it was introduced after 2.5.75, for x86-64, ppc, and ppc64 it was introduced in 2.6.0-test3. */ diff --git a/libc/sysdeps/linux/i386/Makefile.arch b/libc/sysdeps/linux/i386/Makefile.arch index e1739e193..6c9eed897 100644 --- a/libc/sysdeps/linux/i386/Makefile.arch +++ b/ |