lkml.org 
[lkml]   [2014]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2014-06-03 16:21    [W:0.159 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site