![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
![]() 猫猫猫 ![]() ![]() ![]() Group: Power Cat Posts: 626 Joined: 2006-12-8 Member No.: 2 ![]() |
程序模型:
代码 pipe(rpipes);
pipe(wpipes); fork() child: close(wpipes[1]); close(rpipes[0]); dup2(wpipes[0], STDIN); dup2(rpipes[1], STDOUT); close(wpipes[0]); close(rpipes[1]); exec(..) parent: close(wpipes[0]); close(rpipes[1]); //write to stdin write(wpipes[1], ...); //read from stdout read(rpipes[0], ...); |
|
|
![]() ![]() |
Lo-Fi Version | Time is now: 2025-4-4 12:40 |