From f0de5ff1738fa06c95cc15179c5544c3e7486afe Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 6 Apr 1993 22:23:35 +0000 Subject: [PATCH] Implement primitive to detect availability of `select' system call. --- v7/src/microcode/dosio.c | 7 ++++--- v7/src/microcode/osio.h | 7 ++++--- v7/src/microcode/prosio.c | 10 ++++++++-- v7/src/microcode/pruxio.c | 8 +------- v7/src/microcode/uxio.c | 6 +++--- v7/src/microcode/uxselect.h | 3 +-- v7/src/microcode/version.h | 4 ++-- v7/src/microcode/x11base.c | 5 +++-- v8/src/microcode/version.h | 4 ++-- 9 files changed, 28 insertions(+), 26 deletions(-) diff --git a/v7/src/microcode/dosio.c b/v7/src/microcode/dosio.c index 1dc753c02..e873576e7 100644 --- a/v7/src/microcode/dosio.c +++ b/v7/src/microcode/dosio.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: dosio.c,v 1.3 1992/11/23 04:17:43 gjr Exp $ +$Id: dosio.c,v 1.4 1993/04/06 22:19:01 cph Exp $ -Copyright (c) 1992 Massachusetts Institute of Technology +Copyright (c) 1992-93 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -491,8 +491,9 @@ DEFUN (OS_channel_unregister, (channel), Tchannel channel) } } - /* No SELECT in DOS */ +CONST int OS_have_select_p = 0; + long DEFUN (OS_channel_select_then_read, (channel, buffer, nbytes), Tchannel channel AND diff --git a/v7/src/microcode/osio.h b/v7/src/microcode/osio.h index 2ec48f8b3..21da23922 100644 --- a/v7/src/microcode/osio.h +++ b/v7/src/microcode/osio.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osio.h,v 1.7 1991/03/11 23:42:31 cph Exp $ +$Id: osio.h,v 1.8 1993/04/06 22:18:26 cph Exp $ -Copyright (c) 1990-91 Massachusetts Institute of Technology +Copyright (c) 1990-93 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -31,7 +31,7 @@ there shall be no use of the name of the Massachusetts Institute of Technology nor of any adaptation thereof in any advertising, promotional, or sales literature without prior written consent from MIT in each case. */ - + #ifndef SCM_OSIO_H #define SCM_OSIO_H @@ -77,6 +77,7 @@ extern int EXFUN (OS_channel_nonblocking_p, (Tchannel channel)); extern void EXFUN (OS_channel_nonblocking, (Tchannel channel)); extern void EXFUN (OS_channel_blocking, (Tchannel channel)); +extern CONST int OS_have_select_p; extern unsigned int OS_channels_registered; extern int EXFUN (OS_channels_registered_p, (void)); extern void EXFUN (OS_channel_register, (Tchannel channel)); diff --git a/v7/src/microcode/prosio.c b/v7/src/microcode/prosio.c index 5547a905a..84efe6b41 100644 --- a/v7/src/microcode/prosio.c +++ b/v7/src/microcode/prosio.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prosio.c,v 1.7 1992/02/04 04:36:56 cph Exp $ +$Id: prosio.c,v 1.8 1993/04/06 22:18:09 cph Exp $ -Copyright (c) 1987-92 Massachusetts Institute of Technology +Copyright (c) 1987-93 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -207,6 +207,12 @@ DEFINE_PRIMITIVE ("MAKE-PIPE", Prim_make_pipe, 0, 0, } } +DEFINE_PRIMITIVE ("HAVE-SELECT?", Prim_have_select_p, 0, 0, 0) +{ + PRIMITIVE_HEADER (0); + PRIMITIVE_RETURN (BOOLEAN_TO_OBJECT (OS_have_select_p)); +} + DEFINE_PRIMITIVE ("CHANNEL-REGISTERED?", Prim_channel_registered_p, 1, 1, "Return #F iff CHANNEL is registered for selection.") { diff --git a/v7/src/microcode/pruxio.c b/v7/src/microcode/pruxio.c index f9f1b02f2..fda974b80 100644 --- a/v7/src/microcode/pruxio.c +++ b/v7/src/microcode/pruxio.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: pruxio.c,v 1.2 1993/04/06 21:34:02 cph Exp $ +$Id: pruxio.c,v 1.3 1993/04/06 22:18:19 cph Exp $ Copyright (c) 1993 Massachusetts Institute of Technology @@ -45,12 +45,6 @@ extern Tchannel EXFUN (arg_channel, (int arg_number)); extern int EXFUN (UX_channel_descriptor, (Tchannel channel)); #endif -DEFINE_PRIMITIVE ("HAVE-SELECT?", Prim_have_select_p, 0, 0, 0) -{ - PRIMITIVE_HEADER (0); - PRIMITIVE_RETURN (BOOLEAN_TO_OBJECT (UX_have_select_p)); -} - DEFINE_PRIMITIVE ("SELECT-REGISTRY-SIZE", Prim_selreg_size, 0, 0, 0) { PRIMITIVE_HEADER (0); diff --git a/v7/src/microcode/uxio.c b/v7/src/microcode/uxio.c index 571117140..f4ef01f4f 100644 --- a/v7/src/microcode/uxio.c +++ b/v7/src/microcode/uxio.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxio.c,v 1.24 1993/03/15 18:36:18 cph Exp $ +$Id: uxio.c,v 1.25 1993/04/06 22:18:45 cph Exp $ Copyright (c) 1990-93 Massachusetts Institute of Technology @@ -373,7 +373,7 @@ DEFUN (OS_channel_blocking, (channel), Tchannel channel) #endif #ifdef HAVE_SELECT -CONST int UX_have_select_p = 1; +CONST int OS_have_select_p = 1; extern int EXFUN (UX_process_any_status_change, (void)); #ifndef SELECT_DECLARED extern int EXFUN (UX_select, @@ -381,7 +381,7 @@ extern int EXFUN (UX_select, struct timeval *)); #endif /* not SELECT_DECLARED */ #else /* not HAVE_SELECT */ -CONST int UX_have_select_p = 0; +CONST int OS_have_select_p = 0; #endif /* not HAVE_SELECT */ unsigned int diff --git a/v7/src/microcode/uxselect.h b/v7/src/microcode/uxselect.h index 679e55bc6..1f589e43f 100644 --- a/v7/src/microcode/uxselect.h +++ b/v7/src/microcode/uxselect.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxselect.h,v 1.3 1993/03/10 17:55:54 cph Exp $ +$Id: uxselect.h,v 1.4 1993/04/06 22:18:54 cph Exp $ Copyright (c) 1991-93 Massachusetts Institute of Technology @@ -44,7 +44,6 @@ enum select_input select_input_interrupt }; -extern CONST int UX_have_select_p; extern enum select_input EXFUN (UX_select_input, (int fd, int blockp)); extern unsigned int EXFUN (UX_select_registry_size, (void)); extern unsigned int EXFUN (UX_select_registry_lub, (void)); diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index a1c595abd..007673e64 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: version.h,v 11.129 1993/03/10 17:56:45 cph Exp $ +$Id: version.h,v 11.130 1993/04/06 22:23:35 cph Exp $ Copyright (c) 1988-1993 Massachusetts Institute of Technology @@ -46,5 +46,5 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 129 +#define SUBVERSION 130 #endif diff --git a/v7/src/microcode/x11base.c b/v7/src/microcode/x11base.c index 7282c4dde..8e6ad848b 100644 --- a/v7/src/microcode/x11base.c +++ b/v7/src/microcode/x11base.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: x11base.c,v 1.47 1993/03/10 17:56:24 cph Exp $ +$Id: x11base.c,v 1.48 1993/04/06 22:18:36 cph Exp $ Copyright (c) 1989-93 Massachusetts Institute of Technology @@ -38,6 +38,7 @@ MIT in each case. */ #include "prims.h" #include "ux.h" #include "uxselect.h" +#include "osio.h" #include "x11.h" #ifndef X_DEFAULT_FONT @@ -1134,7 +1135,7 @@ DEFUN (xd_process_events, (xd, non_block_p, use_select_p), { Display * display = (XD_DISPLAY (xd)); unsigned int events_queued; - if (!UX_have_select_p) + if (!OS_have_select_p) use_select_p = 0; if (XD_CACHED_EVENT_P (xd)) { diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index a1c595abd..007673e64 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: version.h,v 11.129 1993/03/10 17:56:45 cph Exp $ +$Id: version.h,v 11.130 1993/04/06 22:23:35 cph Exp $ Copyright (c) 1988-1993 Massachusetts Institute of Technology @@ -46,5 +46,5 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 129 +#define SUBVERSION 130 #endif -- 2.25.1