lkml.org 
[lkml]   [1996]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Named pipes - slightly broken in new kernels
On Thu, 28 Mar 1996, Ronald Wahl wrote:

> >
> > btw, is there a way on Linux to have a blocking read at the end of file?
>
> IMHO tail -f do this - look at the sources.

well ... mine doesnt. "strace -f test" does the following (test is an
ordinary ext2fs file):

open("test", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
lseek(3, 0, SEEK_END) = 0
read(3, "", 4096) = 0
sigprocmask(SIG_BLOCK, [ALRM], []) = 0
sigaction(SIGALRM, {0x4005ce3c, [], 0}, {SIG_DFL}) = 0
time(NULL) = 828021859
alarm(1) = 0
sigsuspend([] <unfinished ...>
--- SIGALRM (Alarm clock) ---
<... sigsuspend resumed> ) = -1 EINTR (Interrupted system
call)
sigreturn() = ? (mask now [ALRM])
time(NULL) = 828021860
sigaction(SIGALRM, {SIG_DFL}, NULL) = 0
alarm(0) = 0
sigprocmask(SIG_SETMASK, [], NULL) = 0
read(3, "", 4096) = 0

[etc].

pc5829:~$ tail --version
GNU textutils 1.9

It uses select() for pipes, but not for ordinary files. (and i conclude
that it's not possible to have a blocking read at the end of a file). Is
this some POSIX thing?


\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.045 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site