On 01/06/10 12:22, Joerg Schilling wrote:
Bill Holler<bill.hol...@sun.com> wrote:
Great discussion.
Linux and glibc have the same 64-bit implementation of strcpy(3C)& strncpy(3C)
as Solaris. The undefined behavior is the same as the current Solaris version.
Those communities have accepted that code which calls str[n]cpy with overlapping
strings is unsupported. Solaris will do the same.
This looks like a joke....
Linux started to exist _after_ the interface for strcpy() was changed.
I am sure that the people who have been asked do not even know about
the background and that before ~ 1988 there was no such limitation
in any documentation and the implementation was well known for supporting
overlapping strings.
In case it is not known, memmove() is not a replacement for strcpy() as it
takes a length parameter.
It would be interesting to know how this interface change could make it into
POSIX as the intention of the POSIX standard is not to invalidate existing
interfaces.....well, POSIX recent introduced a similar non-compliance and
created functions fexec*() and getline() with a parameter list that is in
conflict with a well established interface from 1982 and there was a similar
conflict introduced by POSIX by chaning the interface for getpgrp()/setpgrp().
Jörg
All early strcpy implementations handle some overlapping copies
incorrectly. In order to determine safety, it is necessary to
find the length of the string before beginning the copy.
- Bart
--
Bart Smaalders Solaris Kernel Performance
ba...@cyber.eng.sun.com http://blogs.sun.com/barts
"You will contribute more with mercurial than with thunderbird."
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code