[PATCH 0/2] Fix tmpfile creation for MIT-SHM files

Keith Packard keithp at keithp.com
Tue Nov 12 21:33:11 PST 2013


The new MIT-SHM CreateSegment request needs to stick the requested
shared memory file someplace in the file system. Precisely where it
needs to live depends on the target system.

 [PATCH 1/2] Select directory for MIT-SHM temp files at configure time

The first of these patches allows that to be configured in the X
server build process. By default, it looks through a list of likely
spots, picking the first that it finds. Of course, you can also
specify the directory on the configure command line using
--with-shared-memory-dir=PATH

 [PATCH 2/2] Xext: Use SHMDIR and O_TMPFILE when creating mapping

The second patch actually uses that directory in the MIT-SHM
extension, at the same time it also adds support for the new Linux
O_TMPFILE flag, which avoids ever needing a name for the file nicely.

To test the patch, I needed to stick this in the file above the call
as my glibc doesn't yet have the necessary O_TMPFILE define.

/* Hacks needed until glibc has O_TMPFILE */
#define __O_TMPFILE    020000000
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)

-keith


More information about the xorg-devel mailing list