+
+static struct runtime_options *
+read_runtime_options(int fd)
+{
+ size_t optarray[RUNTIME_OPTIONS_WORDS];
+ struct runtime_options *options = NULL;
+
+ if (read(fd, optarray, RUNTIME_OPTIONS_WORDS * sizeof(size_t)) !=
+ RUNTIME_OPTIONS_WORDS * sizeof(size_t)) {
+ return NULL;
+ }
+
+ if ((RUNTIME_OPTIONS_MAGIC != optarray[0]) || (0 == optarray[1])) {
+ return NULL;
+ }
+
+ options = successful_malloc(sizeof(struct runtime_options));
+
+ options->dynamic_space_size = optarray[2];
+ options->thread_control_stack_size = optarray[3];
+
+ return options;
+}
+
+void
+maybe_initialize_runtime_options(int fd)
+{
+ off_t end_offset = sizeof(lispobj) +
+ sizeof(os_vm_offset_t) +
+ (RUNTIME_OPTIONS_WORDS * sizeof(size_t));
+
+ lseek(fd, -end_offset, SEEK_END);
+ runtime_options = read_runtime_options(fd);
+}
+