/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osproc.h,v 1.5 1991/03/14 04:22:35 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osproc.h,v 1.6 1992/02/11 23:01:04 cph Exp $
-Copyright (c) 1990-91 Massachusetts Institute of Technology
+Copyright (c) 1990-92 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(CONST char * filename,
CONST char ** argv,
char ** env,
+ CONST char * working_directory,
enum process_ctty_type ctty_type,
char * ctty_name,
enum process_channel_type channel_in_type,
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prosproc.c,v 1.10 1992/01/20 17:30:50 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prosproc.c,v 1.11 1992/02/11 23:01:37 cph Exp $
-Copyright (c) 1990-1992 Massachusetts Institute of Technology
+Copyright (c) 1990-92 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
{
PRIMITIVE_HEADER (7);
CHECK_ARG (2, string_vector_p);
- if ((ARG_REF (3)) != SHARP_F)
- CHECK_ARG (3, string_vector_p);
{
PTR position = dstack_position;
CONST char * filename = (STRING_ARG (1));
CONST char ** argv =
((CONST char **) (convert_string_vector (ARG_REF (2))));
- char ** env =
- (((ARG_REF (3)) == SHARP_F) ? 0 : (convert_string_vector (ARG_REF (3))));
+ SCHEME_OBJECT env_object = (ARG_REF (3));
+ char ** env = 0;
+ CONST char * working_directory = 0;
enum process_ctty_type ctty_type;
char * ctty_name = 0;
enum process_channel_type channel_in_type;
enum process_channel_type channel_err_type;
Tchannel channel_err;
+ if ((PAIR_P (env_object)) && (STRING_P (PAIR_CDR (env_object))))
+ {
+ working_directory =
+ ((CONST char *) (STRING_LOC ((PAIR_CDR (env_object)), 0)));
+ env_object = (PAIR_CAR (env_object));
+ }
+ if (env_object != SHARP_F)
+ {
+ if (! (string_vector_p (env_object)))
+ error_wrong_type_arg (3);
+ env = (convert_string_vector (env_object));
+ }
if ((ARG_REF (4)) == SHARP_F)
ctty_type = process_ctty_type_none;
else if ((ARG_REF (4)) == (LONG_TO_FIXNUM (-1)))
{
Tprocess process =
(OS_make_subprocess
- (filename, argv, env,
+ (filename, argv, env, working_directory,
ctty_type, ctty_name,
channel_in_type, channel_in,
channel_out_type, channel_out,
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxproc.c,v 1.11 1991/06/15 00:40:36 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxproc.c,v 1.12 1992/02/11 23:01:17 cph Exp $
-Copyright (c) 1990-91 Massachusetts Institute of Technology
+Copyright (c) 1990-92 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
CONST char * filename AND
CONST char ** argv AND
char ** envp AND
+ CONST char * working_directory AND
enum process_ctty_type ctty_type AND
char * ctty_name AND
enum process_channel_type channel_in_type AND
/* Don't do `transaction_commit ()' here. Because we used `vfork'
to spawn the child, the side-effects that are performed by
`transaction_commit' will occur in the parent as well. */
+ if (working_directory != 0)
+ UX_chdir (working_directory);
{
int in_fd = (-1);
int out_fd = (-1);