Dr Andrew Scott G7VAV

My photo
 
April 2024
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 1 2 3 4 5
6 7 8 9 10 11 12


spawn.h
001: /* Definitions for POSIX spawn interface.
002:    Copyright (C) 2000, 2003, 2004, 2009, 2011 Free Software Foundation, Inc.
003:    This file is part of the GNU C Library.
004: 
005:    The GNU C Library is free software; you can redistribute it and/or
006:    modify it under the terms of the GNU Lesser General Public
007:    License as published by the Free Software Foundation; either
008:    version 2.1 of the License, or (at your option) any later version.
009: 
010:    The GNU C Library is distributed in the hope that it will be useful,
011:    but WITHOUT ANY WARRANTY; without even the implied warranty of
012:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:    Lesser General Public License for more details.
014: 
015:    You should have received a copy of the GNU Lesser General Public
016:    License along with the GNU C Library; if not, write to the Free
017:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
018:    02111-1307 USA.  */
019: 
020: #ifndef _SPAWN_H
021: #define _SPAWN_H        1
022: 
023: #include <features.h>
024: #include <sched.h>
025: #include <signal.h>
026: #include <sys/types.h>
027: 
028: 
029: /* Data structure to contain attributes for thread creation.  */
030: typedef struct
031: {
032:   short int __flags;
033:   pid_t __pgrp;
034:   sigset_t __sd;
035:   sigset_t __ss;
036:   struct sched_param __sp;
037:   int __policy;
038:   int __pad[16];
039: } posix_spawnattr_t;
040: 
041: 
042: /* Data structure to contain information about the actions to be
043:    performed in the new process with respect to file descriptors.  */
044: typedef struct
045: {
046:   int __allocated;
047:   int __used;
048:   struct __spawn_action *__actions;
049:   int __pad[16];
050: } posix_spawn_file_actions_t;
051: 
052: 
053: /* Flags to be set in the `posix_spawnattr_t'.  */
054: #define POSIX_SPAWN_RESETIDS            0x01
055: #define POSIX_SPAWN_SETPGROUP           0x02
056: #define POSIX_SPAWN_SETSIGDEF           0x04
057: #define POSIX_SPAWN_SETSIGMASK          0x08
058: #define POSIX_SPAWN_SETSCHEDPARAM       0x10
059: #define POSIX_SPAWN_SETSCHEDULER        0x20
060: #ifdef __USE_GNU
061: # define POSIX_SPAWN_USEVFORK           0x40
062: #endif
063: 
064: 
065: __BEGIN_DECLS
066: 
067: /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
068:    Before running the process perform the actions described in FILE-ACTIONS.
069: 
070:    This function is a possible cancellation point and therefore not
071:    marked with __THROW. */
072: extern int posix_spawn (pid_t *__restrict __pid,
073:                         __const char *__restrict __path,
074:                         __const posix_spawn_file_actions_t *__restrict
075:                         __file_actions,
076:                         __const posix_spawnattr_t *__restrict __attrp,
077:                         char *__const __argv[__restrict_arr],
078:                         char *__const __envp[__restrict_arr]);
079: 
080: /* Similar to `posix_spawn' but search for FILE in the PATH.
081: 
082:    This function is a possible cancellation point and therefore not
083:    marked with __THROW.  */
084: extern int posix_spawnp (pid_t *__pid, __const char *__file,
085:                          __const posix_spawn_file_actions_t *__file_actions,
086:                          __const posix_spawnattr_t *__attrp,
087:                          char *__const __argv[], char *__const __envp[]);
088: 
089: 
090: /* Initialize data structure with attributes for `spawn' to default values.  */
091: extern int posix_spawnattr_init (posix_spawnattr_t *__attr) __THROW;
092: 
093: /* Free resources associated with ATTR.  */
094: extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr) __THROW;
095: 
096: /* Store signal mask for signals with default handling from ATTR in
097:    SIGDEFAULT.  */
098: extern int posix_spawnattr_getsigdefault (__const posix_spawnattr_t *
099:                                           __restrict __attr,
100:                                           sigset_t *__restrict __sigdefault)
101:      __THROW;
102: 
103: /* Set signal mask for signals with default handling in ATTR to SIGDEFAULT.  */
104: extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *__restrict __attr,
105:                                           __const sigset_t *__restrict
106:                                           __sigdefault)
107:      __THROW;
108: 
109: /* Store signal mask for the new process from ATTR in SIGMASK.  */
110: extern int posix_spawnattr_getsigmask (__const posix_spawnattr_t *__restrict
111:                                        __attr,
112:                                        sigset_t *__restrict __sigmask) __THROW;
113: 
114: /* Set signal mask for the new process in ATTR to SIGMASK.  */
115: extern int posix_spawnattr_setsigmask (posix_spawnattr_t *__restrict __attr,
116:                                        __const sigset_t *__restrict __sigmask)
117:      __THROW;
118: 
119: /* Get flag word from the attribute structure.  */
120: extern int posix_spawnattr_getflags (__const posix_spawnattr_t *__restrict
121:                                      __attr,
122:                                      short int *__restrict __flags) __THROW;
123: 
124: /* Store flags in the attribute structure.  */
125: extern int posix_spawnattr_setflags (posix_spawnattr_t *_attr,
126:                                      short int __flags) __THROW;
127: 
128: /* Get process group ID from the attribute structure.  */
129: extern int posix_spawnattr_getpgroup (__const posix_spawnattr_t *__restrict
130:                                       __attr, pid_t *__restrict __pgroup)
131:      __THROW;
132: 
133: /* Store process group ID in the attribute structure.  */
134: extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
135:                                       pid_t __pgroup) __THROW;
136: 
137: /* Get scheduling policy from the attribute structure.  */
138: extern int posix_spawnattr_getschedpolicy (__const posix_spawnattr_t *
139:                                            __restrict __attr,
140:                                            int *__restrict __schedpolicy)
141:      __THROW;
142: 
143: /* Store scheduling policy in the attribute structure.  */
144: extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
145:                                            int __schedpolicy) __THROW;
146: 
147: /* Get scheduling parameters from the attribute structure.  */
148: extern int posix_spawnattr_getschedparam (__const posix_spawnattr_t *
149:                                           __restrict __attr,
150:                                           struct sched_param *__restrict
151:                                           __schedparam) __THROW;
152: 
153: /* Store scheduling parameters in the attribute structure.  */
154: extern int posix_spawnattr_setschedparam (posix_spawnattr_t *__restrict __attr,
155:                                           const struct sched_param *
156:                                           __restrict __schedparam) __THROW;
157: 
158: 
159: /* Initialize data structure for file attribute for `spawn' call.  */
160: extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *
161:                                           __file_actions) __THROW;
162: 
163: /* Free resources associated with FILE-ACTIONS.  */
164: extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *
165:                                              __file_actions) __THROW;
166: 
167: /* Add an action to FILE-ACTIONS which tells the implementation to call
168:    `open' for the given file during the `spawn' call.  */
169: extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *
170:                                              __restrict __file_actions,
171:                                              int __fd,
172:                                              __const char *__restrict __path,
173:                                              int __oflag, mode_t __mode)
174:      __THROW;
175: 
176: /* Add an action to FILE-ACTIONS which tells the implementation to call
177:    `close' for the given file descriptor during the `spawn' call.  */
178: extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *
179:                                               __file_actions, int __fd)
180:      __THROW;
181: 
182: /* Add an action to FILE-ACTIONS which tells the implementation to call
183:    `dup2' for the given file descriptors during the `spawn' call.  */
184: extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *
185:                                              __file_actions,
186:                                              int __fd, int __newfd) __THROW;
187: 
188: __END_DECLS
189: 
190: #endif /* spawn.h */
191: 


for client 3.143.17.127
© Andrew Scott 2006 - 2024,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/