Subject: Re: dlopen() on a fifo
To: None <tech-misc@netbsd.org>
From: Jed Davis <jdev@panix.com>
List: tech-misc
Date: 05/12/2006 22:49:40
tron@zhadum.org.uk (Matthias Scheler) writes:
> Kirk Russell <kirk@ba23.org> writes:
>> I am using NetBSD 3.0. I found that dlopen() will block if the given
>> path is a fifo:
>>
>> $ mkfifo -m a+wrx afifo
>> $ ksh -c "LD_PRELOAD=./afifo /usr/bin/true"
>> [... blocked ...]
>>
>> Is this expected behaviour?
>
> Yes. Processes get blocked if they try to read from a FIFO and there is
> no writer.
More to the point, the *open* will block if there's nothing on the
other end (and O_NONBLOCK hasn't been given).
--
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l)))))) (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k))))))) '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))