Workaround for systems that does not have PATH_MAX, like hurd.

Submitted by Tobias Frost on April 24, 2016, 7:57 a.m.

Details

Message ID 1461484621-15446-1-git-send-email-tobi@coldtobi.de
State New
Headers show
Series "libdrm: Patch to compile on hurd." ( rev: 3 ) in DRI devel

Not browsing as part of any series.

Commit Message

Tobias Frost April 24, 2016, 7:57 a.m.
It is safe to define it here, as the code is only using it for string
manipulation and not for syscalls that might make different assumptions.
---
 xf86drm.c | 7 +++++++
 xf86drm.h | 4 ++++
 2 files changed, 11 insertions(+)

Patch hide | download patch | download mbox

diff --git a/xf86drm.c b/xf86drm.c
index 45aa5fc..4dac7a4 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -103,6 +103,13 @@ 
 
 #define memclear(s) memset(&s, 0, sizeof(s))
 
+/* for systems like hurd, which does not have PATH_MAX.
+ Usage is only for string manipulation, so it is save to define it.
+ 1kB will be plenty space.*/
+#ifndef PATH_MAX
+#define PATH_MAX (1024)
+#endif
+
 static drmServerInfoPtr drm_server_info;
 
 void drmSetServerInfo(drmServerInfoPtr info)
diff --git a/xf86drm.h b/xf86drm.h
index 481d882..1d45f02 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -58,7 +58,11 @@  extern "C" {
 
 #else /* One of the *BSDs */
 
+#if defined(__GNU__)
+#include <mach/i386/ioccom.h>
+#else
 #include <sys/ioccom.h>
+#endif
 #define DRM_IOCTL_NR(n)         ((n) & 0xff)
 #define DRM_IOC_VOID            IOC_VOID
 #define DRM_IOC_READ            IOC_OUT