From owner-freebsd-questions Mon Aug 16 18:21:27 1999 Delivered-To: freebsd-questions@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id DD68B15599 for ; Mon, 16 Aug 1999 18:21:21 -0700 (PDT) (envelope-from zzhang@cs.binghamton.edu) Received: from sol.cs.binghamton.edu (cs1-gw.cs.binghamton.edu [128.226.171.72]) by bingnet2.cc.binghamton.edu (8.9.3/8.9.3) with SMTP id VAA04916; Mon, 16 Aug 1999 21:21:15 -0400 (EDT) Date: Mon, 16 Aug 1999 21:07:57 -0400 (EDT) From: Zhihui Zhang To: Danaii Maziar Cc: freebsd-questions@FreeBSD.ORG Subject: Re: FIFO -- Device not configured In-Reply-To: <14264.9594.118127.306139@golem.easynet.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 > #include > > 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