We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From open group write() doc:
Code to reproduction:
#include <errno.h> #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <signal.h> pid_t pid; int pipefd[2]; void handler(int signum) { printf("In handler\n"); } int main(void) { pipe(pipefd); pid = fork(); if (pid == 0){ exit(0); } sleep(1); struct sigaction sa; sa.sa_handler = handler; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sigaction(SIGPIPE, &sa, NULL); close(pipefd[0]); int ret = write(pipefd[1], "aa", 2); printf("errno: %d\n", errno); //32 = EPIPE printf("ret: %d\n", ret); return 0; }
Output:
Parent process should get SIGPIPE and invoke handler. Probably same fix in read().
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
From open group write() doc:
Code to reproduction:
Output:
Parent process should get SIGPIPE and invoke handler. Probably same fix in read().
The text was updated successfully, but these errors were encountered: