On 02/13/2012 04:06 PM, Bernhard Voelker wrote: > Now, I see it: it's reading from *stdout*, not from stdin: > > lseek(1, 0, SEEK_END) = -1 ESPIPE (Illegal seek) > read(1, 0x616000, 512) = ? > > It could issue an error if "seek=..." is used when fdesc is a tty.
Interestingly, read returns with EBADF if stdout is redirected to /dev/tty: /usr/bin/printf "abc" | strace src/dd seek=1 > /dev/tty ... lseek(1, 0, SEEK_END) = -1 ESPIPE (Illegal seek) read(1, 0x616000, 512) = -1 EBADF (Bad file descriptor) but it blocks again when of=/dev/tty is given: /usr/bin/printf "abc" | strace src/dd seek=1 of=/dev/tty I'm getting the impression that this is a kernel problem. Have a nice day, Berny