src/chardev.c
/************************************************************************/
/*                                                                      */
/*                          C H A R _ b o u t                           */
/*                                                                      */
/*      Write character ch to the character file descriptor id.  If     */
/*      the write works, return T; else return NIL and sets the FIXP    */
/*      cell at errno to contain the Unix error number.                         */
/*                                                                      */
/************************************************************************/
C H A R _ b o u t

Write character ch to the character file descriptor id.  If
the write works, return T; else return NIL and sets the FIXP
cell at errno to contain the Unix error number.
C H A R _ b o u t Write character ch to the character file descriptor id . If the write works return T ; else return NIL and sets the FIXP cell at errno to contain the Unix error number .
LispPTR CHAR_bout(int fd, LispPTR ch, LispPTR errn)
{
#ifndef DOS
  register int rval;
  char buf[4];
  Lisp_errno = (int *)(Addr68k_from_LADDR(errn));
  ERRSETJMP(NIL);
  fd = LispNumToCInt(fd);
  buf[0] = LispNumToCInt(ch);
  TIMEOUT(rval = write(fd, buf, 1));
  if (rval == -1) {
    *Lisp_errno = errno;
    return (NIL);
  }
  if (rval == 0) {
    *Lisp_errno = EWOULDBLOCK;
    return (NIL);
  }
  return (ATOM_T);
#endif 
}
LispPTR CHAR_bout ( int fd , LispPTR ch , LispPTR errn ) { #ifndef DOS register int rval ; char buf [ 4 ] ; Lisp_errno = ( int * ) ( Addr68k_from_LADDR ( errn ) ) ; ERRSETJMP ( NIL ) ; fd = LispNumToCInt ( fd ) ; buf [ 0 ] = LispNumToCInt ( ch ) ; TIMEOUT ( rval = write ( fd , buf , 1 ) ) ; if ( rval == -1 ) { * Lisp_errno = errno ; return ( NIL ) ; } if ( rval == 0 ) { * Lisp_errno = EWOULDBLOCK ; return ( NIL ) ; } return ( ATOM_T ) ; #endif }
C H A R _ b o u t
C H A R _ b o u t
/* DOS */