我继承了一个 Perl 脚本,根据机器配置,该脚本在使用 $ 调用
。 fork
期间会失败? == 11
根据errno.h
和various posts , 11 是EAGAIN
,即“再试一次”,因为某些资源暂时不可用。
有没有办法确定哪个资源导致 fork 失败, 除了一一增加各种系统限制之外 ( open file descriptors , swap space , 或者 数量allowable threads )?
最佳答案
假设您的意思是 $!
是 EAGAIN
,我系统上的 fork
手册页显示:
EAGAIN: fork() cannot allocate sufficient memory to copy the parent's page tables and allocate a task structure for the child.
EAGAIN: It was not possible to create a new process because the caller's RLIMIT_NPROC resource limit was encountered. To exceed this limit, the process must have either the CAP_SYS_ADMIN or the CAP_SYS_RESOURCE capability.
您是否正在尝试创建大量流程?当你的 child 长大后,你会收割他们吗?
关于perl - fork 失败并显示 "resource temporarily unavailable"。哪个资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44081295/