tail(1) and char device files

2002-09-11 Thread Muli Ben-Yehuda
salutations, syscalltrack's log device file is a character device. Reading from it with cat(1) works fine, but reading from it with tail(1) produces no output. At first we thought that it was a bug with our handling of read() and (lack of) handling of lseek(), but it appears that 'tail

Re: tail(1) and char device files

2002-09-11 Thread Nadav Har'El
On Wed, Sep 11, 2002, Muli Ben-Yehuda wrote about tail(1) and char device files: Perusing the tail source code shows that for files which are not regular files, tail just hordes up all output, until it runs out of memory or EOF is reached and only then it prints it. Does anyone know why

Re: tail(1) and char device files

2002-09-11 Thread Muli Ben-Yehuda
On Wed, Sep 11, 2002 at 05:58:32PM +0300, Oleg Goldshmidt wrote: Muli Ben-Yehuda [EMAIL PROTECTED] writes: At first we thought that it was a bug with our handling of read() and (lack of) handling of lseek(), but it appears that 'tail /dev/urandom' bechaves in exactly the same way.

Re: tail(1) and char device files

2002-09-11 Thread Muli Ben-Yehuda
On Wed, Sep 11, 2002 at 06:55:33PM +0300, Nadav Har'El wrote: On Wed, Sep 11, 2002, Muli Ben-Yehuda wrote about tail(1) and char device files: Perusing the tail source code shows that for files which are not regular files, tail just hordes up all output, until it runs out of memory or EOF

Re: tail(1) and char device files

2002-09-11 Thread Nadav Har'El
On Wed, Sep 11, 2002, Muli Ben-Yehuda wrote about Re: tail(1) and char device files: No, that's not it. For !S_ISREG files, tail does the equivalent of: while (read(...) 0) { allocate a buffer add what we read to the buffer continue } That loop will only terminate

Re: tail(1) and char device files

2002-09-11 Thread Muli Ben-Yehuda
On Wed, Sep 11, 2002 at 07:22:28PM +0300, Nadav Har'El wrote: On Wed, Sep 11, 2002, Muli Ben-Yehuda wrote about Re: tail(1) and char device files: No, that's not it. For !S_ISREG files, tail does the equivalent of: while (read(...) 0) { allocate a buffer add what we

Re: tail(1) and char device files

2002-09-11 Thread Nadav Har'El
On Wed, Sep 11, 2002, Muli Ben-Yehuda wrote about Re: tail(1) and char device files: On Wed, Sep 11, 2002 at 07:22:28PM +0300, Nadav Har'El wrote: POSIX (or SUv3) is available online freely, by the way, so you might want to have a look. I intend to, when I'll find the time :) Ok, I