Messages in this thread | | | Date | Tue, 03 Jun 2014 07:39:09 -0600 | From | David Ahern <> | Subject | Re: [PATCH 06/13] perf tools: Cache dso data file descriptor |
| |
On 6/2/14, 3:18 PM, Jiri Olsa wrote: > +static rlim_t get_fd_limit(void) > +{ > + struct rlimit l; > + rlim_t limit = 0; > + > + /* Allow half of the current open fd limit. */ > + if (getrlimit(RLIMIT_NOFILE, &l) == 0) { > + if (l.rlim_cur == RLIM_INFINITY) > + limit = l.rlim_cur;
Why not limit this to something reasonable -- 512 or 1024 -- rather "infinity" (~0UL).
David
| |