r/cprogramming • u/RoomNo7891 • Jan 22 '26
Why some famous open source projects rewrite some C standard function from zero?
Hello,
I was watching NGINX and libuv source code and noticed that both the projects (at different ratios) rewrite standard functions (such as string manipulation functions) or rewrite existing macro including their prefix (es.
UV__INET6_ADDRSTRLEN in inet.c).
Is it due to performance or maybe to create a common wrapper between OS?
Thanks!
55
Upvotes
View all comments
13
u/[deleted] Jan 22 '26
C standard library string functions are better avoided, C strings in general are a major source of memory and code execution bugs.
It's not uncommon for applications to implement their own safer strings.