added an Haiku-specific RLIMIT (NumOpenVnodeMONitors) (UNIMPLEMENTED yet) (we might want to renumber it),

and used that one and NOFILE to implement R5 private calls _kset_[fd|mon]_limit_()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17545 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2006-05-22 19:37:40 +00:00
parent 239974d018
commit c2be814ab5
2 changed files with 20 additions and 2 deletions
+16 -2
View File
@@ -10,7 +10,9 @@
#include <SupportDefs.h>
#include <sys/resource.h>
#include <syscalls.h>
#include <errno.h>
int _kset_mon_limit_(int num);
@@ -23,14 +25,26 @@ int _kset_cpu_state_(int cpuNum, int state);
int
_kset_mon_limit_(int num)
{
return B_ERROR;
struct rlimit rl;
if (num < 1)
return EINVAL;
rl.rlim_cur = num;
if (setrlimit(RLIMIT_NOVMON, &rl) < 0)
return errno;
return B_OK;
}
int
_kset_fd_limit_(int num)
{
return B_ERROR;
struct rlimit rl;
if (num < 1)
return EINVAL;
rl.rlim_cur = num;
if (setrlimit(RLIMIT_NOFILE, &rl) < 0)
return errno;
return B_OK;
}