On Sat, Nov 09, 2024 at 12:11:02PM +0100, Sebastian Feld wrote: > > > How should the "bounds checking" work in this case if you only pass > > > two arguments ? > > > > The linux kernel strscpy() checks the sizeof the destination. > > Then the kernel strscpy() should be renamed accordingly, and not > confuse people. Suggested name would be kstrscpy(). > Otherwise this would disqualify strscpy() ever from being adopted as a > POSIX standard, as there are two - kernel and glibc - conflicting > implementations If POSIX decided that this meant they couldn't adopt strscpy(), that is ANSI / ISO's problem, not ours. Note that strscpy() supports the 3 argument version of glibc, and POSIX has always been willing to standardize a subset of a particullar interface. Otherwise, any Legacy Unix system which added some one or more flags to some particular interface could potentially disqualify anything with the same name of that interface from ever being standardized, which is (a) stupid, and (b) not what has been done in historical practice. - Ted