Hi #embedded developers, hi #c developers. I am writing a new #libc to explore alternative idioms and hopefully improve ergonomy, expressiveness, and some other points that seem important to me.

I am considering adding a generic interface for allocators, so the default behaviour can be easily overridden by users and third parties, like #zig or #odin.

This pattern could be expanded to features other than allocators, but I'm struggling to decide which ones can be relevant.

#linux #bsd #windows

Why is there no std::move_only_function in libc++? 😭😭😭
I know there is a pull request since 2024, but I have no idea when or even if it will ever get merged.

I just wanna be able to finally use import std; with libc++ in all my projects.


#C++ #cpp #LLVM #libc++ #import-std

As a side project, I am working on a deep redesign of the C standard library and am contemplating blogging about it to give myself some motivation, as well as hopefully getting helpful feedback from interested enthusiasts or experienced programmers. Feel free to share this thread and ask questions, I'll be happy to answer them in my next blog post if this gets enough traction (I will post the link here on mastodon).

#programming #c #libc #c23 #c2y #clang #gcc #unix #windows #macos #plan9 #blog

Hey #Linux #Developer,
is there some #libc API that I can query on a file descriptor to get the sector size of a filesystem?

#Cpp #CSharp

🎩 Oh joy, another riveting tale about "practical modular inversion" that nobody asked for! 🤓 Lemire's mind-boggling #algorithms are back, now with #binary #flair, to solve problems no one knew existed. Meanwhile, #libc yawns while waiting for someone to care. 🚀
https://purplesyringa.moe/blog/faster-practical-modular-inversion/ #practicalmodularinversion #techhumor #HackerNews #ngated
Faster practical modular inversion

Last year, Lemire wrote about an optimized variation of the Euclidean algorithm for computing the greatest common divisor of two numbers, called binary Euclidean algorithm or Stein’s algorithm. It’s a best-of-class implementation, though it’s currently only used by libc++. The post also briefly mentions the extended Euclidean algorithm, a related algorithm most often used to compute the modular multiplicative inverse (given a remainder a and a modulus m , find x such that a ⋅ x mod m = 1 ): There is also a binary version of the extended Euclidean algorithm[,] although it is quite a bit more involved and it is not clear that it […] can be implemented at high speed, leveraging fast instructions, when working on integers that fit in general-purpose registers. […] My implementation of the binary extended Euclidean algorithm is quite a bit slower and not recommended. I expect that it should be possible to optimize it further. That’s a big shame, because the extended Euclidean algorithm can be optimized in a very similar manner, and the underlying ideas were described in a 2020 paper. It’s probably not well-known because the paper focuses on constant-time evaluation and long arithmetic, so people might have assumed it’s irrelevant. I’m hoping to bring justice to the extended Stein’s algorithm with this post. I’ll cover how the algorithm works, its limitations, some optimizations compared to Pornin’s paper, and potential further improvements. My implementation is available on GitHub as part of a Rust modular arithmetic library.

purplesyringa's blog
I generated a testset of roughly 2 million patterns and respective matches to test the glob matcher of #sydbox. The glob matching code was inherited from #rsync and was first written in 1986(!). In the process I have noticed 5 divergences between the fnmatch(3) implementations of glibc vs. musl and reported it to musl devs. Here are the divergences: https://dpaste.com/44XJS89XM.txt curious to hear inputs from #regex wizards as to whether #glibc or #musl is correct! TYVMIA! #linux #libc
How to unload a LD_PRELOAD library the hard way

<p>Some days ago in the 0x00sec discord channel, somebody asked how to remove a library from memory. That person was trying to inject some code in a program using <code>LD_PRELOAD</code> to get some code executed automatically, however, after doing its stuff the library stayed in memory even after deleting the file in the disk. In other words, it was still visible in <code>/proc/PID/maps</code>.</p>

DMO Blog Tempus Fugit

🎉 systemd Lands Experimental Support For musl libc - Phoronix

「 Systemd today finally merged support for building against and using the musl libc library. This is a win for Linux distributions like postmarketOS, Alpine Linux, and others that use musl by default as their standard C library or offer it as an option. 」

https://www.phoronix.com/news/systemd-musl-libc

#systemd #musl #libc #postmarketOS #opensource

systemd Lands Experimental Support For musl libc

Systemd today finally merged support for building against and using the musl libc library

Коробка багов (взрывается): кроссплатформенное коварство

В сентябре мы рассматривали релиз 86Box v5.0, приуроченный к тридцати годам со дня выхода в розничную продажу Windows 95, и пообещали показать ещё кое-что. О чём мы сознательно умолчали, и почему оставили находку для отдельной статьи? Что осталось в "коробке"?

https://habr.com/ru/companies/pvs-studio/articles/963286/

#pvsstudio #86box #libc #glibc #freebsd #c11 #эмуляция #совершенный_код #стандарты_кодирования

Коробка багов (взрывается): кроссплатформенное коварство

В сентябре мы рассматривали релиз 86Box v5.0, приуроченный к тридцати годам со дня выхода в розничную продажу Windows 95, и пообещали показать ещё кое-что. О чём мы сознательно умолчали, и почему...

Хабр

This is freaking GENIOUS! I'd say the holy grail of both #static and #dynamic #linking, providing the benefits of both. Can't wait to test it in some real projects.

#detour #libc #dlopen #elf #executable

https://github.com/graphitemaster/detour

GitHub - graphitemaster/detour: A detour through the Linux dynamic linker

A detour through the Linux dynamic linker. Contribute to graphitemaster/detour development by creating an account on GitHub.

GitHub