News for hackers. Stuff that matters.
Re:Unix V5, OpenBSD, Plan 9, FreeBSD, and GNU Coreutils Impl... by ori_b on Sunday February 22, 2015 @01:32AM (#9088502)
Note that the plan9 version does some extra work so that it can send the entire buffer in one write() operation. This is because Plan 9 guarantees that messages smaller than the size of a pipe buffer are sent as an atomic write, given a sufficiently large recieve buffer on the other end.

This simplifies quite a bit of code that reads and writes commands into ctl files.

Re:Unix V5, OpenBSD, Plan 9, FreeBSD, and GNU Coreutils Impl... by lallysingh on Sunday February 22, 2015 @01:49AM (#9088541)
Why copy it all instead of writev()?
Re:Unix V5, OpenBSD, Plan 9, FreeBSD, and GNU Coreutils Impl... by ori_b on Sunday February 22, 2015 @02:11AM (#9088581)
http://plan9.bell-labs.com/sources/plan9/sys/src/libc/9sys/w...

In other words, writev on plan9 isn't a system call -- it does the same copying that echo.c does. Also, echo.c probably predates writev.c.