Return sensible errors instead of -1. Added some TODO comments.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20166 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2007-02-19 15:57:58 +00:00
parent c8d3c6f470
commit c926cb8d8a
2 changed files with 14 additions and 10 deletions
+6 -4
View File
@@ -2008,11 +2008,12 @@ spawn_kernel_thread(thread_func function, const char *name, int32 priority,
}
/* TODO: split this; have kernel version set kerrno */
int
getrlimit(int resource, struct rlimit * rlp)
{
if (!rlp)
return -1;
return B_BAD_ADDRESS;
switch (resource) {
case RLIMIT_NOFILE:
@@ -2020,18 +2021,19 @@ getrlimit(int resource, struct rlimit * rlp)
return vfs_getrlimit(resource, rlp);
default:
return -1;
return EINVAL;
}
return 0;
}
/* TODO: split this; have kernel version set kerrno */
int
setrlimit(int resource, const struct rlimit * rlp)
{
if (!rlp)
return -1;
return B_BAD_ADDRESS;
switch (resource) {
case RLIMIT_NOFILE:
@@ -2039,7 +2041,7 @@ setrlimit(int resource, const struct rlimit * rlp)
return vfs_setrlimit(resource, rlp);
default:
return -1;
return EINVAL;
}
return 0;