Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: salex@dsl.cis.upenn.edu (Scott Alexander)
Cc: caml-list@inria.fr
Subject: Re: Deletion of ioctl_ptr in Caml 1.06
Date: Tue, 25 Nov 1997 11:19:05 +0100 (MET)	[thread overview]
Message-ID: <199711251019.LAA22450@pauillac.inria.fr> (raw)
In-Reply-To: <199711240328.WAA01968@codex.cis.upenn.edu> from Scott Alexander at "Nov 23, 97 10:28:08 pm"

> 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





      reply	other threads:[~1997-11-26  9:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-24  3:28 Scott Alexander
1997-11-25 10:19 ` Xavier Leroy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199711251019.LAA22450@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=salex@dsl.cis.upenn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox