[igt-dev] [PATCH 1/1] lib: consolidate duplicated define of vfs_file_max(void)
Caz Yokoyama
Caz.Yokoyama at intel.com
Wed Apr 17 14:49:35 UTC 2019
Petri,
To where Documentation goes to? To commit message? To one of the files
in docs directory? man directory?
It may be obvious for you, but please clarify for clear understanding
on both of us.
Thank you.
-caz
On Wed, 2019-04-17 at 11:12 +0300, Petri Latvala wrote:
> On Tue, Apr 16, 2019 at 08:57:35AM -0700, Caz Yokoyama wrote:
> > Signed-off-by: Caz Yokoyama <caz.yokoyama at intel.com>
> > Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
> > ---
> > lib/igt_aux.c | 14 ++++++++++++++
> > lib/igt_aux.h | 2 ++
> > lib/intel_os.c | 14 --------------
> > tests/i915/gem_exec_reuse.c | 14 +-------------
> > 4 files changed, 17 insertions(+), 27 deletions(-)
> >
> > diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> > index 05528352..ac33875e 100644
> > --- a/lib/igt_aux.c
> > +++ b/lib/igt_aux.c
> > @@ -1615,3 +1615,17 @@ bool igt_allow_unlimited_files(void)
> > rlim.rlim_max = nofile_rlim;
> > return setrlimit(RLIMIT_NOFILE, &rlim) == 0;
> > }
> > +
> > +uint64_t vfs_file_max(void)
> > +{
> > + static long long unsigned max;
> > + if (max == 0) {
> > + FILE *file = fopen("/proc/sys/fs/file-max", "r");
> > + max = 80000;
> > + if (file) {
> > + igt_assert(fscanf(file, "%llu", &max) == 1);
> > + fclose(file);
> > + }
> > + }
> > + return max;
> > +}
>
>
> Documentation for functions added to lib, please.
>
>
More information about the igt-dev
mailing list