public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Caz Yokoyama <caz.yokoyama@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH 1/1] lib: consolidate duplicated define of vfs_file_max(void)
Date: Wed, 17 Apr 2019 11:12:58 +0300	[thread overview]
Message-ID: <20190417081258.GN22949@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <d7db4af933e3f86f7d589517dd4de05a7d46eb54.1555430163.git.caz.yokoyama@intel.com>

On Tue, Apr 16, 2019 at 08:57:35AM -0700, Caz Yokoyama wrote:
> Signed-off-by: Caz Yokoyama <caz.yokoyama@intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@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.


-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-04-17  8:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 15:57 [igt-dev] [PATCH 1/1] lib: consolidate duplicated define of vfs_file_max(void) Caz Yokoyama
2019-04-16 17:33 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [1/1] " Patchwork
2019-04-17  8:12 ` Petri Latvala [this message]
2019-04-17 14:49   ` [igt-dev] [PATCH 1/1] " Caz Yokoyama
2019-04-24 10:19     ` Petri Latvala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190417081258.GN22949@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=caz.yokoyama@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox