From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Trent Huber <trentmhuber@gmail.com>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, pbonzini@redhat.com
Subject: Re: [PATCH] os-posix: Expand setrlimit() syscall compatibility
Date: Fri, 14 Jun 2024 14:30:02 +0100 [thread overview]
Message-ID: <ZmxF2lTY0hvS_HqV@redhat.com> (raw)
In-Reply-To: <20240614051422.13532-1-trentmhuber@gmail.com>
On Fri, Jun 14, 2024 at 01:14:22AM -0400, Trent Huber wrote:
> Darwin (I'm running version 19.6.0) uses a subtly different version
> of the setrlimit() syscall as described in the COMPATIBILITY section
> of the macOS man page. I adjusted the way the rlim_cur member is set
> to accommodate and which shouldn't affect any non-Darwin systems.
>
> Signed-off-by: Trent Huber <trentmhuber@gmail.com>
> ---
> os-posix.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/os-posix.c b/os-posix.c
> index a4284e2c07..5766346521 100644
> --- a/os-posix.c
> +++ b/os-posix.c
> @@ -270,7 +270,7 @@ void os_setup_limits(void)
> return;
> }
>
> - nofile.rlim_cur = nofile.rlim_max;
> + nofile.rlim_cur = OPEN_MAX < nofile.rlim_max ? OPEN_MAX : nofile.rlim_max;
There's no such constant OPEN_MAX on Linux, so this doesn't compile.
There is a sysconf() parameter _SC_OPEN_MAX, but we should not use
that as it is a dynamic value that just reflects what 'rlim_cur'
is set to, and would thus turn this into a no-op.
This should just be made conditional to macOS, since its the only
problematic platform that we known of.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-06-14 13:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 5:14 [PATCH] os-posix: Expand setrlimit() syscall compatibility Trent Huber
2024-06-14 13:30 ` Daniel P. Berrangé [this message]
2024-06-14 20:11 ` Trent Huber
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=ZmxF2lTY0hvS_HqV@redhat.com \
--to=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=trentmhuber@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.