6 ms·
> I can't reproduce this in Python (including my local 2.7 build), only using sh directly. Same for me. It looks like the POSIX folks accepted the author's sug
by akovaski 1y ago
> I can't reproduce this in Python (including my local 2.7 build), only using sh directly.
Same for me. It looks like the POSIX folks accepted the author's suggestion in 2022 and system() in glibc was updated in 2023.
https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=sysdeps/posix/system.c;h=488b95163bb4d88bc1e2bac8b41e29fcf1530f96;hp=d77720a625e0d42a5cdca13961aae9db9c95ea78;hb=868506eb427c9dcc6d869cd4885679be04e1b7dd;hpb=31bfe3ef4ea898df606cb6cc59ac72de27002b01 https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=sysdeps...
#include <stdlib.h>
int main(void) {
system("-x");
return 0;
}
...
> [pid 172293] execve("/bin/sh", ["sh", "-c", "--", "-x"], 0x7ffe221d2f58 /* 76 vars */) = 0