aboutsummaryrefslogtreecommitdiff
path: root/src/process/execle.c (unfollow)
Commit message (Expand)AuthorFilesLines
2013-08-09block all signals, even implementation-internal ones, in faccessat child•••the child process's stack may be insufficient size to support a signal frame, and there is no reason these signal handlers should run in the child anyway. Rich Felker1-1/+1
2013-08-08block signals during fork•••there are several reasons for this. some of them are related to race conditions that arise since fork is required to be async-signal-safe: if fork or pthread_create is called from a signal handler after the fork syscall has returned but before the subsequent userspace code has finished, inconsistent state could result. also, there seem to be kernel and/or strace bugs related to arrival of signals during fork, at least on some versions, and simply blocking signals eliminates the possibility of such bugs. Rich Felker1-0/+3
2013-08-08work around libraries with versioned symbols in dynamic linker•••this commit does not add versioning support; it merely fixes incorrect lookups of symbols in libraries that contain versioned symbols. previously, the version information was completely ignored, and empirically this seems to have resulted in the oldest version being chosen, but I am uncertain if that behavior was even reliable. the new behavior being introduced is to completely ignore symbols which are marked "hidden" (this seems to be the confusing nomenclature for non-current-version) when versioning is present. this should solve all problems related to libraries with symbol versioning as long as all binaries involved are up-to-date (compatible with the latest-version symbols), and it's the needed behavior for dlsym under all circumstances. Rich Felker1-11/+14
2013-08-08sys/personality.h: add missing C++ compatrofl0r1-0/+7
2013-08-08sys/personality.h: add missing macrosrofl0r1-0/+33
2013-08-07add Big5 charset support to iconv•••at this point, it is just the common base charset equivalent to Windows CP 950, with no further extensions. HKSCS and possibly other supersets will be added later. other aliases may need to be added too. Rich Felker2-0/+1066
2013-08-07make fcvt decimal point location for zero make more sense•••the (obsolete) standard allows either 0 or 1 for the decimal point location in this case, but since the number of zero digits returned in the output string (in this implementation) is one more than the number of digits the caller requested, it makes sense for the decimal point to be logically "after" the first digit. in a sense, this change goes with the previous commit which fixed the value of the decimal point location for non-zero inputs. Rich Felker1-1/+1
2013-08-07fix ecvt/fcvt decimal point position output•••these functions are obsolete and have no modern standard. the text in SUSv2 is highly ambiguous, specifying that "negative means to the left of the returned digits", which suggested to me that 0 would mean to the right of the first digit. however, this does not agree with historic practice, and the Linux man pages are more clear, specifying that a negative value means "that the decimal point is to the left of the start of the string" (in which case, 0 would mean the start of the string, in accordance with historic practice). Rich Felker1-1/+1
2013-08-05iconv support for legacy Korean encodings•••like for other character sets, stateful iso-2022 form is not supported yet but everything else should work. all charset aliases are treated the same, as Windows codepage 949, because reportedly the EUC-KR charset name is in widespread (mis?)usage in email and on the web for data which actually uses the extended characters outside the standard 93x94 grid. this could easily be changed if desired. the principle of this converter for handling the giant bulk of rare Hangul syllables outside of the standard KS X 1001 93x94 grid is the same as the GB18030 converter's treatment of non-explicitly-coded Unicode codepoints: sequences in the extension range are mapped to an integer index N, and the converter explicitly computes the Nth Hangul syllable not explicitly encoded in the character map. empirically, this requires at most 7 passes over the grid. this approach reduces the table size required for Korean legacy encodings from roughly 44k to 17k and should have minimal performance impact on real-world text conversions since the "slow" characters are rare. where it does have impact, the cost is merely a large constant time factor. Rich Felker2-0/+678
2013-08-03have new timer threads unblock their own SIGTIMER•••unblocking it in the pthread_once init function is not sufficient, since multiple threads, some of them with the signal blocked, could already exist before this is called; timers started from such threads would be non-functional. Rich Felker1-2/+2
2013-08-03add system for resetting TLS to initial values•••this is needed for reused threads in the SIGEV_THREAD timer notification system, and could be reused elsewhere in the future if needed, though it should be refactored for such use. for static linking, __init_tls.c is simply modified to export the TLS info in a structure with external linkage, rather than using statics. this perhaps makes the code more clear, since the statics were poorly named for statics. the new __reset_tls.c is only linked if it is used. for dynamic linking, the code is in dynlink.c. sharing code with __copy_tls is not practical since __reset_tls must also re-zero thread-local bss. Rich Felker4-14/+56
2013-08-03fix multiple bugs in SIGEV_THREAD timers•••1. the thread result field was reused for storing a kernel timer id, but would be overwritten if the application code exited or cancelled the thread. 2. low pointer values were used as the indicator that the timer id is a kernel timer id rather than a thread id. this is not portable, as mmap may return low pointers on some conditions. instead, use the fact that pointers must be aligned and kernel timer ids must be non-negative to map pointers into the negative integer space. 3. signals were not blocked until after the timer thread started, so a race condition could allow a signal handler to run in the timer thread when it's not supposed to exist. this is mainly problematic if the calling thread was the only thread where the signal was unblocked and the signal handler assumes it runs in that thread. Rich Felker6-22/+36
2013-08-03add some new linux AT_* flagsRich Felker1-0/+2
2013-08-03fix faccessat to support AT_EACCESS flag•••this is another case of the kernel syscall failing to support flags where it needs to, leading to horrible workarounds in userspace. this time the workaround requires changing uid/gid, and that's not safe to do in the current process. in the worst case, kernel resource limits might prevent recovering the original values, and then there would be no way to safely return. so, use the safe but horribly inefficient alternative: forking. clone is used instead of fork to suppress signals from the child. fortunately this worst-case code is only needed when effective and real ids mismatch, which mainly happens in suid programs. Rich Felker1-1/+46
2013-08-03collapse euidaccess to a call to faccessat•••it turns out Linux is buggy for faccessat, just like fchmodat: the kernel does not actually take a flags argument. so we're going to have to emulate it there. Rich Felker1-9/+1
2013-08-03add prototypes for euidaccess/eaccessRich Felker1-0/+2