Add new channel types for character and block devices.
authorChris Hanson <org/chris-hanson/cph>
Mon, 12 Nov 1990 04:01:05 +0000 (04:01 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 12 Nov 1990 04:01:05 +0000 (04:01 +0000)
v7/src/microcode/osio.h
v7/src/microcode/uxfile.c

index 0ba7a38a15a2ed2ad43cd715f4053df6895ae2a4..b9d9376185fd1ad852f199bc70651c56fe3ab51f 100644 (file)
@@ -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;
index 6cf9be8eccd265092ee7dcf71165ec5fa99ed90a..a1056d9077248b89613c8986145bdc89c4e107b7 100644 (file)
@@ -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);