From d00be5ffb0e0c8979e5c7bf499208b44e5651bbd Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 12 Nov 1990 04:01:05 +0000 Subject: [PATCH] Add new channel types for character and block devices. --- v7/src/microcode/osio.h | 6 ++++-- v7/src/microcode/uxfile.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/v7/src/microcode/osio.h b/v7/src/microcode/osio.h index 0ba7a38a1..b9d937618 100644 --- a/v7/src/microcode/osio.h +++ b/v7/src/microcode/osio.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osio.h,v 1.4 1990/11/08 11:03:44 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osio.h,v 1.5 1990/11/12 04:00:45 cph Rel $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -48,7 +48,9 @@ enum channel_type channel_type_unix_stream_socket, channel_type_tcp_stream_socket, channel_type_tcp_server_socket, - channel_type_directory + channel_type_directory, + channel_type_character_device, + channel_type_block_device }; extern size_t OS_channel_table_size; diff --git a/v7/src/microcode/uxfile.c b/v7/src/microcode/uxfile.c index 6cf9be8ec..a1056d907 100644 --- a/v7/src/microcode/uxfile.c +++ b/v7/src/microcode/uxfile.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxfile.c,v 1.2 1990/11/08 11:07:33 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxfile.c,v 1.3 1990/11/12 04:01:05 cph Rel $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -48,9 +48,15 @@ DEFUN (fd_channel_type, (fd), int fd) mode_t type = ((stat_buf . st_mode) & S_IFMT); return ((type == S_IFREG) ? channel_type_file - : ((type == S_IFCHR) && (isatty (fd))) ? channel_type_terminal + : (type == S_IFCHR) + ? ((isatty (fd)) + ? channel_type_terminal + : channel_type_character_device) #ifdef S_IFIFO : (type == S_IFIFO) ? channel_type_fifo +#endif +#ifdef S_IFBLK + : (type == S_IFBLK) ? channel_type_block_device #endif : (type == S_IFDIR) ? channel_type_directory : channel_type_unknown); -- 2.25.1