qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] 9pfs: include <linux/limits.h> for XATTR_SIZE_MAX
@ 2017-06-26 19:20 Patrick Steinhardt
  2017-07-28 17:02 ` Alistair Francis
  2017-08-11  6:52 ` Patrick Steinhardt
  0 siblings, 2 replies; 13+ messages in thread
From: Patrick Steinhardt @ 2017-06-26 19:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Patrick Steinhardt

The function `v9fs_xattrcreate` makes use of the define `XATTR_SIZE_MAX`
to reject attempts of creating xattrs with an invalid size, which is
defined in <linux/limits.h>. On glibc-based systems, this header is
indirectly included via <limits.h>, <bits/posix1_lim.h>,
<bitts/local_lim.h>, but on other platforms this is not guaranteed due
to not being part of the POSIX standard. One examples are systems based
on musl libc, which do not include the <linux/limits.h> indirectly,
which leads to `XATTR_SIZE_MAX` being undefined.

Fix this error by directly include <linux/limits.h>. As the 9P fs code
is being Linux-based either way, we can simply do so without breaking
other platforms. This enables building 9pfs on musl-based systems.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 hw/9pfs/9p.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 96d2683348..48cd558e96 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -13,6 +13,7 @@
 
 #include "qemu/osdep.h"
 #include <glib/gprintf.h>
+#include <linux/limits.h>
 #include "hw/virtio/virtio.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-08-11  6:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-26 19:20 [Qemu-devel] [PATCH] 9pfs: include <linux/limits.h> for XATTR_SIZE_MAX Patrick Steinhardt
2017-07-28 17:02 ` Alistair Francis
2017-07-28 17:20   ` Philippe Mathieu-Daudé
2017-07-29 13:50     ` Patrick Steinhardt
2017-07-29 19:34       ` Peter Maydell
2017-07-30 16:51         ` Kamil Rytarowski
2017-07-30 18:23           ` Peter Maydell
2017-07-30 23:07             ` Kamil Rytarowski
2017-07-31 14:23             ` Fam Zheng
2017-07-31 14:31               ` Peter Maydell
2017-07-31 14:36               ` Daniel P. Berrange
2017-07-31 14:52               ` Kamil Rytarowski
2017-08-11  6:52 ` Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).