#ifdef __APPLE__ #include <crt_externs.h> #define environ (*_NSGetEnviron()) #else /* This is one of the rare times it's more portable to declare an *externalsymbolexplicitly,ratherthanviaasystemheader. *ThedeclarationisstandardizedaspartofUNIX98,butthereis *nostandard(notevende-facto)headerfilewherethe *declarationistobefound.See: *http://www.opengroup.org/onlinepubs/009695399/functions/environ.html *http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_02.html * *"AllidentifiersinthisvolumeofIEEEStd1003.1-2001,except *environ,aredefinedinatleastoneoftheheaders"(!)
*/ externchar **environ; #endif
/* These numbers must be the same as the Enum in ProcessImpl.java *Mustbeabetterwayofdoingthis.
*/ #define MODE_FORK 1 #define MODE_POSIX_SPAWN 2 #define MODE_VFORK 3 #define MODE_CLONE 4
typedefstruct _ChildStuff
{ int in[2]; int out[2]; int err[2]; int fail[2]; int childenv[2]; int fds[3]; int mode; constchar **argv; int argc; constchar **envv; constchar *pdir; int redirectErrorStream; int sendAlivePing;
} ChildStuff;
/* following used in addition when mode is SPAWN */ typedefstruct _SpawnInfo { int nargv; /* number of argv array elements */ int argvBytes; /* total number of bytes in argv array */ int nenvv; /* number of envv array elements */ int envvBytes; /* total number of bytes in envv array */ int dirlen; /* length of home directory string */ int nparentPathv; /* number of elements in parentPathv array */ int parentPathvBytes; /* total number of bytes in parentPathv array */
} SpawnInfo;
/* If ChildStuff.sendAlivePing is true, child shall signal aliveness to *theparentthemomentitgainsconsciousness,beforeanysubsequent *pre-execerrorscouldhappen. *Thiscodemustfitintoanintandnotbeavaliderrnovalueonanyof
* our platforms. */ #define CHILD_IS_ALIVE 65535
ssize_t restartableWrite(int fd, constvoid *buf, size_t count); int restartableDup2(int fd_from, int fd_to); int closeSafely(int fd); int isAsciiDigit(char c); int closeDescriptors(void); int moveDescriptor(int fd_from, int fd_to);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.