Re: [PATCH v2 0/3] Rewrite strcpy(3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jakub,

On 12/13/22 21:56, Jakub Wilk wrote:
The sheer size of this page make it almost unusable for me.
Please don't merge it.

* Alejandro Colomar <alx.manpages@xxxxxxxxx>, 2022-12-13 00:00:
      stpecpy(3), stpecpyx(3)
             Not provided by any library.

Then they don't belong in the man-pages project.

      strscpy(3)
             Not provided by any library.  It  is  a  Linux  kernel  internal
             function.

Ditto.

And strictly speaking, I shouldn't document strlcpy(3bsd) and strlcat(3bsd) either because they're not provided by our libc; libbsd already has manual pages for them, anyway.

Regarding this, the intention of the page is not to coldly document the behavior of functions in terms of the byte operations they perform. That's what has been done until now, and the result is what we know: many string copy functions are dreaded (e.g., strncpy(3)), because most programmers don't use them correctly.

This new page instead, shows all string copying functions, including those developed by other systems as alternatives to the standard ones. They did it for a reason: the standard functions don't cover all use cases, and there's a need to roll your own. But rolling your own is bad. It's better if someone explains what alternative string copy functions exist, when they are more appropriate than libc ones, and when they are not. Even the old pages documented strlcpy(3) a little bit!

I suggest for a first release using the new page string_copy(7). I'll rewrite anyway strcpy(3) and all others to be minimal, _and_ be reductions of string_copy(7), for fast lookup.

Cheers,

Alex



--
<http://www.alejandro-colomar.es/>

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux