src/chardev.c
/************************************************************************/
/*                                                                      */
/*                          C H A R _ i o c t l                                 */
/*                                                                      */
/*      Given the arg vector:                                           */
/*              args[0] the file descriptor to be acted on.             */
/*              args[1] the IOCTL request code.                                 */
/*              args[2] auxiliary data structure passed to IOCTL        */
/*              args[3] a FIXP cell to contain any Unix error number    */
/*                                                                      */
/*      Perform the IOCTL system call on the given file descriptor,     */
/*      passing in the request code and auxiliary structure given.      */
/*      If the IOCTL succeeds, return T (and the aux structure may      */
/*      be side-effected).  Otherwise, return NIL, and put the Unix     */
/*      error number in the FIXP cell for Lisp to look at.              */
/*                                                                      */
/************************************************************************/
C H A R _ i o c t l

Given the arg vector:
args[0] the file descriptor to be acted on.
args[1] the IOCTL request code.
args[2] auxiliary data structure passed to IOCTL
args[3] a FIXP cell to contain any Unix error number

Perform the IOCTL system call on the given file descriptor,
passing in the request code and auxiliary structure given.
If the IOCTL succeeds, return T (and the aux structure may
be side-effected).  Otherwise, return NIL, and put the Unix
error number in the FIXP cell for Lisp to look at.
C H A R _ i o c t l Given the arg vector : args [ 0 ] the file descriptor to be acted on . args [ 1 ] the IOCTL request code . args [ 2 ] auxiliary data structure passed to IOCTL args [ 3 ] a FIXP cell to contain any Unix error number Perform the IOCTL system call on the given file descriptor passing in the request code and auxiliary structure given . If the IOCTL succeeds return T ( and the aux structure may be side - effected ) . Otherwise return NIL and put the Unix error number in the FIXP cell for Lisp to look at .
LispPTR CHAR_ioctl(LispPTR *args)
{
#ifndef DOS
  int fd, request;
  void *data;
  register int rval;
  Lisp_errno = (int *)(Addr68k_from_LADDR(args[3]));
  fd = LispNumToCInt(args[0]);
  request = LispNumToCInt(args[1]);
  data = (Addr68k_from_LADDR(args[2]));
  ERRSETJMP(NIL);
  TIMEOUT(rval = ioctl(fd, request, data));
  if (rval != 0) {
    err_mess("ioctl", errno);
    *Lisp_errno = errno;
    return (NIL);
  }
  return (ATOM_T);
#endif 
}
LispPTR CHAR_ioctl ( LispPTR * args ) { #ifndef DOS int fd , request ; void * data ; register int rval ; Lisp_errno = ( int * ) ( Addr68k_from_LADDR ( args [ 3 ] ) ) ; fd = LispNumToCInt ( args [ 0 ] ) ; request = LispNumToCInt ( args [ 1 ] ) ; data = ( Addr68k_from_LADDR ( args [ 2 ] ) ) ; ERRSETJMP ( NIL ) ; TIMEOUT ( rval = ioctl ( fd , request , data ) ) ; if ( rval != 0 ) { err_mess ( " " , errno ) ; * Lisp_errno = errno ; return ( NIL ) ; } return ( ATOM_T ) ; #endif }
C H A R _ i o c t l
C H A R _ i o c t l
/* DOS */