openat: don’t close (-1)
[gnulib.git] / tests / test-spawn-c++.cc
blob583a8ba4282855081e4a1e500d3ff3e578b7df3b
1 /* Test of <spawn.h> substitute in C++ mode.
2 Copyright (C) 2010-2024 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17 /* Written by Bruno Haible <bruno@clisp.org>, 2010. */
19 #define GNULIB_NAMESPACE gnulib
20 #include <config.h>
22 #include <spawn.h>
24 #include "signature.h"
27 #if GNULIB_TEST_POSIX_SPAWN
28 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn, int,
29 (pid_t *, const char *, const posix_spawn_file_actions_t *,
30 const posix_spawnattr_t *, char *const[], char *const[]));
31 #endif
33 #if GNULIB_TEST_POSIX_SPAWNP
34 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnp, int,
35 (pid_t *, const char *, const posix_spawn_file_actions_t *,
36 const posix_spawnattr_t *, char *const[], char *const[]));
37 #endif
39 #if GNULIB_TEST_POSIX_SPAWNATTR_INIT
40 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_init, int,
41 (posix_spawnattr_t *));
42 #endif
44 #if GNULIB_TEST_POSIX_SPAWNATTR_DESTROY
45 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_destroy, int,
46 (posix_spawnattr_t *));
47 #endif
49 #if GNULIB_TEST_POSIX_SPAWNATTR_GETSIGDEFAULT
50 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_getsigdefault, int,
51 (const posix_spawnattr_t *, sigset_t *));
52 #endif
54 #if GNULIB_TEST_POSIX_SPAWNATTR_SETSIGDEFAULT
55 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_setsigdefault, int,
56 (posix_spawnattr_t *, const sigset_t *));
57 #endif
59 #if GNULIB_TEST_POSIX_SPAWNATTR_GETSIGMASK
60 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_getsigmask, int,
61 (const posix_spawnattr_t *, sigset_t *));
62 #endif
64 #if GNULIB_TEST_POSIX_SPAWNATTR_SETSIGMASK
65 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_setsigmask, int,
66 (posix_spawnattr_t *, const sigset_t *));
67 #endif
69 #if GNULIB_TEST_POSIX_SPAWNATTR_GETFLAGS
70 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_getflags, int,
71 (const posix_spawnattr_t *, short int *));
72 #endif
74 #if GNULIB_TEST_POSIX_SPAWNATTR_SETFLAGS
75 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_setflags, int,
76 (posix_spawnattr_t *, short int));
77 #endif
79 #if GNULIB_TEST_POSIX_SPAWNATTR_GETPGROUP
80 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_getpgroup, int,
81 (const posix_spawnattr_t *, pid_t *));
82 #endif
84 #if GNULIB_TEST_POSIX_SPAWNATTR_SETPGROUP
85 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_setpgroup, int,
86 (posix_spawnattr_t *, pid_t));
87 #endif
89 #if GNULIB_TEST_POSIX_SPAWNATTR_GETSCHEDPOLICY
90 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_getschedpolicy, int,
91 (const posix_spawnattr_t *, int *));
92 #endif
94 #if GNULIB_TEST_POSIX_SPAWNATTR_SETSCHEDPOLICY
95 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_setschedpolicy, int,
96 (posix_spawnattr_t *, int));
97 #endif
99 #if GNULIB_TEST_POSIX_SPAWNATTR_GETSCHEDPARAM
100 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_getschedparam, int,
101 (const posix_spawnattr_t *, struct sched_param *));
102 #endif
104 #if GNULIB_TEST_POSIX_SPAWNATTR_SETSCHEDPARAM
105 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawnattr_setschedparam, int,
106 (posix_spawnattr_t *, const struct sched_param *));
107 #endif
109 #if GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_INIT
110 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_init, int,
111 (posix_spawn_file_actions_t *));
112 #endif
114 #if GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_DESTROY
115 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_destroy, int,
116 (posix_spawn_file_actions_t *));
117 #endif
119 #if GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
120 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_addopen, int,
121 (posix_spawn_file_actions_t *, int, const char *, int,
122 mode_t));
123 #endif
125 #if GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
126 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_addclose, int,
127 (posix_spawn_file_actions_t *, int));
128 #endif
130 #if GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
131 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_adddup2, int,
132 (posix_spawn_file_actions_t *, int, int));
133 #endif
135 #if GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
136 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_addchdir, int,
137 (posix_spawn_file_actions_t *, const char *));
138 #endif
140 #if GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
141 SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_addfchdir, int,
142 (posix_spawn_file_actions_t *, int));
143 #endif
147 main ()