Linux 写模式管道是同步的吗?

Linux 写模式管道是同步的吗?,linux,pipe,Linux,Pipe,下面的代码会在调用abort()之前等待命令执行完成吗? 如果没有,并且父进程被中止,那么子进程(bashshell)将处于活动状态并继续执行该命令 FILE *_popenShell = NULL; _popenShell = popen("/bin/bash","w"); fwrite("some_command", 1, SOME_SIZE, _popenShell); fflush(_popenShell); pclose(_popenShell); ab

下面的代码会在调用abort()之前等待命令执行完成吗? 如果没有,并且父进程被中止,那么子进程(bashshell)将处于活动状态并继续执行该命令

FILE *_popenShell = NULL;
_popenShell = popen("/bin/bash","w");
fwrite("some_command", 1, SOME_SIZE, _popenShell);
fflush(_popenShell);        
pclose(_popenShell);        
abort();
等待直到子项终止(使用
wait4()
)。在您点击
abort()
时,子项不应正在运行