From 3613da4240b82023b6861af08b57c2c426248766 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Fri, 17 Jul 2020 17:13:53 +0100 Subject: [PATCH] Remove unused libcoshell The coshell(1) command, which is required for libcoshell to be useful, is not known to be shipped by any distribution. It was removed by the ksh-community fork and hence also by 93u+m (in 2940b3f5). The coshell facility as a whole is obsolete and insecure. For a long time now, the statically linked libcoshell library has been 40+ kilobytes of dead weight in the ksh binary. Prior discussion (ksh2020): https://github.com/att/ast/issues/619 src/lib/libcoshell/*: - Removed. src/cmd/ksh93/*: - Remove the SHOPT_COSHELL compiler option (which was enabled) and a lot of code that was conditional upon #ifdef SHOPT_COSHELL. - init.c: e_version[]: Removing SHOPT_COSHELL changed the "J" feature identifier in ${.sh.version} to a lowercase "j", which was conditional upon SHOPT_BGX (background job extensions). But src/cmd/ksh93/RELEASE documents (at 08-12-04, on line 1188): | +SHOPT_BGX enables background job extensions. Noted by "J" in | the version string when enabled. [...] That is the only available documentation. So change that "j" back to a "J", leaving the version string unchanged after this commit. - jobs.c: job_walk(): We need to keep one 'job_waitsafe(SIGCHLD);' call that was conditional upon SHOPT_COSHELL; removing it caused a regression test failure in tests/sigchld.sh, 'SIGCHLD blocked for script at end of pipeline' (which means that until now, a ksh compiled without libcoshell had broken SIGCHLD handling.) bin/package, src/cmd/INIT/package.sh: - Don't export COSHELL variable. --- bin/package | 8 +- src/cmd/INIT/package.sh | 8 +- src/cmd/ksh93/Makefile | 7 +- src/cmd/ksh93/Mamfile | 149 ++++++----- src/cmd/ksh93/bltins/whence.c | 8 +- src/cmd/ksh93/data/builtins.c | 16 +- src/cmd/ksh93/data/msg.c | 6 +- src/cmd/ksh93/include/defs.h | 6 - src/cmd/ksh93/include/jobs.h | 22 -- src/cmd/ksh93/sh/init.c | 19 +- src/cmd/ksh93/sh/io.c | 60 ----- src/cmd/ksh93/sh/jobs.c | 155 ------------ src/cmd/ksh93/sh/macro.c | 8 - src/cmd/ksh93/sh/nvdisc.c | 4 - src/cmd/ksh93/sh/parse.c | 26 -- src/cmd/ksh93/sh/path.c | 1 - src/cmd/ksh93/sh/subshell.c | 10 - src/cmd/ksh93/sh/xec.c | 408 ------------------------------ src/lib/libcoshell/Makefile | 20 -- src/lib/libcoshell/Mamfile | 462 ---------------------------------- src/lib/libcoshell/RELEASE | 49 ---- src/lib/libcoshell/coclose.c | 113 --------- src/lib/libcoshell/codata.c | 169 ------------- src/lib/libcoshell/coexec.c | 449 --------------------------------- src/lib/libcoshell/coexport.c | 80 ------ src/lib/libcoshell/coinit.c | 396 ----------------------------- src/lib/libcoshell/cokill.c | 134 ---------- src/lib/libcoshell/colib.h | 137 ---------- src/lib/libcoshell/coopen.c | 411 ------------------------------ src/lib/libcoshell/coquote.c | 60 ----- src/lib/libcoshell/coshell.3 | 396 ----------------------------- src/lib/libcoshell/coshell.h | 143 ----------- src/lib/libcoshell/costash.c | 40 --- src/lib/libcoshell/cosync.c | 129 ---------- src/lib/libcoshell/cowait.c | 411 ------------------------------ src/lib/libcoshell/ignore.sh | 45 ---- src/lib/libcoshell/procrun.c | 56 ----- src/lib/libcoshell/silent.sh | 44 ---- src/lib/libcoshell/system.c | 57 ----- 39 files changed, 87 insertions(+), 4635 deletions(-) delete mode 100644 src/lib/libcoshell/Makefile delete mode 100644 src/lib/libcoshell/Mamfile delete mode 100644 src/lib/libcoshell/RELEASE delete mode 100644 src/lib/libcoshell/coclose.c delete mode 100644 src/lib/libcoshell/codata.c delete mode 100644 src/lib/libcoshell/coexec.c delete mode 100644 src/lib/libcoshell/coexport.c delete mode 100644 src/lib/libcoshell/coinit.c delete mode 100644 src/lib/libcoshell/cokill.c delete mode 100644 src/lib/libcoshell/colib.h delete mode 100644 src/lib/libcoshell/coopen.c delete mode 100644 src/lib/libcoshell/coquote.c delete mode 100644 src/lib/libcoshell/coshell.3 delete mode 100644 src/lib/libcoshell/coshell.h delete mode 100644 src/lib/libcoshell/costash.c delete mode 100644 src/lib/libcoshell/cosync.c delete mode 100644 src/lib/libcoshell/cowait.c delete mode 100644 src/lib/libcoshell/ignore.sh delete mode 100644 src/lib/libcoshell/procrun.c delete mode 100644 src/lib/libcoshell/silent.sh delete mode 100644 src/lib/libcoshell/system.c diff --git a/bin/package b/bin/package index 48ae8a141..d014c576f 100755 --- a/bin/package +++ b/bin/package @@ -3115,10 +3115,6 @@ cat $INITROOT/$i.sh export SHELL $show SHELL=$SHELL $show export SHELL - COSHELL=$SHELL - export COSHELL - $show COSHELL=$COSHELL - $show export COSHELL # tame the environment @@ -3496,7 +3492,7 @@ int main(int argc, char** argv) { return argc || argv; } INITPROTO=$PROTOROOT/src/cmd/INIT note proto convert $PACKAGEROOT/src into $PROTOROOT/src if test -d $PACKAGEROOT/src/cmd/nmake - then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libcoshell src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake" + then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake" else dirs="src" fi ( @@ -6007,8 +6003,6 @@ cat $j $k if test "$KEEP_SHELL" != 1 && executable $OK/ksh then SHELL=$INSTALLROOT/bin/$OK/ksh export SHELL - COSHELL=$SHELL - export COSHELL fi case :$PATH: in *:$INSTALLROOT/bin/$OK:*) diff --git a/src/cmd/INIT/package.sh b/src/cmd/INIT/package.sh index 8174f676c..0c353db67 100644 --- a/src/cmd/INIT/package.sh +++ b/src/cmd/INIT/package.sh @@ -3114,10 +3114,6 @@ cat $INITROOT/$i.sh export SHELL $show SHELL=$SHELL $show export SHELL - COSHELL=$SHELL - export COSHELL - $show COSHELL=$COSHELL - $show export COSHELL # tame the environment @@ -3495,7 +3491,7 @@ int main(int argc, char** argv) { return argc || argv; } INITPROTO=$PROTOROOT/src/cmd/INIT note proto convert $PACKAGEROOT/src into $PROTOROOT/src if test -d $PACKAGEROOT/src/cmd/nmake - then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libcoshell src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake" + then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake" else dirs="src" fi ( @@ -6006,8 +6002,6 @@ cat $j $k if test "$KEEP_SHELL" != 1 && executable $OK/ksh then SHELL=$INSTALLROOT/bin/$OK/ksh export SHELL - COSHELL=$SHELL - export COSHELL fi case :$PATH: in *:$INSTALLROOT/bin/$OK:*) diff --git a/src/cmd/ksh93/Makefile b/src/cmd/ksh93/Makefile index bc387d8c1..e57fcb662 100644 --- a/src/cmd/ksh93/Makefile +++ b/src/cmd/ksh93/Makefile @@ -25,7 +25,6 @@ SHOPT_BGX == 1 /* one SIGCHLD trap per completed job */ SHOPT_BRACEPAT == 1 /* C-shell {...,...} expansions (, required) */ SHOPT_CMDLIB_HDR == /* -lcmd builtin list () */ SHOPT_CMDLIB_DIR == /* SHOPT_CMDLIB_HDR directory prefix (default "/opt/ast/bin") */ -SHOPT_COSHELL == 1 /* build with connection to coshell */ SHOPT_CRNL == /* accept for */ SHOPT_DYNAMIC == 1 /* dynamic loading for builtins */ SHOPT_ECHOPRINT == /* make echo equivalent to print */ @@ -80,7 +79,7 @@ else LIBS_req = +lshell$(RELEASE) end -:PACKAGE: ast$(libtype):20100309 coshell:order --clobber=!($(SH)) +:PACKAGE: ast$(libtype):20100309 --clobber=!($(SH)) .SOURCE : edit sh bltins data tests fun .SOURCE.h : include @@ -165,7 +164,7 @@ shell$(RELEASE) $(VERSION) id=shell :LIBRARY: shell.3 nval.3 alarm.c cd_pwd.c cf fault.c fcin.c history.c init.c io.c jobs.c lex.c macro.c name.c \ nvtree.c parse.c path.c string.c streval.c subshell.c tdump.c timers.c \ trestore.c waitevent.c xec.c env.c $(DATAFILES) $(FILES_opt) \ - $(SHOPT_COSHELL:+-lcoshell) -lcmd -last -lm + -lcmd -last -lm "sol*.i386*" :NOOPTIMIZE: main.c "win32*" :NOOPTIMIZE: strdata.c trestore.c @@ -235,7 +234,7 @@ test.ksh : $(BINDIR)/$(SH) $(SH) shtests cd $(*:O=3:P=L!:D) SHELL=$(*:O=1:P=A) $(*:O=1:P=A) $(*:O=3:B) $(SHTESTSFLAGS) -test.% : %.sh COSHELL_OPTIONS=separate $(BINDIR)/$(SH) $(SH) shtests +test.% : %.sh $(BINDIR)/$(SH) $(SH) shtests $(SILENT) $(CMP) $(CMPFLAGS) $(*:O=2) $(*:O=3) 2>/dev/null || echo "make install to run the tests on the latest $(SH)" >&2 cd $(*:O=4:P=L!:D) diff --git a/src/cmd/ksh93/Mamfile b/src/cmd/ksh93/Mamfile index 03db90a5c..bbb173214 100644 --- a/src/cmd/ksh93/Mamfile +++ b/src/cmd/ksh93/Mamfile @@ -52,7 +52,7 @@ exec - { exec - case "" in exec - *?) echo " " ;; exec - esac -exec - for i in shell dll coshell cmd ast m jobs i socket nsl secdb +exec - for i in shell dll cmd ast m jobs i socket nsl secdb exec - do case $i in exec - "shell"|shell) exec - ;; @@ -77,12 +77,11 @@ exec - done exec - } > shell.req exec - rm -f 1.${COTEMP}.* bind -ldll -bind -lcoshell bind -lcmd bind -last bind -lm dontcare bind -lnsl dontcare -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/externs +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/externs done FEATURE/externs generated make include/shell.h implicit make ${PACKAGE_ast_INCLUDE}/cmd.h implicit @@ -216,7 +215,7 @@ make FEATURE/time implicit meta FEATURE/time features/%>FEATURE/% features/time time make features/time done features/time -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/time +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/time make ${PACKAGE_ast_INCLUDE}/times.h implicit make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit done ${PACKAGE_ast_INCLUDE}/ast_time.h dontcare @@ -231,14 +230,14 @@ make FEATURE/dynamic implicit meta FEATURE/dynamic features/%>FEATURE/% features/dynamic dynamic make features/dynamic done features/dynamic -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/dynamic +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/dynamic prev ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit done FEATURE/dynamic dontcare generated make FEATURE/options implicit meta FEATURE/options features/%>FEATURE/% features/options options make features/options done features/options -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/options +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/options done FEATURE/options dontcare generated prev ${PACKAGE_ast_INCLUDE}/option.h implicit done include/builtins.h @@ -261,13 +260,13 @@ make FEATURE/sigfeatures implicit meta FEATURE/sigfeatures features/%>FEATURE/% features/sigfeatures sigfeatures make features/sigfeatures done features/sigfeatures -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/sigfeatures +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/sigfeatures done FEATURE/sigfeatures dontcare generated make FEATURE/setjmp implicit meta FEATURE/setjmp features/%>FEATURE/% features/setjmp setjmp make features/setjmp done features/setjmp -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/setjmp +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/setjmp done FEATURE/setjmp dontcare generated prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit prev ${PACKAGE_ast_INCLUDE}/error.h implicit @@ -287,7 +286,7 @@ done include/defs.h done bltins/alarm.c meta alarm.o %.c>%.o bltins/alarm.c alarm prev bltins/alarm.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/alarm.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/alarm.c done alarm.o generated make cd_pwd.o make bltins/cd_pwd.c @@ -303,7 +302,7 @@ prev include/name.h implicit make include/path.h implicit make FEATURE/acct implicit meta FEATURE/acct >FEATURE/% acct -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def acct +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def acct done FEATURE/acct dontcare generated prev include/defs.h implicit prev include/nval.h implicit @@ -320,7 +319,7 @@ prev include/defs.h implicit done bltins/cd_pwd.c meta cd_pwd.o %.c>%.o bltins/cd_pwd.c cd_pwd prev bltins/cd_pwd.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_FIXEDARRAY -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c bltins/cd_pwd.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_FIXEDARRAY -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c bltins/cd_pwd.c done cd_pwd.o generated make cflow.o make bltins/cflow.c @@ -335,7 +334,7 @@ prev include/defs.h implicit done bltins/cflow.c meta cflow.o %.c>%.o bltins/cflow.c cflow prev bltins/cflow.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/cflow.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/cflow.c done cflow.o generated make deparse.o make sh/deparse.c @@ -349,7 +348,7 @@ prev include/defs.h implicit done sh/deparse.c meta deparse.o %.c>%.o sh/deparse.c deparse prev sh/deparse.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/deparse.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/deparse.c done deparse.o generated make enum.o make bltins/enum.c @@ -369,7 +368,7 @@ prev include/defs.h implicit done bltins/getopts.c meta getopts.o %.c>%.o bltins/getopts.c getopts prev bltins/getopts.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_NAMESPACE -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/getopts.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_NAMESPACE -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/getopts.c done getopts.o generated make hist.o make bltins/hist.c @@ -381,7 +380,7 @@ make FEATURE/ttys implicit meta FEATURE/ttys features/%>FEATURE/% features/ttys ttys make features/ttys done features/ttys -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/ttys +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/ttys done FEATURE/ttys dontcare generated done include/terminal.h dontcare prev FEATURE/setjmp implicit @@ -390,7 +389,7 @@ make FEATURE/locale implicit meta FEATURE/locale features/%>FEATURE/% features/locale locale make features/locale done features/locale -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/locale +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/locale done FEATURE/locale dontcare generated prev FEATURE/options implicit done include/edit.h dontcare @@ -409,17 +408,13 @@ prev include/defs.h implicit done bltins/hist.c meta hist.o %.c>%.o bltins/hist.c hist prev bltins/hist.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_BLD_shell -DSHOPT_DYNAMIC -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -c bltins/hist.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_BLD_shell -DSHOPT_DYNAMIC -D_API_ast=20100309 -DSHOPT_FIXEDARRAY -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -c bltins/hist.c done hist.o generated make misc.o make bltins/misc.c make include/jobs.h implicit prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit prev include/terminal.h implicit -make ${PACKAGE_ast_INCLUDE}/coshell.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/coshell.h dontcare prev FEATURE/options implicit prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit prev ${PACKAGE_ast_INCLUDE}/ast.h implicit @@ -435,7 +430,7 @@ prev include/defs.h implicit done bltins/misc.c meta misc.o %.c>%.o bltins/misc.c misc prev bltins/misc.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_BGX -DSHOPT_COSHELL -DSHOPT_MULTIBYTE -DSHOPT_PFSH -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_ESH -DSHOPT_FIXEDARRAY -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -c bltins/misc.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_BGX -DSHOPT_MULTIBYTE -DSHOPT_PFSH -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_ESH -DSHOPT_FIXEDARRAY -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -c bltins/misc.c done misc.o generated make print.o make bltins/print.c @@ -474,7 +469,7 @@ prev include/defs.h implicit done bltins/print.c meta print.o %.c>%.o bltins/print.c print prev bltins/print.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_DYNAMIC -DKSHELL -c bltins/print.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_DYNAMIC -DKSHELL -c bltins/print.c done print.o generated make read.o make bltins/read.c @@ -496,7 +491,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done bltins/read.c meta read.o %.c>%.o bltins/read.c read prev bltins/read.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_FIXEDARRAY -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DERROR_CONTEXT_T=Error_context_t -c bltins/read.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_FIXEDARRAY -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -c bltins/read.c done read.o generated make sleep.o make bltins/sleep.c @@ -504,7 +499,7 @@ make FEATURE/poll implicit meta FEATURE/poll features/%>FEATURE/% features/poll poll make features/poll done features/poll -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/poll +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/poll done FEATURE/poll generated prev FEATURE/time implicit prev include/builtins.h implicit @@ -514,7 +509,7 @@ prev include/defs.h implicit done bltins/sleep.c meta sleep.o %.c>%.o bltins/sleep.c sleep prev bltins/sleep.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/sleep.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/sleep.c done sleep.o generated make trap.o make bltins/trap.c @@ -524,7 +519,7 @@ prev include/defs.h implicit done bltins/trap.c meta trap.o %.c>%.o bltins/trap.c trap prev bltins/trap.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_BGX -DSHOPT_COSHELL -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/trap.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_BGX -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/trap.c done trap.o generated make test.o make bltins/test.c @@ -542,7 +537,7 @@ prev include/defs.h implicit done bltins/test.c meta test.o %.c>%.o bltins/test.c test prev bltins/test.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DKSHELL -c bltins/test.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DKSHELL -c bltins/test.c done test.o generated make typeset.o make bltins/typeset.c @@ -557,7 +552,7 @@ prev include/defs.h implicit done bltins/typeset.c meta typeset.o %.c>%.o bltins/typeset.c typeset prev bltins/typeset.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_FIXEDARRAY -DSHOPT_DYNAMIC -DSHOPT_NAMESPACE -DSHOPT_TYPEDEF -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_ESH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -c bltins/typeset.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_FIXEDARRAY -DSHOPT_DYNAMIC -DSHOPT_NAMESPACE -DSHOPT_TYPEDEF -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_ESH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -c bltins/typeset.c done typeset.o generated make ulimit.o make bltins/ulimit.c @@ -566,7 +561,7 @@ make FEATURE/rlimits implicit meta FEATURE/rlimits features/%>FEATURE/% features/rlimits rlimits make features/rlimits done features/rlimits -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/rlimits +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/rlimits done FEATURE/rlimits dontcare generated prev FEATURE/time implicit done include/ulimit.h @@ -579,7 +574,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done bltins/ulimit.c meta ulimit.o %.c>%.o bltins/ulimit.c ulimit prev bltins/ulimit.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_FIXEDARRAY -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c bltins/ulimit.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_FIXEDARRAY -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c bltins/ulimit.c done ulimit.o generated make umask.o make bltins/umask.c @@ -612,7 +607,7 @@ prev include/defs.h implicit done bltins/whence.c meta whence.o %.c>%.o bltins/whence.c whence prev bltins/whence.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_KIA -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/whence.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_KIA -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/whence.c done whence.o generated make main.o make sh/main.c @@ -623,11 +618,11 @@ done nc.h dontcare virtual prev FEATURE/externs implicit make FEATURE/execargs implicit meta FEATURE/execargs >FEATURE/% execargs -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def execargs +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def execargs done FEATURE/execargs generated make FEATURE/pstat implicit meta FEATURE/pstat >FEATURE/% pstat -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def pstat +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def pstat done FEATURE/pstat generated prev FEATURE/time implicit make include/timeout.h implicit @@ -650,7 +645,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done sh/main.c meta main.o %.c>%.o sh/main.c main prev sh/main.c -exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${DEBUG+-DDEBUG=${DEBUG}} ${SHOPT_TIMEOUT+-DSHOPT_TIMEOUT=${SHOPT_TIMEOUT}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SH_DICT+-DSH_DICT=${SH_DICT}} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_BASH+-DSHOPT_BASH=${SHOPT_BASH}} ${SHOPT_REMOTE+-DSHOPT_REMOTE=${SHOPT_REMOTE}} ${SHOPT_OLDTERMIO+-DSHOPT_OLDTERMIO=${SHOPT_OLDTERMIO}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_ESH -D_BLD_shell -DSHOPT_KIA -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_BGX -DSHOPT_COSHELL -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_DYNAMIC -c sh/main.c +exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${DEBUG+-DDEBUG=${DEBUG}} ${SHOPT_TIMEOUT+-DSHOPT_TIMEOUT=${SHOPT_TIMEOUT}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SH_DICT+-DSH_DICT=${SH_DICT}} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_BASH+-DSHOPT_BASH=${SHOPT_BASH}} ${SHOPT_REMOTE+-DSHOPT_REMOTE=${SHOPT_REMOTE}} ${SHOPT_OLDTERMIO+-DSHOPT_OLDTERMIO=${SHOPT_OLDTERMIO}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_ESH -D_BLD_shell -DSHOPT_KIA -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_BGX -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_DYNAMIC -c sh/main.c done main.o generated make nvdisc.o make sh/nvdisc.c @@ -661,7 +656,7 @@ prev include/defs.h implicit done sh/nvdisc.c meta nvdisc.o %.c>%.o sh/nvdisc.c nvdisc prev sh/nvdisc.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_TYPEDEF -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -D_BLD_shell -DSHOPT_STATS -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_DYNAMIC -c sh/nvdisc.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_NAMESPACE -DSHOPT_TYPEDEF -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -D_BLD_shell -DSHOPT_STATS -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_DYNAMIC -c sh/nvdisc.c done nvdisc.o generated make nvtype.o make sh/nvtype.c @@ -671,7 +666,7 @@ prev include/defs.h implicit done sh/nvtype.c meta nvtype.o %.c>%.o sh/nvtype.c nvtype prev sh/nvtype.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_FIXEDARRAY -DSHOPT_NAMESPACE -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DKSHELL -DSHOPT_STATS -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/nvtype.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_FIXEDARRAY -DSHOPT_NAMESPACE -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DKSHELL -DSHOPT_STATS -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/nvtype.c done nvtype.o generated make arith.o make sh/arith.c @@ -684,7 +679,7 @@ prev include/defs.h implicit done sh/arith.c meta arith.o %.c>%.o sh/arith.c arith prev sh/arith.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_FIXEDARRAY -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/arith.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_FIXEDARRAY -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/arith.c done arith.o generated make args.o make sh/args.c @@ -699,7 +694,7 @@ prev include/defs.h implicit done sh/args.c meta args.o %.c>%.o sh/args.c args prev sh/args.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_OPTIMIZE -DSHOPT_RAWONLY -DSHOPT_HISTEXPAND -DSHOPT_PFSH -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_KIA -DSHOPT_MULTIBYTE -DSHOPT_EDPREDICT -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_DYNAMIC -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/args.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_OPTIMIZE -DSHOPT_RAWONLY -DSHOPT_HISTEXPAND -DSHOPT_PFSH -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_KIA -DSHOPT_MULTIBYTE -DSHOPT_EDPREDICT -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_DYNAMIC -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/args.c done args.o generated make array.o make sh/array.c @@ -709,7 +704,7 @@ prev include/defs.h implicit done sh/array.c meta array.o %.c>%.o sh/array.c array prev sh/array.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_FIXEDARRAY -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/array.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_FIXEDARRAY -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/array.c done array.o generated make completion.o make edit/completion.c @@ -723,7 +718,7 @@ prev include/defs.h implicit done edit/completion.c meta completion.o %.c>%.o edit/completion.c completion prev edit/completion.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -DSHOPT_ESH -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DKSHELL -DSHOPT_VSH -DSHOPT_PFSH -D_BLD_shell -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/completion.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -DSHOPT_ESH -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DKSHELL -DSHOPT_VSH -DSHOPT_PFSH -D_BLD_shell -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/completion.c done completion.o generated make defs.o make sh/defs.c @@ -735,7 +730,7 @@ prev include/defs.h implicit done sh/defs.c meta defs.o %.c>%.o sh/defs.c defs prev sh/defs.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_KIA -D_API_ast=20100309 -D_BLD_shell -DSHOPT_BGX -DSHOPT_COSHELL -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/defs.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_KIA -D_API_ast=20100309 -D_BLD_shell -DSHOPT_BGX -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/defs.c done defs.o generated make edit.o make edit/edit.c @@ -750,7 +745,7 @@ make FEATURE/cmds implicit meta FEATURE/cmds features/%>FEATURE/% features/cmds cmds make features/cmds done features/cmds -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/cmds +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/cmds done FEATURE/cmds generated prev FEATURE/time implicit prev FEATURE/options implicit @@ -759,7 +754,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done edit/edit.c meta edit.o %.c>%.o edit/edit.c edit prev edit/edit.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_EDPREDICT -DSHOPT_RAWONLY -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_MULTIBYTE -DSHOPT_HISTEXPAND -DKSHELL -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/edit.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_EDPREDICT -DSHOPT_RAWONLY -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_MULTIBYTE -DSHOPT_HISTEXPAND -DKSHELL -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/edit.c done edit.o generated make expand.o make sh/expand.c @@ -788,7 +783,7 @@ prev include/defs.h implicit done sh/expand.c meta expand.o %.c>%.o sh/expand.c expand prev sh/expand.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -DSHOPT_SUID_EXEC -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_DYNAMIC -c sh/expand.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -DSHOPT_SUID_EXEC -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_DYNAMIC -c sh/expand.c done expand.o generated make regress.o make bltins/regress.c @@ -801,7 +796,7 @@ prev include/defs.h implicit done bltins/regress.c meta regress.o %.c>%.o bltins/regress.c regress prev bltins/regress.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DKSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/regress.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DKSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c bltins/regress.c done regress.o generated make fault.o make sh/fault.c @@ -819,7 +814,7 @@ prev include/defs.h implicit done sh/fault.c meta fault.o %.c>%.o sh/fault.c fault prev sh/fault.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_KIA -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_TYPEDEF -DSHOPT_BGX -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DKSHELL -c sh/fault.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_KIA -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_TYPEDEF -DSHOPT_BGX -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DKSHELL -c sh/fault.c done fault.o generated make fcin.o make sh/fcin.c @@ -849,7 +844,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done edit/history.c meta history.o %.c>%.o edit/history.c history prev edit/history.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_VSH -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_AUDITFILE=\""/etc/ksh_audit"\" -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DSHOPT_DYNAMIC -DSHOPT_PFSH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_AUDIT -c edit/history.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_VSH -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_AUDITFILE=\""/etc/ksh_audit"\" -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DSHOPT_DYNAMIC -DSHOPT_PFSH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_AUDIT -c edit/history.c done history.o generated make init.o make sh/init.c @@ -878,7 +873,7 @@ prev include/defs.h implicit done sh/init.c meta init.o %.c>%.o sh/init.c init prev sh/init.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_2DMATCH -DSHOPT_PFSH -DSHOPT_MULTIBYTE -DSHOPT_BGX -DSHOPT_COSHELL -DSHOPT_AUDIT -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_DYNAMIC -D_BLD_shell -DSHOPT_KIA -DKSHELL -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_FIXEDARRAY -DERROR_CONTEXT_T=Error_context_t -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -c sh/init.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_2DMATCH -DSHOPT_PFSH -DSHOPT_MULTIBYTE -DSHOPT_BGX -DSHOPT_AUDIT -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_DYNAMIC -D_BLD_shell -DSHOPT_KIA -DKSHELL -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_FIXEDARRAY -DERROR_CONTEXT_T=Error_context_t -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -c sh/init.c done init.o generated make io.o make sh/io.c @@ -901,7 +896,7 @@ prev include/defs.h implicit done sh/io.c meta io.o %.c>%.o sh/io.c io prev sh/io.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_RAWONLY -DSHOPT_VSH -DSHOPT_ESH -DSHOPT_HISTEXPAND -DSHOPT_COSHELL -DSHOPT_DYNAMIC -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_BGX -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/io.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_RAWONLY -DSHOPT_VSH -DSHOPT_ESH -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_BGX -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/io.c done io.o generated make jobs.o make sh/jobs.c @@ -918,7 +913,7 @@ prev include/defs.h implicit done sh/jobs.c meta jobs.o %.c>%.o sh/jobs.c jobs prev sh/jobs.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_VSH -DSHOPT_COSHELL -DSHOPT_BGX -DSHOPT_ESH -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_MULTIBYTE -DSHOPT_PFSH -D_BLD_shell -DKSHELL -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/jobs.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_VSH -DSHOPT_BGX -DSHOPT_ESH -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_MULTIBYTE -DSHOPT_PFSH -D_BLD_shell -DKSHELL -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c sh/jobs.c done jobs.o generated make lex.o make sh/lex.c @@ -937,7 +932,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done sh/lex.c meta lex.o %.c>%.o sh/lex.c lex prev sh/lex.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_MULTIBYTE -DSHOPT_KIA -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_PFSH -DKSHELL -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c sh/lex.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_MULTIBYTE -DSHOPT_KIA -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_PFSH -DKSHELL -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c sh/lex.c done lex.o generated make macro.o make sh/macro.c @@ -956,7 +951,7 @@ prev include/defs.h implicit done sh/macro.c meta macro.o %.c>%.o sh/macro.c macro prev sh/macro.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -DKSHELL -DSHOPT_COSHELL -DSHOPT_OPTIMIZE -DSHOPT_FIXEDARRAY -DSHOPT_TYPEDEF -DSHOPT_FILESCAN -DSHOPT_MULTIBYTE -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_SUID_EXEC -DSHOPT_BGX -DSHOPT_KIA -DSHOPT_DYNAMIC -c sh/macro.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -DKSHELL -DSHOPT_OPTIMIZE -DSHOPT_FIXEDARRAY -DSHOPT_TYPEDEF -DSHOPT_FILESCAN -DSHOPT_MULTIBYTE -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_SUID_EXEC -DSHOPT_BGX -DSHOPT_KIA -DSHOPT_DYNAMIC -c sh/macro.c done macro.o generated make name.o make sh/name.c @@ -972,7 +967,7 @@ prev include/defs.h implicit done sh/name.c meta name.o %.c>%.o sh/name.c name prev sh/name.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_OPTIMIZE -DSHOPT_FIXEDARRAY -DSHOPT_NAMESPACE -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_TYPEDEF -DSHOPT_STATS -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -c sh/name.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_OPTIMIZE -DSHOPT_FIXEDARRAY -DSHOPT_NAMESPACE -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_MULTIBYTE -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_TYPEDEF -DSHOPT_STATS -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -c sh/name.c done name.o generated make nvtree.o make sh/nvtree.c @@ -983,7 +978,7 @@ prev include/defs.h implicit done sh/nvtree.c meta nvtree.o %.c>%.o sh/nvtree.c nvtree prev sh/nvtree.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_FIXEDARRAY -DSHOPT_MULTIBYTE -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/nvtree.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_FIXEDARRAY -DSHOPT_MULTIBYTE -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/nvtree.c done nvtree.o generated make parse.o make sh/parse.c @@ -999,7 +994,7 @@ prev include/defs.h implicit done sh/parse.c meta parse.o %.c>%.o sh/parse.c parse prev sh/parse.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -D_BLD_shell -DSHOPT_STATS -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_KIA -DSHOPT_DYNAMIC -DKSHELL -c sh/parse.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_NAMESPACE -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -D_BLD_shell -DSHOPT_STATS -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_KIA -DSHOPT_DYNAMIC -DKSHELL -c sh/parse.c done parse.o generated make path.o make sh/path.c @@ -1024,7 +1019,7 @@ prev include/defs.h implicit done sh/path.c meta path.o %.c>%.o sh/path.c path prev sh/path.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_DYNAMIC -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_BGX -DKSHELL -DSHOPT_BRACEPAT -c sh/path.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_DYNAMIC -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_BGX -DKSHELL -DSHOPT_BRACEPAT -c sh/path.c done path.o generated make string.o make sh/string.c @@ -1040,7 +1035,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done sh/string.c meta string.o %.c>%.o sh/string.c string prev sh/string.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c sh/string.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_MULTIBYTE -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c sh/string.c done string.o generated make streval.o make sh/streval.c @@ -1052,7 +1047,7 @@ prev include/streval.h implicit done sh/streval.c meta streval.o %.c>%.o sh/streval.c streval prev sh/streval.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/streval.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/streval.c done streval.o generated make subshell.o make sh/subshell.c @@ -1068,7 +1063,7 @@ prev include/defs.h implicit done sh/subshell.c meta subshell.o %.c>%.o sh/subshell.c subshell prev sh/subshell.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_COSHELL -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_DYNAMIC -DSHOPT_BGX -DSHOPT_KIA -DKSHELL -c sh/subshell.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_DYNAMIC -DSHOPT_BGX -DSHOPT_KIA -DKSHELL -c sh/subshell.c done subshell.o generated make tdump.o make sh/tdump.c @@ -1080,7 +1075,7 @@ prev include/defs.h implicit done sh/tdump.c meta tdump.o %.c>%.o sh/tdump.c tdump prev sh/tdump.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/tdump.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/tdump.c done tdump.o generated make timers.o make sh/timers.c @@ -1094,7 +1089,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done sh/timers.c meta timers.o %.c>%.o sh/timers.c timers prev sh/timers.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/timers.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/timers.c done timers.o generated make trestore.o make sh/trestore.c @@ -1106,7 +1101,7 @@ prev include/defs.h implicit done sh/trestore.c meta trestore.o %.c>%.o sh/trestore.c trestore prev sh/trestore.c -exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SHOPT_BASH+-DSHOPT_BASH=${SHOPT_BASH}} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SH_DICT+-DSH_DICT=${SH_DICT}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/trestore.c +exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SHOPT_BASH+-DSHOPT_BASH=${SHOPT_BASH}} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SH_DICT+-DSH_DICT=${SH_DICT}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/trestore.c done trestore.o generated make waitevent.o make sh/waitevent.c @@ -1114,7 +1109,7 @@ prev include/defs.h implicit done sh/waitevent.c meta waitevent.o %.c>%.o sh/waitevent.c waitevent prev sh/waitevent.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/waitevent.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c sh/waitevent.c done waitevent.o generated make xec.o make sh/xec.c @@ -1137,7 +1132,7 @@ prev include/defs.h implicit done sh/xec.c meta xec.o %.c>%.o sh/xec.c xec prev sh/xec.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BGX -DSHOPT_TYPEDEF -DSHOPT_PFSH -DSHOPT_FILESCAN -DSHOPT_COSHELL -DSHOPT_NAMESPACE -DSHOPT_OPTIMIZE -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_DYNAMIC -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -c sh/xec.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BGX -DSHOPT_TYPEDEF -DSHOPT_PFSH -DSHOPT_FILESCAN -DSHOPT_NAMESPACE -DSHOPT_OPTIMIZE -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_HISTEXPAND -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DSHOPT_DYNAMIC -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -c sh/xec.c done xec.o generated make env.o make sh/env.c @@ -1174,7 +1169,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done data/msg.c meta msg.o %.c>%.o data/msg.c msg prev data/msg.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_SUID_EXEC -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_BGX -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_KIA -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c data/msg.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_SUID_EXEC -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_BGX -D_BLD_shell -DSHOPT_DYNAMIC -DSHOPT_KIA -DSHOPT_BRACEPAT -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c data/msg.c done msg.o generated make strdata.o make data/strdata.c @@ -1184,7 +1179,7 @@ make features/math.sh make data/math.tab implicit done data/math.tab done features/math.sh dontcare -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcoshell} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/math.sh ${PACKAGEROOT}/src/cmd/ksh93/data/math.tab +exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/math.sh ${PACKAGEROOT}/src/cmd/ksh93/data/math.tab make ${PACKAGE_ast_INCLUDE}/ast_standards.h implicit done ${PACKAGE_ast_INCLUDE}/ast_standards.h dontcare done FEATURE/math generated @@ -1194,7 +1189,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast_standards.h implicit done data/strdata.c meta strdata.o %.c>%.o data/strdata.c strdata prev data/strdata.c -exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SHOPT_BASH+-DSHOPT_BASH=${SHOPT_BASH}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SH_DICT+-DSH_DICT=${SH_DICT}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/strdata.c +exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SHOPT_BASH+-DSHOPT_BASH=${SHOPT_BASH}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SH_DICT+-DSH_DICT=${SH_DICT}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/strdata.c done strdata.o generated make testops.o make data/testops.c @@ -1204,7 +1199,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done data/testops.c meta testops.o %.c>%.o data/testops.c testops prev data/testops.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/testops.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/testops.c done testops.o generated make keywords.o make data/keywords.c @@ -1224,7 +1219,7 @@ prev include/defs.h implicit done data/options.c meta options.o %.c>%.o data/options.c options prev data/options.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/options.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DSHOPT_FIXEDARRAY -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/options.c done options.o generated make signals.o make data/signals.c @@ -1232,7 +1227,7 @@ prev include/defs.h implicit done data/signals.c meta signals.o %.c>%.o data/signals.c signals prev data/signals.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/signals.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -c data/signals.c done signals.o generated make builtins.o make data/builtins.c @@ -1247,7 +1242,7 @@ prev include/defs.h implicit done data/builtins.c meta builtins.o %.c>%.o data/builtins.c builtins prev data/builtins.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_KIA -DSHOPT_PFSH -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -DSHOPT_BRACEPAT -DSHOPT_HISTEXPAND -DSHOPT_COSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_BGX -DSHOPT_MULTIBYTE -D_BLD_shell -DSHOPT_DYNAMIC -DKSHELL -DSHOPT_FIXEDARRAY -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c data/builtins.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_TYPEDEF -DSHOPT_KIA -DSHOPT_PFSH -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -DSHOPT_BRACEPAT -DSHOPT_HISTEXPAND -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_BGX -DSHOPT_MULTIBYTE -D_BLD_shell -DSHOPT_DYNAMIC -DKSHELL -DSHOPT_FIXEDARRAY -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c data/builtins.c done builtins.o generated make variables.o make data/variables.c @@ -1263,7 +1258,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done data/variables.c meta variables.o %.c>%.o data/variables.c variables prev data/variables.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_MULTIBYTE -D_BLD_shell -DSHOPT_DYNAMIC -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c data/variables.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_STATS -DSHOPT_MULTIBYTE -D_BLD_shell -DSHOPT_DYNAMIC -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -DSHOPT_NAMESPACE -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -c data/variables.c done variables.o generated make lexstates.o make data/lexstates.c @@ -1287,7 +1282,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done edit/emacs.c meta emacs.o %.c>%.o edit/emacs.c emacs prev edit/emacs.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DSHOPT_HISTEXPAND -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/emacs.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DSHOPT_HISTEXPAND -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -D_API_ast=20100309 -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/emacs.c done emacs.o generated make vi.o make edit/vi.c @@ -1303,7 +1298,7 @@ prev include/defs.h implicit done edit/vi.c meta vi.o %.c>%.o edit/vi.c vi prev edit/vi.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_EDPREDICT -DSHOPT_RAWONLY -DSHOPT_MULTIBYTE -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_HISTEXPAND -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_PFSH -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/vi.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_EDPREDICT -DSHOPT_RAWONLY -DSHOPT_MULTIBYTE -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_HISTEXPAND -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_PFSH -D_BLD_shell -DSHOPT_STATS -DSHOPT_NAMESPACE -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/vi.c done vi.o generated make hexpand.o make edit/hexpand.c @@ -1312,7 +1307,7 @@ prev include/defs.h implicit done edit/hexpand.c meta hexpand.o %.c>%.o edit/hexpand.c hexpand prev edit/hexpand.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -D_BLD_shell -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/hexpand.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_MULTIBYTE -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -D_PACKAGE_ast -DSHOPT_PFSH -DSHOPT_STATS -DSHOPT_NAMESPACE -D_BLD_shell -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -c edit/hexpand.c done hexpand.o generated exec - ${AR} rc libshell.a alarm.o cd_pwd.o cflow.o deparse.o enum.o getopts.o hist.o misc.o print.o read.o sleep.o trap.o test.o typeset.o ulimit.o umask.o whence.o main.o nvdisc.o nvtype.o arith.o args.o array.o completion.o defs.o edit.o expand.o regress.o fault.o fcin.o exec - ${AR} rc libshell.a history.o init.o io.o jobs.o lex.o macro.o name.o nvtree.o parse.o path.o string.o streval.o subshell.o tdump.o timers.o trestore.o waitevent.o xec.o env.o limits.o msg.o strdata.o testops.o keywords.o options.o signals.o builtins.o variables.o lexstates.o emacs.o vi.o hexpand.o @@ -1338,7 +1333,7 @@ setv CC.DLL -UCC.DLL setv SH_DICT -DSH_DICT="\"libshell\"" setv _BLD_shell -U_BLD_shell setv _BLD_DLL -U_BLD_DLL -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -DSH_DICT=\""libshell"\" -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_COSHELL -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -c sh/shcomp.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -DSH_DICT=\""libshell"\" -D_API_ast=20100309 -D_PACKAGE_ast -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_PFSH -DSHOPT_HISTEXPAND -DERROR_CONTEXT_T=Error_context_t -DSHOPT_FIXEDARRAY -DSHOPT_ESH -DSHOPT_MULTIBYTE -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -c sh/shcomp.c done shcomp.o generated prev libshell.a archive prev +ljobs diff --git a/src/cmd/ksh93/bltins/whence.c b/src/cmd/ksh93/bltins/whence.c index e84dc63b3..2fabd5531 100644 --- a/src/cmd/ksh93/bltins/whence.c +++ b/src/cmd/ksh93/bltins/whence.c @@ -193,7 +193,10 @@ static int whence(Shell_t *shp,char **argv, register int flags) if(flags&V_FLAG) { if(nv_isnull(np)) +{ +errormsg(SH_DICT,ERROR_warn(0),"[DEBUG] is_ufunction ONE: %s", name); cp = sh_translate(is_ufunction); +} else if(is_abuiltin(np)) { if(nv_isattr(np,BLT_SPC)) @@ -253,8 +256,11 @@ static int whence(Shell_t *shp,char **argv, register int flags) const char *command_path = np->nvalue.pathcomp->name; sfprintf(sfstdout,"%s %s %s/%s\n",name,sh_translate(is_talias),command_path,cp); } - else if(!np || nv_isnull(np)) + else if(np && nv_isnull(np)) +{ +errormsg(SH_DICT,ERROR_warn(0),"[DEBUG] is_ufunction TWO: %s", name); sfprintf(sfstdout,"%s%s\n",name,sh_translate(is_ufunction)); +} continue; } sfputr(sfstdout,sh_fmtq(name),' '); diff --git a/src/cmd/ksh93/data/builtins.c b/src/cmd/ksh93/data/builtins.c index 789a4b013..47d5ff128 100644 --- a/src/cmd/ksh93/data/builtins.c +++ b/src/cmd/ksh93/data/builtins.c @@ -164,20 +164,7 @@ const struct shtable3 shtab_builtins[] = "", 0, 0 }; -#if SHOPT_COSHELL -# define _JOB_ "[+?Each \ajob\a can be specified as one of the following:]{" \ - "[+\anumber\a?\anumber\a refers to a process id.]" \ - "[+-\anumber\a?\anumber\a refers to a process group id.]" \ - "[+\apool\a.\anum\a?refers to job \anum\a in background pool named \apool\a.]" \ - "[+\apool\a?refers to all jobs in background pool named \apool\a.]" \ - "[+%\anumber\a?\anumber\a refer to a job number.]" \ - "[+%\astring\a?Refers to a job whose name begins with \astring\a.]" \ - "[+%??\astring\a?Refers to a job whose name contains \astring\a.]" \ - "[+%+ \bor\b %%?Refers to the current job.]" \ - "[+%-?Refers to the previous job.]" \ - "}" -#else -# define _JOB_ "[+?Each \ajob\a can be specified as one of the following:]{" \ +#define _JOB_ "[+?Each \ajob\a can be specified as one of the following:]{" \ "[+\anumber\a?\anumber\a refers to a process id.]" \ "[+-\anumber\a?\anumber\a refers to a process group id.]" \ "[+%\anumber\a?\anumber\a refer to a job number.]" \ @@ -186,7 +173,6 @@ const struct shtable3 shtab_builtins[] = "[+%+ \bor\b %%?Refers to the current job.]" \ "[+%-?Refers to the previous job.]" \ "}" -#endif const char sh_set[] = diff --git a/src/cmd/ksh93/data/msg.c b/src/cmd/ksh93/data/msg.c index c9741f7d9..eb6c94a68 100644 --- a/src/cmd/ksh93/data/msg.c +++ b/src/cmd/ksh93/data/msg.c @@ -158,11 +158,7 @@ const char is_ufunction[] = " is an undefined function"; const char e_no_job[] = "no such job"; const char e_no_proc[] = "no such process"; const char e_badpid[] = "%s: invalid process id"; -# if SHOPT_COSHELL - const char e_jobusage[] = "%s: Arguments must be %%job, process ids, or job pool names"; -# else - const char e_jobusage[] = "%s: Arguments must be %%job or process ids"; -# endif /* SHOPT_COSHELL */ + const char e_jobusage[] = "%s: Arguments must be %%job or process ids"; #endif /* JOBS */ const char e_coredump[] = "(coredump)"; const char e_alphanum[] = "[_[:alpha:]]*([_[:alnum:]])"; diff --git a/src/cmd/ksh93/include/defs.h b/src/cmd/ksh93/include/defs.h index 526ca91ca..816876559 100644 --- a/src/cmd/ksh93/include/defs.h +++ b/src/cmd/ksh93/include/defs.h @@ -263,7 +263,6 @@ struct shared Namval_t *typeinit; \ Namfun_t nvfun; \ char *mathnodes; \ - void *coshell; \ char *bltin_dir; \ struct Regress_s*regress; @@ -437,11 +436,6 @@ extern int sh_type(const char*); extern void sh_unscope(Shell_t*); extern void sh_utol(const char*, char*); extern int sh_whence(char**,int); -#if SHOPT_COSHELL - extern int sh_coaddfile(Shell_t*,char*); - extern int sh_copipe(Shell_t*, int[], int); - extern int sh_coaccept(Shell_t*,int[],int); -#endif /* SHOPT_COSHELL */ #if SHOPT_NAMESPACE extern Namval_t *sh_fsearch(Shell_t*,const char *,int); #endif /* SHOPT_NAMESPACE */ diff --git a/src/cmd/ksh93/include/jobs.h b/src/cmd/ksh93/include/jobs.h index 84d48dae7..77a4fc5c8 100644 --- a/src/cmd/ksh93/include/jobs.h +++ b/src/cmd/ksh93/include/jobs.h @@ -34,22 +34,6 @@ #endif /* !SIGINT */ #include "FEATURE/options" -#if SHOPT_COSHELL -# include -# define COPID_BIT (1L<<30) - struct cosh - { - struct cosh *next; - Coshell_t *coshell; - Cojob_t *cojob; - char *name; - short id; - }; - - extern pid_t sh_copid(struct cosh*); - extern char *sh_pid2str(Shell_t*,pid_t); -#endif /* SHOPT_COSHELL */ - #undef JOBS #if defined(SIGCLD) && !defined(SIGCHLD) # define SIGCHLD SIGCLD @@ -76,9 +60,6 @@ struct process struct process *p_nxtjob; /* next job structure */ struct process *p_nxtproc; /* next process in current job */ Shell_t *p_shp; /* shell that posted the job */ -#if SHOPT_COSHELL - Cojob_t *p_cojob; /* coshell job */ -#endif /* SHOPT_COSHELL */ int *p_exitval; /* place to store the exitval */ pid_t p_pid; /* process id */ pid_t p_pgrp; /* process group */ @@ -120,9 +101,6 @@ struct jobs char waitall; /* wait for all jobs in pipe */ char toclear; /* job table needs clearing */ unsigned char *freejobs; /* free jobs numbers */ -#if SHOPT_COSHELL - struct cosh *colist; /* coshell job list */ -#endif /* SHOPT_COSHELL */ }; /* flags for joblist */ diff --git a/src/cmd/ksh93/sh/init.c b/src/cmd/ksh93/sh/init.c index 310a2ca12..5b91a232b 100644 --- a/src/cmd/ksh93/sh/init.c +++ b/src/cmd/ksh93/sh/init.c @@ -91,14 +91,9 @@ char e_version[] = "\n@(#)$Id: Version " #define ATTRS 1 "B" #endif -#if SHOPT_COSHELL -#define ATTRS 1 - "J" -#else #if SHOPT_BGX #define ATTRS 1 - "j" -#endif + "J" #endif #if SHOPT_ACCT #define ATTRS 1 @@ -199,9 +194,6 @@ typedef struct _init_ Namfun_t SH_VERSION_init; struct match SH_MATCH_init; Namfun_t SH_MATH_init; -#if SHOPT_COSHELL - Namfun_t SH_JOBPOOL_init; -#endif /* SHOPT_COSHELL */ #ifdef _hdr_locale Namfun_t LC_TYPE_init; Namfun_t LC_NUM_init; @@ -1028,10 +1020,6 @@ static char *setdisc_any(Namval_t *np, const char *event, Namval_t *action, Namf static const Namdisc_t SH_MATH_disc = { 0, 0, get_math, 0, setdisc_any, create_math, }; -#if SHOPT_COSHELL -static const Namdisc_t SH_JOBPOOL_disc = { 0, 0, 0, 0, setdisc_any, 0, }; -#endif /* SHOPT_COSHELL */ - #if SHOPT_NAMESPACE static char* get_nspace(Namval_t* np, Namfun_t *fp) { @@ -1792,11 +1780,6 @@ static Init_t *nv_init(Shell_t *shp) ip->SH_MATCH_init.hdr.nofree = 1; ip->SH_MATH_init.disc = &SH_MATH_disc; ip->SH_MATH_init.nofree = 1; -#if SHOPT_COSHELL - ip->SH_JOBPOOL_init.disc = &SH_JOBPOOL_disc; - ip->SH_JOBPOOL_init.nofree = 1; - nv_stack(SH_JOBPOOL, &ip->SH_JOBPOOL_init); -#endif /* SHOPT_COSHELL */ ip->SH_VERSION_init.disc = &SH_VERSION_disc; ip->SH_VERSION_init.nofree = 1; ip->LINENO_init.disc = &LINENO_disc; diff --git a/src/cmd/ksh93/sh/io.c b/src/cmd/ksh93/sh/io.c index a6acc6413..337b84531 100644 --- a/src/cmd/ksh93/sh/io.c +++ b/src/cmd/ksh93/sh/io.c @@ -317,7 +317,6 @@ inetopen(const char* path, int flags, Inetintr_f onintr, void* handle) #else #undef O_SERVICE -#undef SHOPT_COSHELL #endif @@ -924,57 +923,6 @@ int sh_pipe(register int pv[]) } #endif -#if SHOPT_COSHELL - int sh_coaccept(Shell_t *shp,int *pv,int out) - { - int fd = accept(pv[0],(struct sockaddr*)0,(socklen_t*)0); - sh_close(pv[0]); - pv[0] = -1; - if(fd<0) - errormsg(SH_DICT,ERROR_system(1),e_pipe); - if((pv[out]=sh_fcntl(fd,F_DUPFD,10)) >=10) - sh_close(fd); - else - pv[out] = sh_iomovefd(fd); - if(fcntl(pv[out],F_SETFD,FD_CLOEXEC) >=0) - shp->fdstatus[pv[out]] |= IOCLEX; - shp->fdstatus[pv[out]] = (out?IOWRITE:IOREAD); - shp->fdstatus[pv[out]] |= IONOSEEK; - sh_subsavefd(pv[out]); -#if defined(SHUT_RD) && defined(SHUT_WR) - shutdown(pv[out],out?SHUT_RD:SHUT_WR); -#endif - return(0); - } - - int sh_copipe(Shell_t *shp, int *pv, int out) - { - int r,port=20000; - struct sockaddr_in sin; - socklen_t slen; - if ((pv[out] = socket (AF_INET, SOCK_STREAM, 0)) < 0) - errormsg(SH_DICT,ERROR_system(1),e_pipe); - do - { - sin.sin_family = AF_INET; - sin.sin_port = htons(++port); - sin.sin_addr.s_addr = INADDR_ANY; - slen = sizeof (sin); - } - while ((r=bind (pv[out], (struct sockaddr *) &sin, slen)) == -1 && errno==EADDRINUSE); - if(r<0 || listen(pv[out],5) <0) - { - close(pv[out]); - errormsg(SH_DICT,ERROR_system(1),e_pipe); - } - fcntl(pv[out],F_SETFD,FD_CLOEXEC); - shp->fdstatus[pv[out]] |= IOCLEX; - pv[1-out] = -1; - pv[2] = port; - return(0); - } -#endif /* SHOPT_COSHELL */ - static int pat_seek(void *handle, const char *str, size_t sz) { char **bp = (char**)handle; @@ -1199,14 +1147,6 @@ int sh_redirect(Shell_t *shp,struct ionod *iop, int flag) } errno=0; np = 0; -#if SHOPT_COSHELL - if(shp->inpool) - { - if(!(iof&(IODOC|IOLSEEK|IOMOV))) - sh_coaddfile(shp,fname); - continue; - } -#endif /* SHOPT_COSHELL */ if(iop->iovname) { np = nv_open(iop->iovname,shp->var_tree,NV_NOASSIGN|NV_VARNAME); diff --git a/src/cmd/ksh93/sh/jobs.c b/src/cmd/ksh93/sh/jobs.c index ab82b17b2..d066a505f 100644 --- a/src/cmd/ksh93/sh/jobs.c +++ b/src/cmd/ksh93/sh/jobs.c @@ -253,82 +253,6 @@ static struct jobsave *jobsave_create(pid_t pid) return(jp); } -#if SHOPT_COSHELL - pid_t sh_copid(struct cosh *csp) - { - return(COPID_BIT|(csp->id<<16)|csp->cojob->id); - } - - - char *sh_pid2str(Shell_t *shp,pid_t pid) - { - struct cosh *csp=0; - if(pid&COPID_BIT) - { - int id = (pid>>16) &0x3f; - for(csp=job.colist; csp; csp = csp->next) - { - if(csp->id == id) - break; - } - } - if(csp) - sfprintf(shp->strbuf,"%s.%d%c",csp->name,pid&0xff,0); - else - sfprintf(shp->strbuf,"%d%c",pid,0); - return(sfstruse(shp->strbuf)); - } - - int job_cowalk(int (*fun)(struct process*,int),int arg,char *name) - { - Shell_t *shp = sh_getinterp(); - struct cosh *csp; - struct process *pw,*pwnext; - pid_t val; - int n,r=0; - char *cp = strchr(name,'.'); - if(!cp) - n = strlen(name); - else - n = cp-name; - for(csp=(struct cosh*)job.colist;csp;csp=csp->next) - { - if(memcmp(name,csp->name,n)==0 && csp->name[n]==0) - break; - } - if(!csp) - errormsg(SH_DICT,ERROR_exit(1),e_jobusage,name); - if(cp) - { - n = pid_fromstring(cp+1); - val = (csp->id<<16)|n|COPID_BIT; - } - job_reap(SIGCHLD); - for(n=0,pw=job.pwlist; pw; pw=pwnext) - { - pwnext = pw->p_nxtjob; - if((cp && val==pw->p_pid) || (pw->p_cojob && pw->p_cojob->local==(void*)csp)) - { - if(fun) - { - if(pw->p_flag&P_DONE) - continue; - r |= (*fun)(pw,arg); - } - else - job_wait(-pw->p_pid); - n++; - } - } - if(!n) - shp->exitval = fun?1:ERROR_NOENT; - else if(fun) - shp->exitval = r; - return(r); - } - -#endif /* SHOPT_COSHELL */ - /* * Reap one job * When called with sig==0, it does a blocking wait @@ -345,18 +269,6 @@ int job_reap(register int sig) Waitevent_f waitevent = shp->gd->waitevent; static int wcontinued = WCONTINUED; int was_ttywait_on; -#if SHOPT_COSHELL - Cojob_t *cjp; - int cojobs; - long cotimeout = sig?0:-1; - for(pw=job.pwlist;pw;pw=pw->p_nxtjob) - { - if(pw->p_cojob && !(pw->p_flag&P_DONE)) - break; - } - cojobs = (pw!=0); - pid = 0; -#endif /* SHOPT_COSHELL */ if (vmbusy()) { errormsg(SH_DICT,ERROR_warn(0),"vmbusy() inside job_reap() -- should not happen"); @@ -385,33 +297,9 @@ int job_reap(register int sig) if(waitevent && (*waitevent)(-1,-1L,0)) flags |= WNOHANG; } -#if SHOPT_COSHELL - if(cojobs) - { - if(cjp = cowait(0,0,cotimeout)) - { - struct cosh *csp; - csp = (struct cosh*)(cjp->coshell->data); - csp->cojob = cjp; - pid = sh_copid(csp); - if(cjp->status < 256) - wstat = cjp->status <<8; - else - wstat = cjp->status-256; - cotimeout = 0; - goto cojob; - } - else if(copending(0)==0) - cojobs = 0; - cotimeout = 0; - } -#endif /* SHOPT_COSHELL */ pid = waitpid((pid_t)-1,&wstat,flags); if(!was_ttywait_on) sh_offstate(SH_TTYWAIT); -#if SHOPT_COSHELL - cojob: -#endif /* SHOPT_COSHELL */ /* * some systems (linux 2.6) may return EINVAL @@ -563,10 +451,6 @@ int job_reap(register int sig) } #endif } -#if SHOPT_COSHELL - if(!was_ttywait_on) - sh_offstate(SH_TTYWAIT); /* only required after 'goto cojob' in the while loop */ -#endif if(errno==ECHILD) { errno = oerrno; @@ -894,13 +778,6 @@ void job_bwait(char **jobs) else return; } -# if SHOPT_COSHELL - else if(isalpha(*jp)) - { - job_cowalk(NULL,0,jp); - return; - } -# endif /* SHOPT_COSHELL */ else #endif /* JOBS */ pid = pid_fromstring(jp); @@ -924,9 +801,7 @@ int job_walk(Sfio_t *file,int (*fun)(struct process*,int),int arg,char *joblist[ by_number = 0; job_lock(); pw = job.pwlist; -#if SHOPT_COSHELL job_waitsafe(SIGCHLD); -#endif /* SHOPT_COSHELL */ if(jobs==0) { /* do all jobs */ @@ -952,15 +827,6 @@ int job_walk(Sfio_t *file,int (*fun)(struct process*,int),int arg,char *joblist[ job_string = jobid; if(*jobid==0) errormsg(SH_DICT,ERROR_exit(1),e_jobusage,job_string); -#if SHOPT_COSHELL - if(isalpha(*jobid)) - { - r = job_cowalk(fun,arg,jobid); - by_number = 0; - job_unlock(); - return(r); - } -#endif /* SHOPT_COSHELL */ if(*jobid == '%') pw = job_bystring(jobid); else @@ -1015,11 +881,7 @@ int job_list(struct process *pw,register int flag) return(0); if((flag&JOB_PFLAG)) { -#if SHOPT_COSHELL - sfprintf(outfile,"%s\n",sh_pid2str(shp,px->p_pgrp?px->p_pgrp:px->p_pid)); -#else sfprintf(outfile,"%d\n",px->p_pgrp?px->p_pgrp:px->p_pid); -#endif /* SHOPT_COSHELL */ return(0); } if((px->p_flag&P_DONE) && job.waitall && !(flag&JOB_LFLAG)) @@ -1039,11 +901,7 @@ int job_list(struct process *pw,register int flag) { n = 0; if(flag&JOB_LFLAG) -#if SHOPT_COSHELL - sfprintf(outfile,"%s\t",sh_pid2str(shp,px->p_pid)); -#else sfprintf(outfile,"%d\t",px->p_pid); -#endif /* SHOPT_COSHELL */ if(px->p_flag&P_SIGNALLED) msg = job_sigmsg((int)(px->p_exit)); else if(px->p_flag&P_NOTIFY) @@ -1133,11 +991,6 @@ int job_kill(register struct process *pw,register int sig) job_lock(); errno = ECHILD; pid = pw->p_pid; -#if SHOPT_COSHELL - if(pw->p_cojob) - r = cokill(pw->p_cojob->coshell,pw->p_cojob,sig); - else -#endif /* SHOPT_COSHELL */ if(by_number) { if(pid==0 && job.jobcontrol) @@ -1364,14 +1217,6 @@ int job_post(Shell_t *shp,pid_t pid, pid_t join) pw->p_nxtproc = 0; } pw->p_exitval = job.exitval; -#if SHOPT_COSHELL - pw->p_cojob = 0; - if(shp->coshell && (pid&COPID_BIT)) - { - pw->p_cojob = ((struct cosh*)shp->coshell)->cojob; - job.curpgid = sh_isstate(SH_MONITOR)?pid:0; - } -#endif /* SHOPT_COSHELL */ job.pwlist = pw; pw->p_shp = shp; pw->p_env = shp->curenv; diff --git a/src/cmd/ksh93/sh/macro.c b/src/cmd/ksh93/sh/macro.c index 2899908ba..530da993c 100644 --- a/src/cmd/ksh93/sh/macro.c +++ b/src/cmd/ksh93/sh/macro.c @@ -2062,10 +2062,6 @@ static void comsubst(Mac_t *mp,register Shnode_t* t, int type) mp->shp->argaddr = 0; savemac = *mp; mp->shp->st.staklist=0; -#ifdef SHOPT_COSHELL - if(mp->shp->inpool) - return; -#endif /*SHOPT_COSHELL */ if(type) { sp = 0; @@ -2770,11 +2766,7 @@ static char *special(Shell_t *shp,register int c) return(ltos(shp->st.dolc)); case '!': if(shp->bckpid) -#if SHOPT_COSHELL - return(sh_pid2str(shp,shp->bckpid)); -#else return(ltos(shp->bckpid)); -#endif /* SHOPT_COSHELL */ break; case '$': if(nv_isnull(SH_DOLLARNOD)) diff --git a/src/cmd/ksh93/sh/nvdisc.c b/src/cmd/ksh93/sh/nvdisc.c index 608c1269f..9ea9a1523 100644 --- a/src/cmd/ksh93/sh/nvdisc.c +++ b/src/cmd/ksh93/sh/nvdisc.c @@ -1060,10 +1060,6 @@ Namval_t *nv_search(const char *name, Dt_t *root, int mode) root = sh.var_base; np = dtmatch(root,(void*)name); } -#if SHOPT_COSHELL - if(sh.inpool) - mode |= HASH_NOSCOPE; -#endif /* SHOPT_COSHELL */ if(!np && (mode&NV_ADD)) { if(sh.namespace && !(mode&HASH_NOSCOPE) && root==sh.var_tree) diff --git a/src/cmd/ksh93/sh/parse.c b/src/cmd/ksh93/sh/parse.c index f1ee9528b..bd7e93c53 100644 --- a/src/cmd/ksh93/sh/parse.c +++ b/src/cmd/ksh93/sh/parse.c @@ -573,19 +573,11 @@ static Shnode_t *term(Lex_t *lexp,register int flag) t->par.partyp |= COMSCAN; t->par.partre = term(lexp,0); } -#if SHOPT_COSHELL - else if((t=item(lexp,SH_NL|SH_EMPTY|(flag&SH_SEMI))) && (lexp->token=='|' || lexp->token==PIPESYM2)) -#else else if((t=item(lexp,SH_NL|SH_EMPTY|(flag&SH_SEMI))) && lexp->token=='|') -#endif /* SHOPT_COSHELL */ { register Shnode_t *tt; int showme = t->tre.tretyp&FSHOWME; t = makeparent(lexp,TFORK|FPOU,t); -#if SHOPT_COSHELL - if(lexp->token==PIPESYM2) - t->tre.tretyp |= FALTPIPE; -#endif /* SHOPT_COSHELL */ if(tt=term(lexp,SH_NL)) { switch(tt->tre.tretyp&COMMSK) @@ -1325,24 +1317,6 @@ static Shnode_t *item(Lex_t *lexp,int flag) t->par.partyp=TPAR; break; -#if SHOPT_COSHELL - case '&': - if(tok=sh_lex(lexp)) - { - if(tok!=NL) - sh_syntax(lexp); - t = getnode(comnod); - memset(t,0,sizeof(struct comnod)); - t->com.comline = sh_getlineno(lexp); - } - else - t = (Shnode_t*)simple(lexp,SH_NOIO,NIL(struct ionod*)); - t->com.comtyp |= FAMP; - if(lexp->token=='&' || lexp->token=='|') - sh_syntax(lexp); - return(t); - break; -#endif /* SHOPT_COSHELL */ default: if(io==0) return(0); diff --git a/src/cmd/ksh93/sh/path.c b/src/cmd/ksh93/sh/path.c index 3059bafbe..a3c642812 100644 --- a/src/cmd/ksh93/sh/path.c +++ b/src/cmd/ksh93/sh/path.c @@ -1258,7 +1258,6 @@ static void exscript(Shell_t *shp,register char *path,register char *argv[],char path = path_relative(shp,path); shp->comdiv=0; shp->bckpid = 0; - shp->coshell = 0; shp->st.ioset=0; /* clean up any cooperating processes */ if(shp->cpipe[0]>0) diff --git a/src/cmd/ksh93/sh/subshell.c b/src/cmd/ksh93/sh/subshell.c index f77a0fae1..5b12f922e 100644 --- a/src/cmd/ksh93/sh/subshell.c +++ b/src/cmd/ksh93/sh/subshell.c @@ -101,9 +101,6 @@ static struct subshell char subshare; char comsub; char pwdclose; -#if SHOPT_COSHELL - void *coshell; -#endif /* SHOPT_COSHELL */ } *subshell_data; static int subenv; @@ -493,10 +490,6 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_t *t, volatile int flags, int comsub) sp->options = shp->options; sp->jobs = job_subsave(); sp->subdup = shp->subdup; -#if SHOPT_COSHELL - sp->coshell = shp->coshell; - shp->coshell = 0; -#endif /* SHOPT_COSHELL */ /* make sure initialization has occurred */ if(!shp->pathlist) { @@ -759,9 +752,6 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_t *t, volatile int flags, int comsub) shp->subshare = sp->subshare; shp->comsub = sp->comsub; shp->subdup = sp->subdup; -#if SHOPT_COSHELL - shp->coshell = sp->coshell; -#endif /* SHOPT_COSHELL */ if(shp->subshell) { shp->subshell--; /* decrease level of virtual subshells */ diff --git a/src/cmd/ksh93/sh/xec.c b/src/cmd/ksh93/sh/xec.c index 07439a6ff..4f99919bf 100644 --- a/src/cmd/ksh93/sh/xec.c +++ b/src/cmd/ksh93/sh/xec.c @@ -859,177 +859,6 @@ static void unset_instance(Namval_t *nq, Namval_t *node, struct Namref *nr,long _nv_unset(SH_SUBSCRNOD,0); } -#if SHOPT_COSHELL -uintmax_t coused; -/* - * print out function definition - */ -static void print_fun(register Namval_t* np, void *data) -{ - register char *format; - NOT_USED(data); - if(!is_afunction(np) || !np->nvalue.ip) - return; - if(nv_isattr(np,NV_FPOSIX)) - format="%s()\n{ "; - else - format="function %s\n{ "; - sfprintf(sfstdout,format,nv_name(np)); - sh_deparse(sfstdout,(Shnode_t*)(nv_funtree(np)),0); - sfwrite(sfstdout,"}\n",2); -} - -static void *sh_coinit(Shell_t *shp,char **argv) -{ - struct cosh *csp = job.colist; - const char *name = argv?argv[0]:0; - int id, open=1; - if(!name) - return(0); - if(*name=='-') - { - name++; - open=0; - } - nv_open(name,shp->var_tree,NV_IDENT|NV_NOADD); - while(csp) - { - if(strcmp(name,csp->name)==0) - { - if(open) - { - coattr(csp->coshell,argv[1]); - return((void*)csp); - } - coclose(csp->coshell); - return(0); - } - csp = csp->next; - } - if(!open) - errormsg(SH_DICT,ERROR_exit(1),"%s: unknown namespace",name); - environ[0][2]=0; - csp = newof(0,struct cosh,1,strlen(name)+1); - if(!(csp->coshell = coopen(NULL,CO_SHELL|CO_SILENT,argv[1]))) - { - free((void*)csp); - errormsg(SH_DICT,ERROR_exit(1),"%s: unable to create namespace",name); - } - csp->coshell->data = (void*)csp; - csp->name = (char*)(csp+1); - strcpy(csp->name,name); - for(id=0; coused&(1<id = id; - csp->next = job.colist; - job.colist = csp; - return((void*)csp); -} - -int sh_coaddfile(Shell_t *shp, char *name) -{ - Namval_t *np = dtmatch(shp->inpool,name); - if(!np) - { - np = (Namval_t*)stakalloc(sizeof(Dtlink_t)+sizeof(char*)); - np->nvname = name; - (Namval_t*)dtinsert(shp->inpool,np); - shp->poolfiles++; - return(1); - } - return(0); -} - -static int sh_coexec(Shell_t *shp,const Shnode_t *t, int filt) -{ - struct cosh *csp = ((struct cosh*)shp->coshell); - Cojob_t *cjp; - char *str,*trap,host[PATH_MAX]; - int lineno,sig,trace = sh_isoption(SH_XTRACE); - int verbose = sh_isoption(SH_VERBOSE); - sh_offoption(SH_XTRACE); - sh_offoption(SH_VERBOSE); - if(!shp->strbuf2) - shp->strbuf2 = sfstropen(); - sfswap(shp->strbuf2,sfstdout); - sh_trap("typeset -p\nprint cd \"$PWD\"\nprint .sh.dollar=$$\nprint umask $(umask)",0); - for(sig=shp->st.trapmax;--sig>0;) - { - if((trap=shp->st.trapcom[sig]) && *trap==0) - sfprintf(sfstdout,"trap '' %d\n",sig); - } - if(t->tre.tretyp==TFIL) - lineno = ((struct forknod*)t->lst.lstlef)->forkline; - else - lineno = t->fork.forkline; - if(filt) - { - if(gethostname(host,sizeof(host)) < 0) - errormsg(SH_DICT,ERROR_system(1),e_pipe); - if(shp->inpipe[2]>=20000) - sfprintf(sfstdout,"command exec < /dev/tcp/%s/%d || print -u2 'cannot create pipe'\n",host,shp->inpipe[2]); - sfprintf(sfstdout,"command exec > /dev/tcp/%s/%d || print -u2 'cannot create pipe'\n",host,shp->outpipe[2]); - if(filt==3) - t = t->fork.forktre; - } - else - t = t->fork.forktre; - nv_scan(shp->fun_tree, print_fun, (void*)0,0, 0); - if(1) - { - Dt_t *top = shp->var_tree; - sh_scope(shp,(struct argnod*)0,0); - shp->inpool = dtopen(&_Nvdisc,Dtset); - sh_exec(t,filt==1||filt==2?SH_NOFORK:0); - if(shp->poolfiles) - { - Namval_t *np; - sfprintf(sfstdout,"[[ ${.sh} == *pool* ]] && .sh.pool.files=(\n"); - for(np=(Namval_t*)dtfirst(shp->inpool);np;np=(Namval_t*)dtnext(shp->inpool,np)) - { - sfprintf(sfstdout,"\t%s\n",sh_fmtq(np->nvname)); - } - sfputr(sfstdout,")",'\n'); - ; - } - dtclose(shp->inpool); - shp->inpool = 0; - shp->poolfiles = 0; - sh_unscope(shp); - shp->var_tree = top; - } - sfprintf(sfstdout,"typeset -f .sh.pool.init && .sh.pool.init\n"); - sfprintf(sfstdout,"LINENO=%d\n",lineno); - if(trace) - sh_onoption(SH_XTRACE); - if(verbose) - sh_onoption(SH_VERBOSE); - sh_trap("set +o",0); - sh_deparse(sfstdout,t,filt==1||filt==2?FALTPIPE:0); - sfputc(sfstdout,0); - sfswap(shp->strbuf2,sfstdout); - str = sfstruse(shp->strbuf2); - if(cjp=coexec(csp->coshell,str,0,NULL,NULL,NULL)) - { - csp->cojob = cjp; - cjp->local = shp->coshell; - if(filt) - { - if(filt>1) - sh_coaccept(shp,shp->inpipe,1); - sh_coaccept(shp,shp->outpipe,0); - if(filt > 2) - { - shp->coutpipe = shp->inpipe[1]; - shp->fdptrs[shp->coutpipe] = &shp->coutpipe; - } - } - return(sh_copid(csp)); - } - return(-1); -} -#endif /*SHOPT_COSHELL*/ - #if SHOPT_FILESCAN static Sfio_t *openstream(Shell_t *shp, struct ionod *iop, int *save) { @@ -1203,31 +1032,6 @@ int sh_exec(register const Shnode_t *t, int flags) else shp->xargmin = 0; argn -= command; -#if SHOPT_COSHELL - if(argn && shp->inpool) - { - if(io=t->tre.treio) - sh_redirect(shp,io,0); - if(!np || !is_abuiltin(np) || *np->nvname=='/' || np==SYSCD) - { - char **argv, *cp; - for(argv=com+1; cp= *argv; argv++) - { - if(cp && *cp && *cp!='-') - sh_coaddfile(shp,*argv); - } - break; - } - if(np->nvalue.bfp!=SYSTYPESET->nvalue.bfp) - break; - } - if(t->tre.tretyp&FAMP) - { - shp->coshell = sh_coinit(shp,com); - com0 = 0; - break; - } -#endif /* SHOPT_COSHELL */ if(np && is_abuiltin(np)) { if(!command) @@ -1721,13 +1525,6 @@ int sh_exec(register const Shnode_t *t, int flags) register pid_t parent; int no_fork,jobid; int pipes[3]; -#if SHOPT_COSHELL - if(shp->inpool) - { - sh_exec(t->fork.forktre,0); - break; - } -#endif /* SHOPT_COSHELL */ if(shp->subshell) { sh_subtmpfile(shp); @@ -1774,34 +1571,8 @@ int sh_exec(register const Shnode_t *t, int flags) if(type&FCOOP) { pipes[2] = 0; -#if SHOPT_COSHELL - if(shp->coshell) - { - if(shp->cpipe[0]<0 || shp->cpipe[1] < 0) - { - sh_copipe(shp,shp->outpipe=shp->cpipe,0); - shp->fdptrs[shp->cpipe[0]] = shp->cpipe; - } - sh_copipe(shp,shp->inpipe=pipes,0); - parent = sh_coexec(shp,t,3); - shp->cpid = parent; - jobid = job_post(shp,parent,0); - goto skip; - } -#endif /* SHOPT_COSHELL */ coproc_init(shp,pipes); } -#if SHOPT_COSHELL - if((type&(FAMP|FINT)) == (FAMP|FINT)) - { - if(shp->coshell) - { - parent = sh_coexec(shp,t,0); - jobid = job_post(shp,parent,0); - goto skip; - } - } -#endif /* SHOPT_COSHELL */ #if SHOPT_AMP if((type&(FAMP|FINT)) == (FAMP|FINT)) parent = sh_ntfork(shp,t,com,&jobid,ntflag); @@ -1835,9 +1606,6 @@ int sh_exec(register const Shnode_t *t, int flags) #endif /* SHOPT_SPAWN */ #endif } -#if SHOPT_COSHELL - skip: -#endif /* SHOPT_COSHELL */ if(job.parent=parent) /* This is the parent branch of fork * It may or may not wait for the child @@ -1882,11 +1650,7 @@ int sh_exec(register const Shnode_t *t, int flags) { /* print job number */ #ifdef JOBS -# if SHOPT_COSHELL - sfprintf(sfstderr,"[%d]\t%s\n",jobid,sh_pid2str(shp,parent)); -# else sfprintf(sfstderr,"[%d]\t%d\n",jobid,parent); -# endif /* SHOPT_COSHELL */ #else sfprintf(sfstderr,"%d\n",parent); #endif /* JOBS */ @@ -1944,20 +1708,12 @@ int sh_exec(register const Shnode_t *t, int flags) #endif /* !SHOPT_DEVFD */ if(type&FPIN) { -#if SHOPT_COSHELL - if(shp->inpipe[2]>20000) - sh_coaccept(shp,shp->inpipe,0); -#endif /* SHOPT_COSHELL */ sh_iorenumber(shp,shp->inpipe[0],0); if(!(type&FPOU) || (type&FCOOP)) sh_close(shp->inpipe[1]); } if(type&FPOU) { -#if SHOPT_COSHELL - if(shp->outpipe[2]>20000) - sh_coaccept(shp,shp->outpipe,1); -#endif /* SHOPT_COSHELL */ sh_iorenumber(shp,shp->outpipe[1],1); sh_pclose(shp->outpipe); } @@ -2025,14 +1781,6 @@ int sh_exec(register const Shnode_t *t, int flags) int jmpval, waitall; int simple = (t->fork.forktre->tre.tretyp&COMMSK)==TCOM; struct checkpt *buffp = (struct checkpt*)stkalloc(shp->stk,sizeof(struct checkpt)); -#if SHOPT_COSHELL - if(shp->inpool) - { - sh_redirect(shp,t->fork.forkio,0); - sh_exec(t->fork.forktre,0); - break; - } -#endif /*SHOPT_COSHELL */ if(shp->subshell) execflg = 0; sh_pushcontext(shp,buffp,SH_JMPIO); @@ -2103,13 +1851,6 @@ int sh_exec(register const Shnode_t *t, int flags) } case TPAR: -#if SHOPT_COSHELL - if(shp->inpool) - { - sh_exec(t->par.partre,0); - break; - } -#endif /* SHOPT_COSHELL */ echeck = 1; flags &= ~OPTIMIZE_FLAG; if(!shp->subshell && !shp->st.trapcom[0] && !shp->st.trap[SH_ERRTRAP] && (flags&sh_state(SH_NOFORK))) @@ -2169,28 +1910,7 @@ int sh_exec(register const Shnode_t *t, int flags) int savejobid = job.curjobid; int *exitval=0,*saveexitval = job.exitval; pid_t savepgid = job.curpgid; -#if SHOPT_COSHELL - int copipe=0; - Shnode_t *tt; -#endif /* SHOPT_COSHELL */ job.exitval = 0; -#if SHOPT_COSHELL - if(shp->inpool) - { - do - { - sh_exec(t->lst.lstlef, 0); - t = t->lst.lstrit; - if(flags && (t->tre.tretyp!=TFIL || !(t->lst.lstlef->tre.tretyp&FALTPIPE))) - goto coskip1; - } - while(t->tre.tretyp==TFIL); - sh_exec(t,0); - coskip1: - break; - } - pvo[2] = pvn[2] = 0; -#endif /* SHOPT_COSHELL */ job.curjobid = 0; if(shp->subshell) { @@ -2218,42 +1938,7 @@ int sh_exec(register const Shnode_t *t, int flags) do { /* create the pipe */ -#if SHOPT_COSHELL - tt = t->lst.lstrit; - if(shp->coshell && !showme) - { - if(t->lst.lstlef->tre.tretyp&FALTPIPE) - { - sh_copipe(shp,pvn,0); - type = sh_coexec(shp,t,1+copipe); - pvn[1] = -1; - pipejob=1; - if(type>0) - { - job_post(shp,type,0); - type = 0; - } - copipe = 1; - pvo[0] = pvn[0]; - while(tt->tre.tretyp==TFIL && tt->lst.lstlef->tre.tretyp&FALTPIPE) - tt = tt->lst.lstrit; - t = tt; - continue; - } - else if(tt->tre.tretyp==TFIL && tt->lst.lstlef->tre.tretyp&FALTPIPE) - { - sh_copipe(shp,pvn,0); - pvo[2] = pvn[2]; - copipe = 0; - goto coskip2; - } - } -#endif /* SHOPT_COSHELL */ sh_pipe(pvn); -#if SHOPT_COSHELL - pvn[2] = 0; - coskip2: -#endif /* SHOPT_COSHELL */ /* execute out part of pipe no wait */ (t->lst.lstlef)->tre.tretyp |= showme; type = sh_exec(t->lst.lstlef, errorflg); @@ -2337,15 +2022,6 @@ int sh_exec(register const Shnode_t *t, int flags) } case TAND: -#if SHOPT_COSHELL - if(shp->inpool) - { - andor: - sh_exec(t->lst.lstlef,0); - sh_exec(t->lst.lstrit,0); - break; - } -#endif /* SHOPT_COSHELL */ if(type&TTEST) skipexitset++; if(sh_exec(t->lst.lstlef,OPTIMIZE)==0) @@ -2353,10 +2029,6 @@ int sh_exec(register const Shnode_t *t, int flags) break; case TORF: -#if SHOPT_COSHELL - if(shp->inpool) - goto andor; -#endif /* SHOPT_COSHELL */ if(type&TTEST) skipexitset++; if(sh_exec(t->lst.lstlef,OPTIMIZE)!=0) @@ -2374,9 +2046,6 @@ int sh_exec(register const Shnode_t *t, int flags) char *cp, *trap, *nullptr = 0; int nameref, refresh=1; char *av[5]; -#if SHOPT_COSHELL - int poolfiles; -#endif /* SHOPT_COSHELL */ #if SHOPT_OPTIMIZE int jmpval = ((struct checkpt*)shp->jmplist)->mode; struct checkpt *buffp = (struct checkpt*)stkalloc(shp->stk,sizeof(struct checkpt)); @@ -2464,15 +2133,6 @@ int sh_exec(register const Shnode_t *t, int flags) av[4] = 0; sh_debug(shp,trap,(char*)0,(char*)0,av,0); } -#if SHOPT_COSHELL - if(shp->inpool) - { - poolfiles = shp->poolfiles; - sh_exec(t->for_.fortre,0); - if(poolfiles==shp->poolfiles) - break; - } -#endif /* SHOPT_COSHELL */ sh_exec(t->for_.fortre,flag); flag &= ~OPTIMIZE_FLAG; if(t->tre.tretyp&COMSCAN) @@ -2516,31 +2176,6 @@ int sh_exec(register const Shnode_t *t, int flags) struct checkpt *buffp = (struct checkpt*)stkalloc(shp->stk,sizeof(struct checkpt)); void *optlist = shp->optlist; #endif /* SHOPT_OPTIMIZE */ -#if SHOPT_COSHELL - if(shp->inpool) - { - int poolfiles; -# if SHOPT_FILESCAN - if(type==TWH && tt->tre.tretyp==TCOM && !tt->com.comarg && tt->com.comio) - { - sh_redirect(shp,tt->com.comio,0); - break; - } -# endif /* SHOPT_FILESCAN */ - sh_exec(tt,0); - do - { - if((sh_exec(tt,0)==0)!=(type==TWH)) - break; - poolfiles = shp->poolfiles; - sh_exec(t->wh.dotre,0); - if(t->wh.whinc) - sh_exec((Shnode_t*)t->wh.whinc,0); - } - while(poolfiles != shp->poolfiles); - break; - } -#endif /*SHOPT_COSHELL */ #if SHOPT_OPTIMIZE shp->optlist = 0; sh_tclear(t->wh.whtre); @@ -2635,15 +2270,6 @@ int sh_exec(register const Shnode_t *t, int flags) } case TIF: -#if SHOPT_COSHELL - if(shp->inpool) - { - sh_exec(t->if_.thtre,0); - if(t->if_.eltre) - sh_exec(t->if_.eltre, 0); - break; - } -#endif /*SHOPT_COSHELL */ if(sh_exec(t->if_.iftre,OPTIMIZE)==0) sh_exec(t->if_.thtre,flags); else if(t->if_.eltre) @@ -2670,13 +2296,6 @@ int sh_exec(register const Shnode_t *t, int flags) while(t) { register struct argnod *rex=(struct argnod*)t->reg.regptr; -#if SHOPT_COSHELL - if(shp->inpool) - { - sh_exec(t->reg.regcom,0); - continue; - } -#endif /*SHOPT_COSHELL */ while(rex) { register char *s; @@ -2718,14 +2337,6 @@ int sh_exec(register const Shnode_t *t, int flags) struct tms before,after; clock_t at, bt, tm[3]; #endif -#if SHOPT_COSHELL - if(shp->inpool) - { - if(t->par.partre) - sh_exec(t->par.partre,0); - break; - } -#endif /*SHOPT_COSHELL */ if(type!=TTIME) { sh_exec(t->par.partre,OPTIMIZE); @@ -2807,13 +2418,6 @@ int sh_exec(register const Shnode_t *t, int flags) register char *fname = ((struct functnod*)t)->functnam; register char *cp = strrchr(fname,'.'); register Namval_t *npv=0,*mp; -#if SHOPT_COSHELL - if(shp->inpool) - { - sh_exec(t->funct.functtre,0); - break; - } -#endif /* SHOPT_COSHELL */ #if SHOPT_NAMESPACE if(t->tre.tretyp==TNSPACE) { @@ -2965,10 +2569,6 @@ int sh_exec(register const Shnode_t *t, int flags) register int n; register char *left; int negate = (type&TNEGATE)!=0; -#if SHOPT_COSHELL - if(shp->inpool) - break; -#endif /* SHOPT_COSHELL */ if(type&TTEST) skipexitset++; error_info.line = t->tst.tstline-shp->st.firstline; @@ -3075,11 +2675,7 @@ int sh_exec(register const Shnode_t *t, int flags) } if(!skipexitset) exitset(); -#if SHOPT_COSHELL - if(!shp->inpool && !(OPTIMIZE)) -#else if(!(OPTIMIZE)) -#endif /* SHOPT_COSHELL */ { if(sav != stkptr(stkp,0)) stkset(stkp,sav,0); @@ -3952,10 +3548,6 @@ static pid_t sh_ntfork(Shell_t *shp,const Shnode_t *t,char *argv[],int *jobid,in } if(otype&FPOU) { -#if SHOPT_COSHELL - if(shp->outpipe[2] > 20000) - sh_coaccept(shp,shp->outpipe,1); -#endif /* SHOPT_COSHELL */ sh_iosave(shp,1,buffp->topfd,(char*)0); sh_iorenumber(shp,sh_dup(shp->outpipe[1]),1); if(fcntl(shp->outpipe[0],F_SETFD,FD_CLOEXEC)>=0) diff --git a/src/lib/libcoshell/Makefile b/src/lib/libcoshell/Makefile deleted file mode 100644 index 8fe9beb61..000000000 --- a/src/lib/libcoshell/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -/* - * coshell library - */ - -:PACKAGE: ast - -CCFLAGS = $(CC.OPTIMIZE) $(CC.PIC) /* pic allows archive to be pulled into other dlls */ - -LICENSE = since=1990,author=gsf - -coshell 1.0 :LIBRARY: RELEASE coshell.3 coshell.h colib.h \ - coopen.c coclose.c coinit.c coexec.c costash.c \ - cowait.c cokill.c cosync.c coquote.c codata.c \ - coexport.c procrun.c system.c - -ignore :: ignore.sh - -silent :: silent.sh - -$(INCLUDEDIR) :INSTALLPROTO: coshell.h diff --git a/src/lib/libcoshell/Mamfile b/src/lib/libcoshell/Mamfile deleted file mode 100644 index 9f82caac8..000000000 --- a/src/lib/libcoshell/Mamfile +++ /dev/null @@ -1,462 +0,0 @@ -info mam static 00000 1994-07-17 make (AT&T Research) 5.7 2012-06-20 -setv INSTALLROOT ../../.. -setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast -setv PACKAGE_ast_LIB ${INSTALLROOT}/lib -setv PACKAGEROOT ../../../../.. -setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} -setv ARFLAGS rc -setv AS as -setv ASFLAGS -setv CC cc -setv mam_cc_FLAGS ${mam_cc_PIC} -setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} -setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} -setv COTEMP $$ -setv CPIO cpio -setv CPIOFLAGS -setv CPP "${CC} -E" -setv F77 f77 -setv HOSTCC ${CC} -setv IGNORE -setv LD ld -setv LDFLAGS -setv LEX lex -setv LEXFLAGS -setv LPR lpr -setv LPRFLAGS -setv M4FLAGS -setv NMAKE nmake -setv NMAKEFLAGS -setv PR pr -setv PRFLAGS -setv SHELL /bin/sh -setv SILENT -setv TAR tar -setv YACC yacc -setv YACCFLAGS -d -make ${PACKAGEROOT}/lib/package/ast.lic -done ${PACKAGEROOT}/lib/package/ast.lic -make install -make coshell -make libcoshell.a archive -make coshell.req -exec - set - -exec - echo 'int main(){return 0;}' > 1.${COTEMP}.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -c 1.${COTEMP}.c && -exec - x=`${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l'*' 2>&1 | sed -e 's/[][()+@?]/#/g' || :` && -exec - { -exec - case "" in -exec - *?) echo " " ;; -exec - esac -exec - for i in coshell ast -exec - do case $i in -exec - "coshell"|coshell) -exec - ;; -exec - *) if test -f ${INSTALLROOT}/lib/lib/$i -exec - then y=`cat ${INSTALLROOT}/lib/lib/$i` -exec - case $y in -exec - *-?*) echo "" $y ;; -exec - esac -exec - continue -exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a -exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in -exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in -exec - *$x*) continue ;; -exec - esac -exec - ;; -exec - esac -exec - fi -exec - ;; -exec - esac -exec - echo " -l$i" -exec - done -exec - } > coshell.req -exec - rm -f 1.${COTEMP}.* -done coshell.req generated -make coopen.o -make coopen.c -make ${PACKAGE_ast_INCLUDE}/tok.h implicit -make ${PACKAGE_ast_INCLUDE}/ast.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_api.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_api.h dontcare -make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_map.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_map.h dontcare -make ${PACKAGE_ast_INCLUDE}/endian.h implicit -make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit -done ${PACKAGE_ast_INCLUDE}/bytesex.h dontcare -done ${PACKAGE_ast_INCLUDE}/endian.h dontcare -done ${PACKAGE_ast_INCLUDE}/ast_common.h dontcare -make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit -make ${PACKAGE_ast_INCLUDE}/regex.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit -make ${PACKAGE_ast_INCLUDE}/wctype.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit -prev ${PACKAGE_ast_INCLUDE}/endian.h implicit -make ${PACKAGE_ast_INCLUDE}/wchar.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit -done ${PACKAGE_ast_INCLUDE}/wchar.h dontcare -done ${PACKAGE_ast_INCLUDE}/ast_wctype.h dontcare -done ${PACKAGE_ast_INCLUDE}/wctype.h dontcare -make ${PACKAGE_ast_INCLUDE}/stdio.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit -make ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit -done ${PACKAGE_ast_INCLUDE}/sfio_s.h dontcare -prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_stdio.h dontcare -done ${PACKAGE_ast_INCLUDE}/stdio.h dontcare -prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_wchar.h dontcare -prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit -make ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/prototyped.h dontcare -done ${PACKAGE_ast_INCLUDE}/regex.h dontcare -make ${PACKAGE_ast_INCLUDE}/getopt.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_getopt.h dontcare -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/getopt.h dontcare -prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_botch.h dontcare -make ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_limits.h dontcare -make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_fs.h dontcare -done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h dontcare -prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit -prev ${PACKAGE_ast_INCLUDE}/getopt.h implicit -prev ${PACKAGE_ast_INCLUDE}/endian.h implicit -prev ${PACKAGE_ast_INCLUDE}/endian.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_sys.h dontcare -make ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_lib.h dontcare -prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_std.h dontcare -done ${PACKAGE_ast_INCLUDE}/vmalloc.h dontcare -make ${PACKAGE_ast_INCLUDE}/sfio.h implicit -prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit -done ${PACKAGE_ast_INCLUDE}/sfio.h dontcare -prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/ast.h dontcare -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/tok.h -make ${PACKAGE_ast_INCLUDE}/sfdisc.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/sfdisc.h -make ${PACKAGE_ast_INCLUDE}/proc.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/proc.h -make ${PACKAGE_ast_INCLUDE}/namval.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/namval.h -make colib.h implicit -make ${PACKAGE_ast_INCLUDE}/wait.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_wait.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_wait.h dontcare -prev ${PACKAGE_ast_INCLUDE}/ast.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/wait.h dontcare -make ${PACKAGE_ast_INCLUDE}/sig.h implicit -done ${PACKAGE_ast_INCLUDE}/sig.h dontcare -make ${PACKAGE_ast_INCLUDE}/error.h implicit -make ${PACKAGE_ast_INCLUDE}/option.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/option.h dontcare -prev ${PACKAGE_ast_INCLUDE}/ast.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/error.h dontcare -make coshell.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast.h implicit -done coshell.h dontcare -prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit -make ${PACKAGE_ast_INCLUDE}/dt.h implicit -prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit -make ${PACKAGE_ast_INCLUDE}/cdt.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit -done ${PACKAGE_ast_INCLUDE}/cdt.h dontcare -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/dt.h dontcare -prev ${PACKAGE_ast_INCLUDE}/ast.h implicit -done colib.h -done coopen.c -meta coopen.o %.c>%.o coopen.c coopen -prev coopen.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c coopen.c -done coopen.o generated -make coclose.o -make coclose.c -prev colib.h implicit -done coclose.c -meta coclose.o %.c>%.o coclose.c coclose -prev coclose.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c coclose.c -done coclose.o generated -make coinit.o -make coinit.c -make ${PACKAGE_ast_INCLUDE}/ls.h implicit -make ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit -done ${PACKAGE_ast_INCLUDE}/ast_mode.h dontcare -prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit -prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit -done ${PACKAGE_ast_INCLUDE}/ls.h -prev ${PACKAGE_ast_INCLUDE}/endian.h implicit -prev colib.h implicit -done coinit.c -meta coinit.o %.c>%.o coinit.c coinit -prev coinit.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c coinit.c -done coinit.o generated -make coexec.o -make coexec.c -prev ${PACKAGE_ast_INCLUDE}/ls.h implicit -prev ${PACKAGE_ast_INCLUDE}/proc.h implicit -prev colib.h implicit -done coexec.c -meta coexec.o %.c>%.o coexec.c coexec -prev coexec.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c coexec.c -done coexec.o generated -make costash.o -make costash.c -prev colib.h implicit -done costash.c -meta costash.o %.c>%.o costash.c costash -prev costash.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c costash.c -done costash.o generated -make cowait.o -make cowait.c -prev colib.h implicit -done cowait.c -meta cowait.o %.c>%.o cowait.c cowait -prev cowait.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c cowait.c -done cowait.o generated -make cokill.o -make cokill.c -prev colib.h implicit -done cokill.c -meta cokill.o %.c>%.o cokill.c cokill -prev cokill.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c cokill.c -done cokill.o generated -make cosync.o -make cosync.c -make FEATURE/nfsd implicit -meta FEATURE/nfsd >FEATURE/% nfsd -bind -last -exec - iffe -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} : def nfsd -done FEATURE/nfsd generated -prev ${PACKAGE_ast_INCLUDE}/ls.h implicit -prev colib.h implicit -done cosync.c -meta cosync.o %.c>%.o cosync.c cosync -prev cosync.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c cosync.c -done cosync.o generated -make coquote.o -make coquote.c -prev colib.h implicit -done coquote.c -meta coquote.o %.c>%.o coquote.c coquote -prev coquote.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c coquote.c -done coquote.o generated -make codata.o -make codata.c -prev colib.h implicit -done codata.c -meta codata.o %.c>%.o codata.c codata -prev codata.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c codata.c -done codata.o generated -make coexport.o -make coexport.c -prev colib.h implicit -done coexport.c -meta coexport.o %.c>%.o coexport.c coexport -prev coexport.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c coexport.c -done coexport.o generated -make procrun.o -make procrun.c -prev ${PACKAGE_ast_INCLUDE}/proc.h implicit -prev colib.h implicit -done procrun.c -meta procrun.o %.c>%.o procrun.c procrun -prev procrun.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c procrun.c -done procrun.o generated -make system.o -make system.c -prev colib.h implicit -done system.c -meta system.o %.c>%.o system.c system -prev system.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_coshell -c system.c -done system.o generated -exec - ${AR} rc libcoshell.a coopen.o coclose.o coinit.o coexec.o costash.o cowait.o cokill.o cosync.o coquote.o codata.o coexport.o procrun.o system.o -exec - (ranlib libcoshell.a) >/dev/null 2>&1 || true -done libcoshell.a generated -done coshell virtual -prev libcoshell.a archive -make ignore -make ignore.sh -done ignore.sh -meta ignore %.sh>% ignore.sh ignore -prev ignore.sh -exec - case static,port:$OPTIND:$RANDOM in -exec - ?*:*:*|*::*|*:*:$RANDOM) -exec - ;; -exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null -exec - then if grep '### .*archaic.* ###' >/dev/null -exec - then : ignore contains archaic constructs : -exec - else ENV= LC_ALL=C $SHELL -n ignore.sh -exec - fi -exec - fi -exec - ;; -exec - esac -exec - case '${mam_cc_SHELLMAGIC}' in -exec - "") case 0 in -exec - 0) cp ignore.sh ignore -exec - ;; -exec - *) { -exec - i=`(read x; echo $x) < ignore.sh` -exec - case $i in -exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; -exec - esac -exec - cat - ignore.sh <<'!' -exec - -exec - ! -exec - } > ignore -exec - ;; -exec - esac -exec - ;; -exec - *) cat - ignore.sh > ignore <<'!' -exec - ${mam_cc_SHELLMAGIC} -exec - -exec - ! -exec - ;; -exec - esac -exec - silent test -w ignore -a -x ignore || chmod u+w,+x ignore -done ignore generated -make silent -make silent.sh -done silent.sh -meta silent %.sh>% silent.sh silent -prev silent.sh -exec - case static,port:$OPTIND:$RANDOM in -exec - ?*:*:*|*::*|*:*:$RANDOM) -exec - ;; -exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null -exec - then if grep '### .*archaic.* ###' >/dev/null -exec - then : silent contains archaic constructs : -exec - else ENV= LC_ALL=C $SHELL -n silent.sh -exec - fi -exec - fi -exec - ;; -exec - esac -exec - case '${mam_cc_SHELLMAGIC}' in -exec - "") case 0 in -exec - 0) cp silent.sh silent -exec - ;; -exec - *) { -exec - i=`(read x; echo $x) < silent.sh` -exec - case $i in -exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;; -exec - esac -exec - cat - silent.sh <<'!' -exec - -exec - ! -exec - } > silent -exec - ;; -exec - esac -exec - ;; -exec - *) cat - silent.sh > silent <<'!' -exec - ${mam_cc_SHELLMAGIC} -exec - -exec - ! -exec - ;; -exec - esac -exec - silent test -w silent -a -x silent || chmod u+w,+x silent -done silent generated -make ${INSTALLROOT}/lib -exec - if silent test ! -d ${INSTALLROOT}/lib -exec - then mkdir -p ${INSTALLROOT}/lib -exec - fi -done ${INSTALLROOT}/lib generated -make ${INSTALLROOT}/lib/libcoshell.a archive -prev ${INSTALLROOT}/lib -prev libcoshell.a archive -exec - test '' = 'libcoshell.a' || ${STDCMP} 2>/dev/null -s libcoshell.a ${INSTALLROOT}/lib/libcoshell.a || { ${STDMV} ${INSTALLROOT}/lib/libcoshell.a ${INSTALLROOT}/lib/libcoshell.a.old 2>/dev/null || true; ${STDCP} libcoshell.a ${INSTALLROOT}/lib/libcoshell.a ;} -exec - (ranlib ${INSTALLROOT}/lib/libcoshell.a) >/dev/null 2>&1 || true -done ${INSTALLROOT}/lib/libcoshell.a generated -make ${INSTALLROOT}/man/man3 -exec - if silent test ! -d ${INSTALLROOT}/man/man3 -exec - then mkdir -p ${INSTALLROOT}/man/man3 -exec - fi -done ${INSTALLROOT}/man/man3 generated -make ${INSTALLROOT}/man/man3/coshell.3 -prev ${INSTALLROOT}/man/man3 -make coshell.3 -done coshell.3 -exec - test '' = 'coshell.3' || ${STDCMP} 2>/dev/null -s coshell.3 ${INSTALLROOT}/man/man3/coshell.3 || { ${STDMV} ${INSTALLROOT}/man/man3/coshell.3 ${INSTALLROOT}/man/man3/coshell.3.old 2>/dev/null || true; ${STDCP} coshell.3 ${INSTALLROOT}/man/man3/coshell.3 ;} -done ${INSTALLROOT}/man/man3/coshell.3 generated -make ${INSTALLROOT}/lib/lib -exec - if silent test ! -d ${INSTALLROOT}/lib/lib -exec - then mkdir -p ${INSTALLROOT}/lib/lib -exec - fi -done ${INSTALLROOT}/lib/lib generated -make ${INSTALLROOT}/lib/lib/coshell -prev ${INSTALLROOT}/lib/lib -prev coshell.req -exec - test '' = 'coshell.req' || ${STDCMP} 2>/dev/null -s coshell.req ${INSTALLROOT}/lib/lib/coshell || { ${STDMV} ${INSTALLROOT}/lib/lib/coshell ${INSTALLROOT}/lib/lib/coshell.old 2>/dev/null || true; ${STDCP} coshell.req ${INSTALLROOT}/lib/lib/coshell ;} -done ${INSTALLROOT}/lib/lib/coshell generated -make ${INSTALLROOT}/bin -exec - if silent test ! -d ${INSTALLROOT}/bin -exec - then mkdir -p ${INSTALLROOT}/bin -exec - fi -done ${INSTALLROOT}/bin generated -make ${INSTALLROOT}/bin/ignore -prev ${INSTALLROOT}/bin -prev ignore -exec - test '' = 'ignore' || ${STDCMP} 2>/dev/null -s ignore ${INSTALLROOT}/bin/ignore || { ${STDMV} ${INSTALLROOT}/bin/ignore ${INSTALLROOT}/bin/ignore.old 2>/dev/null || true; ${STDCP} ignore ${INSTALLROOT}/bin/ignore ;} -done ${INSTALLROOT}/bin/ignore generated -make ${INSTALLROOT}/bin/silent -prev silent -exec - test '' = 'silent' || ${STDCMP} 2>/dev/null -s silent ${INSTALLROOT}/bin/silent || { ${STDMV} ${INSTALLROOT}/bin/silent ${INSTALLROOT}/bin/silent.old 2>/dev/null || true; ${STDCP} silent ${INSTALLROOT}/bin/silent ;} -done ${INSTALLROOT}/bin/silent generated -make ${PACKAGE_ast_INCLUDE} -exec - if silent test ! -d ${PACKAGE_ast_INCLUDE} -exec - then mkdir -p ${PACKAGE_ast_INCLUDE} -exec - fi -done ${PACKAGE_ast_INCLUDE} generated -make ${PACKAGE_ast_INCLUDE}/coshell.h -prev ${PACKAGE_ast_INCLUDE} -prev coshell.h -exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1990,author=gsf' coshell.h > 1.${COTEMP}.x -exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/coshell.h 1.${COTEMP}.x -exec - then rm -f 1.${COTEMP}.x -exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/coshell.h -exec - fi -done ${PACKAGE_ast_INCLUDE}/coshell.h generated -done install virtual -make test -done test dontcare virtual diff --git a/src/lib/libcoshell/RELEASE b/src/lib/libcoshell/RELEASE deleted file mode 100644 index 9d09db232..000000000 --- a/src/lib/libcoshell/RELEASE +++ /dev/null @@ -1,49 +0,0 @@ -12-02-22 coinit.c: handle non-identifier export var names -11-12-13 cowait.c: handle sfpoll() error return on interrupt -11-11-21 cowait.c: poll before blocking read to weed out killed jobs (no 'x' message) -11-08-30 codata.c,coopen.c: drop macro "..." catenation for old cc -10-08-11 coinit.c: force _BLD_DLL for environ intercept -10-06-01 sync with ast api 20100601 -10-05-19 cokill.c: do cowait(co,co,0) to drain pending messages -10-05-15 coshell.h,coopen.c: add CO_ORPHAN for PROC_ORPHAN -10-05-11 coopen.c: add PROC_ORPHAN for CO_SHELL -10-05-10 coopen.c: no atexit() for CO_SHELL -10-04-15 first ksh93u local job pool tests work (service daemon tbd) -10-04-14 cowait.c: add 3rd cowait() arg timeout; 0 Coshell_t* operates on all open coshells -10-04-10 coshell.h: add CO_SHELL for shell using coshell! -09-12-09 coexport.c: add runtime CO_ENV_EXPORT hook that avoids changing environ -08-10-28 coopen.c: close write side of parent msgfd -- doh -08-04-28 coexec.c: check for fd 1,2 equivalence before CO_SERIALIZE 2>&1 -07-10-29 coshell.h,coexec.c: fix procrun()/system() intercept logic -07-08-15 add CO_SEPARATE,CO_MODE_SEPARATE for separate shell+wait per action -07-04-09 Makefile: $(CC.PIC) to allow archive to be pulled into other dlls -06-08-22 coshell.h: procrun => coprocrun, system => cosystem -06-08-09 coshell.h: export CO_ENV_MSGFD for COSHELL=coshell -06-08-02 coexec.c: Cojob_t.flags&CO_SERVICE for service requests -06-08-02 cokill.c: cokill() signal==0 => kill CO_SERVICE jobs -06-07-27 coexec.c: drop server cowait() that bypassed caller -06-06-21 coexec.c: add non-block cowait() to drain responses -06-06-11 fix service intercept cleanup -06-05-24 add service=name:init lightweight service intercepts -05-04-19 cowait.c: beef up invalid message tests and diagnostics -05-04-11 drop fixed CO_MSGFD for $_coshell_msgfd -05-04-07 coexec.c: fix !_lib_fork&&_map_spawnve close-on-exec redirection -04-09-22 cowait.c: remove CO_SERIALIZE temporaries after listing -- duh -04-09-01 co*: add CO_SERIALIZE -04-07-22 system.c: access() => eaccess() -04-02-11 coinit.c: fix CO_CROSS PATH initialization -02-10-30 coclose.c: fix reference-after-free bug in coclose() -02-01-31 codata.c,coopen.c: fix CO_MSGFD parameterization -02-01-24 coopen.c: fix small memory leak -01-10-26 coopen.c: hung sfclose(fp) -> close(sffileno(fp)) -- wow -01-09-11 coinit.c: fix coident[] for ancient bsh that die on `test == 1' - coinit.c: and fix coident[] to weed out buggy ksh88i trap on exit -01-05-31 co*: add CO_CROSS, expose CO_DEVFD -01-04-23 coquote: add state.type to avoid getenv() overwrite on some systems -01-01-01 cokill: killjob => cokilljob, killshell => cokillshell -00-12-18 coinit: CO_OSH ? "${!-$$}" : "${!:-$$}" -00-10-25 codata: $ZSH_VERSION is not ksh -00-02-14 procrun,system: system(3) returns wait() status (not shell status) -99-11-19 co*: add CO_OSH for bsdi lack of times(1) - coexec: CO_IGNORE for all but real ksh -98-06-22 coinit: quote cd path arg diff --git a/src/lib/libcoshell/coclose.c b/src/lib/libcoshell/coclose.c deleted file mode 100644 index 9ca00b583..000000000 --- a/src/lib/libcoshell/coclose.c +++ /dev/null @@ -1,113 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * close a coshell - */ - -#include "colib.h" - -/* - * called when coshell is hung - */ - -static void -hung(int sig) -{ - NoP(sig); - kill(state.current->pid, SIGKILL); -} - -/* - * shut down one coshell - */ - -static int -shut(register Coshell_t* co) -{ - register Coshell_t* cs; - int n; - int status; - Coshell_t* ps; - Coservice_t* sv; - Sig_handler_t handler; - - sfclose(co->msgfp); - close(co->cmdfd); - if (co->pid) - { - if (co->running > 0) - killpg(co->pid, SIGTERM); - state.current = co; - handler = signal(SIGALRM, hung); - n = alarm(3); - if (waitpid(co->pid, &status, 0) != co->pid) - status = -1; - alarm(n); - signal(SIGALRM, handler); - killpg(co->pid, SIGTERM); - } - else - status = 0; - if (co->flags & CO_DEBUG) - errormsg(state.lib, 2, "coshell %d jobs %d user %s sys %s", co->index, co->total, fmtelapsed(co->user, CO_QUANT), fmtelapsed(co->sys, CO_QUANT)); - for (sv = co->service; sv; sv = sv->next) - { - if (sv->fd > 0) - close(sv->fd); - if (sv->pid) - waitpid(sv->pid, &status, 0); - } - cs = state.coshells; - ps = 0; - while (cs) - { - if (cs == co) - { - cs = cs->next; - if (ps) - ps->next = cs; - else - state.coshells = cs; - vmclose(co->vm); - break; - } - ps = cs; - cs = cs->next; - } - return status; -} - -/* - * close coshell co - */ - -int -coclose(register Coshell_t* co) -{ - if (co) - return shut(co); - while (state.coshells) - shut(state.coshells); - return 0; -} diff --git a/src/lib/libcoshell/codata.c b/src/lib/libcoshell/codata.c deleted file mode 100644 index fa6559f39..000000000 --- a/src/lib/libcoshell/codata.c +++ /dev/null @@ -1,169 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2012 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * coshell readonly data - */ - -#include "colib.h" - -char coident[] = "\ -# @(#)$Id: libcoshell (AT&T Research) 2012-02-22 $\n\ -%s=%d\n\ -{ { (eval 'function fun { trap \":\" 0; return 1; }; trap \"exit 0\" 0; fun; exit 1') && PATH= print -u$%s ksh; } || { times && echo bsh >&$%s; } || { echo osh >&$%s; }; } >/dev/null 2>&1\n\ -"; - -char cobinit[] = "\ -if (eval 'f() echo') >/dev/null 2>&1\n\ -then eval 'ignore() {\n\ - case $- in\n\ - *x*) set -\n\ - _coshell_silent=\n\ - ;;\n\ - *) _coshell_silent=1\n\ - ;;\n\ - esac\n\ - _coshell_state=exp\n\ - _coshell_stop=\"<< -- StoP -- >>\"\n\ - _coshell_quote='\\\\\\''\n\ - set \"$@\" \"$_coshell_stop\"\n\ - while :\n\ - do case $1 in\n\ - $_coshell_stop)\n\ - shift\n\ - break\n\ - ;;\n\ - *=*) ;;\n\ - *) _coshell_state=arg ;;\n\ - esac\n\ - case $_coshell_state in\n\ - exp) _coshell_arg=`echo $1 | sed \"s/\\\\([^=]*\\\\)=\\\\(.*\\\\)/\\\\1=$_coshell_quote\\\\2$_coshell_quote/\"`\n\ - set \"\" \"$@\" \"$_coshell_arg\"\n\ - shift\n\ - ;;\n\ - arg) set \"\" \"$@\" \"$_coshell_quote$1$_coshell_quote\"\n\ - shift\n\ - ;;\n\ - esac\n\ - shift\n\ - done\n\ - case $_coshell_silent in\n\ - \"\") set \"set -x;\" \"$@\" ;;\n\ - esac\n\ - eval \"$@\"\n\ - return 0\n\ - }'\n\ - eval 'silent() {\n\ - case $- in\n\ - *x*) set -\n\ - _coshell_silent=\n\ - ;;\n\ - *) _coshell_silent=1\n\ - ;;\n\ - esac\n\ - _coshell_state=exp\n\ - _coshell_stop=\"<< -- StoP -- >>\"\n\ - _coshell_quote='\\\\\\''\n\ - set \"$@\" \"$_coshell_stop\"\n\ - while :\n\ - do case $1 in\n\ - $_coshell_stop)\n\ - shift\n\ - break\n\ - ;;\n\ - *=*) ;;\n\ - *) _coshell_state=arg ;;\n\ - esac\n\ - case $_coshell_state in\n\ - exp) _coshell_arg=`echo $1 | sed \"s/\\\\([^=]*\\\\)=\\\\(.*\\\\)/\\\\1=$_coshell_quote\\\\2$_coshell_quote/\"`\n\ - set \"\" \"$@\" \"$_coshell_arg\"\n\ - shift\n\ - ;;\n\ - arg) set \"\" \"$@\" \"$_coshell_quote$1$_coshell_quote\"\n\ - shift\n\ - ;;\n\ - esac\n\ - shift\n\ - done\n\ - eval \"$@\"\n\ - _coshell_state=$?\n\ - case $_coshell_silent in\n\ - \"\") set -x ;;\n\ - esac\n\ - return $_coshell_state\n\ - }'\n\ -else :\n\ -fi\n\ -"; - -char cokinit[] = "\ -set +o bgnice -o monitor\n\ -(wait $$; exit 0) 2>/dev/null || alias wait=:\n\ -alias ignore='ignore '\n\ -function ignore\n\ -{\n\ - integer argc=0\n\ - typeset argv state=exp\n\ - while :\n\ - do case $# in\n\ - 0) break ;;\n\ - esac\n\ - case $1 in\n\ - *=*) ;;\n\ - *) state=arg ;;\n\ - esac\n\ - case $state in\n\ - exp) argv[argc]=${1%%=*}=\"'${1#*=}'\" ;;\n\ - arg) argv[argc]=\"'\"$1\"'\" ;;\n\ - esac\n\ - ((argc=argc+1))\n\ - shift\n\ - done\n\ - eval \"${argv[@]}\"\n\ - return 0\n\ -}\n\ -alias silent='set +x X$- \"$@\";_coshell_flags_=$1;shift;silent '\n\ -function silent\n\ -{\n\ - case $_coshell_flags_ in\n\ - *x*) trap ' _coshell_status_=$?\n\ - if ((_coshell_status_==0))\n\ - then set -x\n\ - else set -x;(set +x;exit $_coshell_status_)\n\ - fi' 0\n\ - ;;\n\ - esac\n\ - \"$@\"\n\ -}\n\ -typeset -xf ignore silent\n\ -"; - -char* co_export[] = /* default export var list */ -{ - CO_ENV_EXPORT, /* first */ - CO_ENV_ATTRIBUTES, - CO_ENV_PROC, - "FPATH", - "VPATH", - 0 /* last */ -}; diff --git a/src/lib/libcoshell/coexec.c b/src/lib/libcoshell/coexec.c deleted file mode 100644 index 637c65099..000000000 --- a/src/lib/libcoshell/coexec.c +++ /dev/null @@ -1,449 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * send an action to the coshell for execution - */ - -#include "colib.h" - -#include -#include - -static Cojob_t* -service(register Coshell_t* co, Coservice_t* cs, Cojob_t* cj, int flags, Sfio_t* sp) -{ - Proc_t* proc; - size_t n; - int i; - int j; - int fds[2]; - long ops[4]; - char* s; - char** a; - - if (flags & CO_DEBUG) - { - for (a = cs->argv; *a; a++) - sfprintf(sp, " %s", *a); - if (!(s = costash(sp))) - goto nospace; - errormsg(state.lib, ERROR_LIBRARY|2, "service %s:%s", cs->path, s); - } - if (pipe(fds) < 0) - { - errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "%s: cannot allocate service pipe", cs->name); - return 0; - } - if (co->flags & CO_SHELL) - for (i = 0; i < elementsof(fds); i++) - if (fds[i] < 10 && (j = fcntl(fds[i], F_DUPFD, 10)) >= 0) - { - close(fds[i]); - fds[i] = j; - } - cs->fd = fds[1]; - ops[0] = PROC_FD_DUP(fds[0], 0, PROC_FD_PARENT); - ops[1] = PROC_FD_CLOSE(fds[1], PROC_FD_CHILD); - ops[2] = PROC_FD_DUP(co->gsmfd, 1, 0); - ops[3] = 0; - if (!(proc = procopen(cs->path, cs->argv, NiL, ops, PROC_DAEMON|PROC_IGNORE))) - { - errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "%s: cannot connect to %s service", cs->path, cs->name); - close(fds[0]); - close(fds[1]); - return 0; - } - fcntl(cs->fd, F_SETFD, FD_CLOEXEC); - cs->pid = proc->pid; - procfree(proc); - sfprintf(sp, "id=%d info\n", cj->id); - n = sfstrtell(sp); - if (!(s = costash(sp))) - goto bad; - if (write(cs->fd, s, n) != n || sfpoll(&co->msgfp, 1, 5 * 1000) <= 0) - goto bad; - cj->pid = 0; - cj->status = 0; - cj->local = 0; - cj->service = cs; - co->svc_outstanding++; - co->svc_running++; - if (!cowait(co, cj, -1)) - goto bad; - return cj; - bad: - errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "%s: service not responding", cs->name); - nospace: - cj->pid = CO_PID_FREE; - cs->pid = 0; - close(cs->fd); - cs->fd = -1; - return 0; -} - -static Cojob_t* -request(register Coshell_t* co, Cojob_t* cj, Coservice_t* cs, const char* action, int flags) -{ - ssize_t n; - ssize_t i; - Sfio_t* sp; - - if (!(sp = sfstropen())) - { - errormsg(state.lib, ERROR_LIBRARY|2, "out of space"); - return 0; - } - if (!cs->fd && !service(co, cs, cj, flags, sp)) - goto bad; - if (!cs->pid) - goto bad; - if (flags & CO_DEBUG) - errormsg(state.lib, ERROR_LIBRARY|2, "job %d commands:\n\n%s %s\n", cj->id, cs->name, action); - if (!(flags & CO_SILENT)) - sfprintf(sfstderr, "+ %s %s\n", cs->name, action); - sfprintf(sp, "id=%d %s\n", cj->id, action); - n = sfstrtell(sp); - action = sfstrbase(sp); - while ((i = write(cs->fd, action, n)) > 0 && (n -= i) > 0) - action += i; - sfstrclose(sp); - if (n) - goto bad; - sfclose(sp); - cj->pid = 0; - cj->status = 0; - cj->local = 0; - cj->service = cs; - co->svc_outstanding++; - co->svc_running++; - co->total++; - return cj; - bad: - cj->pid = CO_PID_FREE; - sfclose(sp); - return 0; -} - -Cojob_t* -coexec(register Coshell_t* co, const char* action, int flags, const char* out, const char* err, const char* att) -{ - register Cojob_t* cj; - register Sfio_t* sp; - register Coservice_t* cs; - int n; - int i; - int og; - int cg; - char* s; - char* t; - char* env; - char* red; - char* sh[4]; - struct stat sto; - struct stat ste; - - /* - * get a free job slot - */ - - for (cj = co->jobs; cj; cj = cj->next) - if (cj->pid == CO_PID_FREE) - break; - if (cj) - cj->service = 0; - else if (!(cj = vmnewof(co->vm, 0, Cojob_t, 1, 0))) - return 0; - else - { - cj->coshell = co; - cj->pid = CO_PID_FREE; - cj->id = ++co->slots; - cj->next = co->jobs; - co->jobs = cj; - } - - /* - * set the flags - */ - - flags &= ~co->mask; - flags |= co->flags; - cj->flags = flags; - - /* - * check service intercepts - */ - - for (cs = co->service; cs; cs = cs->next) - { - for (s = cs->name, t = (char*)action; *s && *s == *t; s++, t++); - if (!*s && *t == ' ') - return request(co, cj, cs, t + 1, flags); - } - cj->flags &= ~CO_SERVICE; - red = (cj->flags & CO_APPEND) ? ">>" : ">"; - - /* - * package the action - */ - - if (!(env = coinitialize(co, co->flags))) - return 0; - if (!(sp = sfstropen())) - return 0; - n = strlen(action); - if (co->flags & CO_SERVER) - { - /* - * leave it to server - */ - - sfprintf(sp, "#%05d\ne %d %d %s %s %s", - 0, - cj->id, - cj->flags, - state.pwd, - out, - err); - if (att) - sfprintf(sp, " (%d:%s)", strlen(att), att); - else - sfprintf(sp, " %s", att); - sfprintf(sp, " (%d:%s) (%d:%s)\n", strlen(env), env, n, action); - } - else if (co->flags & CO_INIT) - { - if (flags & CO_DEBUG) - sfprintf(sp, "set -x\n"); - sfprintf(sp, "%s%s\necho x %d $? >&$%s\n", - env, - action, - cj->id, - CO_ENV_MSGFD); - } - else if (flags & CO_KSH) - { -#if !_lib_fork && defined(_map_spawnve) - Sfio_t* tp; - - tp = sp; - if (!(sp = sfstropen())) - sp = tp; -#endif - sfprintf(sp, "{\ntrap 'set %s$?; trap \"\" 0; IFS=\"\n\"; print -u$%s x %d $1 $(times); exit $1' 0 HUP INT QUIT TERM%s\n%s%s%s", - (flags & CO_SILENT) ? "" : "+x ", - CO_ENV_MSGFD, - cj->id, - (flags & CO_IGNORE) ? "" : " ERR", - env, - n > CO_MAXEVAL ? "" : "eval '", - (flags & CO_SILENT) ? "" : "set -x\n"); - if (n > CO_MAXEVAL) - sfputr(sp, action, -1); - else - { - coquote(sp, action, 0); - sfprintf(sp, "\n'"); - } - sfprintf(sp, "\n} out = pathtemp(NiL, 64, NiL, "coo", NiL))) - sfprintf(sp, " >%s", cj->out); - if (err) - { - if (out && streq(out, err)) - sfprintf(sp, " 2>&1"); - else if (*err == '/') - sfprintf(sp, " 2%s%s", red, err); - else - sfprintf(sp, " 2%s%s/%s", red, state.pwd, err); - } - else if (flags & CO_SERIALIZE) - { - if (!out && !fstat(1, &sto) && !fstat(2, &ste) && sto.st_dev == ste.st_dev && sto.st_ino == ste.st_ino) - sfprintf(sp, " 2>&1"); - else if (cj->err = pathtemp(NiL, 64, NiL, "coe", NiL)) - sfprintf(sp, " 2>%s", cj->err); - } -#if !_lib_fork && defined(_map_spawnve) - if (sp != tp) - { - sfprintf(tp, "%s -c '", state.sh); - if (!(s = costash(sp))) - return 0; - coquote(tp, s, 0); - sfprintf(tp, "'"); - sfstrclose(sp); - sp = tp; - } -#endif - sfprintf(sp, " &\nprint -u$%s j %d $!\n", - CO_ENV_MSGFD, - cj->id); - } - else - { -#if !_lib_fork && defined(_map_spawnve) - Sfio_t* tp; - - tp = sp; - if (!(sp = sfstropen())) sp = tp; -#endif - flags |= CO_IGNORE; - if (co->mode & CO_MODE_SEPARATE) - { - flags &= ~CO_SERIALIZE; - og = '{'; - cg = '}'; - } - else - { - og = '('; - cg = ')'; - } - sfprintf(sp, "%c\n%s%sset -%s%s\n", - og, - env, - n > CO_MAXEVAL ? "" : "eval '", - (flags & CO_IGNORE) ? "" : "e", - (flags & CO_SILENT) ? "" : "x"); - if (n > CO_MAXEVAL) - sfprintf(sp, "%s", action); - else - { - coquote(sp, action, 0); - sfprintf(sp, "\n'"); - } - sfprintf(sp, "\n%c out = pathtemp(NiL, 64, NiL, "coo", NiL))) - sfprintf(sp, " >%s", cj->out); - if (err) - { - if (out && streq(out, err)) - sfprintf(sp, " 2>&1"); - else if (*err == '/') - sfprintf(sp, " 2%s%s", red, err); - else - sfprintf(sp, " 2%s%s/%s", red, state.pwd, err); - } - else if (flags & CO_SERIALIZE) - { - if (out) - sfprintf(sp, " 2>&1"); - else if (cj->err = pathtemp(NiL, 64, NiL, "coe", NiL)) - sfprintf(sp, " 2>%s", cj->err); - } - if (!(co->mode & CO_MODE_SEPARATE)) - { - if (flags & CO_OSH) - sfprintf(sp, " && echo x %d 0 >&$%s || echo x %d $? >&$%s", - cj->id, - CO_ENV_MSGFD, - cj->id, - CO_ENV_MSGFD); - else - sfprintf(sp, " && echo x %d 0 `times` >&$%s || echo x %d $? `times` >&$%s", - cj->id, - CO_ENV_MSGFD, - cj->id, - CO_ENV_MSGFD); - } -#if !_lib_fork && defined(_map_spawnve) - if (sp != tp) - { - sfprintf(tp, "%s -c '", state.sh); - if (!(s = costash(sp))) - return 0; - coquote(tp, s, 0); - sfprintf(tp, "'"); - sfstrclose(sp); - sp = tp; - } -#endif - if (!(co->mode & CO_MODE_SEPARATE)) - sfprintf(sp, " &\necho j %d $! >&$%s\n", - cj->id, - CO_ENV_MSGFD); - } - n = sfstrtell(sp); - if (!costash(sp)) - return 0; - if (flags & CO_SERVER) - sfprintf(sp, "#%05d\n", n - 7); - s = sfstrseek(sp, 0, SEEK_SET); - if (flags & CO_DEBUG) - errormsg(state.lib, ERROR_LIBRARY|2, "job %d commands:\n\n%s\n", cj->id, s); - if (co->mode & CO_MODE_SEPARATE) - { - sh[0] = state.sh; - sh[1] = "-c"; - sh[2] = s; - sh[3] = 0; - cj->status = procrun(state.sh, sh, 0); - sfstrclose(sp); - cj->pid = CO_PID_ZOMBIE; - cj->local = 0; - co->outstanding++; - co->total++; - } - else - { - /* - * send it off - */ - - while ((i = write(co->cmdfd, s, n)) > 0 && (n -= i) > 0) - s += i; - sfstrclose(sp); - if (n) - return 0; - - /* - * it's a job - */ - - cj->pid = 0; - cj->status = 0; - cj->local = 0; - co->outstanding++; - co->running++; - co->total++; - if (co->mode & CO_MODE_ACK) - cj = cowait(co, cj, -1); - } - return cj; -} diff --git a/src/lib/libcoshell/coexport.c b/src/lib/libcoshell/coexport.c deleted file mode 100644 index 4ba62a630..000000000 --- a/src/lib/libcoshell/coexport.c +++ /dev/null @@ -1,80 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * at&t Research - * - * coshell export var set/unset - */ - -#include "colib.h" - -/* - * set or unset coshell export variable - */ - -int -coexport(Coshell_t* co, const char* name, const char* value) -{ - Coexport_t* ex; - char* v; - - if (!co->export) - { - if (!(co->exdisc = vmnewof(co->vm, 0, Dtdisc_t, 1, 0))) - return -1; - co->exdisc->link = offsetof(Coexport_t, link); - co->exdisc->key = offsetof(Coexport_t, name); - co->exdisc->size = 0; - if (!(co->export = dtnew(co->vm, co->exdisc, Dtset))) - { - vmfree(co->vm, co->exdisc); - return -1; - } - } - if (!(ex = (Coexport_t*)dtmatch(co->export, name))) - { - if (!value) - return 0; - if (!(ex = vmnewof(co->vm, 0, Coexport_t, 1, strlen(name)))) - return -1; - strcpy(ex->name, name); - dtinsert(co->export, ex); - } - if (ex->value) - { - vmfree(co->vm, ex->value); - ex->value = 0; - } - if (value) - { - if (!(v = vmstrdup(co->vm, value))) - return -1; - ex->value = v; - } - else - { - dtdelete(co->export, ex); - vmfree(co->vm, ex); - } - co->init.sync = 1; - return 0; -} diff --git a/src/lib/libcoshell/coinit.c b/src/lib/libcoshell/coinit.c deleted file mode 100644 index fc6fe8443..000000000 --- a/src/lib/libcoshell/coinit.c +++ /dev/null @@ -1,396 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2012 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * return job initialization commands - */ - -#if _WIN32 -#undef _BLD_DLL -#define _BLD_DLL 1 -#endif - -#include "colib.h" - -#include -#include - -static void -exid(Sfio_t* sp, const char* pre, const char* name, const char* pos) -{ - int c; - - sfputr(sp, pre, -1); - if ((c = *name++) && c != '=') - { - if (isdigit(c)) - sfputc(sp, '_'); - do - { - if (!isalnum(c)) - c = '_'; - sfputc(sp, c); - } while ((c = *name++) && c != '='); - } - else - sfputc(sp, '_'); - sfputr(sp, pos, -1); -} - -/* - * add n to the export list - * old!=0 formats in old style - * coex!=0 for CO_ENV_EXPORT - * if n prefixed by % then coquote conversion enabled - */ - -static void -putexport(Coshell_t* co, Sfio_t* sp, char* n, int old, int coex, int flags) -{ - int cvt; - char* v; - Coexport_t* ex; - - if (cvt = *n == '%') - n++; - - /* - * currently limited to valid identifier env var names - */ - - if (!co->export || !dtmatch(co->export, n)) - { - if (old) - cvt = 0; - if ((v = getenv(n)) && *v || coex && ((flags & CO_EXPORT) || co->export && dtsize(co->export) > 0)) - { - if (!old) - sfprintf(sp, "\\\n"); - exid(sp, " ", n, "='"); - if (coex && (flags & CO_EXPORT)) - v = "(*)"; - if (v) - coquote(sp, v, cvt); - if (coex && !(flags & CO_EXPORT)) - { - v = v ? ":" : ""; - for (ex = (Coexport_t*)dtfirst(co->export); ex; ex = (Coexport_t*)dtnext(co->export, ex)) - { - sfprintf(sp, "%s%s", v, ex->name); - exid(sp, v, ex->name, ""); - v = ":"; - } - } - sfputc(sp, '\''); - if (old) - exid(sp, "\nexport ", n, "\n"); - } - } -} - -/* - * return job initialization commands - */ - -char* -coinitialize(Coshell_t* co, int flags) -{ - register char* s; - int n; - int m; - int old; - int sync; - char* t; - long p; - Coexport_t* ex; - Sfio_t* sp; - Sfio_t* tp; - struct stat st; - - sync = co->init.sync; - co->init.sync = 0; - - /* - * pwd - */ - - if (stat(".", &st)) - return 0; - if (!state.pwd || st.st_ino != co->init.pwd_ino || st.st_dev != co->init.pwd_dev) - { - co->init.pwd_dev = st.st_dev; - co->init.pwd_ino = st.st_ino; - if (state.pwd) - free(state.pwd); - if (!(state.pwd = getcwd(NiL, 0))) - { - if (errno != EINVAL || !(state.pwd = newof(0, char, PATH_MAX, 0))) - return 0; - if (!getcwd(state.pwd, PATH_MAX)) - { - free(state.pwd); - state.pwd = 0; - return 0; - } - } - if (!(flags & CO_INIT)) - sync = 1; - } - - /* - * umask - */ - - umask(n = umask(co->init.mask)); - if (co->init.mask != n) - { - co->init.mask = n; - if (!(flags & CO_INIT)) - sync = 1; - } - if (!co->init.script || sync) - { - /* - * co_export[] vars - */ - - if (!(sp = sfstropen())) - return 0; - tp = 0; - old = !(flags & (CO_KSH|CO_SERVER)); - if (!old) - sfprintf(sp, "export"); - if (sync) - { - if (flags & CO_EXPORT) - s = "(*)"; - else - { - for (n = 0; s = co_export[n]; n++) - putexport(co, sp, s, old, !n, flags); - s = getenv(co_export[0]); - } - if (s) - { - if (*s == '(') - { - register char** ep = environ; - register char* e; - char* v; - char* es; - char* xs; - - if (v = strchr(s, ':')) - *v = 0; - while (e = *ep++) - if ((t = strsubmatch(e, s, 1)) && (*t == '=' || !*t && (t = strchr(e, '=')))) - { - m = (int)(t - e); - if (!strneq(e, "PATH=", 5) && !strneq(e, "_=", 2)) - { - for (n = 0; xs = co_export[n]; n++) - { - es = e; - while (*xs && *es == *xs) - { - es++; - xs++; - } - if (*es == '=' && !*xs) - break; - } - if (!xs) - { - if (!old) - sfprintf(sp, "\\\n"); - exid(sp, " ", e, "='"); - coquote(sp, e + m + 1, 0); - sfputc(sp, '\''); - if (old) - exid(sp, "\nexport ", e, "\n"); - } - } - } - if (v) - { - *v++ = ':'; - s = v; - } - } - if (*s) - for (;;) - { - if (t = strchr(s, ':')) - *t = 0; - putexport(co, sp, s, old, 0, 0); - if (!(s = t)) - break; - *s++ = ':'; - } - } - if (co->export) - for (ex = (Coexport_t*)dtfirst(co->export); ex; ex = (Coexport_t*)dtnext(co->export, ex)) - { - if (!old) - sfprintf(sp, "\\\n"); - exid(sp, " ", ex->name, "='"); - coquote(sp, ex->value, 0); - sfputc(sp, '\''); - if (old) - exid(sp, "\nexport ", ex->name, "\n"); - } - } - - /* - * PATH - */ - - if (!old) - sfprintf(sp, "\\\n"); - sfprintf(sp, " PATH='"); - n = PATH_MAX; - if (!(t = sfstrrsrv(sp, n))) - { - bad: - sfstrclose(sp); - if (tp) - sfstrclose(tp); - return 0; - } - t += n / 2; - if (!(flags & CO_CROSS) && !pathpath("ignore", NiL, PATH_ABSOLUTE|PATH_REGULAR|PATH_EXECUTE, t, n / 2) && pathpath("bin/ignore", "", PATH_ABSOLUTE|PATH_REGULAR|PATH_EXECUTE, t, n / 2)) - { - *strrchr(t, '/') = 0; - sfputc(sp, ':'); - coquote(sp, t, !old); - sfputc(sp, ':'); - s = pathbin(); - } - else - { - s = pathbin(); - if (!(flags & CO_CROSS)) - { - if (!sync && (*s == ':' || *s == '.' && *(s + 1) == ':')) - { - sfstrseek(sp, 0, SEEK_SET); - goto done; - } - sfputc(sp, ':'); - } - } - for (;;) - { - if (*s == ':') - s++; - else if (*s == '.' && *(s + 1) == ':') - s += 2; - else - break; - } - if (!(flags & CO_CROSS)) - tp = 0; - else if (!(tp = sfstropen())) - goto bad; - else - { - while (n = *s++) - { - if (n == ':') - { - while (*s == ':') - s++; - if (!*s) - break; - if (*s == '.') - { - if (!*(s + 1)) - break; - if (*(s + 1) == ':') - { - s++; - continue; - } - } - } - sfputc(tp, n); - } - if (!(s = costash(tp))) - goto bad; - } - coquote(sp, s, !old); - if (tp) - sfstrclose(tp); - sfputc(sp, '\''); - if (old) - sfprintf(sp, "\nexport PATH"); - sfputc(sp, '\n'); - done: - if (!(flags & CO_SERVER)) - { - sfprintf(sp, "%s%s=%05d${!%s-$$}\n", old ? "" : "export ", CO_ENV_TEMP, getpid(), (flags & CO_OSH) ? "" : ":"); - if (old) - sfprintf(sp, "export %s\n", CO_ENV_TEMP); - } - sfputc(sp, 0); - n = (int)sfstrtell(sp); - if (co->vm) - { - if (co->init.script) - vmfree(co->vm, co->init.script); - if (!(co->init.script = vmnewof(co->vm, 0, char, n, 1))) - goto bad; - } - else - { - if (co->init.script) - free(co->init.script); - if (!(co->init.script = newof(0, char, n, 1))) - goto bad; - } - memcpy(co->init.script, sfstrbase(sp), n); - sfstrclose(sp); - } - else if (!co->init.script) - { - if (co->init.script = co->vm ? vmnewof(co->vm, 0, char, 1, 0) : newof(0, char, 1, 0)) - *co->init.script = 0; - } - return co->init.script; -} - -/* - * return generic job initialization commands - */ - -char* -coinit(int flags) -{ - if (!state.generic) - { - if (!(state.generic = newof(0, Coshell_t, 1, 0))) - return 0; - state.generic->init.sync = 1; - } - return coinitialize(state.generic, flags); -} diff --git a/src/lib/libcoshell/cokill.c b/src/lib/libcoshell/cokill.c deleted file mode 100644 index b0c4fd416..000000000 --- a/src/lib/libcoshell/cokill.c +++ /dev/null @@ -1,134 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * if co==0 then kill all coshell jobs with sig - * elif cj==0 then kill co jobs with sig - * else kill cj with sig - * - * if sig==0 then cause all CO_SERVICE jobs to fail - */ - -#include "colib.h" - -/* - * kill job cj in shell co with signal sig - */ - -static int -cokilljob(register Coshell_t* co, register Cojob_t* cj, int sig) -{ - int n; - - if (co->flags & CO_DEBUG) - errormsg(state.lib, 2, "coshell %d kill co=%d cj=%d sig=%d", co->index, co->pid, cj->pid, sig); - if (cj->pid < 0) - return 0; - if (cj->pid == 0) - { - if (cj->service) - co->svc_running--; - else - co->running--; - cj->pid = CO_PID_ZOMBIE; - cj->status = EXIT_TERM(sig); - return 0; - } - if (sig == SIGKILL) - { - co->running--; - cj->pid = CO_PID_ZOMBIE; - cj->status = EXIT_TERM(sig); - } - n = kill(cj->pid, sig); - killpg(cj->pid, sig); - return n; -} - -/* - * kill cj (or all jobs if cj==0) in shell co with sig - */ - -static int -cokillshell(register Coshell_t* co, register Cojob_t* cj, int sig) -{ - int n; - - if (sig && (co->flags & CO_SERVER)) - { - char buf[CO_BUFSIZ]; - - n = sfsprintf(buf, sizeof(buf), "#%05d\nk %d %d\n", 0, cj ? cj->id : 0, sig); - sfsprintf(buf, 7, "#%05d\n", n - 7); - return write(co->cmdfd, buf, n) == n ? 0 : -1; - } - if (cj) - return cokilljob(co, cj, sig); - n = 0; - for (cj = co->jobs; cj; cj = cj->next) - if (cj->pid > 0) - n |= cokilljob(co, cj, sig); - return n; -} - -int -cokill(register Coshell_t* co, register Cojob_t* cj, int sig) -{ - int any; - int n; - - if (cj) - { - if (!co) - co = cj->coshell; - else if (co != cj->coshell) - return -1; - any = 0; - } - else if (co) - any = 0; - else if (!(co = state.coshells)) - return -1; - else - any = 1; - if (co->flags & CO_DEBUG) - errormsg(state.lib, 2, "coshell %d kill co=%d cj=%d sig=%d", co->index, co ? co->pid : 0, cj ? cj->pid : 0, sig); - switch (sig) - { - case SIGINT: - sig = SIGTERM; - break; -#if defined(SIGSTOP) && defined(SIGTSTP) - case SIGTSTP: - sig = SIGSTOP; - break; -#endif - } - n = 0; - do - { - cowait(co, (Cojob_t*)co, 0); - n |= cokillshell(co, cj, sig); - } while (any && (co = co->next)); - return n; -} diff --git a/src/lib/libcoshell/colib.h b/src/lib/libcoshell/colib.h deleted file mode 100644 index e4512b5fd..000000000 --- a/src/lib/libcoshell/colib.h +++ /dev/null @@ -1,137 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * coshell library private definitions - */ - -#ifndef _COLIB_H -#define _COLIB_H - -#include -#include -#include - -#define _CO_JOB_PRIVATE_ /* Cojob_t private additions */ \ - Cojob_t* next; /* next in list */ \ - Coservice_t* service; /* service */ \ - int pid; /* pid */ \ - char* out; /* serialized stdout file */ \ - char* err; /* serialized stderr file */ \ - /* end of private additions */ - -#define _CO_SHELL_PRIVATE_ /* Coshell_t private additions */ \ - Vmalloc_t* vm; /* Coshell_t vm */ \ - Coshell_t* next; /* next in list */ \ - Cojob_t* jobs; /* job list */ \ - Coservice_t* service; /* service */ \ - Dt_t* export; /* coexport() dictionary */ \ - Dtdisc_t* exdisc; /* coexport() discipline */ \ - struct Coinit_s /* initialization script state */ \ - { \ - char* script; /* initialization script */ \ - dev_t pwd_dev; /* previous pwd dev */ \ - ino_t pwd_ino; /* previous pwd inode number */ \ - int mask; /* previous umask */ \ - int sync; /* sync script */ \ - } init; \ - int cmdfd; /* command pipe fd */ \ - int gsmfd; /* msgfp child write side */ \ - int mask; /* CO_* flags to clear */ \ - int mode; /* connection modes */ \ - int svc_outstanding;/* outstanding service intercepts */ \ - int svc_running; /* running service intercepts */ \ - int pid; /* pid */ \ - int index; /* coshell index */ \ - int slots; /* number of job slots */ \ - /* end of private additions */ - -typedef struct Coexport_s -{ - Dtlink_t link; - char* value; - char name[1]; -} Coexport_t; - -struct Coservice_s; -typedef struct Coservice_s Coservice_t; - -struct Coservice_s /* service info */ -{ - Coservice_t* next; /* next in list */ - char* name; /* instance name */ - char* path; /* coexec() command path */ - char* db; /* state/db path */ - int fd; /* command pipe */ - int pid; /* pid */ - char* argv[16]; /* coexec() command argv[] */ -}; - -#include -#include -#include -#include - -#define state _coshell_info_ /* hide external symbol */ - -#define CO_MODE_ACK (1<<0) /* wait for coexec() ack */ -#define CO_MODE_INDIRECT (1<<1) /* indirect CO_SERVER */ -#define CO_MODE_SEPARATE (1<<2) /* 1 shell+wait per action */ - -#define CO_INIT (CO_USER>>1) /* initial command */ - -#define CO_PID_FREE (-3) /* free job slot */ -#define CO_PID_WARPED (-2) /* exit before start message */ -#define CO_PID_ZOMBIE (-1) /* ready for wait */ - -#define CO_BUFSIZ (PATH_MAX/2) /* temporary buffer size */ -#define CO_MAXEVAL (PATH_MAX*8) /* max eval'd action size */ - -typedef struct Costate_s /* global coshell state */ -{ - const char* lib; /* library id */ - Coshell_t* coshells; /* list of all coshells */ - Coshell_t* current; /* current coshell */ - Coshell_t* generic; /* generic coshell for coinit() */ - char* pwd; /* pwd */ - char* sh; /* sh from first coopen() */ - char* type; /* CO_ENV_TYPE value */ - int init; /* 0 if first coopen() */ - int index; /* last coshell index */ -} Costate_t; - -extern char coident[]; /* coshell ident script */ -extern char cobinit[]; /* bsh initialition script */ -extern char cokinit[]; /* ksh initialition script */ -extern char* co_export[]; /* default export var list */ - -extern Costate_t state; /* global coshell info */ - -#ifndef errno -extern int errno; -#endif - -extern char* costash(Sfio_t*); -extern char* coinitialize(Coshell_t*, int); - -#endif diff --git a/src/lib/libcoshell/coopen.c b/src/lib/libcoshell/coopen.c deleted file mode 100644 index 07dcb8790..000000000 --- a/src/lib/libcoshell/coopen.c +++ /dev/null @@ -1,411 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * open a new coshell - */ - -#include "colib.h" - -#include -#include -#include -#include - -static const Namval_t options[] = -{ - "cross", CO_CROSS, - "debug", CO_DEBUG, - "devfd", CO_DEVFD, - "ignore", CO_IGNORE, - "orphan", CO_ORPHAN, - "silent", CO_SILENT, - "separate", CO_SEPARATE, - "service", CO_SERVICE, - 0, 0 -}; - -Costate_t state = { "libcoshell:coshell" }; - -/* - * called when ident sequence hung - */ - -static void -hung(int sig) -{ - NoP(sig); - close(sffileno(state.current->msgfp)); -} - -/* - * close all open coshells - */ - -static void -clean(void) -{ - coclose(NiL); -} - -#ifdef SIGCONT - -/* - * pass job control signals to the coshell and self - */ - -static void -stop(int sig) -{ - cokill(NiL, NiL, sig); - signal(sig, SIG_DFL); - sigunblock(sig); - kill(getpid(), sig); - cokill(NiL, NiL, SIGCONT); - signal(sig, stop); -} - -#endif - -/* - * called by stropt() to set options - */ - -static int -setopt(void* handle, register const void* p, int n, const char* v) -{ - Coshell_t* co = (Coshell_t*)handle; - Coservice_t* cs; - char* s; - char** a; - - NoP(v); - if (p) - { - if (n) - { - co->flags |= ((Namval_t*)p)->value; - if (((Namval_t*)p)->value == CO_SERVICE && v && (cs = vmnewof(co->vm, 0, Coservice_t, 1, 2 * strlen(v)))) - { - a = cs->argv; - *a++ = s = cs->path = cs->name = (char*)(cs + 1); - while (*s = *v++) - if (*s++ == ':') - { - *(s - 1) = 0; - if (*v == '-') - { - v++; - if (*v == '-') - v++; - } - if (strneq(v, "command=", 8)) - cs->path = s + 8; - else if (strneq(v, "state=", 6)) - cs->db = s + 6; - else if (strneq(v, "db=", 3)) - cs->db = s + 3; - else if (a < &cs->argv[elementsof(cs->argv)-2] && *v && *v != ':') - { - *a++ = s; - *s++ = '-'; - *s++ = '-'; - } - } - if (cs->db) - *a++ = cs->db; - *a = 0; - cs->next = co->service; - co->service = cs; - } - } - else - co->mask |= ((Namval_t*)p)->value; - } - return 0; -} - -Coshell_t* -coopen(const char* path, int flags, const char* attributes) -{ - register Coshell_t* co; - register char* s; - register int i; - char* t; - int n; - Proc_t* proc; - Cojob_t* cj; - Vmalloc_t* vm; - Sfio_t* sp; - Sig_handler_t handler; - int pio[4]; - long ops[5]; - char devfd[16]; - char evbuf[sizeof(CO_ENV_MSGFD) + 8]; - char* av[8]; - char* ev[2]; - - static char* sh[] = { 0, 0, "ksh", "sh", "/bin/sh" }; - - if (!state.type && (!(s = getenv(CO_ENV_TYPE)) || !(state.type = strdup(s)))) - state.type = ""; - if ((flags & CO_ANY) && (co = state.coshells)) - return co; - if (!(vm = vmopen(Vmdcheap, Vmbest, 0)) || !(co = vmnewof(vm, 0, Coshell_t, 1, 0))) - { - if (vm) - vmclose(vm); - errormsg(state.lib, ERROR_LIBRARY|2, "out of space"); - return 0; - } - co->vm = vm; - co->index = ++state.index; - stropt(getenv(CO_ENV_OPTIONS), options, sizeof(*options), setopt, co); - if (attributes) - stropt(attributes, options, sizeof(*options), setopt, co); - co->flags |= ((flags | CO_DEVFD) & ~co->mask); - if (co->flags & CO_SEPARATE) - { - co->flags &= ~CO_SEPARATE; - co->mode |= CO_MODE_SEPARATE; - } - co->flags |= CO_INIT; - if (co->mode & CO_MODE_SEPARATE) - { - flags = 0; - proc = 0; - } - else - { - for (i = 0; i < elementsof(pio); i++) - pio[i] = -1; - if (pipe(&pio[0]) < 0 || pipe(&pio[2]) < 0) - { - errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "cannot allocate pipes"); - goto bad; - } - if (flags & CO_SHELL) - for (i = 0; i < elementsof(pio); i++) - if (pio[i] < 10 && (n = fcntl(pio[i], F_DUPFD, 10)) >= 0) - { - close(pio[i]); - pio[i] = n; - } - co->cmdfd = pio[1]; - co->gsmfd = pio[3]; - if (!(co->msgfp = sfnew(NiL, NiL, 256, pio[2], SF_READ))) - { - errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "cannot allocate message stream"); - goto bad; - } - sfdcslow(co->msgfp); - ops[0] = PROC_FD_DUP(pio[0], 0, PROC_FD_PARENT); - ops[1] = PROC_FD_CLOSE(pio[1], PROC_FD_CHILD); - ops[2] = PROC_FD_CLOSE(pio[2], PROC_FD_CHILD); - ops[3] = PROC_FD_CLOSE(pio[3], PROC_FD_PARENT); - ops[4] = 0; - sfsprintf(devfd, sizeof(devfd), "/dev/fd/%d", pio[0]); - flags = !access(devfd, F_OK); - } - sh[0] = (char*)path; - sh[1] = getenv(CO_ENV_SHELL); - for (i = 0; i < elementsof(sh); i++) - if ((s = sh[i]) && *s && (s = strdup(s))) - { - if ((n = tokscan(s, NiL, " %v ", av, elementsof(av) - 1)) > 0) - { - if (t = strrchr(s = av[0], '/')) - av[0] = t + 1; - if (flags || (co->flags & CO_DEVFD) && strmatch(s, "*ksh*")) - av[n++] = devfd; - av[n] = 0; - sfsprintf(evbuf, sizeof(evbuf), "%s=%d", CO_ENV_MSGFD, co->gsmfd); - ev[0] = evbuf; - ev[1] = 0; - if ((co->mode & CO_MODE_SEPARATE) || (proc = procopen(s, av, ev, ops, (co->flags & (CO_SHELL|CO_ORPHAN)) ? (PROC_ORPHAN|PROC_DAEMON|PROC_IGNORE) : (PROC_DAEMON|PROC_IGNORE)))) - { - if (!state.sh) - state.sh = strdup(s); - free(s); - if (proc) - { - co->pid = proc->pid; - procfree(proc); - } - break; - } - } - free(s); - } - if (i >= elementsof(sh)) - { - errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "cannot execute"); - goto bad; - } - if (!(co->mode & CO_MODE_SEPARATE)) - { - /* - * send the shell identification sequence - */ - - if (!(sp = sfstropen())) - { - errormsg(state.lib, ERROR_LIBRARY|2, "out of buffer space"); - goto bad; - } - sfprintf(sp, "#%05d\n%s='", 0, CO_ENV_ATTRIBUTES); - if (t = getenv(CO_ENV_ATTRIBUTES)) - { - coquote(sp, t, 0); - if (attributes) - sfprintf(sp, ","); - } - if (attributes) - coquote(sp, attributes, 0); - sfprintf(sp, "'\n"); - sfprintf(sp, coident, CO_ENV_MSGFD, pio[3], CO_ENV_MSGFD, CO_ENV_MSGFD, CO_ENV_MSGFD); - i = sfstrtell(sp); - sfstrseek(sp, 0, SEEK_SET); - sfprintf(sp, "#%05d\n", i - 7); - i = write(co->cmdfd, sfstrbase(sp), i) != i; - sfstrclose(sp); - if (i) - { - errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "cannot write initialization message"); - goto nope; - } - state.current = co; - handler = signal(SIGALRM, hung); - i = alarm(30); - if (!(s = sfgetr(co->msgfp, '\n', 1))) - { - if (errno == EINTR) - errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "identification message read timeout"); - goto nope; - } - alarm(i); - signal(SIGALRM, handler); - if (co->flags & CO_DEBUG) - errormsg(state.lib, 2, "coshell %d shell path %s identification \"%s\"", co->index, state.sh, s); - switch (*s) - { - case 'o': - co->flags |= CO_OSH; - /*FALLTHROUGH*/ - case 'b': - s = cobinit; - break; - case 'k': - co->flags |= CO_KSH; - s = cokinit; - break; - case 'i': /* NOTE: 'i' is obsolete */ - case 's': - co->flags |= CO_SERVER; - co->pid = 0; - for (;;) - { - if (t = strchr(s, ',')) - *t = 0; - if (streq(s, CO_OPT_ACK)) - co->mode |= CO_MODE_ACK; - else if (streq(s, CO_OPT_INDIRECT)) - co->mode |= CO_MODE_INDIRECT; - if (!(s = t)) - break; - s++; - } - if (!(co->mode & CO_MODE_INDIRECT)) - wait(NiL); - break; - default: - goto nope; - } - if (s) - { - if (!(cj = coexec(co, s, 0, NiL, NiL, NiL)) || cowait(co, cj, -1) != cj) - { - errormsg(state.lib, ERROR_LIBRARY|ERROR_SYSTEM|2, "initialization message exec error"); - goto nope; - } - co->total = 0; - co->user = 0; - co->sys = 0; - } - } - co->flags &= ~CO_INIT; - fcntl(pio[1], F_SETFD, FD_CLOEXEC); - fcntl(pio[2], F_SETFD, FD_CLOEXEC); - co->next = state.coshells; - state.coshells = co; - if (!(co->flags & CO_SHELL)) - { -#ifdef SIGCONT -#ifdef SIGTSTP - signal(SIGTSTP, stop); -#endif -#ifdef SIGTTIN - signal(SIGTTIN, stop); -#endif -#ifdef SIGTTOU - signal(SIGTTOU, stop); -#endif -#endif - if (!state.init) - { - state.init = 1; - atexit(clean); - } - } - return co; - bad: - n = errno; - if (co->msgfp) - { - sfclose(co->msgfp); - pio[2] = -1; - } - for (i = 0; i < elementsof(pio); i++) - if (pio[i] >= 0) - close(pio[i]); - coclose(co); - errno = n; - return 0; - nope: - i = errno; - if (!(s = sh[1]) || (s = (t = strrchr(s, '/')) ? (t + 1) : s) && !strmatch(s, "?(k)sh") && !streq(s, CO_ID)) - error(2, "export %s={ksh,sh,%s}", CO_ENV_SHELL, CO_ID); - coclose(co); - errno = i; - return 0; -} - -/* - * set coshell attributes - */ - -int -coattr(Coshell_t* co, const char* attributes) -{ - return 0; -} diff --git a/src/lib/libcoshell/coquote.c b/src/lib/libcoshell/coquote.c deleted file mode 100644 index 1c1edf282..000000000 --- a/src/lib/libcoshell/coquote.c +++ /dev/null @@ -1,60 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * single quote s into sp - * if type!=0 then /)/ translated to /$/ - */ - -#include "colib.h" - -void -coquote(register Sfio_t* sp, register const char* s, int type) -{ - register int c; - - if (type && (!state.type || !*state.type)) - type = 0; - while (c = *s++) - { - sfputc(sp, c); - if (c == '\'') - { - sfputc(sp, '\\'); - sfputc(sp, '\''); - sfputc(sp, '\''); - } - else if (type && c == '/' && *s == *state.type) - { - register const char* x = s; - register char* t = state.type; - - while (*t && *t++ == *x) x++; - if (!*t && *x == '/') - { - s = x; - sfprintf(sp, "'$%s'", CO_ENV_TYPE); - } - } - } -} diff --git a/src/lib/libcoshell/coshell.3 b/src/lib/libcoshell/coshell.3 deleted file mode 100644 index 7937b01ca..000000000 --- a/src/lib/libcoshell/coshell.3 +++ /dev/null @@ -1,396 +0,0 @@ -.fp 5 CW -.de L \" literal font -.ft 5 -.if !\\$1 \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \f1 -.. -.de LR -.}S 5 1 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" -.. -.de RL -.}S 1 5 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" -.. -.de EX \" start example -.ta 1i 2i 3i 4i 5i 6i -.PP -.RS -.PD 0 -.ft 5 -.nf -.. -.de EE \" end example -.fi -.ft -.PD -.RE -.PP -.. -.TH COSHELL 3 -.SH NAME \" @(#)coshell.3 (gsf@research.att.com) 10/11/90 -coshell \- shell coprocess support -.SH SYNOPSIS -.L "#include " -.br -.L "\-lcoshell \-last" -.SH DESCRIPTION -The -.I coshell -routines support the shell as a coprocess. -This coprocess may be either -.IR ksh (1) -or -.IR sh (1) -executing on the local host, or it may be -.IR coshell (1) -with access to shells on hosts throughout the local network. -.PP -The coshell inherits the environment of the calling process. -Signals sent to the calling process are passed to the coshell. -.PP -More than one coshell may be open in the current process. -If the -.L Coshell_t* -argument to the -.LR cowait() , -.LR cokill() , -.LR copending() , -.LR cozombie() , -or -.L coclose() -calls below is -.L 0 -then the call is applied to all open coshell. -.PP -.L "Coshell_t* coopen(const char* shell, int flags, const char* attributes)" -.PP -Returns a pointer to a new coshell. -.L NULL -is returned on error. -If -.L shell -is -.L NULL -then the coshell executable is determined by doing the usual path search, -in order, on the value of the environment variable -.B COSHELL -and the commands -.BR ksh -and -.BR sh . -.L flags -is the inclusive-or of the following: -.TP -.L CO_ANY -Return a pointer to a previously opened coshell if possible, otherwise -open a new coshell. -.TP -.L CO_DEBUG -Enable library debug tracing. -.TP -.L CO_IGNORE -Ignore any command errors. -By default any command error that is not tested by a conditional causes -the job to terminate. -.TP -.L CO_LOCAL -Commands are to be executed on the local host only. -.TP -.L CO_SHELL -The caller is -.BR sh (1): -internal file descriptors are moved to 10 or above; -SIGSTOP and SIGCONT handlers are not installed. -.TP -.L CO_SILENT -Don't trace commands. -By default commands are traced using the shell -.B \-x -option. -.TP -.L CO_NONBLOCK -Normally -.L coexec() -blocks when the job queue is full and waits until a job completes. -.L CO_NONBLOCK -causes -.L coexec() -to return -.L NULL -when the job queue is full. -.PP -.L attributes -is a string that is interpreted by the coshell. -If -.L attributes -is -.L NULL -then the value of the environment variable -.B COATTRIBUTES -is used if defined. -.B ksh -and -.B sh -ignore this string. -The return value points to a structure with the following readonly elements: -.TP -.L "int flags" -The default flags. -.TP -.L "int outstanding" -The number of jobs that have not been waited for. -.TP -.L "int running" -The number of jobs still running. -.TP -.L "int total" -The total number of jobs sent to the coshell. -.TP -.L "unsigned long user" -The total user time of all completed jobs in -.L 1/CO_QUANT -second increments. -.TP -.L "unsigned long sys" -The total system time of all completed jobs in -.L 1/CO_QUANT -second increments. -.PP -.L "int coclose(Coshell_t* sh)" -.PP -Close an open coshell pointed to by -.LR sh . -The coshell exit status is returned. -.PP -.L "Cojob_t* coexec(Coshell_t* sh, const char* cmd, int flags, const char* out, const char* err, const char* att)" -.PP -Sends the shell command line -.L cmd -to the open coshell pointed to by -.L sh -for execution. -.L flags -are the same as in the -.L coopen() -call, and are used to augment the default settings from -.LR coopen() . -.L out -is the standard output file name and defaults to -.B stdout -if -.LR NULL . -.L err -is the standard error file name and defaults to -.B stderr -if -.LR NULL . -.LR att , -if -.RL non- NULL , -contains job attributes that are appended to the attributes from -.L coopen() -before being sent to the coshell. -The return value points to a structure with the following elements: -.TP -.L "int id" -A number that uniquely identifies the job within the coshell. -.TP -.L "int status" -The job exit status, valid only for job pointers returned by -.LR cowait() . -.TP -.L "int flags" -The flags enabled for this job. -.TP -.L "void* local" -A user reserved pointer, initially set to -.L NULL -on return from -.LR coexec() . -This is the only job field that may be modified by the user. -The user defined value is preserved until after the -.L cowait() -call that returns the job pointer. -.TP -.L "unsigned long user" -The user time of this job in -.L 1/CO_QUANT -second increments, valid only for job pointers returned by -.LR cowait() . -.TP -.L "unsigned long sys" -The system time of this job in -.L 1/CO_QUANT -second increments, valid only for job pointers returned by -.LR cowait() . -.PP -.L "Cojob_t* cowait(Coshell_t* sh, Cojob_t* job, int timeout)" -.PP -Returns the job pointer in the coshell pointed to by -.L sh -for the job pointed to by -.LR job . -If -.L job -is -.L NULL -then a pointer to any completed job is returned. -.L cowait() -blocks until the specified job(s) complete. -.L NULL -is returned on error or if all jobs have completed and -.L errno -is set to EINVAL for coshell communication errors, -ECHILD if -.L job -is -.L NULL -and there are no children, and ESRCH if -.L job -is not -.L NULL -and not an active job. -.L "cozombie(sh)" -is the number of jobs that may be waited for without blocking. -The return value -.LR status , -.L user -and -.L sys -job fields are set to their final values. -The return value is valid until the next -.LR coexec() , -.L cowait() -or -.L coclose() -call. -.L timeout -is the maximum time in milliseconds that wait will block. -If the wait times out then 0 is returned. -A negative -.L timeout -waits until a job completes or a signal is received. -.TP -.L "int cojobs(Coshell_t* sh)" -Returns the number of outstanding jobs that are children of the caller. -(Remote jobs or jobs executed by a separate daemon are not counted here.) -.TP -.L "int copending(Coshell_t* sh)" -Returns the number of pending jobs; this is the number of -.L cowait() -calls required to reap all running jobs. -.TP -.L "int cozombie(Coshell_t* sh)" -Returns the number of jobs that have completed but have not been -.L cowait()'d -for. -.TP -.L "int cokill(Coshell_t* sh, Cojob_t* job, int sig)" -The signal -.L sig -is sent to the job pointed to by -.L job -running in the coshell pointed to by -.LR sh . -If -.L job -is -.L NULL -then the signal is sent to all jobs in the coshell. -If both -.L sh -and -.L job -are -.L NULL -then the signal is sent to all jobs in all coshells. -.L \-1 -is returned on error, -.L 0 -otherwise. -.TP -.L "int cosync(Coshell_t* sh, const char* path, int fd, int mode)" -Sync all outstanding file operations for either the file -.L path -or the file descriptor -.L fd -after its shell action has completed in -.LR sh . -If -.L path -is -.L NULL -then -.L fd -is used. -If -.L fd<0 -and -.L mode>=0 -then -.L path -is opened using -.L mode. -This is an unfortunate workaround for NFS and remote coshells, and is a -no-op for all real file systems. -It should be called after -.L cowait() -to ensure that all file system cache info has been flushed. -.IR sync (2) -or -.IR fsync (2) -must still be called to schedule file data to be written to disk. -.TP -.L "char* coinit(Coshell_t* sh)" -Returns the shell initialization commands for the next job. -These commands represent process state changes that may have occurred -since the last call to -.L coinit(), -e.g., current working directory or umask. -If -.L sh -is local (a child of the calling process) -.L coinit() -may return the empty string; -if -.L sh -is remote then considerably more information may be returned. -This routine is used by remote coshell implementations and is -not normally called from user code. -.TP -.L "void coquote(Sfio_T* sp, const char* string, int type)" -Applies shell single quoting to -.L string -and copies the result into the sfio stream -.L sp. -If -.L type!=0 -then any occurrence of \f5/\fP\fIhosttype\fP\f5/\fP is translated to -\f5/$HOSTTYPE/\fP, where -.I hosttype -is the current value of the -.L HOSTTYPE -environment variable. -This routine is used by remote coshell implementations and is -not normally called from user code. -.SH CAVEATS -.L cosync() -is a hack workaround, but we do have to work in the real world. -.PP -A bug in -.IR bsh (1) -and -.IR ksh (1) -implementations up to and including ksh88e causes some interrupted -jobs to return 0 exit status. -This should be fixed in later shell releases. -.PP -.L "trap 0" -is reserved by -.L coexec() -at the outermost scope. -To use -.L "trap 0" -use -.L "(...)" -to force a subshell. -.SH "SEE ALSO" -coshell(1), ksh(1), nmake(1), sh(1), cs(3), libast(3) diff --git a/src/lib/libcoshell/coshell.h b/src/lib/libcoshell/coshell.h deleted file mode 100644 index 9063f1429..000000000 --- a/src/lib/libcoshell/coshell.h +++ /dev/null @@ -1,143 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * coshell library interface - */ - -#ifndef _COSHELL_H -#define _COSHELL_H - -#include - -#if !_BLD_coshell - -#undef procrun -#define procrun(a,b,c) coprocrun(a,b,c) -#undef system -#define system(a) cosystem(a) - -#endif - -struct Coshell_s; typedef struct Coshell_s Coshell_t; -struct Cojob_s; typedef struct Cojob_s Cojob_t; - -/* - * DEPRECATED names for compatibility - */ - -#define COSHELL Coshell_t -#define COJOB Cojob_t - -#define CO_ID "coshell" /* library/command id */ - -#define CO_ENV_ATTRIBUTES "COATTRIBUTES"/* coshell attributes env var */ -#define CO_ENV_EXPORT "COEXPORT" /* coshell env var export list */ -#define CO_ENV_HOST "HOSTNAME" /* coshell host name env var */ -#define CO_ENV_MSGFD "_COSHELL_msgfd"/* msg fd */ -#define CO_ENV_OPTIONS "COSHELL_OPTIONS"/* options environment var */ -#define CO_ENV_PROC "NPROC" /* concurrency environment var */ -#define CO_ENV_SHELL "COSHELL" /* coshell path environment var */ -#define CO_ENV_TEMP "COTEMP" /* 10 char temp file base */ -#define CO_ENV_TYPE "HOSTTYPE" /* coshell host type env var */ - -#define CO_OPT_ACK "ack" /* wait for server coexec() ack */ -#define CO_OPT_INDIRECT "indirect" /* indirect server connection */ -#define CO_OPT_SERVER "server" /* server connection */ - -#define CO_QUANT 100 /* time quanta per sec */ - -#define CO_ANY 0x000001 /* return any open coshell */ -#define CO_DEBUG 0x000002 /* library debug trace */ -#define CO_EXPORT 0x000004 /* export everything */ -#define CO_IGNORE 0x000008 /* ignore command errors */ -#define CO_LOCAL 0x000010 /* local affinity */ -#define CO_NONBLOCK 0x000020 /* don't block coexec if Q full */ -#define CO_SHELL 0x000040 /* shell using coshell! */ -#define CO_SILENT 0x000080 /* don't trace commands */ - -#define CO_KSH 0x000100 /* coshell is ksh (readonly) */ -#define CO_SERVER 0x000200 /* coshell is server (readonly) */ -#define CO_OSH 0x000400 /* coshell is OLD (readonly) */ - -#define CO_CROSS 0x000800 /* don't prepend local dirs */ -#define CO_DEVFD 0x001000 /* coshell handles /dev/fd/# */ - -#define CO_SERIALIZE 0x002000 /* serialize stdout and stderr */ -#define CO_SERVICE 0x004000 /* service callouts */ - -#define CO_APPEND 0x008000 /* append coexec() out/err */ -#define CO_SEPARATE 0x010000 /* 1 shell+wait per coexec() */ -#define CO_ORPHAN 0x020000 /* PROC_ORPHAN */ - -#define CO_USER 0x100000 /* first user flag */ - -struct Cojob_s /* coshell job info */ -{ - Coshell_t* coshell; /* running in this coshell */ - int id; /* job id */ - int status; /* exit status */ - int flags; /* CO_* flags */ - void* local; /* local info */ - unsigned long user; /* user time in 1/CO_QUANT secs */ - unsigned long sys; /* sys time in 1/CO_QUANT secs */ -#ifdef _CO_JOB_PRIVATE_ - _CO_JOB_PRIVATE_ /* library private additions */ -#endif -}; - -struct Coshell_s /* coshell connection info */ -{ - void* data; /* user data, initially 0 */ - int flags; /* flags */ - int outstanding; /* number of outstanding jobs */ - int running; /* number of running jobs */ - int total; /* number of coexec() jobs */ - unsigned long user; /* user time in 1/CO_QUANT secs */ - unsigned long sys; /* sys time in 1/CO_QUANT secs */ - Sfio_t* msgfp; /* message stream for sfpoll() */ -#ifdef _CO_SHELL_PRIVATE_ - _CO_SHELL_PRIVATE_ /* library private additions */ -#endif -}; - -extern int coclose(Coshell_t*); -extern Cojob_t* coexec(Coshell_t*, const char*, int, const char*, const char*, const char*); -extern char* coinit(int); -extern int coexport(Coshell_t*, const char*, const char*); -extern int cokill(Coshell_t*, Cojob_t*, int); -extern Coshell_t* coopen(const char*, int, const char*); -extern void coquote(Sfio_t*, const char*, int); -extern int cosync(Coshell_t*, const char*, int, int); -extern Cojob_t* cowait(Coshell_t*, Cojob_t*, int); - -extern int cojobs(Coshell_t*); -extern int copending(Coshell_t*); -extern int cozombie(Coshell_t*); - -extern int coattr(Coshell_t*, const char*); - -extern int coprocrun(const char*, char**, int); -extern int cosystem(const char*); - -#endif diff --git a/src/lib/libcoshell/costash.c b/src/lib/libcoshell/costash.c deleted file mode 100644 index c378909f4..000000000 --- a/src/lib/libcoshell/costash.c +++ /dev/null @@ -1,40 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - */ - -#include - -/* - * 0 terminate string stream, reset, and return value - */ - -char* -costash(Sfio_t* sp) -{ - char* s; - - if (!(s = sfstruse(sp))) - errormsg(state.lib, ERROR_LIBRARY|2, "out of space"); - return s; -} diff --git a/src/lib/libcoshell/cosync.c b/src/lib/libcoshell/cosync.c deleted file mode 100644 index 5090b9c21..000000000 --- a/src/lib/libcoshell/cosync.c +++ /dev/null @@ -1,129 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2012 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * sync all outstanding file operations for file opened on fd - * if file==0 then fd used - * if fd<0 then file used - * if mode<0 then fd not created - * - * NOTE: this is an unfortunate NFS workaround that should be done by fsync() - */ - -#include "colib.h" - -#include - -#include "FEATURE/nfsd" - -int -cosync(Coshell_t* co, const char* file, int fd, int mode) -{ -#if defined(_cmd_nfsd) - if (!co || (co->flags & CO_SERVER)) - { - char tmp[PATH_MAX]; - - if (file && *file) - { - register const char* s; - register char* t; - register char* b; - int td; - - /* - * writing to a dir apparently flushes the - * attribute cache for all entries in the dir - */ - - s = file; - b = t = tmp; - while (t < &tmp[sizeof(tmp) - 1]) - { - if (!(*t = *s++)) break; - if (*t++ == '/') b = t; - } - s = "..nfs..botch.."; - t = b; - while (t < &tmp[sizeof(tmp) - 1] && (*t++ = *s++)); - *t = 0; - if ((td = open(tmp, O_WRONLY|O_CREAT|O_TRUNC|O_cloexec, 0)) >= 0) - close(td); - unlink(tmp); - if (fd >= 0 && mode >= 0) - { - if ((td = open(file, mode|O_cloexec)) < 0) - return(-1); - close(fd); - dup2(td, fd); - close(td); - } - } -#if defined(F_SETLK) - else - { - int clean = 0; - struct flock lock; - - if (fd < 0) - { - if (!file || mode < 0 || (fd = open(file, O_RDONLY|O_cloexec)) < 0) return(-1); - clean = 1; - } - - /* - * this sets the VNOCACHE flag across NFS - */ - - lock.l_type = F_RDLCK; - lock.l_whence = 0; - lock.l_start = 0; - lock.l_len = 1; - if (!fcntl(fd, F_SETLK, &lock)) - { - lock.l_type = F_UNLCK; - fcntl(fd, F_SETLK, &lock); - } - if (clean) close(fd); - - /* - * 4.1 has a bug that lets VNOCACHE linger after unlock - * VNOCACHE inhibits mapping which kills exec - * the double rename flushes the incore vnode (and VNOCACHE) - * - * this kind of stuff doesn't happen with *real* file systems - */ - - if (file && *file) - { - strcpy(tmp, file); - fd = strlen(tmp) - 1; - tmp[fd] = (tmp[fd] == '*') ? '?' : '*'; - if (!rename(file, tmp)) rename(tmp, file); - } - } -#endif - } -#endif - return(0); -} diff --git a/src/lib/libcoshell/cowait.c b/src/lib/libcoshell/cowait.c deleted file mode 100644 index ccc98d322..000000000 --- a/src/lib/libcoshell/cowait.c +++ /dev/null @@ -1,411 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * wait for and return status of job or the next coshell job that completes - * job==co for non-blocking wait - */ - -#include "colib.h" - -#include - -/* - * cat and remove fd {1,2} serialized output - */ - -static void -cat(Cojob_t* job, char** path, Sfio_t* op) -{ - Sfio_t* sp; - - if (sp = sfopen(NiL, *path, "r")) - { - sfmove(sp, op, SF_UNBOUND, -1); - sfclose(sp); - } - else - errormsg(state.lib, ERROR_LIBRARY|2, "%s: cannot open job %d serialized output", *path, job->id); - remove(*path); - free(*path); - *path = 0; -} - -/* - * the number of running+zombie jobs - * these would count against --jobs or NPROC - */ - -int -cojobs(Coshell_t* co) -{ - int any; - int n; - - if (co) - any = 0; - else if (!(co = state.coshells)) - return -1; - else - any = 1; - n = 0; - do - { - n += co->outstanding; - } while (any && (co = co->next)); - return n; -} - -/* - * the number of pending cowait()'s - */ - -int -copending(Coshell_t* co) -{ - int any; - int n; - - if (co) - any = 0; - else if (!(co = state.coshells)) - return -1; - else - any = 1; - n = 0; - do - { - n += co->outstanding + co->svc_outstanding; - } while (any && (co = co->next)); - return n; -} - -/* - * the number of completed jobs not cowait()'d for - * cowait() always reaps the zombies first - */ - -int -cozombie(Coshell_t* co) -{ - int any; - int n; - - if (co) - any = 0; - else if (!(co = state.coshells)) - return -1; - else - any = 1; - n = 0; - do - { - n += (co->outstanding + co->svc_outstanding) - (co->running + co->svc_running); - } while (any && (co = co->next)); - return n; -} - -Cojob_t* -cowait(register Coshell_t* co, Cojob_t* job, int timeout) -{ - register char* s; - register Cojob_t* cj; - register Coservice_t* cs; - register ssize_t n; - char* b; - char* e; - unsigned long user; - unsigned long sys; - int active; - int any; - int id; - int loop; - int to; - int type; - char buf[128]; - - static unsigned long serial = 0; - - serial++; - if (co || job && (co = job->coshell)) - any = 0; - else if (!(co = state.coshells)) - goto echild; - else - any = 1; - - /* - * first drain the zombies - */ - - active = 0; - to = timeout >= 0 ? timeout : 60 * 1000; - zombies: - do - { -#if 0 - errormsg(state.lib, 2, "coshell %d zombie wait %lu timeout=%d outstanding=<%d,%d> running=<%d,%d>", co->index, serial, timeout, co->outstanding, co->svc_outstanding, co->running, co->svc_running); -#endif - if ((co->outstanding + co->svc_outstanding) > (co->running + co->svc_running)) - for (cj = co->jobs; cj; cj = cj->next) - if (cj->pid == CO_PID_ZOMBIE && (!job || cj == job)) - { - cj->pid = CO_PID_FREE; - if (cj->service) - co->svc_outstanding--; - else - co->outstanding--; -#if 0 - errormsg(state.lib, 2, "coshell %d zombie wait %lu timeout=%d outstanding=<%d,%d> running=<%d,%d> reap job %d", co->index, serial, timeout, co->outstanding, co->svc_outstanding, co->running, co->svc_running, cj->id); -#endif - return cj; - } - else if (cj->service && !cj->service->pid) - { - cj->pid = CO_PID_ZOMBIE; - cj->status = 2; - cj->service = 0; - co->svc_running--; - } - if (co->running > 0) - active = 1; - else if (co->svc_running > 0) - { - n = 0; - for (cs = co->service; cs; cs = cs->next) - if (cs->pid && kill(cs->pid, 0)) - { - cs->pid = 0; - close(cs->fd); - cs->fd = -1; - n = 1; - } - if (n) - goto zombies; - active = 1; - } - } while (any && (co = co->next)); - - /* - * reap the active jobs - */ - - if (!active) - goto echild; - if (any) - co = state.coshells; - do - { - loop = 0; - for (;;) - { - if (co->flags & CO_DEBUG) - { - loop++; - errormsg(state.lib, 2, "coshell %d wait %lu.%d timeout=%d outstanding=<%d,%d> running=<%d,%d>", co->index, serial, loop, timeout, co->outstanding, co->svc_outstanding, co->running, co->svc_running); - for (cj = co->jobs; cj; cj = cj->next) - if (cj->pid != CO_PID_FREE) - errormsg(state.lib, 2, "\tjob %d pid=%d status=%d", cj->id, cj->pid, cj->status); - } - if (co->running <= 0) - break; - while ((n = sfpoll(&co->msgfp, 1, to)) < 1) - { - if (n < 0) - { - if (errno == EINTR) - return 0; - break; - } - if (timeout >= 0) - break; - - /* - * check for a killed job with no status - */ - - for (cj = co->jobs; cj; cj = cj->next) - if (cj->pid > 0) - { - n = sfsprintf(buf, sizeof(buf), "kill -0 %d 2>/dev/null || echo k %d `wait %d 2>/dev/null; echo $?` >&$%s\n", cj->pid, cj->id, cj->pid, CO_ENV_MSGFD); - write(co->cmdfd, buf, n); - break; - } - } - - /* - * get one coshell message - */ - - if (!(s = b = sfgetr(co->msgfp, '\n', 1))) - break; -#if 0 - errormsg(state.lib, 2, "coshell %d active wait %lu timeout=%d outstanding=<%d,%d> running=<%d,%d>", co->index, serial, timeout, co->outstanding, co->svc_outstanding, co->running, co->svc_running); -#endif - - /* - * read and parse a coshell message packet of the form - * - * - * %c %d %s %c - */ - - while (isspace(*s)) - s++; - if (!(type = *s) || type != 'a' && type != 'j' && type != 'k' && type != 'x') - goto invalid; - while (*++s && !isspace(*s)); - id = strtol(s, &e, 10); - if (*e && !isspace(*e)) - goto invalid; - for (s = e; isspace(*s); s++); - - /* - * locate id in the job list - */ - - for (cj = co->jobs; cj; cj = cj->next) - if (id == cj->id) - break; - if ((co->flags | (cj ? cj->flags : 0)) & CO_DEBUG) - errormsg(state.lib, 2, "coshell %d message \"%c %d %s\"", co->index, type, id, s); - if (!cj) - { - if (type == 'k') - continue; - errormsg(state.lib, 2, "coshell %d job id %d not found [%s]", co->index, id, b); - errno = ESRCH; - return 0; - } - - /* - * now interpret the message - */ - - switch (type) - { - - case 'a': - /* - * coexec() ack - */ - - if (cj == job) - return cj; - break; - - case 'j': - /* - * is the job pid - */ - - n = cj->pid; - cj->pid = strtol(s, NiL, 10); - if (n == CO_PID_WARPED) - goto nuke; - break; - - case 'k': - /* - * is a synthesized killed status - */ - - if (cj->pid < 0) - continue; - /*FALLTHROUGH*/ - - case 'x': - /* - * is the job exit code and user,sys times - */ - - cj->status = strtol(s, &e, 10); - user = sys = 0; - for (;;) - { - if (e <= s) - break; - for (s = e; isalpha(*s) || isspace(*s); s++); - user += strelapsed(s, &e, CO_QUANT); - if (e <= s) - break; - for (s = e; isalpha(*s) || isspace(*s); s++); - sys += strelapsed(s, &e, CO_QUANT); - } - cj->user += user; - cj->sys += sys; - co->user += user; - co->sys += sys; - if (cj->out) - cat(cj, &cj->out, sfstdout); - if (cj->err) - cat(cj, &cj->err, sfstderr); - if (cj->pid > 0 || cj->service || (co->flags & (CO_INIT|CO_SERVER))) - { - nuke: - if (cj->pid > 0 && type != 'k') - { - /* - * nuke the zombies - */ - - n = sfsprintf(buf, sizeof(buf), "wait %d\n", cj->pid); - write(co->cmdfd, buf, n); - } - if (cj->service) - co->svc_running--; - else - co->running--; - if (!job || cj == job) - { - cj->pid = CO_PID_FREE; - if (cj->service) - co->svc_outstanding--; - else - co->outstanding--; -#if 0 - errormsg(state.lib, 2, "coshell %d active wait %lu timeout=%d outstanding=<%d,%d> running=<%d,%d> reap job %d", co->index, serial, timeout, co->outstanding, co->svc_outstanding, co->running, co->svc_running, cj->id); -#endif - return cj; - } - cj->pid = CO_PID_ZOMBIE; - } - else - cj->pid = CO_PID_WARPED; - break; - - } - } - } while (any && (co = co->next)); - return 0; - echild: -#if 0 - errormsg(state.lib, 2, "coshell wait ECHILD"); -#endif - errno = ECHILD; - return 0; - invalid: - errormsg(state.lib, 2, "coshell %d invalid message \"%-.*s>>>%s<<<\"", co->index, s - b, b, s); - errno = EINVAL; - return 0; -} diff --git a/src/lib/libcoshell/ignore.sh b/src/lib/libcoshell/ignore.sh deleted file mode 100644 index f70002e5a..000000000 --- a/src/lib/libcoshell/ignore.sh +++ /dev/null @@ -1,45 +0,0 @@ -######################################################################## -# # -# This software is part of the ast package # -# Copyright (c) 1990-2011 AT&T Intellectual Property # -# and is licensed under the # -# Eclipse Public License, Version 1.0 # -# by AT&T Intellectual Property # -# # -# A copy of the License is available at # -# http://www.eclipse.org/org/documents/epl-v10.html # -# (with md5 checksum b35adb5213ca9657e911e9befb180842) # -# # -# Information and Software Systems Research # -# AT&T Research # -# Florham Park NJ # -# # -# Glenn Fowler # -# # -######################################################################## -: -# -# Glenn Fowler -# AT&T Bell Laboratories -# -# Bourne coshell support -# -# @(#)ignore (AT&T Bell Laboratories) 08/11/92 -# -while : -do case $# in - 0) exit 0 ;; - esac - case $1 in - *=*) case $RANDOM in - $RANDOM)`echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;; - *) export "$1" ;; - esac - shift - ;; - *) break - ;; - esac -done -"$@" -exit 0 diff --git a/src/lib/libcoshell/procrun.c b/src/lib/libcoshell/procrun.c deleted file mode 100644 index cdd53577e..000000000 --- a/src/lib/libcoshell/procrun.c +++ /dev/null @@ -1,56 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * coshell procrun(3) - */ - -#include "colib.h" - -#include - -int -coprocrun(const char* path, char** argv, int flags) -{ - register char* s; - register char** a; - register Sfio_t* tmp; - int n; - - if (!(a = argv)) - return procclose(procopen(path, a, NiL, NiL, PROC_FOREGROUND|PROC_GID|PROC_UID|flags)); - if (!(tmp = sfstropen())) - return -1; - sfputr(tmp, path ? path : "sh", -1); - while (s = *++a) - { - sfputr(tmp, " '", -1); - coquote(tmp, s, 0); - sfputc(tmp, '\''); - } - if (!(s = costash(tmp))) - return -1; - n = cosystem(s); - sfstrclose(tmp); - return n; -} diff --git a/src/lib/libcoshell/silent.sh b/src/lib/libcoshell/silent.sh deleted file mode 100644 index 1f3f4b783..000000000 --- a/src/lib/libcoshell/silent.sh +++ /dev/null @@ -1,44 +0,0 @@ -######################################################################## -# # -# This software is part of the ast package # -# Copyright (c) 1990-2011 AT&T Intellectual Property # -# and is licensed under the # -# Eclipse Public License, Version 1.0 # -# by AT&T Intellectual Property # -# # -# A copy of the License is available at # -# http://www.eclipse.org/org/documents/epl-v10.html # -# (with md5 checksum b35adb5213ca9657e911e9befb180842) # -# # -# Information and Software Systems Research # -# AT&T Research # -# Florham Park NJ # -# # -# Glenn Fowler # -# # -######################################################################## -: -# -# Glenn Fowler -# AT&T Bell Laboratories -# -# Bourne coshell support -# -# @(#)silent (AT&T Bell Laboratories) 08/11/92 -# -while : -do case $# in - 0) exit 0 ;; - esac - case $1 in - *=*) case $RANDOM in - $RANDOM)`echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;; - *) export "$1" ;; - esac - shift - ;; - *) break - ;; - esac -done -"$@" diff --git a/src/lib/libcoshell/system.c b/src/lib/libcoshell/system.c deleted file mode 100644 index 9179ef8b4..000000000 --- a/src/lib/libcoshell/system.c +++ /dev/null @@ -1,57 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -/* - * Glenn Fowler - * AT&T Research - * - * coshell system(3) - */ - -#include "colib.h" - -int -cosystem(const char* cmd) -{ - Coshell_t* co; - Cojob_t* cj; - int status; - - if (!cmd) - return !eaccess(pathshell(), X_OK); - if (!(co = coopen(NiL, CO_ANY, NiL))) - return -1; - if (cj = coexec(co, cmd, CO_SILENT, NiL, NiL, NiL)) - cj = cowait(co, cj, -1); - if (!cj) - return -1; - - /* - * synthesize wait() status from shell status - * lack of synthesis is the standard's proprietary sellout - */ - - status = cj->status; - if (EXITED_TERM(status)) - status &= ((1<<(EXIT_BITS-1))-1); - else - status = (status & ((1<