lkml.org 
[lkml]   [2004]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectPROC_BLOCK_SIZE in proc_info_read()
Date
proc_info_read() (in fs/proc/base.c) uses this macro to limit the size
of a single read:

#define PROC_BLOCK_SIZE (3*1024) /* 4K page size but our output
routines use some slack for overruns */

It seems to me like it's a legacy from array_read() in 2.2.x and can be
safely removed. Besides an outdated assumption about the page size,
the value is not passed down to (*proc_read)(), so it cannot guard
against any overruns, and serves no useful purpose.
Am I missing anything?

(This is not to be confused with PROC_BLOCK_SIZE in fs/proc/generic.c)

The reason it bothers me is that if you have a process with a really long
command line, then /proc/<pid>/cmdline "contains" up to PAGE_SIZE bytes,
but sys_read() only returns 3072, and needs to be called repeatedly.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.025 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site