stderr, write()/writev()

in shell

> printf foo > /dev/fd/2
foo%                                                                                                                                                                                                                                                                                                                                            ⺁master⺄ ┗⬛ DIRTY ┃2012-05-09┃❘⚑

> printf foo > /dev/fd/2  | grep o+
foofoo

> strace -ewrite printf foo > /dev/fd/2
write(1, "foo", 3foo)                      = 3

> perl -E 'say STDOUT stdout; say STDERR stderr'
stdout
stderr

> strace -ewritev perl -E 'say STDOUT stdout; say STDERR stderr'
writev(1, [{"stdout\n", 7}], 1stdout
)         = 7
writev(2, [{"\33[38;5;85;3m", 12}, {"stderr", 6}, {"\33[m", 3}], 3stderr) = 21
writev(2, [{"\33[38;5;85;3m", 12}, {"\n", 1}, {"\33[m", 3}], 3
) = 16

visual

stderr