mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix build on QNX
This makes ksh 93u+m build on the following system: $ uname -a QNX qnx 6.5.0 2010/07/09-14:44:03EDT x86pc x86 Thanks to polarhome.com for providing the QNX shell account. There are a number of regressions left to work out: arrays.sh[636]: copying a large array fails bracket.sh[129]: /tmp/ksh93.shtests.1753215026.6923/bracket.C/original should be older than /tmp/ksh93.shtests.1753215026.6923/bracket.C/newer bracket.sh[132]: /tmp/ksh93.shtests.1753215026.6923/bracket.C/newer should be newer than /tmp/ksh93.shtests.1753215026.6923/bracket.C/original builtins.sh[683]: real_t1 not found after parent directory renamed in subshell functions.sh[1023]: cannot handle comsub depth > 256 in function io.sh[252]: <# not working for pipes io.sh[337]: read -n3 from pipe not working io.sh[346]: read -n3 from fifo failed -- expected 'a', got 'abc' io.sh[349]: read -n1 from fifo failed -- expected 'b', got 'd' io.sh[379]: should have timed out io.sh[380]: line1 should be 'prompt1: ' io.sh[381]: line2 should be line2 io.sh[382]: line3 should be 'prompt2: ' io.sh[406]: LC_ALL=C read -n2 from pipe 'a bcd' failed -- expected 'a bcd', got 'ab cd' io.sh[406]: LC_ALL=C.UTF-8 read -n2 from pipe 'a bcd' failed -- expected 'a bcd', got 'ab cd' jobs.sh[86]: warning: skipping subshell job control test due to non-compliant 'ps' pty.sh[105]: POSIX sh 026(C): line 120: expected "(Stopped|Suspended)", got EOF pty.sh[128]: POSIX sh 028(C): line 143: expected "(Stopped|Suspended) \(SIGTTIN\)", got EOF pty.sh[151]: POSIX sh 029(C): line 166: expected "(Stopped|Suspended) \(SIGTTOU\)", got EOF signal.sh[310]: kill -TERM $$ failed, required termination by signal 'EXIT' signal.sh[310]: kill -VTALRM $$ failed, required termination by signal 'EXIT' signal.sh[310]: kill -PIPE $$ failed, required termination by signal 'EXIT' (The io.sh failures mean libast sfpkrd() is not working.) src/lib/libast/obsolete/spawn.c: - Removed. Didn't compile due to wrong number of arguments to spawnve(2), but is obsolete and unused. src/lib/libast/comp/localeconv.c: - The initialisation of two static 'struct lconv' variables was done in a way that depended on OS headers declaring the struct members in a certain order. This holds on most systems, but not on QNX, and POSIX does not actually specify the order at all: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html So each member must be initialised by name. But C89 does not support initialising struct members by name, so we have to do it using an initialiser function that simply assigns the values. src/lib/libast/comp/spawnveg.c: - Fix for systems without either P_DETACH or _P_DETACH. src/lib/libast/features/vmalloc, src/lib/libast/vmalloc/vmmopen.c, src/lib/libast/Mamfile: - Add test for sys/shm.h header. If it doesn't exist, as it doesn't on QNX, use the stub vmmapopen() as the real one won't compile. (Mamfile: Add dependency on FEATURE/vmalloc to vmmopen.c.) src/lib/libast/vmalloc/malloc.c: - Remove superfluous externs that are already provided by either AST or system headers. The 'void cfree' extern caused a build failure on QNX because cfree() is of type int on QNX. src/lib/libast/comp/conf.tab: - Remove check for _map_spawnve; src/lib/libast/RELEASE says it was removed.
This commit is contained in:
parent
cd35ec6048
commit
21d00ffb6c
11 changed files with 45 additions and 248 deletions
5
TODO
5
TODO
|
@ -8,11 +8,6 @@ Fix regression test failures:
|
|||
|
||||
- There are many regression test failures on NetBSD.
|
||||
|
||||
______
|
||||
Fix build system:
|
||||
|
||||
- ksh does not currently build on QNX.
|
||||
|
||||
______
|
||||
Fix currently known bugs affecting shell scripting. These are identified by
|
||||
their modernish IDs. For exact details, see code/comments in:
|
||||
|
|
|
@ -184,6 +184,7 @@ failures (crashes, and/or essential functionality does not work).
|
|||
macOS 10.14.6 (Mojave) on x86_64
|
||||
*** NetBSD 8.1 and 9.0 on x86_64
|
||||
* OpenBSD 6.8 on x86_64
|
||||
** QNX 6.5.0 on i386
|
||||
* Solaris 11.4 (gcc) on x86_64
|
||||
Solaris 11.4 (Solaris Studio 12.5 cc) on x86_64
|
||||
* UnixWare 7.1.4 on x86
|
||||
|
|
|
@ -5836,6 +5836,7 @@ make install
|
|||
make vmalloc/vmmopen.c
|
||||
prev std/stdio.h implicit
|
||||
prev vmalloc/vmhdr.h implicit
|
||||
prev FEATURE/vmalloc implicit
|
||||
done vmalloc/vmmopen.c
|
||||
meta vmmopen.o %.c>%.o vmalloc/vmmopen.c vmmopen
|
||||
prev vmalloc/vmmopen.c
|
||||
|
@ -6073,23 +6074,13 @@ make install
|
|||
prev disc/sfstrtmp.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -D__OBSOLETE__=20120101 -D_PACKAGE_ast -c disc/sfstrtmp.c
|
||||
done sfstrtmp.o generated
|
||||
make spawn.o
|
||||
make obsolete/spawn.c
|
||||
prev include/error.h implicit
|
||||
prev include/ast.h implicit
|
||||
prev ast_lib.h implicit
|
||||
done obsolete/spawn.c
|
||||
meta spawn.o %.c>%.o obsolete/spawn.c spawn
|
||||
prev obsolete/spawn.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd -D_PACKAGE_ast -c obsolete/spawn.c
|
||||
done spawn.o generated
|
||||
exec - ${AR} rc libast.a state.o transition.o opendir.o readdir.o rewinddir.o seekdir.o telldir.o getcwd.o fastfind.o hashalloc.o hashdump.o hashfree.o hashlast.o hashlook.o hashscan.o hashsize.o hashview.o hashwalk.o memhash.o memsum.o strhash.o strkey.o strsum.o stracmp.o strnacmp.o ccmap.o ccmapid.o ccnative.o chresc.o chrtoi.o
|
||||
exec - ${AR} rc libast.a streval.o strexpr.o strmatch.o strcopy.o modei.o modex.o strmode.o strlcat.o strlcpy.o strlook.o strncopy.o strsearch.o strpsearch.o stresc.o stropt.o strtape.o strpcmp.o strnpcmp.o strvcmp.o strnvcmp.o tok.o tokline.o tokscan.o pathaccess.o pathcat.o pathcanon.o pathcheck.o pathpath.o pathexists.o pathfind.o pathkey.o pathprobe.o pathrepl.o pathnative.o pathposix.o pathtemp.o pathtmp.o pathstat.o pathgetlink.o pathsetlink.o pathbin.o pathshell.o pathcd.o pathprog.o ftwalk.o ftwflags.o fts.o astintercept.o conformance.o getenv.o setenviron.o optget.o optjoin.o optesc.o optctx.o strsort.o struniq.o magic.o mime.o mimetype.o signal.o sigflag.o systrace.o error.o errorf.o errormsg.o errorx.o localeconv.o setlocale.o translate.o catopen.o iconv.o lc.o lctab.o mc.o base64.o recfmt.o recstr.o reclen.o fmtrec.o fmtbase.o fmtbuf.o fmtclock.o fmtdev.o fmtelapsed.o fmterror.o fmtesc.o fmtfmt.o fmtfs.o fmtident.o fmtint.o fmtip4.o fmtip6.o fmtls.o fmtmatch.o fmtmode.o fmtnum.o fmtperm.o fmtre.o fmttime.o
|
||||
exec - ${AR} rc libast.a fmtuid.o fmtgid.o fmtsignal.o fmtscale.o fmttmx.o fmttv.o fmtversion.o strelapsed.o strperm.o struid.o strgid.o strtoip4.o strtoip6.o stack.o stk.o swapget.o swapmem.o swapop.o swapput.o sigdata.o sigcrit.o sigunblock.o procopen.o procclose.o procrun.o procfree.o tmdate.o tmequiv.o tmfix.o tmfmt.o tmform.o tmgoff.o tminit.o tmleap.o tmlex.o tmlocale.o tmmake.o tmpoff.o tmscan.o tmsleep.o tmtime.o tmtype.o tmweek.o tmword.o tmzone.o tmxdate.o tmxduration.o tmxfmt.o tmxgettime.o tmxleap.o tmxmake.o tmxscan.o tmxsettime.o tmxsleep.o tmxtime.o tmxtouch.o tvcmp.o tvgettime.o tvsettime.o tvsleep.o tvtouch.o cmdarg.o vecargs.o vecfile.o vecfree.o vecload.o vecstring.o univdata.o touch.o mnt.o debug.o memccpy.o memchr.o memcmp.o memcpy.o memdup.o memmove.o memset.o mkdir.o mkfifo.o mknod.o rmdir.o remove.o rename.o link.o unlink.o strdup.o strchr.o strrchr.o strstr.o strtod.o strtold.o strtol.o strtoll.o strtoul.o strtoull.o strton.o strtonll.o strntod.o strntold.o strnton.o
|
||||
exec - ${AR} rc libast.a strntonll.o strntol.o strntoll.o strntoul.o strntoull.o strcasecmp.o strncasecmp.o strerror.o mktemp.o tmpnam.o fsync.o execlp.o execve.o execvp.o execvpe.o spawnveg.o vfork.o killpg.o hsearch.o tsearch.o getlogin.o putenv.o setenv.o unsetenv.o lstat.o statvfs.o eaccess.o gross.o omitted.o readlink.o symlink.o getpgrp.o setpgid.o setsid.o waitpid.o creat64.o fcntl.o open.o atexit.o getdents.o getwd.o dup2.o errno.o getpreroot.o ispreroot.o realopen.o setpreroot.o getgroups.o mount.o system.o iblocks.o modedata.o tmdata.o memfatal.o sfkeyprintf.o sfdcdio.o sfdcdos.o sfdcfilter.o sfdcseekable.o sfdcslow.o sfdcsubstr.o sfdctee.o sfdcunion.o sfdcmore.o sfdcprefix.o wc.o wc2utf8.o basename.o closelog.o dirname.o fmtmsglib.o fnmatch.o ftw.o getdate.o getsubopt.o glob.o nftw.o openlog.o re_comp.o resolvepath.o realpath.o regcmp.o regexp.o setlogmask.o strftime.o strptime.o swab.o syslog.o tempnam.o wordexp.o mktime.o regalloc.o regclass.o regcoll.o regcomp.o regcache.o regdecomp.o regerror.o regexec.o regfatal.o reginit.o
|
||||
exec - ${AR} rc libast.a regnexec.o regsubcomp.o regsubexec.o regsub.o regrecord.o regrexec.o regstat.o dtclose.o dtdisc.o dthash.o dtlist.o dtmethod.o dtopen.o dtstat.o dtstrhash.o dttree.o dtuser.o dtview.o dtwalk.o dtnew.o dtcomp.o sfclose.o sfclrlock.o sfdisc.o sfdlen.o sfexcept.o sfgetl.o sfgetu.o sfcvt.o sfecvt.o sffcvt.o sfextern.o sffilbuf.o sfflsbuf.o sfprints.o sfgetd.o sfgetr.o sfllen.o sfmode.o sfmove.o sfnew.o sfpkrd.o sfnotify.o sfnputc.o sfopen.o sfpeek.o sfpoll.o sfpool.o sfpopen.o sfprintf.o sfputd.o sfputl.o sfputr.o sfputu.o sfrd.o sfread.o sfreserve.o sfscanf.o sfseek.o sfset.o sfsetbuf.o sfsetfd.o sfsize.o sfsk.o sfstack.o sfstrtod.o sfsync.o sfswap.o sftable.o sftell.o sftmp.o sfungetc.o sfvprintf.o sfvscanf.o sfwr.o sfwrite.o sfpurge.o sfraise.o sfwalk.o sfgetm.o sfmutex.o sfputm.o sfresize.o _sfclrerr.o _sfeof.o _sferror.o _sffileno.o _sfopen.o _sfstacked.o _sfvalue.o _sfgetc.o _sfgetl.o _sfgetl2.o _sfgetu.o _sfgetu2.o _sfdlen.o _sfllen.o _sfslen.o _sfulen.o _sfputc.o _sfputd.o _sfputl.o _sfputm.o
|
||||
exec - ${AR} rc libast.a _sfputu.o clearerr.o fclose.o fdopen.o feof.o ferror.o fflush.o fgetc.o fgetpos.o fgets.o fileno.o fopen.o fprintf.o fpurge.o fputc.o fputs.o fread.o freopen.o fscanf.o fseek.o fseeko.o fsetpos.o ftell.o ftello.o fwrite.o flockfile.o ftrylockfile.o funlockfile.o getc.o getchar.o getw.o pclose.o popen.o printf.o putc.o putchar.o puts.o putw.o rewind.o scanf.o setbuf.o setbuffer.o setlinebuf.o setvbuf.o snprintf.o sprintf.o sscanf.o asprintf.o vasprintf.o tmpfile.o ungetc.o vfprintf.o vfscanf.o vprintf.o vscanf.o vsnprintf.o vsprintf.o vsscanf.o _doprnt.o _doscan.o _filbuf.o _flsbuf.o _stdfun.o _stdopen.o _stdprintf.o _stdscanf.o _stdsprnt.o _stdvbuf.o _stdvsnprnt.o _stdvsprnt.o _stdvsscn.o fgetwc.o fwprintf.o putwchar.o vfwscanf.o wprintf.o fgetws.o fwscanf.o swprintf.o vswprintf.o wscanf.o fputwc.o getwc.o swscanf.o vswscanf.o fputws.o getwchar.o ungetwc.o vwprintf.o fwide.o putwc.o vfwprintf.o vwscanf.o stdio_c99.o fcloseall.o fmemopen.o getdelim.o getline.o frexp.o frexpl.o astcopy.o
|
||||
exec - ${AR} rc libast.a astconf.o astdynamic.o astlicense.o astquery.o astwinsize.o conftab.o aststatic.o getopt.o getoptl.o aso.o asolock.o asometh.o asorelax.o aso-sem.o aso-fcntl.o vmbest.o vmclear.o vmclose.o vmdcheap.o vmdebug.o vmdisc.o vmexit.o vmlast.o vmopen.o vmpool.o vmprivate.o vmprofile.o vmregion.o vmsegment.o vmset.o vmstat.o vmstrdup.o vmtrace.o vmwalk.o vmmopen.o malloc.o vmgetmem.o a64l.o acosh.o asinh.o atanh.o cbrt.o crypt.o erf.o err.o exp.o exp__E.o expm1.o gamma.o getpass.o lgamma.o log.o log1p.o log__L.o rand48.o random.o rcmd.o rint.o support.o sfstrtmp.o spawn.o
|
||||
exec - ${AR} rc libast.a astconf.o astdynamic.o astlicense.o astquery.o astwinsize.o conftab.o aststatic.o getopt.o getoptl.o aso.o asolock.o asometh.o asorelax.o aso-sem.o aso-fcntl.o vmbest.o vmclear.o vmclose.o vmdcheap.o vmdebug.o vmdisc.o vmexit.o vmlast.o vmopen.o vmpool.o vmprivate.o vmprofile.o vmregion.o vmsegment.o vmset.o vmstat.o vmstrdup.o vmtrace.o vmwalk.o vmmopen.o malloc.o vmgetmem.o a64l.o acosh.o asinh.o atanh.o cbrt.o crypt.o erf.o err.o exp.o exp__E.o expm1.o gamma.o getpass.o lgamma.o log.o log1p.o log__L.o rand48.o random.o rcmd.o rint.o support.o sfstrtmp.o
|
||||
exec - (ranlib libast.a) >/dev/null 2>&1 || true
|
||||
done libast.a generated
|
||||
done ast virtual
|
||||
|
|
|
@ -68,9 +68,6 @@ CHILD_MAX POSIX SC 1 CDLMUX 6 cc{
|
|||
#if _lib_fork
|
||||
#define child() fork()
|
||||
#else
|
||||
#ifdef _map_spawnve
|
||||
#define spawnve _map_spawnve
|
||||
#endif
|
||||
extern int spawnve(const char*, char* const[], char* const[]);
|
||||
static char* cmd[] = { "/bin/echo", 0 };
|
||||
#define child() spawnve(cmd[0],cmd,(char**)0)
|
||||
|
|
|
@ -29,57 +29,45 @@
|
|||
|
||||
#undef localeconv
|
||||
|
||||
static char null[] = "";
|
||||
static struct lconv debug_lconv, default_lconv;
|
||||
|
||||
static struct lconv debug_lconv =
|
||||
/*
|
||||
* POSIX does not specify the order in which struct lconv members are declared,
|
||||
* so they must be initialized by name. But C89 does not support initializing
|
||||
* struct members by name, so we have to do it using an initializer function.
|
||||
*/
|
||||
static void init_lconv_structs(void)
|
||||
{
|
||||
",",
|
||||
".",
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
};
|
||||
|
||||
static struct lconv default_lconv =
|
||||
{
|
||||
".",
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
&null[0],
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
CHAR_MAX,
|
||||
};
|
||||
debug_lconv.decimal_point = ",";
|
||||
default_lconv.decimal_point = debug_lconv.thousands_sep = ".";
|
||||
default_lconv.thousands_sep =
|
||||
debug_lconv.grouping = default_lconv.grouping =
|
||||
debug_lconv.int_curr_symbol = default_lconv.int_curr_symbol =
|
||||
debug_lconv.currency_symbol = default_lconv.currency_symbol =
|
||||
debug_lconv.mon_decimal_point = default_lconv.mon_decimal_point =
|
||||
debug_lconv.mon_thousands_sep = default_lconv.mon_thousands_sep =
|
||||
debug_lconv.mon_grouping = default_lconv.mon_grouping =
|
||||
debug_lconv.positive_sign = default_lconv.positive_sign =
|
||||
debug_lconv.negative_sign = default_lconv.negative_sign =
|
||||
"";
|
||||
debug_lconv.int_frac_digits = default_lconv.int_frac_digits =
|
||||
debug_lconv.frac_digits = default_lconv.frac_digits =
|
||||
debug_lconv.p_cs_precedes = default_lconv.p_cs_precedes =
|
||||
debug_lconv.p_sep_by_space = default_lconv.p_sep_by_space =
|
||||
debug_lconv.n_cs_precedes = default_lconv.n_cs_precedes =
|
||||
debug_lconv.n_sep_by_space = default_lconv.n_sep_by_space =
|
||||
debug_lconv.p_sign_posn = default_lconv.p_sign_posn =
|
||||
debug_lconv.n_sign_posn = default_lconv.n_sign_posn =
|
||||
CHAR_MAX;
|
||||
}
|
||||
|
||||
#if !_lib_localeconv
|
||||
|
||||
struct lconv*
|
||||
localeconv(void)
|
||||
{
|
||||
if(!default_lconv.decimal_point)
|
||||
init_lconv_structs();
|
||||
return &default_lconv;
|
||||
}
|
||||
|
||||
|
@ -92,6 +80,8 @@ localeconv(void)
|
|||
struct lconv*
|
||||
_ast_localeconv(void)
|
||||
{
|
||||
if(!default_lconv.decimal_point)
|
||||
init_lconv_structs();
|
||||
if ((locales[AST_LC_MONETARY]->flags | locales[AST_LC_NUMERIC]->flags) & LC_debug)
|
||||
return &debug_lconv;
|
||||
if ((locales[AST_LC_NUMERIC]->flags & (LC_default|LC_local)) == LC_local)
|
||||
|
|
|
@ -94,14 +94,18 @@ spawnveg(const char* path, char* const argv[], char* const envv[], pid_t pgid)
|
|||
#ifndef P_NOWAIT
|
||||
#define P_NOWAIT _P_NOWAIT
|
||||
#endif
|
||||
#ifndef P_DETACH
|
||||
#if !defined(P_DETACH) && defined(_P_DETACH)
|
||||
#define P_DETACH _P_DETACH
|
||||
#endif
|
||||
|
||||
pid_t
|
||||
spawnveg(const char* path, char* const argv[], char* const envv[], pid_t pgid)
|
||||
{
|
||||
#if defined(P_DETACH)
|
||||
return spawnve(pgid ? P_DETACH : P_NOWAIT, path, argv, envv ? envv : environ);
|
||||
#else
|
||||
return spawnve(P_NOWAIT, path, argv, envv ? envv : environ);
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
|
@ -11,7 +11,7 @@ ref -D_def_map_ast=1
|
|||
lib atexit,getpagesize,mallinfo,mallopt,memalign,mstats
|
||||
lib onexit,pvalloc,strdup,valloc,vmalloc
|
||||
lib _malloc,__malloc,__libc_malloc
|
||||
hdr alloca,malloc,stat,stdlib,unistd
|
||||
hdr alloca,malloc,stat,stdlib,unistd,sys/shm
|
||||
mem mallinfo.arena,mstats.bytes_total malloc.h
|
||||
sys stat
|
||||
typ ssize_t
|
||||
|
|
|
@ -57,7 +57,7 @@ and
|
|||
as well as on systems with only
|
||||
.IR spawnve (2)
|
||||
or
|
||||
.IR spanwveg (3).
|
||||
.IR spawnveg (3).
|
||||
.PP
|
||||
.L procopen
|
||||
runs
|
||||
|
|
|
@ -1,152 +0,0 @@
|
|||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1985-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 <gsf@research.att.com> *
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
/*
|
||||
* OBSOLETE 20030321 -- use spawnveg()
|
||||
*/
|
||||
|
||||
#include <ast_lib.h>
|
||||
|
||||
#if !_lib_spawnve
|
||||
#define spawnve ______spawnve
|
||||
#endif
|
||||
#if !_lib_spawnvpe
|
||||
#define spawnvpe ______spawnvpe
|
||||
#endif
|
||||
#if !_lib_spawnvp
|
||||
#define spawnvp ______spawnvp
|
||||
#endif
|
||||
#if !_lib_spawnlp
|
||||
#define spawnlp ______spawnlp
|
||||
#endif
|
||||
|
||||
#include <ast.h>
|
||||
#include <error.h>
|
||||
|
||||
#if !_lib_spawnve
|
||||
#undef spawnve
|
||||
#endif
|
||||
#if !_lib_spawnvpe
|
||||
#undef spawnvpe
|
||||
#endif
|
||||
#if !_lib_spawnvp
|
||||
#undef spawnvp
|
||||
#endif
|
||||
#if !_lib_spawnlp
|
||||
#undef spawnlp
|
||||
#endif
|
||||
|
||||
#if defined(__EXPORT__)
|
||||
#define extern __EXPORT__
|
||||
#endif
|
||||
|
||||
#if _lib_spawnve
|
||||
|
||||
NoN(spawnve)
|
||||
|
||||
#else
|
||||
|
||||
extern pid_t
|
||||
spawnve(const char* cmd, char* const argv[], char* const envv[])
|
||||
{
|
||||
return spawnveg(cmd, argv, envv, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if _lib_spawnvpe
|
||||
|
||||
NoN(spawnvpe)
|
||||
|
||||
#else
|
||||
|
||||
extern pid_t
|
||||
spawnvpe(const char* name, char* const argv[], char* const envv[])
|
||||
{
|
||||
register const char* path = name;
|
||||
pid_t pid;
|
||||
char buffer[PATH_MAX];
|
||||
|
||||
if (*path != '/')
|
||||
path = pathpath(name, NULL, PATH_REGULAR|PATH_EXECUTE, buffer, sizeof(buffer));
|
||||
if ((pid = spawnve(path, argv, envv)) >= 0)
|
||||
return pid;
|
||||
if (errno == ENOEXEC)
|
||||
{
|
||||
register char** newargv;
|
||||
register char** ov;
|
||||
register char** nv;
|
||||
|
||||
for (ov = (char**)argv; *ov++;);
|
||||
if (newargv = newof(0, char*, ov + 1 - (char**)argv, 0))
|
||||
{
|
||||
nv = newargv;
|
||||
*nv++ = "sh";
|
||||
*nv++ = (char*)path;
|
||||
ov = (char**)argv;
|
||||
while (*nv++ = *++ov);
|
||||
path = pathshell();
|
||||
pid = spawnve(path, newargv, environ);
|
||||
free(newargv);
|
||||
}
|
||||
else
|
||||
errno = ENOMEM;
|
||||
}
|
||||
return pid;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if _lib_spawnvp
|
||||
|
||||
NoN(spawnvp)
|
||||
|
||||
#else
|
||||
|
||||
extern pid_t
|
||||
spawnvp(const char* name, char* const argv[])
|
||||
{
|
||||
return spawnvpe(name, argv, environ);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if _lib_spawnlp
|
||||
|
||||
NoN(spawnlp)
|
||||
|
||||
#else
|
||||
|
||||
extern pid_t
|
||||
spawnlp(const char* name, const char* arg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
pid_t pid;
|
||||
|
||||
va_start(ap, arg);
|
||||
pid = spawnvp(name, (char* const*)&arg);
|
||||
va_end(ap);
|
||||
return pid;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -998,36 +998,6 @@ extern Mstats_t mstats()
|
|||
|
||||
#define setregmax(n)
|
||||
|
||||
#undef calloc
|
||||
extern Void_t* calloc _ARG_((size_t, size_t));
|
||||
|
||||
#undef cfree
|
||||
extern void cfree _ARG_((Void_t*));
|
||||
|
||||
#undef free
|
||||
extern void free _ARG_((Void_t*));
|
||||
|
||||
#undef malloc
|
||||
extern Void_t* malloc _ARG_((size_t));
|
||||
|
||||
#if _lib_memalign
|
||||
#undef memalign
|
||||
extern Void_t* memalign _ARG_((size_t, size_t));
|
||||
#endif
|
||||
|
||||
#if _lib_pvalloc
|
||||
#undef pvalloc
|
||||
extern Void_t* pvalloc _ARG_((size_t));
|
||||
#endif
|
||||
|
||||
#undef realloc
|
||||
extern Void_t* realloc _ARG_((Void_t*, size_t));
|
||||
|
||||
#if _lib_valloc
|
||||
#undef valloc
|
||||
extern Void_t* valloc _ARG_((size_t));
|
||||
#endif
|
||||
|
||||
#if defined(__EXPORT__)
|
||||
#define extern __EXPORT__
|
||||
#endif
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
* Phong Vo <kpv@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#if defined(_UWIN) && defined(_BLD_ast)
|
||||
#include "FEATURE/vmalloc"
|
||||
#if !_hdr_sys_shm || (defined(_UWIN) && defined(_BLD_ast))
|
||||
|
||||
void _STUB_vmmapopen(){}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue