c - Vfork() 和更多腐败

标签 c unix bsd

我的问题是执行时父堆栈会发生什么?

main()
{
    f();
    g();
}
f()
{
   vfork();
}
g()
{ 
    int blast[100],i;
    for(i=0;i<100;i++)
        blast[i]=i;
}

最佳答案

根据 http://pubs.opengroup.org/onlinepubs/009695399/functions/vfork.html 未定义该行为

the behavior is undefined if the process created by vfork() [...] returns from the function in which vfork() was called [...]

关于c - Vfork() 和更多腐败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8201243/

相关文章:

c - 如果我有一个整数值大于 1024 的文件描述符,select() 仍然可以处理它吗?

c - 按位否定后右移的意外结果

ios - 如何在 C 文件中检查 iOS 版本?

php - 逐行读取文本文件并在每一行中搜索另一个文件 php 脚本

linux - 为什么不使用 sshrc 中设置的 $PATH?

mysql - FreeBSD 上的多个 MySQL 实例

c - 为什么 "const int*"可以指向一个非常量 int?

c - 带有 "if"的循环无法正常工作

unix - '-a' 在 Unix Shell 脚本中做什么

Python3.7 : error while loading shared libraries: libpython3. 7m.so.1.0