Subject: Re: Low-level access to fd's in ACL
From: Erik Naggum <erik@naggum.net>
Date: 2000/11/15
Newsgroups: comp.lang.lisp
Message-ID: <3183309741355373@naggum.net>

* Kaelin Colclasure <kaelin@acm.org>
| Notably missing is any sign of the ioctl call -- which Lisp reported as
| failing when I know perfectly well all this device does with an ioctl is
| spit out a printk() and return success.

  You don't actually reach the ioctl system call.  The ioctl function
  seems to call _fcntl_ or a proxy for it depending on the platform.
  You would have seen this if you traced the process for system or
  shared library calls, by the way.

| I realize that using unexported functions is in questionable taste --
| my motivation for avoiding defining my own ffi's to the system calls
| is the (perhaps misguided) belief that Franz's implementation should
| be "safer".  Okay, that and I'm lazy... ;-)

  Well, it should be as simple as the following, except that the request
  is extremely dependent on the stupid C macro facility for the "named
  constants" and actually unearthing any values out of it is _painful_.

(def-foreign-call (ioctl "ioctl") (filedes request argument)
  :strings-convert nil
  :arg-checking nil)

#:Erik
-- 
  ALGORITHM: a procedure for solving a mathematical problem in a finite
  number of steps that frequently involves repetition of an operation.
  ALGOREISM: a procedure for solving an electoral problem in a finite
  number of steps that frequently involves repetition of an operation.