News for hackers. Stuff that matters.
Re:Unix v6 Ported to ANSI C by derleth on Tuesday November 08, 2011 @04:39PM (#3212936)
Right. Quoting from the manpage:

> The memory areas may overlap: copying takes place as though the bytes in src are first copied into a temporary array that does not overlap src or dest, and the bytes are then copied from the temporary array to dest.

http://www.kernel.org/doc/man-pages/online/pages/man3/memmov...

Notice how it says 'as though'; I can't see why doing the copy backwards (from end to start) wouldn't work, myself.

Re:Unix v6 Ported to ANSI C by sp332 on Tuesday November 08, 2011 @05:22PM (#3213116)
If it's higher, move from the front. If it's lower, start at the back. You have to check each time you do it.
Re:Unix v6 Ported to ANSI C by eddington on Tuesday November 08, 2011 @05:14PM (#3213084)
Still doesn't work going end to start.

    src starts at 50, ends at 100
    dst starts at 25, ends at 75.
First we copy 100 to 75, then 99 to 74, etc ... now we get to copy from 75 to 50, but we've overwritten it already!
Re:Unix v6 Ported to ANSI C by suivix on Tuesday November 08, 2011 @08:42PM (#3213856)
Linux isn't Unix, so are you sure it's the same?
Re:Unix v6 Ported to ANSI C by dchest on Tuesday November 08, 2011 @09:02PM (#3213892)
memmove() is in ANSI C standard.
Re:Unix v6 Ported to ANSI C by aidenn0 on Wednesday November 09, 2011 @07:51PM (#3218300)
UNIX v6 predates ANSI C by over a decade I think.