diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-01-23 16:54:55 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-01-23 16:54:55 (GMT) |
commit | 5bf617b1e9347322b8b16419fd5e74107e8b1c26 (patch) | |
tree | e5bbb785b82b35bc62df41bebca8b540078aaf76 /xpa/xlaunch.h | |
parent | 51e1f85047b34f095ed69a3024d696997d2667c8 (diff) | |
parent | 0ebcd152c10d2eae6b62f16e7138aa187a8a1bdd (diff) | |
download | blt-5bf617b1e9347322b8b16419fd5e74107e8b1c26.zip blt-5bf617b1e9347322b8b16419fd5e74107e8b1c26.tar.gz blt-5bf617b1e9347322b8b16419fd5e74107e8b1c26.tar.bz2 |
Merge commit '0ebcd152c10d2eae6b62f16e7138aa187a8a1bdd' as 'xpa'
Diffstat (limited to 'xpa/xlaunch.h')
-rw-r--r-- | xpa/xlaunch.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/xpa/xlaunch.h b/xpa/xlaunch.h new file mode 100644 index 0000000..2c20cb8 --- /dev/null +++ b/xpa/xlaunch.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory + */ + +/* + * + * xlaunch.h -- declarations for launching a program + * + */ + +#ifndef __xlaunch_h +#define __xlaunch_h + +#if HAVE_CONFIG_H +#include <conf.h> +#endif + +#include <stdio.h> +#include <errno.h> +#include <signal.h> +#include <fcntl.h> +#include <sys/time.h> +#include <sys/stat.h> +#if HAVE_STRING_H +#include <string.h> +#endif +#if HAVE_STRINGS_H +#include <strings.h> +#endif +#if HAVE_MALLOC_H +#include <malloc.h> +#endif +#if HAVE_UNISTD_H +#include <unistd.h> +#endif +#if HAVE_POSIX_SPAWN +#include <spawn.h> +#endif +#include <xport.h> +#include <word.h> +#include <xalloc.h> +#include <prsetup.h> + +#define LAUNCH_ARGS 1024 + +#define LAUNCH_SPACE '\001' + +/* for fork/exec, one of these is required to specify the technique to be used + by the parent when determining if the child started successfully */ +#if !defined(LAUNCH_USE_PIPE) && !defined(LAUNCH_USE_WAITPID) +#define LAUNCH_USE_PIPE 1 +#endif +/* ... but not both */ +#if defined(LAUNCH_USE_PIPE) && defined(LAUNCH_USE_WAITPID) +#error "LAUNCH_USE_PIPE and LAUNCH_USE_WAITPID are mutually exclusive" +#endif + +#ifndef LAUNCH_WAIT_TRIES +#define LAUNCH_WAIT_TRIES 100 +#endif +#ifndef LAUNCH_WAIT_MSEC +#define LAUNCH_WAIT_MSEC 5000 +#endif + +#if HAVE_MINGW32|HAVE_CYGWIN +#define HAVE_SPAWNVP 1 +#endif + +#if HAVE_MINGW32 +/* for now, ensure that MinGW utilizes spawnvp() */ +#define LAUNCH_DEFAULT_WHICH 3 +#elif HAVE_POSIX_SPAWN +/* use posix_spawn if possible (required for OS X 10.5) */ +#define LAUNCH_DEFAULT_WHICH 2 +#else +/* use our home-grown version */ +#define LAUNCH_DEFAULT_WHICH 1 +#endif + +_PRbeg + +int Launch _PRx((char *cmdstring, int wait, char **stdfiles, int *pipes)); +pid_t LaunchPid _PRx((void)); + +_PRend + +#endif |