Hacker GitHub

← All repos

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

Mentions per year 45 mentions · busiest year 2021 (10)
20082026
  1. …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)
  2. …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…
  3. …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
  4. …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.
  5. …careful assuming the expertise of people on this forum. Some people here are quite technical. [1] https://github.com/bminor/glibc/commit/7a61e7f557a97ab597d6f...
  6. …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...
  7. …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
  8. …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
  9. …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()
  10. …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... ,…
  11. …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
  12. …was very ancient (1996-12) and no mailing list archive is available for this time period. [1] https://github.com/bminor/glibc/commit/68dbb3a69e78e24a778c6...
  13. …apple-oss-distributions/Libc/blob/c5a3293... ), while glibc doesn't appear to even bother with that ( https://github.com/bminor/glibc/blob/6ae7b5f43d4b13f24606d71... )
  14. …(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
  15. …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…
  16. …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...
  17. …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_...
  18. …/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
  19. …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...
  20. …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
  21. …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
  22. …here in multithreaded programs, compared to allocators like tcmalloc or jemalloc.) [1]: < https://github.com/bminor/glibc/blob/a364a3a7090b82ddd30e920... >
  23. …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
  24. …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
  25. …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
  26. …by people who definitely do not have the authority to grant any additional rights to the code. [1]: https://github.com/bminor/glibc
  27. …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…
  28. 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.
  29. …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
  30. …'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
  31. …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
  32. …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…
  33. …(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...…
  34. …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…
  35. …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…
  36. …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
  37. 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.
  38. …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)
  39. …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..…
  40. …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?
  41. …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?
  42. …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...
  43. …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?
  44. 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…
  45. 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…