gpt4 book ai didi

node.js - node-posix setrlimit 崩溃,EINVAL - 无效参数

转载 作者:搜寻专家 更新时间:2023-10-31 22:41:14 25 4
gpt4 key购买 nike

以下男女同校给我一个 EINVAL 错误和 Node 崩溃:

var posix = require('posix');
console.log(posix.getrlimit('nofile'));
posix.setrlimit('nofile', {soft: 10000});


ERROR:

/var/myfil/index.js:19
posix.setrlimit('nofile', {soft: 10000});
^
Error: EINVAL, Invalid argument
at Object.<anonymous> (/var/myfile/index.js:19:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)

问题是什么?这与文档完全一样。

最佳答案

如果您尝试设置高于硬限制的软限制,就会发生这种情况。

尝试同时设置它们:

posix.setrlimit('nofile', { soft: 10000, hard: 10000 });

关于node.js - node-posix setrlimit 崩溃,EINVAL - 无效参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19017658/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com