[ofa-general] Re: [PATCH] suppress RLIMIT warning for root user
Roland Dreier
rdreier at cisco.com
Tue May 29 13:59:47 PDT 2007
makes sense but:
> - if (rlim.rlim_cur <= 32768)
> - fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %lu bytes.\n"
> - " This will severely limit memory registrations.\n",
> - rlim.rlim_cur);
> + if (rlim.rlim_cur > 32768)
> + return;
> +
> + if (!getuid())
> + return;
I think it would be more natural to check the UID before getting the
rlimit. And shouldn't this be geteuid() to handle processes that have
dropped their privileges?
More information about the general
mailing list