Print this page
remove support for non-ANSI compilation


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*


  23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 /*
  28  * Copyright (c) 2011 by Delphix. All rights reserved.
  29  */
  30 
  31 #ifndef _SPAWN_H
  32 #define _SPAWN_H
  33 
  34 #include <sys/feature_tests.h>
  35 #include <sys/types.h>
  36 #include <signal.h>
  37 #include <sched.h>
  38 
  39 #ifdef  __cplusplus
  40 extern "C" {
  41 #endif
  42 


  50 #define POSIX_SPAWN_SETSCHEDPARAM       0x0010
  51 #define POSIX_SPAWN_SETSCHEDULER        0x0020
  52 /*
  53  * non-portable Solaris extensions
  54  */
  55 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
  56 #define POSIX_SPAWN_SETSIGIGN_NP        0x0800
  57 #define POSIX_SPAWN_NOSIGCHLD_NP        0x1000
  58 #define POSIX_SPAWN_WAITPID_NP          0x2000
  59 #define POSIX_SPAWN_NOEXECERR_NP        0x4000
  60 #endif  /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
  61 
  62 typedef struct {
  63         void *__spawn_attrp;    /* implementation-private */
  64 } posix_spawnattr_t;
  65 
  66 typedef struct {
  67         void *__file_attrp;     /* implementation-private */
  68 } posix_spawn_file_actions_t;
  69 
  70 #if defined(__STDC__)
  71 
  72 extern int posix_spawn(
  73         pid_t *_RESTRICT_KYWD pid,
  74         const char *_RESTRICT_KYWD path,
  75         const posix_spawn_file_actions_t *file_actions,
  76         const posix_spawnattr_t *_RESTRICT_KYWD attrp,
  77         char *const argv[_RESTRICT_KYWD],
  78         char *const envp[_RESTRICT_KYWD]);
  79 
  80 extern int posix_spawnp(
  81         pid_t *_RESTRICT_KYWD pid,
  82         const char *_RESTRICT_KYWD file,
  83         const posix_spawn_file_actions_t *file_actions,
  84         const posix_spawnattr_t *_RESTRICT_KYWD attrp,
  85         char *const argv[_RESTRICT_KYWD],
  86         char *const envp[_RESTRICT_KYWD]);
  87 
  88 extern int posix_spawn_file_actions_init(
  89         posix_spawn_file_actions_t *file_actions);
  90 
  91 extern int posix_spawn_file_actions_destroy(


 171         int lowfiledes);
 172 
 173 extern int posix_spawnattr_setsigignore_np(
 174         posix_spawnattr_t *_RESTRICT_KYWD attr,
 175         const sigset_t *_RESTRICT_KYWD sigignore);
 176 
 177 extern int posix_spawnattr_getsigignore_np(
 178         const posix_spawnattr_t *_RESTRICT_KYWD attr,
 179         sigset_t *_RESTRICT_KYWD sigignore);
 180 
 181 #endif  /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
 182 
 183 extern int posix_spawnattr_setsigmask(
 184         posix_spawnattr_t *_RESTRICT_KYWD attr,
 185         const sigset_t *_RESTRICT_KYWD sigmask);
 186 
 187 extern int posix_spawnattr_getsigmask(
 188         const posix_spawnattr_t *_RESTRICT_KYWD attr,
 189         sigset_t *_RESTRICT_KYWD sigmask);
 190 
 191 #else   /* __STDC__ */
 192 
 193 extern int posix_spawn();
 194 extern int posix_spawnp();
 195 extern int posix_spawn_file_actions_init();
 196 extern int posix_spawn_file_actions_destroy();
 197 extern int posix_spawn_file_actions_addopen();
 198 extern int posix_spawn_file_actions_addclose();
 199 extern int posix_spawn_file_actions_adddup2();
 200 extern int posix_spawnattr_init();
 201 extern int posix_spawnattr_destroy();
 202 extern int posix_spawnattr_setflags();
 203 extern int posix_spawnattr_getflags();
 204 extern int posix_spawnattr_setpgroup();
 205 extern int posix_spawnattr_getpgroup();
 206 extern int posix_spawnattr_setschedparam();
 207 extern int posix_spawnattr_getschedparam();
 208 extern int posix_spawnattr_setschedpolicy();
 209 extern int posix_spawnattr_getschedpolicy();
 210 extern int posix_spawnattr_setsigdefault();
 211 extern int posix_spawnattr_getsigdefault();
 212 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
 213 extern int posix_spawn_pipe_np();
 214 extern int posix_spawn_file_actions_addclosefrom_np();
 215 extern int posix_spawnattr_setsigignore_np();
 216 extern int posix_spawnattr_getsigignore_np();
 217 #endif  /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
 218 extern int posix_spawnattr_setsigmask();
 219 extern int posix_spawnattr_getsigmask();
 220 
 221 #endif  /* __STDC__ */
 222 
 223 #ifdef  __cplusplus
 224 }
 225 #endif
 226 
 227 #endif  /* _SPAWN_H */


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24  *
  25  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29 /*
  30  * Copyright (c) 2011 by Delphix. All rights reserved.
  31  */
  32 
  33 #ifndef _SPAWN_H
  34 #define _SPAWN_H
  35 
  36 #include <sys/feature_tests.h>
  37 #include <sys/types.h>
  38 #include <signal.h>
  39 #include <sched.h>
  40 
  41 #ifdef  __cplusplus
  42 extern "C" {
  43 #endif
  44 


  52 #define POSIX_SPAWN_SETSCHEDPARAM       0x0010
  53 #define POSIX_SPAWN_SETSCHEDULER        0x0020
  54 /*
  55  * non-portable Solaris extensions
  56  */
  57 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
  58 #define POSIX_SPAWN_SETSIGIGN_NP        0x0800
  59 #define POSIX_SPAWN_NOSIGCHLD_NP        0x1000
  60 #define POSIX_SPAWN_WAITPID_NP          0x2000
  61 #define POSIX_SPAWN_NOEXECERR_NP        0x4000
  62 #endif  /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
  63 
  64 typedef struct {
  65         void *__spawn_attrp;    /* implementation-private */
  66 } posix_spawnattr_t;
  67 
  68 typedef struct {
  69         void *__file_attrp;     /* implementation-private */
  70 } posix_spawn_file_actions_t;
  71 


  72 extern int posix_spawn(
  73         pid_t *_RESTRICT_KYWD pid,
  74         const char *_RESTRICT_KYWD path,
  75         const posix_spawn_file_actions_t *file_actions,
  76         const posix_spawnattr_t *_RESTRICT_KYWD attrp,
  77         char *const argv[_RESTRICT_KYWD],
  78         char *const envp[_RESTRICT_KYWD]);
  79 
  80 extern int posix_spawnp(
  81         pid_t *_RESTRICT_KYWD pid,
  82         const char *_RESTRICT_KYWD file,
  83         const posix_spawn_file_actions_t *file_actions,
  84         const posix_spawnattr_t *_RESTRICT_KYWD attrp,
  85         char *const argv[_RESTRICT_KYWD],
  86         char *const envp[_RESTRICT_KYWD]);
  87 
  88 extern int posix_spawn_file_actions_init(
  89         posix_spawn_file_actions_t *file_actions);
  90 
  91 extern int posix_spawn_file_actions_destroy(


 171         int lowfiledes);
 172 
 173 extern int posix_spawnattr_setsigignore_np(
 174         posix_spawnattr_t *_RESTRICT_KYWD attr,
 175         const sigset_t *_RESTRICT_KYWD sigignore);
 176 
 177 extern int posix_spawnattr_getsigignore_np(
 178         const posix_spawnattr_t *_RESTRICT_KYWD attr,
 179         sigset_t *_RESTRICT_KYWD sigignore);
 180 
 181 #endif  /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
 182 
 183 extern int posix_spawnattr_setsigmask(
 184         posix_spawnattr_t *_RESTRICT_KYWD attr,
 185         const sigset_t *_RESTRICT_KYWD sigmask);
 186 
 187 extern int posix_spawnattr_getsigmask(
 188         const posix_spawnattr_t *_RESTRICT_KYWD attr,
 189         sigset_t *_RESTRICT_KYWD sigmask);
 190 
































 191 #ifdef  __cplusplus
 192 }
 193 #endif
 194 
 195 #endif  /* _SPAWN_H */