Commit Graph
11 Commits
Author SHA1 Message Date
Érico NogueiraandRich Felker 379b18218d ldso: make exit condition clearer in fixup_rpath
breaking out of the switch-case when l==-1 means the conditional below
will necessarily be true (-1 >= buf_size, a size_t variable) and the
function will return 0. it is, however, somewhat unclear that that's
what's happening. simply returning there is simpler
2022-08-17 19:49:54 -04:00
Érico NogueiraandRich Felker cbacd638e3 add SEEK_DATA and SEEK_HOLE to unistd.h
these are linux specific constants. glibc exposes them behind
_GNU_SOURCE, but, since SEEK_* is reserved for the implementation, we
can simply define them. furthermore, since they can't be used with
fseek() and other functions that deal with FILE, we don't add them to
stdio.h.
2022-01-09 00:31:05 -05:00
Érico NogueiraandRich Felker b76f37fd56 add qsort_r and make qsort a wrapper around it
we make qsort a wrapper by providing a wrapper_cmp function that uses
the extra argument as a function pointer. should be optimized to a tail
call on most architectures, as long as it's built with
-fomit-frame-pointer, so the performance impact should be minimal.

to keep the git history clean, for now qsort_r is implemented in qsort.c
and qsort is implemented in qsort_nr.c.  qsort.c also received a few
trivial cleanups, including replacing (*cmp)() calls with cmp().
qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper
itself.
2021-09-23 20:09:22 -04:00
Érico NogueiraandRich Felker 3eed6a6f0a fix error checking in pthread_getname_np
len is unsigned and can never be smaller than 0. though unlikely, an
error in read() would have lead to an out of bounds write to name.

Reported-by: Michael Forney <[email protected]>
2021-08-06 11:26:15 -04:00
Érico NogueiraandRich Felker b7a130e0b9 remove unnecessary cast for map_library return
the function already returns (void *)
2021-04-20 15:40:27 -04:00
Érico RolimandRich Felker bd3b9c4ca5 add pthread_getname_np function
based on the pthread_setname_np implementation
2021-04-20 15:34:30 -04:00
Érico NogueiraandRich Felker 9a40e842df define __STDC_UTF_{16,32}__ macros
these macros are used to indicate that the implementation uses,
respectively, utf-16 and utf-32 encoding for char16_t and char32_t.
2021-04-19 09:49:20 -04:00
Érico RolimandRich Felker e48e99c112 suppress isascii() macro for C++
analogous to commit a60457c84a.
2021-02-25 16:35:54 -05:00
Érico RolimandRich Felker 074932c84d fix possible fd leak via missing O_CLOEXEC in pthread_setname_np
the omission of the flag here seems to have been an oversight when the
function was added in 8fb28b0b3e
2021-01-30 17:29:55 -05:00
Érico RolimandRich Felker c5d118ebbc fix segfault in lutimes when tv argument is NULL
calling lutimes with tv=0 is valid if the application wants to set the
timestamps to the current time. this commit makes it so the timespec
struct is populated with values from tv only if tv != 0 and calls
utimensat with times=0 if tv == 0.
2020-11-29 00:57:24 -05:00
Érico RolimandRich Felker c8c3e341fb fix typo in INSTALL
"big-engian" should be "big-endian".
2020-11-29 00:46:38 -05:00