Hi Waldemar,
I've recently encountered an issue with broken posix_spawn in uClibc-ng
1.0.26, which made cups 2.2.[46] unusable. Looking at commit
71b3a63b641716165f664cf112be0673a122cea0, I see that it should be fixed in
1.0.27. I have a small test code that illustrates the problem with
posix_spawn, which works fine with GNU lib C, but fails with uClibc-ng
1.0.26 (see posix_spawn.c attached). If I remove POSIX_SPAWN_SETSIGDEF
flag, it works OK. I can't test it with 1.0.27 yet, could you please verify
that it works?
Also, if it works fine, another question. What is the proper macro test for
working posix_spawn (uClibc-ng version 1.0.27+)?
Thank you,
Alex
#include
#include
#include
#include
#include
#include
extern char **environ;
void run_cmd(char *cmd)
{
pid_t pid;
posix_spawnattr_t attrs;
posix_spawn_file_actions_t actions;
sigset_t defsignals;
char *argv[] = {"sh", "-c", cmd, NULL};
int status;
sigemptyset();
sigaddset(, SIGTERM);
sigaddset(, SIGCHLD);
sigaddset(, SIGPIPE);
posix_spawnattr_init();
posix_spawnattr_setflags(, POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_SETSIGDEF);
posix_spawnattr_setpgroup(, 0);
posix_spawnattr_setsigdefault(, );
printf("Run command: %s\n", cmd);
status = posix_spawn(, "/bin/sh", , , argv, environ);
if (status == 0) {
printf("Child pid: %i\n", pid);
if (waitpid(pid, , 0) != -1) {
printf("Child exited with status %i\n", status);
} else {
perror("waitpid");
}
} else {
printf("posix_spawn: %s\n", strerror(status));
}
}
int main(int argc, char* argv[])
{
run_cmd(argv[1]);
return 0;
}
___
devel mailing list
devel@uclibc-ng.org
https://mailman.uclibc-ng.org/cgi-bin/mailman/listinfo/devel