From owner-freebsd-hackers Mon Jan 19 05:10:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA24929 for hackers-outgoing; Mon, 19 Jan 1998 05:10:34 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from oskar.nanoteq.co.za (oskar.nanoteq.co.za [196.37.91.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA24640 for ; Mon, 19 Jan 1998 05:09:03 -0800 (PST) (envelope-from jacques@oskar.nanoteq.co.za) Received: (from jacques@localhost) by oskar.nanoteq.co.za (8.8.8/8.8.5) id PAA01429 for freebsd-hackers@freebsd.org; Mon, 19 Jan 1998 15:07:58 +0200 (SAT) From: Jacques Fourie Message-Id: <199801191307.PAA01429@oskar.nanoteq.co.za> Subject: Unable to open /dev/urandom when compiling with -lc_r To: freebsd-hackers@FreeBSD.ORG Date: Mon, 19 Jan 1998 15:07:55 +0200 (SAT) X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk Hi I am unable to open /dev/urandom when compiling with -lc_r. The open() call returns -1, with errno set to 25 (ENOTTY). Here is an example program : /* Doesn't Work when compiled with gcc rndtest.c -o rndtest -D_THREAD_SAFE -lc_r */ /* Works when compiled without the threaded c lib. */ #include #include #include #include #include main() { int fd = -1; if((fd=open("/dev/urandom",O_RDONLY,0))==-1) { printf("Error : %d\n",errno); exit(1); } exit(0); } Any ideas ?? Jacques /***********************************************************************\ | Jacques Fourie | | Network System Engineer | | Nanoteq | | Tel: +27-12-6651338 Email: jf@nanoteq.com P.O Box 7991 | | Fax: +27-12-6651343 Centurion | | 0046 | | South Africa | \***********************************************************************/ |Standard disclaimer: | |All views expressed here are my own. | |--------------------------------------------------|