diff options
Diffstat (limited to 'lib/libc')
116 files changed, 413 insertions, 80 deletions
diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 3cff71f..4eb57de 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -68,11 +68,8 @@ NOASM= ${LIBC_ARCH} != "ia64" && \ ${LIBC_ARCH} != "powerpc64" && \ ${LIBC_ARCH} != "sparc64" && \ - ${LIBC_ARCH} != "mips" -.include "${.CURDIR}/quad/Makefile.inc" -.endif -.if ${LIBC_ARCH} == "mips" && \ - (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32") + ${MACHINE_ARCH:Mmipsn32*} == "" && \ + ${MACHINE_ARCH:Mmips64*} == "" .include "${.CURDIR}/quad/Makefile.inc" .endif .include "${.CURDIR}/regex/Makefile.inc" diff --git a/lib/libc/amd64/gen/_setjmp.S b/lib/libc/amd64/gen/_setjmp.S index 38c3c6f..9035632 100644 --- a/lib/libc/amd64/gen/_setjmp.S +++ b/lib/libc/amd64/gen/_setjmp.S @@ -92,3 +92,5 @@ ENTRY(___longjmp) 1: movq %rcx,0(%rsp) ret END(___longjmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/gen/fabs.S b/lib/libc/amd64/gen/fabs.S index 8c0c8bf..2ace0f9 100644 --- a/lib/libc/amd64/gen/fabs.S +++ b/lib/libc/amd64/gen/fabs.S @@ -42,3 +42,5 @@ END(fabs) .data signbit: .quad 0x8000000000000000 + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/gen/modf.S b/lib/libc/amd64/gen/modf.S index 4fee38b..691aad8 100644 --- a/lib/libc/amd64/gen/modf.S +++ b/lib/libc/amd64/gen/modf.S @@ -87,3 +87,5 @@ ENTRY(modf) ret END(modf) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/gen/rfork_thread.S b/lib/libc/amd64/gen/rfork_thread.S index c34a940..9720e08 100644 --- a/lib/libc/amd64/gen/rfork_thread.S +++ b/lib/libc/amd64/gen/rfork_thread.S @@ -100,3 +100,5 @@ ENTRY(rfork_thread) jmp HIDENAME(cerror) #endif END(rfork_thread) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/gen/setjmp.S b/lib/libc/amd64/gen/setjmp.S index 41de587..1409f4c 100644 --- a/lib/libc/amd64/gen/setjmp.S +++ b/lib/libc/amd64/gen/setjmp.S @@ -110,3 +110,5 @@ ENTRY(__longjmp) 1: movq %rcx,0(%rsp) ret END(__longjmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/gen/sigsetjmp.S b/lib/libc/amd64/gen/sigsetjmp.S index 8da4867..438d440 100644 --- a/lib/libc/amd64/gen/sigsetjmp.S +++ b/lib/libc/amd64/gen/sigsetjmp.S @@ -111,3 +111,5 @@ ENTRY(__siglongjmp) 1: movq %rcx,0(%rsp) ret END(__siglongjmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/stdlib/div.S b/lib/libc/amd64/stdlib/div.S index f3c2a59..366010c 100644 --- a/lib/libc/amd64/stdlib/div.S +++ b/lib/libc/amd64/stdlib/div.S @@ -16,3 +16,5 @@ ENTRY(div) orq %rdx,%rax ret END(div) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/stdlib/ldiv.S b/lib/libc/amd64/stdlib/ldiv.S index 2a0a8cf..f11472c 100644 --- a/lib/libc/amd64/stdlib/ldiv.S +++ b/lib/libc/amd64/stdlib/ldiv.S @@ -14,3 +14,5 @@ ENTRY(ldiv) idivq %rsi ret END(ldiv) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/stdlib/lldiv.S b/lib/libc/amd64/stdlib/lldiv.S index e5ae5ca..4dab0fd 100644 --- a/lib/libc/amd64/stdlib/lldiv.S +++ b/lib/libc/amd64/stdlib/lldiv.S @@ -14,3 +14,5 @@ ENTRY(lldiv) idivq %rsi ret END(lldiv) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/string/bcmp.S b/lib/libc/amd64/string/bcmp.S index 375c3bc..d01b76b 100644 --- a/lib/libc/amd64/string/bcmp.S +++ b/lib/libc/amd64/string/bcmp.S @@ -23,3 +23,5 @@ L1: movsbl %al,%eax ret END(bcmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/string/bcopy.S b/lib/libc/amd64/string/bcopy.S index f7aa6d1..cc38f47 100644 --- a/lib/libc/amd64/string/bcopy.S +++ b/lib/libc/amd64/string/bcopy.S @@ -95,3 +95,5 @@ END(memmove) END(bcopy) #endif #endif + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/string/bzero.S b/lib/libc/amd64/string/bzero.S index 0de67d3..cf46a2a 100644 --- a/lib/libc/amd64/string/bzero.S +++ b/lib/libc/amd64/string/bzero.S @@ -42,3 +42,5 @@ L1: movq %rsi,%rcx /* zero remainder by bytes */ ret END(bzero) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/string/memcmp.S b/lib/libc/amd64/string/memcmp.S index a039b5b..66d64a0 100644 --- a/lib/libc/amd64/string/memcmp.S +++ b/lib/libc/amd64/string/memcmp.S @@ -40,3 +40,5 @@ L6: xorl %eax,%eax /* Perform unsigned comparison */ subl %edx,%eax ret END(memcmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/string/memset.S b/lib/libc/amd64/string/memset.S index ed8ba24..84d1562 100644 --- a/lib/libc/amd64/string/memset.S +++ b/lib/libc/amd64/string/memset.S @@ -59,3 +59,5 @@ L1: rep ret END(memset) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/string/strcat.S b/lib/libc/amd64/string/strcat.S index b241ffc..7b5a1dd 100644 --- a/lib/libc/amd64/string/strcat.S +++ b/lib/libc/amd64/string/strcat.S @@ -164,3 +164,5 @@ ENTRY(strcat) .Ldone: ret END(strcat) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/string/strcmp.S b/lib/libc/amd64/string/strcmp.S index 81f54cb..07009c1 100644 --- a/lib/libc/amd64/string/strcmp.S +++ b/lib/libc/amd64/string/strcmp.S @@ -72,3 +72,5 @@ ENTRY(strcmp) subq %rdx,%rax ret END(strcmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/string/strcpy.S b/lib/libc/amd64/string/strcpy.S index 8cafa12..5feb925 100644 --- a/lib/libc/amd64/string/strcpy.S +++ b/lib/libc/amd64/string/strcpy.S @@ -110,3 +110,5 @@ ENTRY(strcpy) .Ldone: ret END(strcpy) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/brk.S b/lib/libc/amd64/sys/brk.S index c25daff..2319417 100644 --- a/lib/libc/amd64/sys/brk.S +++ b/lib/libc/amd64/sys/brk.S @@ -83,3 +83,5 @@ err: jmp HIDENAME(cerror) #endif END(brk) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/cerror.S b/lib/libc/amd64/sys/cerror.S index 547a18c..d01cf4a 100644 --- a/lib/libc/amd64/sys/cerror.S +++ b/lib/libc/amd64/sys/cerror.S @@ -56,3 +56,4 @@ HIDENAME(cerror): movq $-1,%rdx ret + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/exect.S b/lib/libc/amd64/sys/exect.S index 93125fa..81dc8e5 100644 --- a/lib/libc/amd64/sys/exect.S +++ b/lib/libc/amd64/sys/exect.S @@ -54,3 +54,5 @@ ENTRY(exect) jmp HIDENAME(cerror) #endif END(exect) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/getcontext.S b/lib/libc/amd64/sys/getcontext.S index 08a6493..ea29adb 100644 --- a/lib/libc/amd64/sys/getcontext.S +++ b/lib/libc/amd64/sys/getcontext.S @@ -53,3 +53,5 @@ ENTRY(__sys_getcontext) jmp HIDENAME(cerror) #endif END(__sys_getcontext) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/pipe.S b/lib/libc/amd64/sys/pipe.S index a286064..59c1ac1c 100644 --- a/lib/libc/amd64/sys/pipe.S +++ b/lib/libc/amd64/sys/pipe.S @@ -58,3 +58,5 @@ ENTRY(__sys_pipe) jmp HIDENAME(cerror) #endif END(__sys_pipe) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/ptrace.S b/lib/libc/amd64/sys/ptrace.S index 29ebade..6235390 100644 --- a/lib/libc/amd64/sys/ptrace.S +++ b/lib/libc/amd64/sys/ptrace.S @@ -58,3 +58,5 @@ err: jmp HIDENAME(cerror) #endif END(ptrace) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/reboot.S b/lib/libc/amd64/sys/reboot.S index 59df944..e79ca79 100644 --- a/lib/libc/amd64/sys/reboot.S +++ b/lib/libc/amd64/sys/reboot.S @@ -55,3 +55,5 @@ ENTRY(__sys_reboot) jmp HIDENAME(cerror) #endif END(__sys_reboot) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/sbrk.S b/lib/libc/amd64/sys/sbrk.S index fed3882..3e4d8aa 100644 --- a/lib/libc/amd64/sys/sbrk.S +++ b/lib/libc/amd64/sys/sbrk.S @@ -86,3 +86,5 @@ err: jmp HIDENAME(cerror) #endif END(sbrk) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/setlogin.S b/lib/libc/amd64/sys/setlogin.S index 649289a..23692b9 100644 --- a/lib/libc/amd64/sys/setlogin.S +++ b/lib/libc/amd64/sys/setlogin.S @@ -63,3 +63,5 @@ ENTRY(__sys_setlogin) jmp HIDENAME(cerror) #endif END(__sys_setlogin) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/sigreturn.S b/lib/libc/amd64/sys/sigreturn.S index 28dc227..f91816e 100644 --- a/lib/libc/amd64/sys/sigreturn.S +++ b/lib/libc/amd64/sys/sigreturn.S @@ -44,3 +44,5 @@ __FBSDID("$FreeBSD$"); */ RSYSCALL(sigreturn) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/vfork.S b/lib/libc/amd64/sys/vfork.S index d955e5f..555c3ca 100644 --- a/lib/libc/amd64/sys/vfork.S +++ b/lib/libc/amd64/sys/vfork.S @@ -57,3 +57,5 @@ ENTRY(__sys_vfork) jmp HIDENAME(cerror) #endif END(__sys_vfork) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index f9abab5..32cf92c 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -453,6 +453,7 @@ FBSDprivate_1.0 { _rtld_atfork_pre; _rtld_atfork_post; _rtld_error; /* for private use */ + _rtld_get_stack_prot; _rtld_thread_init; /* for private use */ __elf_phdr_match_addr; _err; @@ -499,4 +500,5 @@ FBSDprivate_1.0 { _libc_sem_getvalue_compat; __elf_aux_vector; + __pthread_map_stacks_exec; }; diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index 930ebc1..b109cc9 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); /* * Linkage to services provided by the dynamic linker. */ +#include <sys/mman.h> #include <dlfcn.h> #include <link.h> #include <stddef.h> @@ -165,3 +166,12 @@ _rtld_addr_phdr(const void *addr, struct dl_phdr_info *phdr_info) return (0); } + +#pragma weak _rtld_get_stack_prot +int +_rtld_get_stack_prot(void) +{ + + return (PROT_EXEC | PROT_READ | PROT_WRITE); +} + diff --git a/lib/libc/gen/elf_utils.c b/lib/libc/gen/elf_utils.c index 9ee5f41..7bd7511 100644 --- a/lib/libc/gen/elf_utils.c +++ b/lib/libc/gen/elf_utils.c @@ -26,7 +26,12 @@ * $FreeBSD$ */ +#include <sys/types.h> +#include <sys/mman.h> +#include <sys/resource.h> +#include <sys/sysctl.h> #include <link.h> +#include <stddef.h> int __elf_phdr_match_addr(struct dl_phdr_info *phdr_info, void *addr) @@ -45,3 +50,25 @@ __elf_phdr_match_addr(struct dl_phdr_info *phdr_info, void *addr) } return (i != phdr_info->dlpi_phnum); } + +#pragma weak __pthread_map_stacks_exec +void +__pthread_map_stacks_exec(void) +{ + int mib[2]; + struct rlimit rlim; + u_long usrstack; + size_t len; + + mib[0] = CTL_KERN; + mib[1] = KERN_USRSTACK; + len = sizeof(usrstack); + if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), &usrstack, &len, NULL, 0) + == -1) + return; + if (getrlimit(RLIMIT_STACK, &rlim) == -1) + return; + mprotect((void *)(uintptr_t)(usrstack - rlim.rlim_cur), + rlim.rlim_cur, _rtld_get_stack_prot()); +} + diff --git a/lib/libc/gen/glob.3 b/lib/libc/gen/glob.3 index 4c912bb..7d6e43b 100644 --- a/lib/libc/gen/glob.3 +++ b/lib/libc/gen/glob.3 @@ -30,7 +30,7 @@ .\" @(#)glob.3 8.3 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd September 1, 2004 +.Dd February 15, 2011 .Dt GLOB 3 .Os .Sh NAME @@ -417,7 +417,7 @@ execvp("ls", g.gl_pathv); .Sh SEE ALSO .Xr sh 1 , .Xr fnmatch 3 , -.Xr regexp 3 +.Xr regex 3 .Sh STANDARDS The current implementation of the .Fn glob diff --git a/lib/libc/gen/psignal.3 b/lib/libc/gen/psignal.3 index 5ad6ee2..5986ffa 100644 --- a/lib/libc/gen/psignal.3 +++ b/lib/libc/gen/psignal.3 @@ -28,7 +28,7 @@ .\" @(#)psignal.3 8.2 (Berkeley) 2/27/95 .\" $FreeBSD$ .\" -.Dd February 27, 1995 +.Dd February 4, 2011 .Dt PSIGNAL 3 .Os .Sh NAME @@ -89,7 +89,7 @@ indexed by recognized signal numbers. The external array .Va sys_signame is used similarly and -contains short, lower-case abbreviations for signals +contains short, upper-case abbreviations for signals which are useful for recognizing signal names in user input. The defined variable diff --git a/lib/libc/gen/rfork_thread.3 b/lib/libc/gen/rfork_thread.3 index e985e1c..dfd6fbc 100644 --- a/lib/libc/gen/rfork_thread.3 +++ b/lib/libc/gen/rfork_thread.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2000 +.Dd February 6, 2011 .Dt RFORK_THREAD 3 .Os .Sh NAME @@ -38,6 +38,13 @@ .Ft pid_t .Fn rfork_thread "int flags" "void *stack" "int (*func)(void *arg)" "void *arg" .Sh DESCRIPTION +.Bf -symbolic +The +.Fn rfork_thread +function has been deprecated in favor of +.Xr pthread_create 3 . +.Ef +.Pp The .Fn rfork_thread function @@ -71,7 +78,8 @@ for error return codes. .Xr intro 2 , .Xr minherit 2 , .Xr rfork 2 , -.Xr vfork 2 +.Xr vfork 2 , +.Xr pthread_create 3 .Sh HISTORY The .Fn rfork_thread diff --git a/lib/libc/gen/siglist.c b/lib/libc/gen/siglist.c index 1ff1337..d4abfaa 100644 --- a/lib/libc/gen/siglist.c +++ b/lib/libc/gen/siglist.c @@ -37,37 +37,37 @@ __FBSDID("$FreeBSD$"); const char *const sys_signame[NSIG] = { "Signal 0", - "hup", /* SIGHUP */ - "int", /* SIGINT */ - "quit", /* SIGQUIT */ - "ill", /* SIGILL */ - "trap", /* SIGTRAP */ - "abrt", /* SIGABRT */ - "emt", /* SIGEMT */ - "fpe", /* SIGFPE */ - "kill", /* SIGKILL */ - "bus", /* SIGBUS */ - "segv", /* SIGSEGV */ - "sys", /* SIGSYS */ - "pipe", /* SIGPIPE */ - "alrm", /* SIGALRM */ - "term", /* SIGTERM */ - "urg", /* SIGURG */ - "stop", /* SIGSTOP */ - "tstp", /* SIGTSTP */ - "cont", /* SIGCONT */ - "chld", /* SIGCHLD */ - "ttin", /* SIGTTIN */ - "ttou", /* SIGTTOU */ - "io", /* SIGIO */ - "xcpu", /* SIGXCPU */ - "xfsz", /* SIGXFSZ */ - "vtalrm", /* SIGVTALRM */ - "prof", /* SIGPROF */ - "winch", /* SIGWINCH */ - "info", /* SIGINFO */ - "usr1", /* SIGUSR1 */ - "usr2" /* SIGUSR2 */ + "HUP", /* SIGHUP */ + "INT", /* SIGINT */ + "QUIT", /* SIGQUIT */ + "ILL", /* SIGILL */ + "TRAP", /* SIGTRAP */ + "ABRT", /* SIGABRT */ + "EMT", /* SIGEMT */ + "FPE", /* SIGFPE */ + "KILL", /* SIGKILL */ + "BUS", /* SIGBUS */ + "SEGV", /* SIGSEGV */ + "SYS", /* SIGSYS */ + "PIPE", /* SIGPIPE */ + "ALRM", /* SIGALRM */ + "TERM", /* SIGTERM */ + "URG", /* SIGURG */ + "STOP", /* SIGSTOP */ + "TSTP", /* SIGTSTP */ + "CONT", /* SIGCONT */ + "CHLD", /* SIGCHLD */ + "TTIN", /* SIGTTIN */ + "TTOU", /* SIGTTOU */ + "IO", /* SIGIO */ + "XCPU", /* SIGXCPU */ + "XFSZ", /* SIGXFSZ */ + "VTALRM", /* SIGVTALRM */ + "PROF", /* SIGPROF */ + "WINCH", /* SIGWINCH */ + "INFO", /* SIGINFO */ + "USR1", /* SIGUSR1 */ + "USR2" /* SIGUSR2 */ }; const char *const sys_siglist[NSIG] = { diff --git a/lib/libc/gen/sysconf.3 b/lib/libc/gen/sysconf.3 index 05766cc..51f7eeb 100644 --- a/lib/libc/gen/sysconf.3 +++ b/lib/libc/gen/sysconf.3 @@ -28,7 +28,7 @@ .\" @(#)sysconf.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 14, 2006 +.Dd February 13, 2011 .Dt SYSCONF 3 .Os .Sh NAME @@ -85,6 +85,9 @@ The number of processors currently online. The maximum number of open files per user id. .It Li _SC_PAGESIZE The size of a system page in bytes. +.It Li _SC_PAGE_SIZE +Equivalent to +.Li _SC_PAGESIZE . .It Li _SC_STREAM_MAX The minimum maximum number of streams that a process may have open at any one time. @@ -160,10 +163,64 @@ otherwise \-1. .It Li _SC_2_UPE Return 1 if the system supports the User Portability Utilities Option, otherwise \-1. +.It Li _SC_AIO_LISTIO_MAX +Maximum number of I/O operations in a single list I/O call supported. +.It Li _SC_AIO_MAX +Maximum number of outstanding asynchronous I/O operations supported. +.It Li _SC_AIO_PRIO_DELTA_MAX +The maximum amount by which a process can decrease its asynchronous I/O +priority level from its own scheduling priority. +.It Li _SC_DELAYTIMER_MAX +Maximum number of timer expiration overruns. +.It Li _SC_MQ_OPEN_MAX +The maximum number of open message queue descriptors a process may hold. +.It Li _SC_RTSIG_MAX +Maximum number of realtime signals reserved for application use. +.It Li _SC_SEM_NSEMS_MAX +Maximum number of semaphores that a process may have. +.It Li _SC_SEM_VALUE_MAX +The maximum value a semaphore may have. +.It Li _SC_SIGQUEUE_MAX +Maximum number of queued signals that a process may send and have pending at +the receiver(s) at any time. +.It Li _SC_TIMER_MAX +Maximum number of timers per process supported. +.It Li _SC_GETGR_R_SIZE_MAX +Suggested initial value for the size of the group entry buffer. +.It Li _SC_GETPW_R_SIZE_MAX +Suggested initial value for the size of the password entry buffer. +.It Li _SC_HOST_NAME_MAX +Maximum length of a host name (not including the terminating null) as +returned from the +.Fn gethostname +function. +.It Li _SC_LOGIN_NAME_MAX +Maximum length of a login name. +.It Li _SC_THREAD_STACK_MIN +Minimum size in bytes of thread stack storage. +.It Li _SC_THREAD_THREADS_MAX +Maximum number of threads that can be created per process. +.It Li _SC_TTY_NAME_MAX +Maximum length of terminal device name. +.It Li _SC_SYMLOOP_MAX +Maximum number of symbolic links that can be reliably traversed in the +resolution of a pathname in the absence of a loop. +.It Li _SC_ATEXIT_MAX +Maximum number of functions that may be registered with +.Fn atexit . +.It Li _SC_XOPEN_VERSION +An integer value greater than or equal to 4, +indicating the version of the X/Open Portability Guide to which this +system conforms. +.It Li _SC_XOPEN_XCU_VERSION +An integer value indicating the version of the XCU Specification to which +this system conforms. .El .Pp These values also exist, but may not be standard: .Bl -tag -width 6n +.It Li _SC_CPUSET_SIZE +Size of the kernel cpuset. .It Li _SC_PHYS_PAGES The number of pages of physical memory. Note that it is possible that the product of this value and the value of diff --git a/lib/libc/i386/gen/_ctx_start.S b/lib/libc/i386/gen/_ctx_start.S index 7083d3c..fdea371 100644 --- a/lib/libc/i386/gen/_ctx_start.S +++ b/lib/libc/i386/gen/_ctx_start.S @@ -50,3 +50,5 @@ ENTRY(_ctx_start) call PIC_PLT(abort) /* fubar */ ret END(_ctx_start) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/gen/_setjmp.S b/lib/libc/i386/gen/_setjmp.S index 7eb1ae3..3d9fdb4 100644 --- a/lib/libc/i386/gen/_setjmp.S +++ b/lib/libc/i386/gen/_setjmp.S @@ -78,3 +78,5 @@ ENTRY(___longjmp) 1: movl %ecx,0(%esp) ret END(___longjmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/gen/fabs.S b/lib/libc/i386/gen/fabs.S index 9903fd3..7fb1531 100644 --- a/lib/libc/i386/gen/fabs.S +++ b/lib/libc/i386/gen/fabs.S @@ -41,3 +41,5 @@ ENTRY(fabs) fabs ret END(fabs) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/gen/modf.S b/lib/libc/i386/gen/modf.S index 0f7112e..33c211f 100644 --- a/lib/libc/i386/gen/modf.S +++ b/lib/libc/i386/gen/modf.S @@ -83,3 +83,5 @@ ENTRY(modf) leave ret END(modf) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/gen/rfork_thread.S b/lib/libc/i386/gen/rfork_thread.S index 841717a..3333d84 100644 --- a/lib/libc/i386/gen/rfork_thread.S +++ b/lib/libc/i386/gen/rfork_thread.S @@ -116,3 +116,5 @@ ENTRY(rfork_thread) PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) END(rfork_thread) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/gen/setjmp.S b/lib/libc/i386/gen/setjmp.S index 6f6cd89..5d0ddc4 100644 --- a/lib/libc/i386/gen/setjmp.S +++ b/lib/libc/i386/gen/setjmp.S @@ -98,3 +98,5 @@ ENTRY(__longjmp) 1: movl %ecx,0(%esp) ret END(__longjmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/gen/sigsetjmp.S b/lib/libc/i386/gen/sigsetjmp.S index 6134d03..6487745 100644 --- a/lib/libc/i386/gen/sigsetjmp.S +++ b/lib/libc/i386/gen/sigsetjmp.S @@ -110,3 +110,5 @@ ENTRY(__siglongjmp) 1: movl %ecx,0(%esp) ret END(__siglongjmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/stdlib/div.S b/lib/libc/i386/stdlib/div.S index 42e7ef4..81d6e6e 100644 --- a/lib/libc/i386/stdlib/div.S +++ b/lib/libc/i386/stdlib/div.S @@ -35,3 +35,5 @@ ENTRY(div) idiv %ecx ret END(div) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/stdlib/ldiv.S b/lib/libc/i386/stdlib/ldiv.S index b0455bf..c40c631 100644 --- a/lib/libc/i386/stdlib/ldiv.S +++ b/lib/libc/i386/stdlib/ldiv.S @@ -38,3 +38,5 @@ ENTRY(ldiv) idiv %ecx ret END(ldiv) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/bcmp.S b/lib/libc/i386/string/bcmp.S index eaf9666..b25ee6e 100644 --- a/lib/libc/i386/string/bcmp.S +++ b/lib/libc/i386/string/bcmp.S @@ -62,3 +62,5 @@ L1: popl %edi ret END(bcmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/bcopy.S b/lib/libc/i386/string/bcopy.S index 2f3525e..cab1de6 100644 --- a/lib/libc/i386/string/bcopy.S +++ b/lib/libc/i386/string/bcopy.S @@ -106,3 +106,5 @@ END(memmove) END(bcopy) #endif #endif + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/bzero.S b/lib/libc/i386/string/bzero.S index 3c22b36..c8d3776 100644 --- a/lib/libc/i386/string/bzero.S +++ b/lib/libc/i386/string/bzero.S @@ -80,3 +80,5 @@ L1: rep popl %edi ret END(bzero) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/ffs.S b/lib/libc/i386/string/ffs.S index e668447..3a0431c 100644 --- a/lib/libc/i386/string/ffs.S +++ b/lib/libc/i386/string/ffs.S @@ -52,3 +52,5 @@ ENTRY(ffs) L1: xorl %eax,%eax /* clear result */ ret END(ffs) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/index.S b/lib/libc/i386/string/index.S index e7e7a8c..3bdd68d 100644 --- a/lib/libc/i386/string/index.S +++ b/lib/libc/i386/string/index.S @@ -62,3 +62,5 @@ L2: popl %ebx ret END(index) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/memchr.S b/lib/libc/i386/string/memchr.S index a313d4d..03828db 100644 --- a/lib/libc/i386/string/memchr.S +++ b/lib/libc/i386/string/memchr.S @@ -57,3 +57,5 @@ L1: xorl %eax,%eax popl %edi ret END(memchr) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/memcmp.S b/lib/libc/i386/string/memcmp.S index fa9586f..cbb3b8a 100644 --- a/lib/libc/i386/string/memcmp.S +++ b/lib/libc/i386/string/memcmp.S @@ -74,3 +74,5 @@ L6: movzbl -1(%edi),%eax /* Perform unsigned comparison */ popl %edi ret END(memcmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/memset.S b/lib/libc/i386/string/memset.S index 25768c22..f5da603 100644 --- a/lib/libc/i386/string/memset.S +++ b/lib/libc/i386/string/memset.S @@ -88,3 +88,5 @@ L1: rep popl %edi ret END(memset) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/rindex.S b/lib/libc/i386/string/rindex.S index c52f6d3..e59406c9 100644 --- a/lib/libc/i386/string/rindex.S +++ b/lib/libc/i386/string/rindex.S @@ -63,3 +63,5 @@ L2: popl %ebx ret END(rindex) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/strcat.S b/lib/libc/i386/string/strcat.S index 6715bd8..835a7e9 100644 --- a/lib/libc/i386/string/strcat.S +++ b/lib/libc/i386/string/strcat.S @@ -99,3 +99,5 @@ L2: popl %eax /* pop destination address */ popl %edi /* restore edi */ ret END(strcat) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/strchr.S b/lib/libc/i386/string/strchr.S index 8c518fb..ddae795 100644 --- a/lib/libc/i386/string/strchr.S +++ b/lib/libc/i386/string/strchr.S @@ -62,3 +62,5 @@ L2: popl %ebx ret END(strchr) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/strcmp.S b/lib/libc/i386/string/strcmp.S index 9ca104e..6599577 100644 --- a/lib/libc/i386/string/strcmp.S +++ b/lib/libc/i386/string/strcmp.S @@ -118,3 +118,5 @@ L3: movzbl (%eax),%eax /* unsigned comparison */ subl %edx,%eax ret END(strcmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/strcpy.S b/lib/libc/i386/string/strcpy.S index 7367c07..c5113f6 100644 --- a/lib/libc/i386/string/strcpy.S +++ b/lib/libc/i386/string/strcpy.S @@ -88,3 +88,5 @@ L1: movb (%edx),%al /* unroll loop, but not too much */ L2: popl %eax /* pop dst address */ ret END(strcpy) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/strncmp.S b/lib/libc/i386/string/strncmp.S index 98e3656..ec9b531 100644 --- a/lib/libc/i386/string/strncmp.S +++ b/lib/libc/i386/string/strncmp.S @@ -165,3 +165,5 @@ L4: xorl %eax,%eax popl %ebx ret END(strncmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/strrchr.S b/lib/libc/i386/string/strrchr.S index f044c2e..0d7f0ca 100644 --- a/lib/libc/i386/string/strrchr.S +++ b/lib/libc/i386/string/strrchr.S @@ -63,3 +63,5 @@ L2: popl %ebx ret END(strrchr) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/swab.S b/lib/libc/i386/string/swab.S index 5035de2..3d21e64 100644 --- a/lib/libc/i386/string/swab.S +++ b/lib/libc/i386/string/swab.S @@ -98,3 +98,5 @@ L4: popl %edi popl %esi ret END(swab) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/wcschr.S b/lib/libc/i386/string/wcschr.S index 8f6c543..37862a9 100644 --- a/lib/libc/i386/string/wcschr.S +++ b/lib/libc/i386/string/wcschr.S @@ -75,3 +75,5 @@ no: popl %ebx xorl %eax,%eax ret END(wcschr) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/wcscmp.S b/lib/libc/i386/string/wcscmp.S index 8d0700a..6fbcb8c 100644 --- a/lib/libc/i386/string/wcscmp.S +++ b/lib/libc/i386/string/wcscmp.S @@ -78,3 +78,5 @@ no0: subl (%esi),%eax popl %edi ret END(wcscmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/wcslen.S b/lib/libc/i386/string/wcslen.S index 9fea2b0..691e17f 100644 --- a/lib/libc/i386/string/wcslen.S +++ b/lib/libc/i386/string/wcslen.S @@ -67,3 +67,5 @@ found1: incl %eax found0: popl %ebx ret END(wcslen) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/wmemchr.S b/lib/libc/i386/string/wmemchr.S index 2b5270b..2e81c09 100644 --- a/lib/libc/i386/string/wmemchr.S +++ b/lib/libc/i386/string/wmemchr.S @@ -104,3 +104,5 @@ no: xorl %eax,%eax popl %edi ret END(wmemchr) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/Ovfork.S b/lib/libc/i386/sys/Ovfork.S index 25a9d94..e3cc45d 100644 --- a/lib/libc/i386/sys/Ovfork.S +++ b/lib/libc/i386/sys/Ovfork.S @@ -53,3 +53,5 @@ ENTRY(__sys_vfork) PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) END(__sys_vfork) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/brk.S b/lib/libc/i386/sys/brk.S index f67a2a2..968e437 100644 --- a/lib/libc/i386/sys/brk.S +++ b/lib/libc/i386/sys/brk.S @@ -86,3 +86,5 @@ err: jmp HIDENAME(cerror) #endif END(brk) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/cerror.S b/lib/libc/i386/sys/cerror.S index 3e8d539..129cc1b 100644 --- a/lib/libc/i386/sys/cerror.S +++ b/lib/libc/i386/sys/cerror.S @@ -63,3 +63,4 @@ HIDENAME(cerror): movl $-1,%edx ret + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/exect.S b/lib/libc/i386/sys/exect.S index 5eb0d44..3ae87b8 100644 --- a/lib/libc/i386/sys/exect.S +++ b/lib/libc/i386/sys/exect.S @@ -50,3 +50,5 @@ ENTRY(exect) PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) /* exect(file, argv, env); */ END(exect) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/getcontext.S b/lib/libc/i386/sys/getcontext.S index 6942749..c24dbdc 100644 --- a/lib/libc/i386/sys/getcontext.S +++ b/lib/libc/i386/sys/getcontext.S @@ -49,3 +49,5 @@ ENTRY(__sys_getcontext) PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) END(__sys_getcontext) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/pipe.S b/lib/libc/i386/sys/pipe.S index 0ce3a8c..85f4fd2 100644 --- a/lib/libc/i386/sys/pipe.S +++ b/lib/libc/i386/sys/pipe.S @@ -45,3 +45,5 @@ SYSCALL(pipe) movl $0,%eax ret END(__sys_pipe) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/ptrace.S b/lib/libc/i386/sys/ptrace.S index 7527e7e..6e5e885 100644 --- a/lib/libc/i386/sys/ptrace.S +++ b/lib/libc/i386/sys/ptrace.S @@ -56,3 +56,5 @@ err: PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) END(ptrace) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/reboot.S b/lib/libc/i386/sys/reboot.S index d5caccf..f11000e 100644 --- a/lib/libc/i386/sys/reboot.S +++ b/lib/libc/i386/sys/reboot.S @@ -41,3 +41,5 @@ __FBSDID("$FreeBSD$"); SYSCALL(reboot) iret END(__sys_reboot) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/sbrk.S b/lib/libc/i386/sys/sbrk.S index 36a1b55..337087a 100644 --- a/lib/libc/i386/sys/sbrk.S +++ b/lib/libc/i386/sys/sbrk.S @@ -89,3 +89,5 @@ err: jmp HIDENAME(cerror) #endif /* PIC */ END(sbrk) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/setlogin.S b/lib/libc/i386/sys/setlogin.S index 2a814bd..c6436b5 100644 --- a/lib/libc/i386/sys/setlogin.S +++ b/lib/libc/i386/sys/setlogin.S @@ -53,3 +53,5 @@ SYSCALL(setlogin) #endif ret /* setlogin(name) */ END(__sys_setlogin) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/sigreturn.S b/lib/libc/i386/sys/sigreturn.S index 28dc227..f91816e 100644 --- a/lib/libc/i386/sys/sigreturn.S +++ b/lib/libc/i386/sys/sigreturn.S @@ -44,3 +44,5 @@ __FBSDID("$FreeBSD$"); */ RSYSCALL(sigreturn) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/syscall.S b/lib/libc/i386/sys/syscall.S index d26ce47..e5d6e23 100644 --- a/lib/libc/i386/sys/syscall.S +++ b/lib/libc/i386/sys/syscall.S @@ -51,3 +51,5 @@ ENTRY(syscall) PIC_PROLOGUE jmp PIC_PLT(HIDENAME(cerror)) END(syscall) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h index 6ba8bab..1e00030 100644 --- a/lib/libc/include/namespace.h +++ b/lib/libc/include/namespace.h @@ -137,6 +137,7 @@ #define pthread_getprio _pthread_getprio #define pthread_getschedparam _pthread_getschedparam #define pthread_getspecific _pthread_getspecific +#define pthread_getthreadid_np _pthread_getthreadid_np #define pthread_join _pthread_join #define pthread_key_create _pthread_key_create #define pthread_key_delete _pthread_key_delete diff --git a/lib/libc/include/un-namespace.h b/lib/libc/include/un-namespace.h index 00f0df2..9c9ce97 100644 --- a/lib/libc/include/un-namespace.h +++ b/lib/libc/include/un-namespace.h @@ -118,6 +118,7 @@ #undef pthread_getprio #undef pthread_getschedparam #undef pthread_getspecific +#undef pthread_getthreadid_np #undef pthread_join #undef pthread_key_create #undef pthread_key_delete diff --git a/lib/libc/locale/mbrtowc.3 b/lib/libc/locale/mbrtowc.3 index ae5f5da..10160d1 100644 --- a/lib/libc/locale/mbrtowc.3 +++ b/lib/libc/locale/mbrtowc.3 @@ -69,7 +69,7 @@ was .Dv NULL , .Fa s was an empty string -.Pq Qq \& +.Pq Qq and .Fa n was 1. diff --git a/lib/libc/net/hesiod.c b/lib/libc/net/hesiod.c index c22bdba..2413727 100644 --- a/lib/libc/net/hesiod.c +++ b/lib/libc/net/hesiod.c @@ -324,6 +324,7 @@ read_config_file(ctx, filename) ? &ctx->lhs : &ctx->rhs; *which = strdup(data); if (!*which) { + fclose(fp); errno = ENOMEM; return -1; } diff --git a/lib/libc/posix1e/acl_is_trivial_np.3 b/lib/libc/posix1e/acl_is_trivial_np.3 index 787e3f9..4ad1a63 100644 --- a/lib/libc/posix1e/acl_is_trivial_np.3 +++ b/lib/libc/posix1e/acl_is_trivial_np.3 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd December 13, 2010 .Dt ACL_STRIP_NP 3 .Os .Sh NAME @@ -56,7 +56,9 @@ ACL is trivial if it can be fully expressed as a file mode without loosing any access rules. For POSIX.1e ACLs, ACL is trivial if it has the three required entries, one for owner, one for owning group, and one for other. -For NFSv4 ACLs, ACL is trivial if it has the "canonical six" entries. +For NFSv4 ACLs, ACL is trivial if is identical to the ACL generated by +.Fn acl_strip_np 3 +from the file mode. Files that have non-trivial ACL have a plus sign appended after mode bits in "ls -l" output. .Sh RETURN VALUES diff --git a/lib/libc/powerpc/gen/_ctx_start.S b/lib/libc/powerpc/gen/_ctx_start.S index a269e86..2d3cfcf 100644 --- a/lib/libc/powerpc/gen/_ctx_start.S +++ b/lib/libc/powerpc/gen/_ctx_start.S @@ -41,3 +41,5 @@ * above branch. */ bl PIC_PLT(CNAME(abort)) /* abort */ + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/gen/_setjmp.S b/lib/libc/powerpc/gen/_setjmp.S index 6d6e5e0..9b9f86e 100644 --- a/lib/libc/powerpc/gen/_setjmp.S +++ b/lib/libc/powerpc/gen/_setjmp.S @@ -69,3 +69,5 @@ ENTRY(_longjmp) bnelr li %r3,1 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/gen/fabs.S b/lib/libc/powerpc/gen/fabs.S index 79475ca..7891012 100644 --- a/lib/libc/powerpc/gen/fabs.S +++ b/lib/libc/powerpc/gen/fabs.S @@ -33,3 +33,5 @@ __FBSDID("$FreeBSD$"); ENTRY(fabs) fabs %f1,%f1 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/gen/setjmp.S b/lib/libc/powerpc/gen/setjmp.S index a796120..6aaf81c 100644 --- a/lib/libc/powerpc/gen/setjmp.S +++ b/lib/libc/powerpc/gen/setjmp.S @@ -89,3 +89,4 @@ ENTRY(__longjmp) li %r3,1 blr + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/gen/sigsetjmp.S b/lib/libc/powerpc/gen/sigsetjmp.S index 3d5d1e5..5a6fd21 100644 --- a/lib/libc/powerpc/gen/sigsetjmp.S +++ b/lib/libc/powerpc/gen/sigsetjmp.S @@ -95,3 +95,5 @@ ENTRY(siglongjmp) bnelr li %r3,1 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/sys/brk.S b/lib/libc/powerpc/sys/brk.S index 9223db3..018eec9 100644 --- a/lib/libc/powerpc/sys/brk.S +++ b/lib/libc/powerpc/sys/brk.S @@ -71,3 +71,5 @@ ENTRY(brk) 1: b PIC_PLT(HIDENAME(cerror)) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/sys/cerror.S b/lib/libc/powerpc/sys/cerror.S index 91a3006..7667cb8 100644 --- a/lib/libc/powerpc/sys/cerror.S +++ b/lib/libc/powerpc/sys/cerror.S @@ -54,4 +54,4 @@ HIDENAME(cerror): li %r4,-1 blr /* return to callers caller */ - + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/sys/exect.S b/lib/libc/powerpc/sys/exect.S index d5f9c20..3c39b3c 100644 --- a/lib/libc/powerpc/sys/exect.S +++ b/lib/libc/powerpc/sys/exect.S @@ -37,3 +37,5 @@ ENTRY(exect) blr 1: b PIC_PLT(HIDENAME(cerror)) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/sys/pipe.S b/lib/libc/powerpc/sys/pipe.S index 3ca2358..3f6d9a4 100644 --- a/lib/libc/powerpc/sys/pipe.S +++ b/lib/libc/powerpc/sys/pipe.S @@ -41,3 +41,5 @@ ENTRY(pipe) blr /* and return 0 */ 1: b PIC_PLT(HIDENAME(cerror)) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/sys/ptrace.S b/lib/libc/powerpc/sys/ptrace.S index f47fc67..0bc25c9 100644 --- a/lib/libc/powerpc/sys/ptrace.S +++ b/lib/libc/powerpc/sys/ptrace.S @@ -56,3 +56,5 @@ ENTRY(ptrace) blr 1: b PIC_PLT(HIDENAME(cerror)) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/sys/sbrk.S b/lib/libc/powerpc/sys/sbrk.S index 47fc0fe..a5e4020 100644 --- a/lib/libc/powerpc/sys/sbrk.S +++ b/lib/libc/powerpc/sys/sbrk.S @@ -68,3 +68,5 @@ ENTRY(sbrk) blr 2: b PIC_PLT(HIDENAME(cerror)) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc/sys/setlogin.S b/lib/libc/powerpc/sys/setlogin.S index c65e639..e0d6d3c 100644 --- a/lib/libc/powerpc/sys/setlogin.S +++ b/lib/libc/powerpc/sys/setlogin.S @@ -47,3 +47,5 @@ SYSCALL(setlogin) stw %r5,CNAME(_logname_valid)@l(%r4) #endif blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/gen/_ctx_start.S b/lib/libc/powerpc64/gen/_ctx_start.S index 4dabd13..6e373c8 100644 --- a/lib/libc/powerpc64/gen/_ctx_start.S +++ b/lib/libc/powerpc64/gen/_ctx_start.S @@ -45,3 +45,5 @@ */ nop bl PIC_PLT(CNAME(abort)) /* abort */ + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/gen/_setjmp.S b/lib/libc/powerpc64/gen/_setjmp.S index e7ea5f7..a5c247d 100644 --- a/lib/libc/powerpc64/gen/_setjmp.S +++ b/lib/libc/powerpc64/gen/_setjmp.S @@ -114,3 +114,5 @@ ENTRY(_longjmp) bnelr li %r3,1 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/gen/fabs.S b/lib/libc/powerpc64/gen/fabs.S index 79475ca..7891012 100644 --- a/lib/libc/powerpc64/gen/fabs.S +++ b/lib/libc/powerpc64/gen/fabs.S @@ -33,3 +33,5 @@ __FBSDID("$FreeBSD$"); ENTRY(fabs) fabs %f1,%f1 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/gen/setjmp.S b/lib/libc/powerpc64/gen/setjmp.S index fff8aee..0f33ab2 100644 --- a/lib/libc/powerpc64/gen/setjmp.S +++ b/lib/libc/powerpc64/gen/setjmp.S @@ -137,3 +137,4 @@ ENTRY(__longjmp) li %r3,1 blr + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/gen/sigsetjmp.S b/lib/libc/powerpc64/gen/sigsetjmp.S index 9a26a8f..7b50f9f 100644 --- a/lib/libc/powerpc64/gen/sigsetjmp.S +++ b/lib/libc/powerpc64/gen/sigsetjmp.S @@ -142,3 +142,5 @@ ENTRY(siglongjmp) bnelr li %r3,1 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/sys/brk.S b/lib/libc/powerpc64/sys/brk.S index 59b891c..1e71663 100644 --- a/lib/libc/powerpc64/sys/brk.S +++ b/lib/libc/powerpc64/sys/brk.S @@ -69,3 +69,5 @@ ENTRY(brk) ld %r0,16(%r1) mtlr %r0 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/sys/cerror.S b/lib/libc/powerpc64/sys/cerror.S index f8bcc38..db7a10f 100644 --- a/lib/libc/powerpc64/sys/cerror.S +++ b/lib/libc/powerpc64/sys/cerror.S @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); ENTRY(HIDENAME(cerror)) mflr %r0 std %r0,16(%r1) /* save lr */ - stdu %r1,-56(%r1) /* allocate new stack frame */ + stdu %r1,-64(%r1) /* allocate new stack frame */ std %r31,48(%r1) mr %r31,%r3 /* stash errval in callee-saved register */ @@ -57,4 +57,4 @@ ENTRY(HIDENAME(cerror)) li %r4,-1 blr - + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/sys/exect.S b/lib/libc/powerpc64/sys/exect.S index eecbd11..b752fb8 100644 --- a/lib/libc/powerpc64/sys/exect.S +++ b/lib/libc/powerpc64/sys/exect.S @@ -45,3 +45,5 @@ ENTRY(exect) ld %r0,16(%r1) mtlr %r0 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/sys/pipe.S b/lib/libc/powerpc64/sys/pipe.S index fe115b0..0a92df5 100644 --- a/lib/libc/powerpc64/sys/pipe.S +++ b/lib/libc/powerpc64/sys/pipe.S @@ -49,3 +49,5 @@ ENTRY(pipe) ld %r0,16(%r1) mtlr %r0 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/sys/ptrace.S b/lib/libc/powerpc64/sys/ptrace.S index f420e63..bda17e8 100644 --- a/lib/libc/powerpc64/sys/ptrace.S +++ b/lib/libc/powerpc64/sys/ptrace.S @@ -32,8 +32,8 @@ __FBSDID("$FreeBSD$"); ENTRY(ptrace) mflr %r0 - stdu %r1,-68(%r1) - std %r0,84(%r1) + std %r0,16(%r1) + stdu %r1,-80(%r1) stw %r3,48(%r1) stw %r4,52(%r1) std %r5,56(%r1) @@ -47,10 +47,10 @@ ENTRY(ptrace) lwz %r3,48(%r1) lwz %r4,52(%r1) ld %r5,56(%r1) - ld %r0,84(%r1) lwz %r6,64(%r1) - mtlr %r0 ld %r1,0(%r1) + ld %r0,16(%r1) + mtlr %r0 li %r0,SYS_ptrace sc bso 1f @@ -63,3 +63,5 @@ ENTRY(ptrace) ld %r0,16(%r1) mtlr %r0 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/sys/sbrk.S b/lib/libc/powerpc64/sys/sbrk.S index a7a9c77..c767049 100644 --- a/lib/libc/powerpc64/sys/sbrk.S +++ b/lib/libc/powerpc64/sys/sbrk.S @@ -64,3 +64,5 @@ ENTRY(sbrk) ld %r0,16(%r1) mtlr %r0 blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/sys/setlogin.S b/lib/libc/powerpc64/sys/setlogin.S index 19e3212..6183407 100644 --- a/lib/libc/powerpc64/sys/setlogin.S +++ b/lib/libc/powerpc64/sys/setlogin.S @@ -37,3 +37,5 @@ SYSCALL(setlogin) li %r5,0 stw %r5,CNAME(_logname_valid)@toc@l(%r4) blr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/rpc/publickey.3 b/lib/libc/rpc/publickey.3 index 64fe080..d0ad6cc 100644 --- a/lib/libc/rpc/publickey.3 +++ b/lib/libc/rpc/publickey.3 @@ -44,7 +44,7 @@ fails to decrypt the secret key, the routine will return 1 but the argument will be a .Dv NULL string -.Pq Dq \& . +.Pq Dq . .Sh SEE ALSO .Xr publickey 5 .Pp diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c index e75ee4a..66bb8da 100644 --- a/lib/libc/stdlib/realpath.c +++ b/lib/libc/stdlib/realpath.c @@ -54,7 +54,7 @@ realpath(const char * __restrict path, char * __restrict resolved) char *p, *q, *s; size_t left_len, resolved_len; unsigned symlinks; - int serrno, slen, m; + int m, serrno, slen; char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX]; if (path == NULL) { @@ -73,7 +73,6 @@ realpath(const char * __restrict path, char * __restrict resolved) m = 1; } else m = 0; - symlinks = 0; if (path[0] == '/') { resolved[0] = '/'; @@ -86,8 +85,10 @@ realpath(const char * __restrict path, char * __restrict resolved) if (getcwd(resolved, PATH_MAX) == NULL) { if (m) free(resolved); - else - strlcpy(resolved, ".", PATH_MAX); + else { + resolved[0] = '.'; + resolved[1] = '\0'; + } return (NULL); } resolved_len = strlen(resolved); diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 09d4016..fe6116a 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -53,14 +53,23 @@ SYM_MAPS+= ${.CURDIR}/sys/Symbol.map # Generated files CLEANFILES+= ${SASM} ${SPSEUDO} +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "powerpc" +NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n' +.else +NOTE_GNU_STACK='' +.endif + ${SASM}: printf '#include "compat.h"\n' > ${.TARGET} printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >> ${.TARGET} + printf ${NOTE_GNU_STACK} >>${.TARGET} ${SPSEUDO}: printf '#include "compat.h"\n' > ${.TARGET} printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \ >> ${.TARGET} + printf ${NOTE_GNU_STACK} >>${.TARGET} MAN+= abort2.2 accept.2 access.2 acct.2 adjtime.2 \ aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \ diff --git a/lib/libc/sys/getgroups.2 b/lib/libc/sys/getgroups.2 index c02b229..66238a1 100644 --- a/lib/libc/sys/getgroups.2 +++ b/lib/libc/sys/getgroups.2 @@ -28,7 +28,7 @@ .\" @(#)getgroups.2 8.2 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd March 5, 1999 +.Dd January 21, 2011 .Dt GETGROUPS 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/param.h .In unistd.h .Ft int .Fn getgroups "int gidsetlen" "gid_t *gidset" @@ -66,6 +65,12 @@ is zero, returns the number of supplementary group IDs associated with the calling process without modifying the array pointed to by .Fa gidset . +.Pp +The value of +.Dv {NGROUPS_MAX} +should be obtained using +.Xr sysconf 3 +to avoid hard-coding it into the executable. .Sh RETURN VALUES A successful call returns the number of groups in the group set. A value of -1 indicates that an error occurred, and the error @@ -88,7 +93,8 @@ an invalid address. .El .Sh SEE ALSO .Xr setgroups 2 , -.Xr initgroups 3 +.Xr initgroups 3 , +.Xr sysconf 3 .Sh STANDARDS The .Fn getgroups diff --git a/lib/libc/sys/mknod.2 b/lib/libc/sys/mknod.2 index 0fc8771..a406068 100644 --- a/lib/libc/sys/mknod.2 +++ b/lib/libc/sys/mknod.2 @@ -28,7 +28,7 @@ .\" @(#)mknod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd January 16, 2011 .Dt MKNOD 2 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In unistd.h +.In sys/stat.h .Ft int .Fn mknod "const char *path" "mode_t mode" "dev_t dev" .Ft int diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index f40574b..1b23c9b 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd July 10, 2010 +.Dd January 23, 2011 .Dt PTRACE 2 .Os .Sh NAME @@ -295,6 +295,8 @@ struct ptrace_lwpinfo { sigset_t pl_sigmask; sigset_t pl_siglist; siginfo_t pl_siginfo; + char pl_tdname[MAXCOMLEN + 1]; + int pl_child_pid; }; .Ed .Pp @@ -345,6 +347,14 @@ Indicates that member of .Vt "struct ptrace_lwpinfo" contains valid information. +.It PL_FLAG_FORKED +Indicates that the process is returning from a call to +.Fn fork 2 +that created a new child process. +The process identifier of the new process is available in the +.Va pl_child_pid +member of +.Vt "struct ptrace_lwpinfo" . .El .It pl_sigmask The current signal mask of the LWP @@ -356,11 +366,20 @@ on an LWP siglist until the thread is selected for delivery. The siginfo that accompanies the signal pending. Only valid for .Dv PL_EVENT_SIGNAL -kind of stop, when -.Va pl_flags -has +stop when .Dv PL_FLAG_SI -set. +is set in +.Va pl_flags . +.It pl_tdname +The name of the thread. +.It pl_child_pid +The process identifier of the new child process. +Only valid for a +.Dv PL_EVENT_SIGNAL +stop when +.Dv PL_FLAG_FORKED +is set in +.Va pl_flags . .El .It PT_GETNUMLWPS This request returns the number of kernel threads associated with the @@ -391,6 +410,21 @@ This request will trace the specified process on each system call exit. .It PT_SYSCALL This request will trace the specified process on each system call entry and exit. +.It PT_FOLLOW_FORK +This request controls tracing for new child processes of a traced process. +If +.Fa data +is non-zero, +then new child processes will enable tracing and stop before executing their +first instruction. +If +.Fa data +is zero, then new child processes will execute without tracing enabled. +By default, tracing is not enabled for new child processes. +Child processes do not inherit this property. +The traced process will set the +.Dv PL_FLAG_FORKED +flag upon exit from a system call that creates a new process. .It PT_VM_TIMESTAMP This request returns the generation number or timestamp of the memory map of the traced process as the return value from @@ -567,6 +601,7 @@ function appeared in .At v7 . .Sh BUGS The +.Dv PL_FLAG_FORKED , .Dv PL_FLAG_SCE , .Dv PL_FLAG_SCX and diff --git a/lib/libc/sys/shmat.2 b/lib/libc/sys/shmat.2 index 8fe340c..fd1db93 100644 --- a/lib/libc/sys/shmat.2 +++ b/lib/libc/sys/shmat.2 @@ -35,7 +35,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In machine/param.h .In sys/types.h .In sys/ipc.h .In sys/shm.h diff --git a/lib/libc/sys/shmctl.2 b/lib/libc/sys/shmctl.2 index d3299af..98ddf13 100644 --- a/lib/libc/sys/shmctl.2 +++ b/lib/libc/sys/shmctl.2 @@ -34,7 +34,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In machine/param.h .In sys/types.h .In sys/ipc.h .In sys/shm.h diff --git a/lib/libc/sys/shmget.2 b/lib/libc/sys/shmget.2 index e7fd6d1..3094345 100644 --- a/lib/libc/sys/shmget.2 +++ b/lib/libc/sys/shmget.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 1995 +.Dd December 17, 2010 .Dt SHMGET 2 .Os .Sh NAME @@ -34,7 +34,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In machine/param.h .In sys/types.h .In sys/ipc.h .In sys/shm.h @@ -80,17 +79,17 @@ the following constants into the .Fa flag argument: .Bl -tag -width XSHM_WXX6XXX -.It Dv SHM_R -Read access for user. -.It Dv SHM_W -Write access for user. -.It Dv ( SHM_R>>3 ) +.It Dv S_IRUSR +Read access for owner. +.It Dv S_IWUSR +Write access for owner. +.It Dv S_IRGRP Read access for group. -.It Dv ( SHM_W>>3 ) +.It Dv S_IWGRP Write access for group. -.It Dv ( SHM_R>>6 ) +.It Dv S_IROTH Read access for other. -.It Dv ( SHM_W>>6 ) +.It Dv S_IWOTH Write access for other. .El .\" @@ -143,4 +142,5 @@ already exists. .Xr shmat 2 , .Xr shmctl 2 , .Xr shmdt 2 , +.Xr stat 2 , .Xr ftok 3 |