/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.57 1991/10/29 22:35:36 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.58 1991/11/04 16:49:52 jinx Exp $
Copyright (c) 1987-1991 Massachusetts Institute of Technology
EXFUN (dump_renumber_primitive, (SCHEME_OBJECT)),
* EXFUN (initialize_primitive_table, (SCHEME_OBJECT *, SCHEME_OBJECT *)),
* EXFUN (cons_primitive_table, (SCHEME_OBJECT *, SCHEME_OBJECT *, long *)),
- * EXFUN (cons_whole_primitive_table, (SCHEME_OBJECT *, SCHEME_OBJECT *, long *));
+ * EXFUN (cons_whole_primitive_table,
+ (SCHEME_OBJECT *, SCHEME_OBJECT *, long *));
static char *dump_file_name;
static int real_gc_file, dump_file;
if (fixup_count >= 0)
{
- if (((lseek (real_gc_file, (fixup_count << gc_buffer_byte_shift), 0))
- == -1)
- || ((read (real_gc_file, ((char *) fixup_buffer), gc_buffer_bytes))
- != gc_buffer_bytes))
+ if ((retrying_file_operation
+ (read, real_gc_file, ((char *) fixup_buffer),
+ (gc_file_start_position + (fixup_count << gc_buffer_byte_shift)),
+ gc_buffer_bytes, "read", "the fixup buffer",
+ &gc_file_current_position, io_error_retry_p))
+ != gc_buffer_bytes)
{
gc_death (TERM_EXIT,
"fasdump: Could not read back the fasdump fixup information",
Boolean
DEFUN_VOID (reset_fixes)
{
+ long start;
+
fixup_count += 1;
- if (((lseek (real_gc_file, (fixup_count << gc_buffer_byte_shift), 0))
- == -1)
- || ((write (real_gc_file, ((char *) fixup_buffer), gc_buffer_bytes))
+ start = (gc_file_start_position + (fixup_count << gc_buffer_byte_shift));
+
+ if (((start + gc_buffer_bytes) > gc_file_end_position)
+ || ((retrying_file_operation
+ (write, real_gc_file, ((char *) fixup_buffer),
+ start, gc_buffer_bytes, "write", "the fixup buffer",
+ &gc_file_current_position, io_error_always_abort))
!= gc_buffer_bytes))
- {
return (false);
- }
fixup = fixup_buffer_end;
return (true);
}
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/option.c,v 1.11 1991/10/29 22:38:56 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/option.c,v 1.12 1991/11/04 16:49:03 jinx Exp $
Copyright (c) 1990-1991 Massachusetts Institute of Technology
unsigned int option_stack_size;
/* These only matter for bchscheme */
-static CONST char * option_raw_gcfile = 0;
+static CONST char * option_raw_gc_end_position = 0;
+static CONST char * option_raw_gc_file = 0;
static CONST char * option_raw_gc_read_overlap = 0;
+static CONST char * option_raw_gc_start_position = 0;
static CONST char * option_raw_gc_window_size = 0;
static CONST char * option_raw_gc_write_overlap = 0;
CONST char * option_gc_directory = 0;
int option_gc_read_overlap;
int option_gc_window_size;
int option_gc_write_overlap;
+long option_gc_start_position;
+long option_gc_end_position;
\f/*
Scheme accepts the following command-line options. The options may
appear in any order, but they must all appear before any other
-option-summary
Causes Scheme to write option information to standard error.
-
+\f
-emacs
Specifies that Scheme is running as a subprocess of GNU Emacs.
This option is automatically supplied by GNU Emacs, and should not
MITSCHEME_EDWIN_BAND is used, otherwise "edwin.com" is used. It
also specifies the use of large sizes, exactly like "-large".
-The following options are only meaningful to bchscheme
-(garbage collection to disk):
+The following options are only meaningful to bchscheme:
-gc-directory DIRECTORY
Specifies what directory to use to allocate the garbage collection file.
-gc-drone FILENAME
Specifies the program to use as the gc drones for overlapped I/O.
+-gc-end-position N
+ Specifies a position into the gc file past which bchscheme should not use.
+
-gc-file FILENAME
Specifies that FILENAME should be used garbage collection. Overrides
-gc-directory if it is an absolute pathname. -gcfile means the same thing,
for overlapped I/O. Each implies a drone process to manage it,
if supported.
+-gc-start-position N
+ Specifies a position into the gc file before which bchscheme should not use.
+
-gc-window-size BLOCKS
Specifies the size in 1024-word blocks of each GC window.
-gc-write-overlap N
- Specifies the number of additional GC windows to use when writing
- for overlapped I/O. Each implies a drone process to manage it,
- if supported.
+ Specifies the number of additional GC windows to use when writing for
+ overlapped I/O. Each implies a drone process to manage it, if supported.
*/
\f
#ifndef LIBRARY_PATH_VARIABLE
\f
/* These are only meaningful for bchscheme */
+#ifndef DEFAULT_GC_DIRECTORY
+#define DEFAULT_GC_DIRECTORY "/tmp"
+#endif
+
+#ifndef GC_DIRECTORY_VARIABLE
+#define GC_DIRECTORY_VARIABLE "MITSCHEME_GC_DIRECTORY"
+#endif
+
#ifndef DEFAULT_GC_DRONE
-#define DEFAULT_GC_DRONE "gcdrone"
+#define DEFAULT_GC_DRONE "gcdrone"
#endif
#ifndef GC_DRONE_VARIABLE
-#define GC_DRONE_VARIABLE "MITSCHEME_GC_DRONE"
+#define GC_DRONE_VARIABLE "MITSCHEME_GC_DRONE"
#endif
-#ifndef DEFAULT_GC_DIRECTORY
-#define DEFAULT_GC_DIRECTORY "/tmp"
+#ifndef DEFAULT_GC_END_POSITION
+#define DEFAULT_GC_END_POSITION -1
#endif
-#ifndef GC_DIRECTORY_VARIABLE
-#define GC_DIRECTORY_VARIABLE "MITSCHEME_GC_DIRECTORY"
+#ifndef GC_END_POSITION_VARIABLE
+#define GC_END_POSITION_VARIABLE "MITSCHEME_GC_END_POSITION"
#endif
#ifndef DEFAULT_GC_FILE
-#define DEFAULT_GC_FILE "GCXXXXXX"
+#define DEFAULT_GC_FILE "GCXXXXXX"
#endif
#ifndef GC_FILE_VARIABLE
-#define GC_FILE_VARIABLE "MITSCHEME_GC_FILE"
+#define GC_FILE_VARIABLE "MITSCHEME_GC_FILE"
#endif
#ifndef DEFAULT_GC_READ_OVERLAP
-#define DEFAULT_GC_READ_OVERLAP 0
+#define DEFAULT_GC_READ_OVERLAP 0
#endif
#ifndef GC_READ_OVERLAP_VARIABLE
-#define GC_READ_OVERLAP_VARIABLE "MITSCHEME_GC_READ_OVERLAP"
+#define GC_READ_OVERLAP_VARIABLE "MITSCHEME_GC_READ_OVERLAP"
+#endif
+
+#ifndef DEFAULT_GC_START_POSITION
+#define DEFAULT_GC_START_POSITION 0
+#endif
+
+#ifndef GC_START_POSITION_VARIABLE
+#define GC_START_POSITION_VARIABLE "MITSCHEME_GC_START_POSITION"
#endif
#ifndef DEFAULT_GC_WINDOW_SIZE
-#define DEFAULT_GC_WINDOW_SIZE 16
+#define DEFAULT_GC_WINDOW_SIZE 16
#endif
#ifndef GC_WINDOW_SIZE_VARIABLE
-#define GC_WINDOW_SIZE_VARIABLE "MITSCHEME_GC_WINDOW_SIZE"
+#define GC_WINDOW_SIZE_VARIABLE "MITSCHEME_GC_WINDOW_SIZE"
#endif
#ifndef DEFAULT_GC_WRITE_OVERLAP
-#define DEFAULT_GC_WRITE_OVERLAP 0
+#define DEFAULT_GC_WRITE_OVERLAP 0
#endif
#ifndef GC_WRITE_OVERLAP_VARIABLE
-#define GC_WRITE_OVERLAP_VARIABLE "MITSCHEME_GC_WRITE_OVERLAP"
+#define GC_WRITE_OVERLAP_VARIABLE "MITSCHEME_GC_WRITE_OVERLAP"
#endif
\f
static int
/* The following options are only meaningful to bchscheme. */
option_argument ("-gc-directory", 1, (&option_gc_directory));
option_argument ("-gc-drone", 1, (&option_gc_drone));
+ option_argument ("-gc-end-position", 1, (&option_raw_gc_end_position));
option_argument ("-gc-file", 1, (&option_gc_file));
option_argument ("-gc-keep", 0, (&option_gc_keep));
+ option_argument ("-gc-start-position", 1, (&option_raw_gc_start_position));
option_argument ("-gc-read-overlap", 1, (&option_raw_gc_read_overlap));
option_argument ("-gc-window-size", 1, (&option_raw_gc_window_size));
option_argument ("-gc-write-overlap", 1, (&option_raw_gc_write_overlap));
- option_argument ("-gcfile", 1, (&option_raw_gcfile)); /* Obsolete */
+ option_argument ("-gcfile", 1, (&option_raw_gc_file)); /* Obsolete */
parse_options (argc, argv);
}
\f
}
}
-static unsigned int
-DEFUN (overlap_numeric_option, (option, optval, variable, defval),
+static long
+DEFUN (non_negative_numeric_option, (option, optval, variable, defval),
CONST char * option AND
CONST char * optval AND
CONST char * variable AND
- unsigned int defval)
+ long defval)
{
if (optval != 0)
{
- int n = (atoi (optval));
+ long n = (strtol (optval, ((char **) NULL), 0));
if (n < 0)
{
fprintf (stderr, "%s: illegal argument %s for option %s.\n",
CONST char * t = (getenv (variable));
if (t != 0)
{
- int n = (atoi (t));
+ long n = (strtol (t, ((char **) NULL), 0));
if (n < 0)
{
fprintf (stderr, "%s: illegal value %s for variable %s.\n",
describe_string_option ("microcode tables", option_utabmd_file);
{
/* These are only relevant to bchscheme. */
+ if (option_gc_directory != DEFAULT_GC_DIRECTORY)
+ describe_string_option ("GC directory", option_gc_directory);
+ if (option_gc_drone != DEFAULT_GC_DRONE)
+ describe_string_option ("GC drone program", option_gc_drone);
+ if (option_raw_gc_end_position)
+ describe_numeric_option ("GC end position", option_gc_end_position);
if (option_gc_file != DEFAULT_GC_FILE)
describe_string_option ("GC file", option_gc_file);
- if (option_gc_file != DEFAULT_GC_DIRECTORY)
- describe_string_option ("GC directory", option_gc_directory);
- if (option_raw_gc_window_size)
- describe_size_option ("GC window size", option_gc_window_size);
if (option_raw_gc_read_overlap)
describe_numeric_option ("GC read overlap", option_gc_read_overlap);
+ if (option_raw_gc_start_position)
+ describe_numeric_option ("GC start position", option_gc_start_position);
+ if (option_raw_gc_window_size)
+ describe_size_option ("GC window size", option_gc_window_size);
if (option_raw_gc_write_overlap)
describe_numeric_option ("GC write overlap", option_gc_write_overlap);
- if (option_gc_drone != DEFAULT_GC_DRONE)
- describe_string_option ("GC drone program", option_gc_drone);
if (option_gc_keep)
describe_boolean_option ("keep GC file", option_gc_keep);
}
/* These are only meaningful for bchscheme. */
- if (option_raw_gcfile != ((char *) 0))
+ if (option_raw_gc_file != ((char *) 0))
{
if (option_gc_file != ((char *) 0))
conflicting_options ("-gcfile", "-gc-file");
else
- option_gc_file = option_raw_gcfile;
+ option_gc_file = option_raw_gc_file;
}
option_gc_directory =
GC_DRONE_VARIABLE,
DEFAULT_GC_DRONE));
+ option_gc_end_position =
+ (non_negative_numeric_option ("-gc-end-position",
+ option_raw_gc_end_position,
+ GC_END_POSITION_VARIABLE,
+ DEFAULT_GC_END_POSITION));
+
option_gc_file =
(standard_string_option (option_gc_file,
GC_FILE_VARIABLE,
DEFAULT_GC_FILE));
option_gc_read_overlap =
- (overlap_numeric_option ("-gc-read-overlap",
- option_raw_gc_read_overlap,
- GC_READ_OVERLAP_VARIABLE,
- DEFAULT_GC_READ_OVERLAP));
+ ((int)
+ (non_negative_numeric_option ("-gc-read-overlap",
+ option_raw_gc_read_overlap,
+ GC_READ_OVERLAP_VARIABLE,
+ DEFAULT_GC_READ_OVERLAP)));
+
+ option_gc_start_position =
+ (non_negative_numeric_option ("-gc-start-position",
+ option_raw_gc_start_position,
+ GC_START_POSITION_VARIABLE,
+ DEFAULT_GC_START_POSITION));
option_gc_window_size =
(standard_numeric_option ("-gc-window-size",
DEFAULT_GC_WINDOW_SIZE));
option_gc_write_overlap =
- (overlap_numeric_option ("-gc-write-overlap",
- option_raw_gc_write_overlap,
- GC_WRITE_OVERLAP_VARIABLE,
- DEFAULT_GC_WRITE_OVERLAP));
+ ((int)
+ (non_negative_numeric_option ("-gc-write-overlap",
+ option_raw_gc_write_overlap,
+ GC_WRITE_OVERLAP_VARIABLE,
+ DEFAULT_GC_WRITE_OVERLAP)));
if (option_summary)
describe_options ();