Summary
-
Linux 7.2 removes the buggy strncpy API after a long cleanup process.
-
The cleanup lasted more than six years and hundreds of confirmations; Justin Stitt alone added 211 of them.
-
strncpy might leave non-NUL targets or unnecessarily zero pad; removing it should increase kernel stability.
The world of Linux kernel development never sleeps. Linux 7.1 has just been releasedand people are already adding code to the Linux 7.2 release. Fortunately, because open source software development tends to be, you know, openwe can see all the changes that Linus Torvalds is accepting in the Linux 7.2 kernel as they happen.
A change that just passed marks the end of a six-year, 362-commit battle, with the removal of the strncpy API. That’s good news for everyone, as strncpy was causing a lot more trouble than it was worth and should hopefully result in a more stable kernel overall.
Linux 7.2 finally says goodbye to the strncpy API
I have a feeling they won’t miss it.
How he saw it ForonyxA new update has been merged into the Linux 7.2 kernel. This finally cleans up the last remnants of the strncpy API, which has apparently been a real headache for Linux developers. according to Git patch notes:
string: Remove strncpy() from kernel
strncpy() has been a persistent source of errors due to its ambiguous use and often counterintuitive semantics: it may not NUL-terminate the target and unconditionally zero-padded its entire length, which is not always necessary.
You can check how much effort it took for Linux developers to delete strncpy in the confirmation page. The description states that the fight against the buggy API took more than six years and 352 commits to finally be cleared. There’s even a leaderboard for everyone who added more than one pledge for the cause, with the number one spot held by Justin Stitt with a whopping 211 pledges. Now that’s dedication.
Linux 7.2 should enter the release candidate phase on June 28, so it shouldn’t be long until strncpy is eradicated from everyone’s workstations.






