Wed Nov 29 20:15:21 2017 UTC ()
fix typo in comment


(snj)
diff -r1.5 -r1.6 src/sys/sys/spawn.h

cvs diff -r1.5 -r1.6 src/sys/sys/spawn.h (switch to unified diff)

--- src/sys/sys/spawn.h 2014/09/05 05:46:54 1.5
+++ src/sys/sys/spawn.h 2017/11/29 20:15:21 1.6
@@ -1,105 +1,105 @@ @@ -1,105 +1,105 @@
1/* $NetBSD: spawn.h,v 1.5 2014/09/05 05:46:54 matt Exp $ */ 1/* $NetBSD: spawn.h,v 1.6 2017/11/29 20:15:21 snj Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org> 4 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE. 26 * SUCH DAMAGE.
27 * 27 *
28 * $FreeBSD: src/include/spawn.h,v 1.3.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $ 28 * $FreeBSD: src/include/spawn.h,v 1.3.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $
29 */ 29 */
30 30
31#ifndef _SYS_SPAWN_H_ 31#ifndef _SYS_SPAWN_H_
32#define _SYS_SPAWN_H_ 32#define _SYS_SPAWN_H_
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35#include <sys/featuretest.h> 35#include <sys/featuretest.h>
36#include <sys/types.h> 36#include <sys/types.h>
37#include <sys/sigtypes.h> 37#include <sys/sigtypes.h>
38#include <sys/signal.h> 38#include <sys/signal.h>
39#include <sys/sched.h> 39#include <sys/sched.h>
40 40
41struct posix_spawnattr { 41struct posix_spawnattr {
42 short sa_flags; 42 short sa_flags;
43 pid_t sa_pgroup; 43 pid_t sa_pgroup;
44 struct sched_param sa_schedparam; 44 struct sched_param sa_schedparam;
45 int sa_schedpolicy; 45 int sa_schedpolicy;
46 sigset_t sa_sigdefault; 46 sigset_t sa_sigdefault;
47 sigset_t sa_sigmask; 47 sigset_t sa_sigmask;
48}; 48};
49 49
50enum fae_action { FAE_OPEN, FAE_DUP2, FAE_CLOSE }; 50enum fae_action { FAE_OPEN, FAE_DUP2, FAE_CLOSE };
51typedef struct posix_spawn_file_actions_entry { 51typedef struct posix_spawn_file_actions_entry {
52 enum fae_action fae_action; 52 enum fae_action fae_action;
53 53
54 int fae_fildes; 54 int fae_fildes;
55 union { 55 union {
56 struct { 56 struct {
57 char *path; 57 char *path;
58#define fae_path fae_data.open.path 58#define fae_path fae_data.open.path
59 int oflag; 59 int oflag;
60#define fae_oflag fae_data.open.oflag 60#define fae_oflag fae_data.open.oflag
61 mode_t mode; 61 mode_t mode;
62#define fae_mode fae_data.open.mode 62#define fae_mode fae_data.open.mode
63 } open; 63 } open;
64 struct { 64 struct {
65 int newfildes; 65 int newfildes;
66#define fae_newfildes fae_data.dup2.newfildes 66#define fae_newfildes fae_data.dup2.newfildes
67 } dup2; 67 } dup2;
68 } fae_data; 68 } fae_data;
69} posix_spawn_file_actions_entry_t; 69} posix_spawn_file_actions_entry_t;
70 70
71struct posix_spawn_file_actions { 71struct posix_spawn_file_actions {
72 unsigned int size; /* size of fae array */ 72 unsigned int size; /* size of fae array */
73 unsigned int len; /* how many slots are used */ 73 unsigned int len; /* how many slots are used */
74 posix_spawn_file_actions_entry_t *fae; 74 posix_spawn_file_actions_entry_t *fae;
75}; 75};
76 76
77typedef struct posix_spawnattr posix_spawnattr_t; 77typedef struct posix_spawnattr posix_spawnattr_t;
78typedef struct posix_spawn_file_actions posix_spawn_file_actions_t; 78typedef struct posix_spawn_file_actions posix_spawn_file_actions_t;
79 79
80#define POSIX_SPAWN_RESETIDS 0x01 80#define POSIX_SPAWN_RESETIDS 0x01
81#define POSIX_SPAWN_SETPGROUP 0x02 81#define POSIX_SPAWN_SETPGROUP 0x02
82#define POSIX_SPAWN_SETSCHEDPARAM 0x04 82#define POSIX_SPAWN_SETSCHEDPARAM 0x04
83#define POSIX_SPAWN_SETSCHEDULER 0x08 83#define POSIX_SPAWN_SETSCHEDULER 0x08
84#define POSIX_SPAWN_SETSIGDEF 0x10 84#define POSIX_SPAWN_SETSIGDEF 0x10
85#define POSIX_SPAWN_SETSIGMASK 0x20 85#define POSIX_SPAWN_SETSIGMASK 0x20
86 86
87#ifdef _NETBSD_SOURCE 87#ifdef _NETBSD_SOURCE
88/* 88/*
89 * With this flag set, the kernel part of posix_spawn will not try to 89 * With this flag set, the kernel part of posix_spawn will not try to
90 * maximize parallelism, but instead the parent will wait for the child 90 * maximize parallelism, but instead the parent will wait for the child
91 * process to complete all file/scheduler actions and report back errors 91 * process to complete all file/scheduler actions and report back errors
92 * from that via the return value of the posix_spawn syscall. This is 92 * from that via the return value of the posix_spawn syscall. This is
93 * usefull for testing, as it can verify the generated error codes and 93 * useful for testing, as it can verify the generated error codes and
94 * match to the supposedly triggered failures. 94 * match to the supposedly triggered failures.
95 * In general, the kernel will return from the posix_spawn syscall as 95 * In general, the kernel will return from the posix_spawn syscall as
96 * early as possible, as soon as creating the new process is known to 96 * early as possible, as soon as creating the new process is known to
97 * work. Errors might either be reported back via the return value in 97 * work. Errors might either be reported back via the return value in
98 * the parent, or (less explicit) by an error exit of the child 98 * the parent, or (less explicit) by an error exit of the child
99 * process. Our test cases deal with both behaviours in the general 99 * process. Our test cases deal with both behaviours in the general
100 * case, but request the POSIX_SPAWN_RETURNERROR for some tests. 100 * case, but request the POSIX_SPAWN_RETURNERROR for some tests.
101 */ 101 */
102#define POSIX_SPAWN_RETURNERROR 0x40 102#define POSIX_SPAWN_RETURNERROR 0x40
103#endif 103#endif
104 104
105#endif /* !_SYS_SPAWN_H_ */ 105#endif /* !_SYS_SPAWN_H_ */