Skip to content

Commit 74ccdcd

Browse files
committed
bootstrap jimsh: assume fork() is available on posix platforms
There are very few posix platforms where fork isn't available. Signed-off-by: Steve Bennett <[email protected]>
1 parent c1e7d85 commit 74ccdcd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

jim-posix.c

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ static int Jim_PosixForkCommand(Jim_Interp *interp, int argc, Jim_Obj *const *ar
7171
}
7272
#endif
7373

74+
#if !defined(JIM_BOOTSTRAP)
7475
static int Jim_PosixGetidsCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
7576
{
7677
Jim_Obj *objv[8];
@@ -134,15 +135,18 @@ static int Jim_PosixUptimeCommand(Jim_Interp *interp, int argc, Jim_Obj *const *
134135
#endif
135136
return JIM_OK;
136137
}
138+
#endif /* JIM_BOOTSTRAP */
137139

138140
int Jim_posixInit(Jim_Interp *interp)
139141
{
140142
Jim_PackageProvideCheck(interp, "posix");
141143
#ifdef HAVE_FORK
142144
Jim_CreateCommand(interp, "os.fork", Jim_PosixForkCommand, NULL, NULL);
143145
#endif
146+
#if !defined(JIM_BOOTSTRAP)
144147
Jim_CreateCommand(interp, "os.getids", Jim_PosixGetidsCommand, NULL, NULL);
145148
Jim_CreateCommand(interp, "os.gethostname", Jim_PosixGethostnameCommand, NULL, NULL);
146149
Jim_CreateCommand(interp, "os.uptime", Jim_PosixUptimeCommand, NULL, NULL);
150+
#endif /* JIM_BOOTSTRAP */
147151
return JIM_OK;
148152
}

make-bootstrap-jim

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ EOF
4040
echo "}"
4141
}
4242

43-
cexts="aio readdir regexp file exec clock array"
43+
cexts="aio readdir regexp file exec clock array posix"
4444
tclexts="bootstrap initjimsh glob stdlib tclcompat"
4545

4646
# Note ordering
47-
allexts="bootstrap aio readdir regexp file glob exec clock array stdlib tclcompat"
47+
allexts="bootstrap aio readdir regexp file glob exec posix clock array stdlib tclcompat"
4848

4949
echo "/* This is single source file, bootstrap version of Jim Tcl. See http://jim.tcl.tk/ */"
5050

@@ -92,7 +92,7 @@ cat <<EOF
9292
#else
9393
#define _GNU_SOURCE
9494
#endif
95-
#define HAVE_VFORK
95+
#define HAVE_FORK
9696
#define HAVE_WAITPID
9797
#define HAVE_ISATTY
9898
#define HAVE_MKSTEMP

0 commit comments

Comments
 (0)