qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/6] utils/osdep: Introduce qemu_close_range()


From: Richard Henderson
Subject: Re: [PATCH v2 4/6] utils/osdep: Introduce qemu_close_range()
Date: Mon, 19 Jun 2023 09:07:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 6/16/23 17:27, Bin Meng wrote:
+int qemu_close_range(unsigned int first, unsigned int last)
+{
+    DIR *dir = NULL;
+
+#ifdef CONFIG_CLOSE_RANGE
+    int r = close_range(first, last, 0);
+    if (!r) {
+        /* Success, no need to try other ways. */
+        return 0;
+    }
+#endif

What about first > last?

close_range will yield EINVAL, and your other fallbacks will burn lots of cpu.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]