Date: Mon, 16 Aug 1999 21:07:57 -0400 (EDT) From: Zhihui Zhang <zzhang@cs.binghamton.edu> To: Danaii Maziar <dm@easynet.fr> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: FIFO -- Device not configured Message-ID: <Pine.GSO.3.96.990816210413.15651B-100000@sol.cs.binghamton.edu> In-Reply-To: <14264.9594.118127.306139@golem.easynet.fr>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 16 Aug 1999, Danaii Maziar wrote:
>
>
> Hi,
>
> I've created a fifo (with mkfifo) and every time I try to open it I
> get -- Device not configured -- As I know Fifo is standard part of
> kernel and there is no need to add options.
>
> Any suggestion.
>
> Thanks.
>
> # uname -a
> 2.2.8-STABLE FreeBSD 2.2.8-STABLE
>
> # ls -l
> prw-rw-rw- 1 root wheel 0 Aug 16 16:25 radfifo
>
> # cat xx.c
> #include <stdio.h>
> #include <fcntl.h>
>
> main()
> {
> int pokefd;
> pokefd=open("radfifo", O_WRONLY|O_NONBLOCK);
> if (pokefd < 0) {
> perror("open:");
> exit(1);
> }
> close(pokefd);
> }
>
> # kdump
>
> # kdump
> 5343 ktrace RET ktrace 0
> 5343 ktrace CALL execve(0xefbfdcfb,0xefbfdc90,0xefbfdc98)
> 5343 ktrace NAMI "/tmp/xx"
> 5343 xx RET execve 0
> 5343 xx CALL open(0x10c0,0x5,0)
> 5343 xx NAMI "radfifo"
> 5343 xx RET open -1 errno 6 Device not configured
> 5343 xx CALL writev(0x2,0xefbfdc44,0x4)
> 5343 xx GIO fd 2 wrote 29 bytes
> "open:: Device not configured
> "
> 5343 xx RET writev 29/0x1d
> 5343 xx CALL exit(0x1)
>
> --
> Easynet France
> 33 1.44.54.70.32
>
From "Advanced Programming in the Unix Environment" by W. Richard Stevens,
"If O_NONBLOCK is specified, an open for read-only returns immediately.
But an open for write-only returns an error with an errno of ENXIO if no
process has the FIFO open for reading" -- page 446.
-Zhihui
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.96.990816210413.15651B-100000>
