From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA14375 for caml-redistribution; Wed, 26 Nov 1997 10:53:59 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA22464 for ; Tue, 25 Nov 1997 11:19:54 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.5) with ESMTP id LAA11146; Tue, 25 Nov 1997 11:19:11 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA22450; Tue, 25 Nov 1997 11:19:05 +0100 (MET) From: Xavier Leroy Message-Id: <199711251019.LAA22450@pauillac.inria.fr> Subject: Re: Deletion of ioctl_ptr in Caml 1.06 In-Reply-To: <199711240328.WAA01968@codex.cis.upenn.edu> from Scott Alexander at "Nov 23, 97 10:28:08 pm" To: salex@dsl.cis.upenn.edu (Scott Alexander) Date: Tue, 25 Nov 1997 11:19:05 +0100 (MET) Cc: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis > I'm curious as to the reason that Unix.ioctl_ptr (and Unix.ioctl_int) no > longer exist in OCaml 1.06. Is there a workaround for code that used > them? (I'm using ioctl_ptr in order to get information about the > network interfaces attached to the current machine.) There were two problems with the Unix.ioctl functions: 1- You had to hardwire the ioctl number and couldn't use the symbolic names provided by the C include files. This makes code extremely hard to read and fragile w.r.t. upgrades of the OS. 2- For ioctl_ptr, exploiting the result (which may be a complex struct) was very incovenient. For those two reasons, I think it's better to write a C function that does the ioctl you're interested in, and returns to Caml the results you're interested in. - Xavier Leroy