[PATCH:shmfd 2/2] Use /var/tmp instead of /run/shm on non-linux OS'es

Alan Coopersmith alan.coopersmith at oracle.com
Thu Nov 7 20:55:44 PST 2013


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 Makefile |    9 +++++----
 shmfd.c  |    4 ++++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index e77f938..672979e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,8 @@
-CFLAGS=-Wall -O0 -g $(shell pkg-config --cflags xcb-shm xcb-aux xcb-dri3 xcb-present xshmfence)
-LIBS=$(shell pkg-config --libs xcb-shm xcb-aux xcb-dri3 xcb-present xshmfence)
+CFLAGS=-Wall -O0 -g $(shell pkg-config --cflags xcb-shm xcb-aux xcb-dri3 xcb-present) -m64
+LIBS=$(LDFLAGS) $(shell pkg-config --libs xcb-shm xcb-aux xcb-dri3 xcb-present)
 
-all: shmfd dri3 futex xfence present pipefence shmtest
+#all: shmfd dri3 futex xfence present pipefence shmtest
+all: shmfd present
 
 SHMFD_OBJS=shmfd.o
 
@@ -42,4 +43,4 @@ clean:
 	rm -f shmfd $(SHMFD_OBJS)
 	rm -f dri3 $(DRI3_OBJS)
 	rm -f futex $(FUTEX_OBJS)
-	rm -f present $(PRESENT_OBJS)
\ No newline at end of file
+	rm -f present $(PRESENT_OBJS)
diff --git a/shmfd.c b/shmfd.c
index 4dee9de..cdd3889 100644
--- a/shmfd.c
+++ b/shmfd.c
@@ -32,7 +32,11 @@ int
 make_shm(int size, void **addrp)
 {
 	void	*addr;
+#ifdef linux
 	char	template[] = "/run/shm/shmfd-XXXXXX";
+#else
+	char	template[] = "/var/tmp/shmfd-XXXXXX";
+#endif
 	int	fd = mkstemp(template);
 
 	if (fd < 0)
-- 
1.7.9.2



More information about the xorg-devel mailing list