Commit 7a280a9
chloekek
Add std.process.Config.preExecDelegate
std.process.Config.preExecDelegate is just like
std.process.Config.preExecFunction, but can capture an environment, for
example:
import core.sys.linux.sys.prctl : PR_SET_PDEATHSIG, prctl;
import std.process : Config, execute;
void runProgram(int pdeathsig)
{
execute(
["program"],
config: Config(
preExecDelegate: () @trusted =>
prctl(PR_SET_PDEATHSIG, pdeathsig, 0, 0, 0) != -1,
),
);
}
preExecFunction is retained for backwards compatibility. If both
preExecFunction and preExecDelegate are given, both are called.1 parent 5ce5344 commit 7a280a9
File tree
3 files changed
+64
-45
lines changed- changelog
- std
3 files changed
+64
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1105 | 1113 | | |
1106 | 1114 | | |
1107 | 1115 | | |
| |||
1187 | 1195 | | |
1188 | 1196 | | |
1189 | 1197 | | |
1190 | | - | |
| 1198 | + | |
1191 | 1199 | | |
1192 | 1200 | | |
1193 | 1201 | | |
| |||
1272 | 1280 | | |
1273 | 1281 | | |
1274 | 1282 | | |
1275 | | - | |
| 1283 | + | |
1276 | 1284 | | |
| 1285 | + | |
1277 | 1286 | | |
1278 | 1287 | | |
1279 | 1288 | | |
1280 | | - | |
1281 | | - | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
1282 | 1297 | | |
1283 | 1298 | | |
1284 | 1299 | | |
1285 | 1300 | | |
1286 | | - | |
| 1301 | + | |
1287 | 1302 | | |
1288 | 1303 | | |
1289 | 1304 | | |
| |||
2202 | 2217 | | |
2203 | 2218 | | |
2204 | 2219 | | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
2205 | 2236 | | |
2206 | 2237 | | |
2207 | | - | |
| 2238 | + | |
2208 | 2239 | | |
2209 | 2240 | | |
2210 | 2241 | | |
2211 | | - | |
| 2242 | + | |
| 2243 | + | |
2212 | 2244 | | |
2213 | 2245 | | |
2214 | 2246 | | |
| |||
0 commit comments