bminor/glibc
View on GitHub ↗ ★ 1,893 C archived
Unofficial mirror of sourceware glibc repository.
45 mentions on Hacker News by 42 people: 0 stories, 45 comments · first 2015-09-26 · latest 2026-08-20
20082026
-
…https://github.com/kraj/musl/blob/kraj/master/src/math/__cos... for the implementation in musl, or https://github.com/bminor/glibc/blob/master/sysdeps/ieee754/... for glibc's implementation. Of course, if you're not using a standard math…
comment by jcranmer · 2026-08-20 · in Turns are Better than Radians (2022) -
…routines pretty carefully, regardless of toolchain/OS. For instance the glibc versions are here: https://github.com/bminor/glibc/tree/master/sysdeps/aarch64/... and there are five versions specialised for either specific CPU models or for…
comment by pm215 · 2025-08-26 · in Ask HN: Why hasn't x86 caught up with Apple M series? -
…I hadn't looked at this in quite a while, but it was good to review. Thanks for the prompting. https://github.com/bminor/glibc/blob/glibc-2.41/sysdeps/unix... https://github.com/bminor/glibc/blob/glibc-2.41/sysdeps/unix...
comment by opello · 2025-04-30 · in Path Isn't Real on Linux -
…be better spent ensuring or enforcing your libc is "fixed" via intentional memory leaks per e.g. https://github.com/bminor/glibc/commit/7a61e7f557a97ab597d6f... , which may ≈fix more than your Rust programs.
comment by MaulingMonkey · 2025-01-25 · in C stdlib isn't threadsafe and even safe Rust didn't save us -
…careful assuming the expertise of people on this forum. Some people here are quite technical. [1] https://github.com/bminor/glibc/commit/7a61e7f557a97ab597d6f...
comment by vlovich123 · 2025-01-22 · in C stdlib isn't threadsafe and even safe Rust didn't save us -
…allows direct access to the environ so it can't be completely safe in the face of modification https://github.com/bminor/glibc/commit/7a61e7f557a97ab597d6f...
comment by ChrisSD · 2025-01-22 · in C stdlib isn't threadsafe and even safe Rust didn't save us -
…run it's probably non-negligible. i.e. take a look at the glibc implementation of 'strcmp` [0] [0] https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/m...
comment by RandomBK · 2025-01-05 · in Don't Clobber the Frame Pointer -
…to find the arguments. But a proper syscall implementation would handle this just fine (e.g. < https://github.com/bminor/glibc/blob/ba60be873554ecd141b55ea... >), so I don't think there's anything sus about it.
comment by oguz-ismail · 2024-11-07 · in Linux Syscall Support -
…unless GRND_NONBLOCK is specified in flags. And glibc's implementation doesn't specify any flags. https://github.com/bminor/glibc/blob/e67f8e6dbd5ec98578a775b... Where as GRND_RANDOM is about switching to the random source instead of the…
comment by monocasa · 2024-10-06 · in Getentropy() vs. RAND_bytes() -
…Plauger's old stdlib [3]. [0] https://github.com/lattera/freebsd/blob/master/lib/libc/stdi... [1] https://github.com/bminor/glibc/blob/dff8da6b3e89b986bb7f6b1... , https://github.com/bminor/glibc/blob/dff8da6b3e89b986bb7f6b1... ,…
comment by Joker_vD · 2024-01-09 · in I cut GTA Online loading times by 70% (2021) -
…from the one I would use. For example glibc provides a vectorized strlen. Here is the sse version: https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/m... It’s pretty simple to imagine how to write an unoptimized version: read a…
comment by dan-robertson · 2023-12-25 · in Cray-1 vs Raspberry Pi -
…was very ancient (1996-12) and no mailing list archive is available for this time period. [1] https://github.com/bminor/glibc/commit/68dbb3a69e78e24a778c6...
comment by lifthrasiir · 2023-11-21 · in Setenv Is Not Thread Safe and C Doesn't Want to Fix It -
…apple-oss-distributions/Libc/blob/c5a3293... ), while glibc doesn't appear to even bother with that ( https://github.com/bminor/glibc/blob/6ae7b5f43d4b13f24606d71... )
comment by manwe150 · 2023-11-20 · in Setenv Is Not Thread Safe and C Doesn't Want to Fix It -
…(well, in the kernel case you'll run into other limitations... but no memory corruption). [1] https://github.com/bminor/glibc/blob/master/misc/sys/select.... [2] https://github.com/bminor/glibc/blob/master/sysdeps/unix/sys... [3]…
comment by jcalvinowens · 2023-11-11 · in CTF Writeup: Abusing select() to factor RSA -
…safety measure, compiling with -DFORTIFY_SOURCE > 0 will enable checks on the FD_SET etc macros: https://github.com/bminor/glibc/commit/a0f33f996f7986dbf3763... The kernel side interface probably won't change because apparently legitimate…
comment by moyix · 2023-11-11 · in CTF Writeup: Abusing select() to factor RSA -
…Your own malloc-like functions won't be treated same unless you give similar attributes. [1] https://github.com/bminor/glibc/blob/807690610916df8aef17cd1... [2] https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attribute...
comment by lifthrasiir · 2023-09-04 · in Using uninitialized memory for fun and profit (2008) -
…are how glibc dynamically chooses the best memcpy routine to use at runtime based on the CPU. see https://github.com/bminor/glibc/blob/glibc-2.31/sysdeps/x86_...
comment by aleden · 2023-06-07 · in “csinc”, the AArch64 instruction you didn’t know you wanted -
…/pubs.opengroup.org/onlinepubs/009696799/functions/re... [1] https://linux.die.net/man/3/realpath [2] https://github.com/bminor/glibc/blob/0b9d2d4a76508fdcbd9f421...
comment by kimixa · 2023-04-26 · in Fedora 38 LLVM vs. Team Fortress 2 -
…E.g. glibc already has bunch of specialized assembly impls for many of the string operations https://github.com/bminor/glibc/tree/master/sysdeps/x86_64/m...
comment by the8472 · 2022-12-16 · in Checking for the absence of a string, naive AVX-512 edition -
…or mremap(2) for vector resize, nor could it in many situations due to the semantics of C++. [1] https://github.com/bminor/glibc/blob/15a94e6668a6d7c5697e805...
comment by colanderman · 2022-11-05 · in In defense of linked lists -
…I am aware of do in fact use Taylor series (others are just table lookup). See glibc for example: https://github.com/bminor/glibc/blob/release/2.34/master/sys... And here is musl https://git.musl-libc.org/cgit/musl/tree/src/math/__sin.c…
comment by xyzzyz · 2022-09-26 · in Turns are better than radians -
…here in multithreaded programs, compared to allocators like tcmalloc or jemalloc.) [1]: < https://github.com/bminor/glibc/blob/a364a3a7090b82ddd30e920... >
comment by yakubin · 2022-09-22 · in System memory allocator free operation zeroes out deallocated blocks in iOS 16 -
…implementations all over the place. This is a maintenance failure, not a lack of code. [0] https://github.com/bminor/glibc/commit/ed19993b5b0d05d62cc88... [1] https://austingroupbugs.net/view.php?id=609
comment by pengaru · 2022-09-19 · in Finding the “second bug” in glibc’s condition variable -
…you stopped at is just there to raise an underflow FP exception; its result is discarded. https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270...
comment by ridiculous_fish · 2022-09-08 · in The Ffast and the Furious -
…is used widely in glibc under the name “__wur” (shorthand for __attribute__((warn_unused_result))). https://github.com/bminor/glibc/search?q=__wur&type=
comment by loeg · 2022-06-04 · in Comparing Exceptions and Errors in D -
…by people who definitely do not have the authority to grant any additional rights to the code. [1]: https://github.com/bminor/glibc
comment by rustc · 2021-12-25 · in Microsoft forked MIT licensed repo and changed the copyright [fixed] -
…CPU cores to be worth the overhead compare the code in the RISC V vector spec with this strcmp https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/m... and tell me it's a clean and straightforward implementation using the…
comment by crest · 2021-12-03 · in RISC-V Int. Ratifies 15 New Specs, Opening Up New RISC-V Design Possibilities -
Given the number of implementations of str* routines in https://github.com/bminor/glibc/tree/master/sysdeps/x86_64/m... , maybe you might want to revisit your last statement. PCMP/MOVMSK work well enough for finding the trailing NUL.
comment by jcranmer · 2021-12-02 · in RISC-V Int. Ratifies 15 New Specs, Opening Up New RISC-V Design Possibilities -
…verify nfds is < FD_SETSIZE so you could create your own fd_set as large as you want it. glibc: https://github.com/bminor/glibc/blob/master/sysdeps/unix/sys... musl: https://git.musl-libc.org/cgit/musl/tree/src/select/select.c *BSD allows…
comment by ksherlock · 2021-05-20 · in File Descriptor Limits -
…'fd_set' type https://man7.org/linux/man-pages/man2/select.2.html That struct is defined here: https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270... It does seem to have the limits described by the blogpost.
comment by TheDong · 2021-05-20 · in File Descriptor Limits -
…other than AT_SYMLINK_NOFOLLOW or AT_EACCESS the call just fails without doing the fallback. See https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270... TIL that this this glibc mirror is kept in sync with the real one…
comment by MichaelMoser123 · 2021-05-07 · in Linux and Glibc API Changes -
…string you use (because it need to masquerade as a file and that requires strlen the whole input: https://github.com/bminor/glibc/blob/21c3f4b5368686ade28d90d... ) All your magic on format string doesn't change that poor behavior unless…
comment by liuliu · 2021-03-01 · in Parsing can become accidentally quadratic because of sscanf -
…(ptr, '\0'); essentially a strlen() call, on your input string. Looks correct. Call flow: https://github.com/bminor/glibc/blob/21c3f4b5368686ade28d90d... https://github.com/bminor/glibc/blob/21c3f4b5368686ade28d90d...…
comment by dividuum · 2021-03-01 · in Parsing can become accidentally quadratic because of sscanf -
…FILE structure alongside a special "operations" table, with a _rawmemchr() in the initialization. * https://github.com/bminor/glibc/blob/master/libio/strops.c#L... * https://github.com/bminor/glibc/blob/master/libio/strfile.h#... The…
comment by JdeBP · 2021-03-01 · in How I cut GTA Online loading times by 70% -
…wrap the syscalls, are very unlikely to have bugs. Here's the `read` implementation, for instance: https://github.com/bminor/glibc/blob/21c3f4b5368686ade28d90d... All it does is delegate to the low-level syscall, with some extra handling…
comment by roblabla · 2021-02-02 · in Go 1.16 will make system calls through Libc on OpenBSD -
…parse a format string and format output. The only magic is around format string checking. 1. https://github.com/bminor/glibc/blob/glibc-2.32/stdio-common...
comment by scatters · 2020-12-14 · in Zig 0.7.1 Released – 69 bugs fixed -
https://github.com/bminor/glibc/blob/master/sysdeps/unix/sys... "The Linux implementation of posix_spawn{p} uses the clone syscall directly with CLONE_VM and CLONE_VFORK flags..." Though you're right about errno, line 305.
comment by tyingq · 2020-03-02 · in Fork() can fail: this is important (2014) -
…with the same kernel entry point, which is called "clone". Here is the relevant line in glibc: https://github.com/bminor/glibc/blob/b5b7fb76e15c0db545aa11a... Errors are returned as the function return value.
comment by klodolph · 2020-03-02 · in Fork() can fail: this is important (2014) -
…does similar on glibc so Linux probably performs similarly with the standard POSIX semaphore: > https://github.com/bminor/glibc/blob/master/nptl/sem_wait.c mirrored from here: > https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=blob;f=n..…
comment by asveikau · 2020-01-05 · in No nuances, just buggy code (was: related to Spinlock implementation) -
…the same code, and would be complied if no ARCH-specific implementation is written, as seen here, https://github.com/bminor/glibc/blob/master/string/strlen.c . But it's probably irrelevant to most systems today, as the assembly version is…
comment by bcaa7f3a8bbc · 2019-08-26 · in Why is strlen so complex in C? -
…there is an SSE2 implementation available that might be used on computers that support it: https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/s... . Perhaps this version is for platforms that don't have a hand-optimized…
comment by saagarjha · 2019-08-26 · in Why is strlen so complex in C? -
…assembly version that's dramatically faster than that one (the x86_64 one is here[1]). [1]: https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/s...
comment by johncolanduoni · 2019-05-09 · in Alpine Linux Docker images have NULL for root password -
…the August 2002 security advisory. https://github.com/openbsd/src/commit/c7b2af4b3f7e78424f8943... https://github.com/bminor/glibc/commit/0950889b810736fe7ad34... http://cert.uni-stuttgart.de/ticker/advisories/calloc.html
comment by ksherlock · 2016-12-06 · in Why does calloc exist? -
As far as I see the bug primarily lies within this function here... resolv/res_send.c https://github.com/bminor/glibc/blob/master/resolv/res_send.... Lines 952 ... 1389 [=~450 lines of code], with more than a dozen of variables holding…
comment by cnvogel · 2016-02-16 · in Glibc getaddrinfo stack-based buffer overflow -
glibc's abs() implementation is here: https://github.com/bminor/glibc/blob/master/stdlib/abs.c It's the naive branching version (probably for platform independence?), but my installed GCC 4.9.3 does convert it to branchless cdq/xor trick…
comment by mappu · 2015-09-26 · in Branchless Equivalents of Simple Functions (2008)