Posted in

After 6 years and over 360 commits, Linux 7.2 finally removes "a persistent…

The topic After 6 years and over 360 commits, Linux 7.2 finally removes “a persistent… is currently the subject of lively discussion — readers and analysts are keeping a close eye on developments.

This is taking place in a dynamic environment: companies’ decisions and competitors’ reactions can quickly change the picture.

The world of Linux kernel development never sleeps. Linux 7.1 has only just been released, and people are already getting code added to Linux 7.2’s build. Fortunately, because open-source software’s development tends to be, you know, open, we can see all the changes Linus Torvalds is accepting to the Linux 7.2 kernel as they happen.

One change that just made the cut marks the end of a six-year-long battle and 362 commits, with the removal of the strncpy API. It’s good news for everyone, as strncpy was causing far more problems than it was worth, and should hopefully result in a more stable kernel overall.

As spotted by Phoronix, a new update has been merged into the Linux 7.2 kernel. This one finally cleans up the last few remnants of the strncpy API, which has apparently been a real pain for Linux developers. As per the patch’s Git notes:

strncpy() has been a persistent source of bugs due to its ambiguous intended usage and frequently counter-intuitive semantics: it may not NUL-terminate the destination, and it unconditionally zero-pads to the full length, which isn’t always needed.

You can check out just how much effort it took the Linux developers to erase strncpy over on the commit page. The description claims that the fight against the buggy API took over six years and 352 commits to finally erase. There’s even a leaderboard for everyone who added more than one commit for the cause, with the number one spot held by Justin Stitt with a whopping 211 commits. Now that’s dedication.

Linux 7.2 should enter the release candidate phase on June 28th, so it shouldn’t be too long until strncpy is eradicated from everyone’s workstations.