/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osio.h,v 1.1 1990/06/20 19:36:26 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osio.h,v 1.2 1990/06/21 20:01:42 cph Exp $
Copyright (c) 1990 Massachusetts Institute of Technology
(OS_channel_read, (Tchannel channel, PTR buffer, size_t nbytes));
extern long EXFUN
(OS_channel_write, (Tchannel channel, CONST PTR buffer, size_t nbytes));
-extern int EXFUN (OS_channel_read_char_interruptably, (Tchannel channel));
extern void EXFUN
(OS_channel_write_string, (Tchannel channel, CONST char * string));
extern int EXFUN (OS_channel_nonblocking_p, (Tchannel channel));
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxio.c,v 1.1 1990/06/20 19:37:14 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxio.c,v 1.2 1990/06/21 20:01:48 cph Exp $
Copyright (c) 1990 Massachusetts Institute of Technology
{
Tchannel channel;
for (channel = 0; (channel < OS_channel_table_size); channel += 1)
- if ((CHANNEL_OPEN_P (channel)) && (! (CHANNEL_INTERNAL (channel))))
+ if (CHANNEL_OPEN_P (channel))
OS_channel_close (channel);
}
DEFUN (OS_channel_close, (channel), Tchannel channel)
{
if (! (CHANNEL_INTERNAL (channel)))
- STD_VOID_SYSTEM_CALL ("close", (UX_close (CHANNEL_DESCRIPTOR (channel))));
- MARK_CHANNEL_CLOSED (channel);
+ {
+ STD_VOID_SYSTEM_CALL ("close", (UX_close (CHANNEL_DESCRIPTOR (channel))));
+ MARK_CHANNEL_CLOSED (channel);
+ }
}
void
return (0);
while (1)
{
- long scr = (UX_read ((CHANNEL_DESCRIPTOR (channel)), buffer, nbytes));
+ long scr;
+ INTERRUPTABLE_EXTENT
+ (scr, (UX_read ((CHANNEL_DESCRIPTOR (channel)), buffer, nbytes)));
if (scr < 0)
{
#ifdef ERRNO_NONBLOCK
if (errno == ERRNO_NONBLOCK)
return (-1);
#endif
- if (errno == EINTR)
- continue;
- error_system_call (errno, "read");
+ UX_prim_check_errno ("read");
+ continue;
}
if (scr > nbytes)
error_external_return ();
return (0);
while (1)
{
- long scr = (UX_write ((CHANNEL_DESCRIPTOR (channel)), buffer, nbytes));
+ long scr;
+ INTERRUPTABLE_EXTENT
+ (scr, (UX_write ((CHANNEL_DESCRIPTOR (channel)), buffer, nbytes)));
if (scr < 0)
{
#ifdef ERRNO_NONBLOCK
if (errno == ERRNO_NONBLOCK)
return (-1);
#endif
- if (errno == EINTR)
- continue;
- error_system_call (errno, "write");
+ UX_prim_check_errno ("write");
+ continue;
}
if (scr > nbytes)
error_external_return ();
return ((scr < 0) ? 0 : scr);
}
-int
-DEFUN (OS_channel_read_char_interruptably, (channel), Tchannel channel)
-{
- unsigned char c;
- int nread;
- while (1)
- {
- INTERRUPTABLE_EXTENT
- (nread, (UX_read ((CHANNEL_DESCRIPTOR (channel)), ((PTR) (&c)), 1)));
- if (nread >= 0)
- break;
-#ifdef ERRNO_NONBLOCK
- if (errno == ERRNO_NONBLOCK)
- {
- nread = 0;
- break;
- }
-#endif
- UX_prim_check_errno ("read");
- }
- return ((nread == 1) ? c : (-1));
-}
-
void
DEFUN (OS_channel_write_string, (channel, string),
Tchannel channel AND
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxterm.c,v 1.1 1990/06/20 19:37:38 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxterm.c,v 1.2 1990/06/21 20:01:53 cph Exp $
Copyright (c) 1990 Massachusetts Institute of Technology
return (c);
}
}
- return (OS_channel_read_char_interruptably (channel));
+ {
+ unsigned char c;
+ long nread = (OS_channel_read (channel, (&c), 1));
+ return ((nread == 1) ? c : (-1));
+ }
}
\f
int
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxtty.c,v 1.1 1990/06/20 19:38:04 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxtty.c,v 1.2 1990/06/21 20:01:58 cph Exp $
Copyright (c) 1990 Massachusetts Institute of Technology
static unsigned char
DEFUN (tty_read_char, (immediate), int immediate)
{
- int c;
if ((OS_channel_type (input_channel)) == channel_type_terminal)
{
transaction_begin ();
OS_terminal_nonbuffered (input_channel);
else
OS_terminal_buffered (input_channel);
- c = (OS_terminal_read_char (input_channel));
- if (c == (-1))
- termination_eof ();
- transaction_commit ();
+ {
+ int c = (OS_terminal_read_char (input_channel));
+ if (c == (-1))
+ termination_eof ();
+ transaction_commit ();
+ return ((unsigned char) c);
+ }
}
else
{
- c = (OS_channel_read_char_interruptably (input_channel));
- if (c == (-1))
+ unsigned char c;
+ if ((OS_channel_read (input_channel, (&c), 1)) != 1)
termination_eof ();
if ((OS_channel_type (input_channel)) == channel_type_file)
OS_tty_write_char (c);
+ return (c);
}
- return ((unsigned char) c);
}
unsigned char
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.33 1990/06/20 20:00:58 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.34 1990/06/21 20:02:06 cph Exp $
Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
#define VERSION 11
#endif
#ifndef SUBVERSION
-#define SUBVERSION 33
+#define SUBVERSION 34
#endif
#ifndef UCODE_TABLES_FILENAME
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.33 1990/06/20 20:00:58 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.34 1990/06/21 20:02:06 cph Exp $
Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
#define VERSION 11
#endif
#ifndef SUBVERSION
-#define SUBVERSION 33
+#define SUBVERSION 34
#endif
#ifndef UCODE_TABLES_FILENAME