spawn.h revision f9f6ed06923c6f348695de4d5185b4013adc4b6b
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SPAWN_H
#define _SPAWN_H
#include <sys/feature_tests.h>
#include <signal.h>
#include <sched.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* flags for posix_spawnattr_setflags()
*/
#define POSIX_SPAWN_RESETIDS 0x0001
#define POSIX_SPAWN_SETPGROUP 0x0002
#define POSIX_SPAWN_SETSIGDEF 0x0004
#define POSIX_SPAWN_SETSIGMASK 0x0008
#define POSIX_SPAWN_SETSCHEDPARAM 0x0010
#define POSIX_SPAWN_SETSCHEDULER 0x0020
/*
* non-portable Solaris extensions
*/
#define POSIX_SPAWN_NOSIGCHLD_NP 0x1000
#define POSIX_SPAWN_WAITPID_NP 0x2000
#define POSIX_SPAWN_NOEXECERR_NP 0x4000
typedef struct {
void *__spawn_attrp; /* implementation-private */
typedef struct {
void *__file_attrp; /* implementation-private */
#if defined(__STDC__)
extern int posix_spawn(
const char *_RESTRICT_KYWD path,
char *const argv[_RESTRICT_KYWD],
char *const envp[_RESTRICT_KYWD]);
extern int posix_spawnp(
const char *_RESTRICT_KYWD file,
char *const argv[_RESTRICT_KYWD],
char *const envp[_RESTRICT_KYWD]);
extern int posix_spawn_file_actions_init(
extern int posix_spawn_file_actions_destroy(
extern int posix_spawn_file_actions_addopen(
int filedes,
const char *_RESTRICT_KYWD path,
int oflag,
extern int posix_spawn_file_actions_addclose(
int filedes);
extern int posix_spawn_file_actions_adddup2(
int filedes,
int newfiledes);
extern int posix_spawnattr_init(
extern int posix_spawnattr_destroy(
extern int posix_spawnattr_setflags(
short flags);
extern int posix_spawnattr_getflags(
short *_RESTRICT_KYWD flags);
extern int posix_spawnattr_setpgroup(
extern int posix_spawnattr_getpgroup(
extern int posix_spawnattr_setschedparam(
extern int posix_spawnattr_getschedparam(
extern int posix_spawnattr_setschedpolicy(
int schedpolicy);
extern int posix_spawnattr_getschedpolicy(
int *_RESTRICT_KYWD schedpolicy);
extern int posix_spawnattr_setsigdefault(
extern int posix_spawnattr_getsigdefault(
extern int posix_spawnattr_setsigmask(
extern int posix_spawnattr_getsigmask(
#else /* __STDC__ */
extern int posix_spawn();
extern int posix_spawnp();
extern int posix_spawn_file_actions_init();
extern int posix_spawn_file_actions_destroy();
extern int posix_spawn_file_actions_addopen();
extern int posix_spawn_file_actions_addclose();
extern int posix_spawn_file_actions_adddup2();
extern int posix_spawnattr_init();
extern int posix_spawnattr_destroy();
extern int posix_spawnattr_setflags();
extern int posix_spawnattr_getflags();
extern int posix_spawnattr_setpgroup();
extern int posix_spawnattr_getpgroup();
extern int posix_spawnattr_setschedparam();
extern int posix_spawnattr_getschedparam();
extern int posix_spawnattr_setschedpolicy();
extern int posix_spawnattr_getschedpolicy();
extern int posix_spawnattr_setsigdefault();
extern int posix_spawnattr_getsigdefault();
extern int posix_spawnattr_setsigmask();
extern int posix_spawnattr_getsigmask();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* _SPAWN_H */