/* -*-C-*-
-$Id: os2.h,v 1.4 1995/10/30 07:54:29 cph Exp $
+$Id: os2.h,v 1.5 1996/05/10 18:48:03 cph Exp $
-Copyright (c) 1994-95 Massachusetts Institute of Technology
+Copyright (c) 1994-96 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
#include "os2cthrd.h"
#include "os2pm.h"
-#define OS2_MAX_FILE_HANDLES() 20
-
#define FILE_ANY \
(FILE_NORMAL | FILE_HIDDEN | FILE_SYSTEM | FILE_DIRECTORY | FILE_ARCHIVED)
/* -*-C-*-
-$Id: os2api.h,v 1.8 1996/05/09 20:20:58 cph Exp $
+$Id: os2api.h,v 1.9 1996/05/10 18:47:42 cph Exp $
Copyright (c) 1994-96 Massachusetts Institute of Technology
syscall_dos_set_fh_state,
syscall_dos_set_file_ptr,
syscall_dos_set_file_size,
+ syscall_dos_set_max_fh,
syscall_dos_set_mem,
syscall_dos_set_path_info,
+ syscall_dos_set_rel_max_fh,
syscall_dos_start_timer,
syscall_dos_stop_timer,
syscall_dos_wait_child,
#define dos_set_fh_state DosSetFHState
#define dos_set_file_ptr DosSetFilePtr
#define dos_set_file_size DosSetFileSize
+#define dos_set_max_fh DosSetMaxFH
#define dos_set_mem DosSetMem
#define dos_set_path_info DosSetPathInfo
+#define dos_set_rel_max_fh DosSetRelMaxFH
#define dos_start_timer DosStartTimer
#define dos_stop_timer DosStopTimer
#define dos_wait_child DosWaitChild
"dos-set-fh-state",
"dos-set-file-ptr",
"dos-set-file-size",
+ "dos-set-max-fh",
"dos-set-mem",
"dos-set-path-info",
+ "dos-set-rel-max-fh",
"dos-start-timer",
"dos-stop-timer",
"dos-wait-child",
/* -*-C-*-
-$Id: os2io.c,v 1.6 1996/05/09 20:21:39 cph Exp $
+$Id: os2io.c,v 1.7 1996/05/10 18:47:58 cph Exp $
Copyright (c) 1994-96 Massachusetts Institute of Technology
Tchannel * OS2_channel_pointer_table;
const int OS_have_select_p = 1;
+#ifndef OS2_DEFAULT_MAX_FH
+#define OS2_DEFAULT_MAX_FH 256
+#endif
+
+/* Set this to a larger size than OS2_DEFAULT_MAX_FH, because the
+ maximum number of file handles can be increased dynamically by
+ calling a primitive. */
+#ifndef OS2_DEFAULT_CHANNEL_TABLE_SIZE
+#define OS2_DEFAULT_CHANNEL_TABLE_SIZE 1024
+#endif
+
void
OS2_initialize_channels (void)
{
- OS_channel_table_size = (OS2_MAX_FILE_HANDLES ());
+ {
+ LONG req_max_fh = 0;
+ ULONG current_max_fh;
+ STD_API_CALL (dos_set_rel_max_fh, ((&req_max_fh), (¤t_max_fh)));
+ req_max_fh = (OS2_DEFAULT_MAX_FH - current_max_fh);
+ if (req_max_fh > 0)
+ STD_API_CALL (dos_set_rel_max_fh, ((&req_max_fh), (¤t_max_fh)));
+ }
+ OS_channel_table_size = OS2_DEFAULT_CHANNEL_TABLE_SIZE;
OS2_channel_table =
(OS_malloc (OS_channel_table_size * (sizeof (struct channel))));
OS2_channel_pointer_table =
/* -*-C-*-
-$Id: pros2fs.c,v 1.15 1995/11/06 21:52:24 cph Exp $
+$Id: pros2fs.c,v 1.16 1996/05/10 18:47:52 cph Exp $
-Copyright (c) 1994-95 Massachusetts Institute of Technology
+Copyright (c) 1994-96 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
OS_file_copy ((STRING_ARG (1)), (STRING_ARG (2)));
PRIMITIVE_RETURN (UNSPECIFIC);
}
+
+DEFINE_PRIMITIVE ("OS2-SET-REL-MAX-FH", Prim_OS2_set_rel_max_fh, 1, 1, 0)
+{
+ PRIMITIVE_HEADER (1);
+ {
+ LONG req_max_fh = (arg_integer (1));
+ ULONG current_max_fh;
+ STD_API_CALL (dos_set_rel_max_fh, ((&req_max_fh), (¤t_max_fh)));
+ PRIMITIVE_RETURN (ulong_to_integer (current_max_fh));
+ }
+}