Stub for setrlimit

Change-Id: I54c7233d71805711bd72e1e751456aad30fd3e35
This commit is contained in:
2014-04-28 10:05:45 +02:00
parent e39e890e08
commit ac5b3e53d8
10 changed files with 49 additions and 25 deletions

View File

@@ -417,17 +417,13 @@ static struct {
{ RLIMIT_FSIZE, R_CSIZE, "filesize", },
{ RLIMIT_DATA, R_CSIZE, "datasize", },
{ RLIMIT_STACK, R_CSIZE, "stacksize", },
#if !defined(__minix)
{ RLIMIT_RSS, R_CSIZE, "memoryuse", },
{ RLIMIT_MEMLOCK, R_CSIZE, "memorylocked", },
{ RLIMIT_NPROC, R_CNUMB, "maxproc", },
{ RLIMIT_NTHR, R_CNUMB, "maxthread", },
#endif /* !defined(__minix) */
{ RLIMIT_NOFILE, R_CNUMB, "openfiles", },
{ RLIMIT_CORE, R_CSIZE, "coredumpsize", },
#ifdef RLIMIT_SBSIZE
{ RLIMIT_SBSIZE, R_CSIZE, "sbsize", },
#endif
{ -1, 0, 0 }
};
@@ -477,13 +473,11 @@ gsetrl(login_cap_t *lc, int what, const char *name, int type)
return (-1);
}
#if !defined(__minix)
if (setrlimit(what, &rl)) {
syslog(LOG_ERR, "%s: setting resource limit %s: %m",
lc->lc_class, name);
return (-1);
}
#endif /* !defined(__minix) */
#undef RCUR
#undef RMAX
return (0);

View File

@@ -207,7 +207,6 @@ pw_cont(int sig)
void
pw_init(void)
{
#if !defined(__minix)
struct rlimit rlim;
/* Unlimited resource limits. */
@@ -221,7 +220,6 @@ pw_init(void)
/* Don't drop core (not really necessary, but GP's). */
rlim.rlim_cur = rlim.rlim_max = 0;
(void)setrlimit(RLIMIT_CORE, &rlim);
#endif /* !defined(__minix) */
/* Turn off signals. */
(void)signal(SIGALRM, SIG_IGN);