src/chardev.c
/************************************************************************/
/*                                                                      */
/*                      C H A R _ c l o s e f i l e                     */
/*                                                                      */
/*      Given the arg vector:                                           */
/*              args[0] The SMALLP file descriptor as returned by OPEN  */
/*              args[1] a FIXP cell to hold any Unix error number       */
/*                                                                      */
/*      Close the file identified by the descriptor.  If the            */
/*      close succeeds, return T.  Otherwise, return NIL, and put       */
/*      the Unix error number in the FIXP cell, for Lisp to see.        */
/*                                                                      */
/************************************************************************/
C H A R _ c l o s e f i l e

Given the arg vector:
args[0] The SMALLP file descriptor as returned by OPEN
args[1] a FIXP cell to hold any Unix error number

Close the file identified by the descriptor.  If the
close succeeds, return T.  Otherwise, return NIL, and put
the Unix error number in the FIXP cell, for Lisp to see.
C H A R _ c l o s e f i l e Given the arg vector : args [ 0 ] The SMALLP file descriptor as returned by OPEN args [ 1 ] a FIXP cell to hold any Unix error number Close the file identified by the descriptor . If the close succeeds return T . Otherwise return NIL and put the Unix error number in the FIXP cell for Lisp to see .
LispPTR CHAR_closefile(LispPTR *args)
{
#ifndef DOS
  register int fd; 
  register int rval;
  Lisp_errno = (int *)(Addr68k_from_LADDR(args[1]));
  fd = LispNumToCInt(args[0]);
  ERRSETJMP(NIL);
  TIMEOUT(rval = close(fd));
  if (rval == -1) {
    if (errno == 1) {
      DBPRINT(("Got errno 1 on a CLOSE!"));
      return (ATOM_T);
    }
    DBPRINT(("Closing char device descriptor #%d.\n", fd));
    err_mess("close", errno);
    *Lisp_errno = errno;
    return (NIL);
  }
  return (ATOM_T);
#endif 
}
LispPTR CHAR_closefile ( LispPTR * args ) { #ifndef DOS register int fd ; register int rval ; Lisp_errno = ( int * ) ( Addr68k_from_LADDR ( args [ 1 ] ) ) ; fd = LispNumToCInt ( args [ 0 ] ) ; ERRSETJMP ( NIL ) ; TIMEOUT ( rval = close ( fd ) ) ; if ( rval == -1 ) { if ( errno == 1 ) { DBPRINT ( ( " " ) ) ; return ( ATOM_T ) ; } DBPRINT ( ( " \n " , fd ) ) ; err_mess ( " " , errno ) ; * Lisp_errno = errno ; return ( NIL ) ; } return ( ATOM_T ) ; #endif }
C H A R _ c l o s e f i l e
C H A R _ c l o s e f i l e
/* args[0]            fd      */ /* args[1]            errno   */ /* file descriptor */ /** This if is a patch for an apparent problem **/ /** in SunOS 4 that causes a close on /dev/ttya **/ /** to error with 'not owner' **/ /* DOS */