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
题目要求是 "使用pipe()系统调用,将一个子进程的标准输出连接到另一个子进程的标准输入",但是代码中直接向管道写了
if (pid == 0) { int ppid = fork(); if (ppid == 0) { char *msg = "Hello!\n"; // 关闭多余管道端 close(fd[0]); write(fd[1], msg, sizeof(char) * strlen(msg)); } else if (ppid > 0) { wait(NULL); char asw[10]; close(fd[1]); int res = read(fd[0], asw, sizeof(char) * 10); printf("size:%d, %s", res, asw); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
题目要求是 "使用pipe()系统调用,将一个子进程的标准输出连接到另一个子进程的标准输入",但是代码中直接向管道写了
The text was updated successfully, but these errors were encountered: