在Linux中的子进程是什么,什么父进程的东西在Linux中新创建的子进程中共享

孩子是家长的 副本。例如,孩子获取父母的数据空间,堆和堆栈的副本。请注意,这个 是儿童的副本;父母和孩子不共享这些内存部分

fork的一个特点是在父项中打开的所有文件描述符都是 在子项中复制。

但是也有一些由子继承父的许多其他性质:

1. real user ID, real group ID, effective user ID, effective group ID

2. supplementary group IDs

3. process group ID

4. session ID

5. controlling terminal

6. set-user-ID flag and set-group-ID flag

7. current working directory

8. root directory

9. file mode creation mask

10. signal mask and dispositions

11. the close-on-exec flag for any open file descriptors

12. environment

13. attached shared memory segments

14. resource limits

15. Memory mappings

的父母和孩子之间的差异是

1. the return value from fork

2. the process IDs are different

3. the two processes have different parent process IDs—the parent process ID of the child is the parent; the parent process ID of the parent doesn't change

4. the child's values for tms_utime, tms_stime, tms_cutime, and tms_ustime are set to 0

5. file locks set by the parent are not inherited by the child

6. pending alarms are cleared for the child

7. the set of pending signals for the child is set to the empty set

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值