From: Xavier Leroy <xleroy@pauillac.inria.fr>
To: johnm@vlibs.com (John Gerard Malecki)
Cc: caml-list@pauillac.inria.fr
Subject: Re: Calling ioctl_ptr
Date: Mon, 4 Mar 1996 21:32:45 +0100 (MET) [thread overview]
Message-ID: <199603042032.VAA02627@pauillac.inria.fr> (raw)
In-Reply-To: <199602292019.MAA03081@owl.vlibs.com> from "John Gerard Malecki" at Feb 29, 96 12:19:36 pm
> I need to explicitly manipulate modem/rs-232 control lines on a 32 bit
> sun-0s4.1 system. I was going to invoke ioctl_ptr to do the job.
>
> The first argument to ioctl_ptr is an int. The bits which determine a
> modem control line request are 30 and 31. Is there a trick I can use
> to set only bit 30 and not 31 and vice-versa?
I'm afraid not. That's a weakness of the tagged data representation
scheme used in Caml Light and other ML implementations.
The "unix" library provides a reasonably high-level interface to the
POSIX termios functions, which provide some control on the rs-232 signals.
If that's not sufficient, I'd recommend that you write small C
wrappers around the ioctls you need. This will not only solve the
problem with 31 vs. 32 bit integers, but also allow the use of
symbolic names for ioctl codes, something not easily done in Caml.
Although most of the Unix system calls have a reasonably nice
presentation in Caml, ioctl and fcntl do not, and are fairly hard to
use in any language other than C.
- Xavier Leroy
prev parent reply other threads:[~1996-03-05 10:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-02-29 20:19 John Gerard Malecki
1996-03-04 20:32 ` 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=199603042032.VAA02627@pauillac.inria.fr \
--to=xleroy@pauillac.inria.fr \
--cc=caml-list@pauillac.inria.fr \
--cc=johnm@vlibs.com \
/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