From owner-freebsd-current Fri Jul 28 21:18:51 2000 Delivered-To: freebsd-current@freebsd.org Received: from white.imgsrc.co.jp (ns.imgsrc.co.jp [210.226.20.2]) by hub.freebsd.org (Postfix) with ESMTP id C461037B81B; Fri, 28 Jul 2000 21:18:46 -0700 (PDT) (envelope-from hanai@imgsrc.co.jp) Received: from black.imgsrc.co.jp (black.imgsrc.co.jp [210.226.20.130]) by white.imgsrc.co.jp (8.9.3+3.2W/3.7Wpl2-GW) with ESMTP id NAA56280; Sat, 29 Jul 2000 13:18:45 +0900 (JST) Received: from darkmatter.imgsrc.co.jp (darkmatter.imgsrc.co.jp [210.226.20.149]) by black.imgsrc.co.jp (8.9.3/3.7Wpl2-SPOOL) with ESMTP id NAA07763; Sat, 29 Jul 2000 13:18:45 +0900 (JST) Received: from darkmatter.imgsrc.co.jp (localhost [127.0.0.1]) by darkmatter.imgsrc.co.jp (Postfix) with ESMTP id AE9C3A2AB; Sat, 29 Jul 2000 13:18:47 +0900 (JST) Date: Sat, 29 Jul 2000 13:18:47 +0900 Message-ID: <8266pp602g.wl@darkmatter.imgsrc.co.jp> From: Hiroyuki Hanai To: current@FreeBSD.org Cc: markm@FreeBSD.org Subject: fcntl and /dev/random User-Agent: Wanderlust/1.1.1 (Purple Rain) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/20.6 (i386--freebsd) MULE/4.0 (HANANOEN) Organization: IMG SRC, Inc. MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Setting status flags using F_SETFL command of fcntl(2) on the file descriptor, which is returned by open(2)ing /dev/random, seems not to be supported. For example, when I run following code; #include #include #include main() { int fd; fd = open("/dev/random", O_RDONLY); if (fcntl(fd, F_SETFL, O_NONBLOCK) == -1) { printf("%s\n", strerror(errno)); } } 3.4-RELEASE(and possibly 3.5 and 3.5.1) and 4.1-RELEASE/4.1-STABLE say `Inappropriate ioctl for device' and 5-current says `Operation not supported by device'. I've found above in BIND9's source and its `named' program complains everytime it's invoked. Should I fix BIND9's code? or wait for fcntl's F_SETFL being supported on FreeBSD? Actually, in BIND9, fd is already open(2)ed with `O_RDONLY | O_NONBLOCK' and setting O_NONBLOCK status with fcntl(2) is not needed, which means that fixing BIND9's code is very simple; just comment out the fcntl(2)ing line. h.hanai To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message