16 ms·
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
by ori_b 12y ago
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.
- lallysingh 12y agoWhy copy it all instead of writev()?
- ori_b 12y agohttp://plan9.bell-labs.com/sources/plan9/sys/src/libc/9sys/writev.c 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.