Mark Kettenis <[email protected]> writes: > 1. shm_open(3) is hard to use safely; it pretty much forces you to use > mktemp(3) with all its traps. This is why some people suggested we > need shm_mkstemp(3), and Ted Unangst actually implemented this on > OpenBSD. The code under the ISC license, so it shouldn't be an > issue to include it in Xorg.
shm_mkstemp sounds like what we want, however, I suspect the real problem will be choosing a place to stick the temp file. Can we come up with a list of directories and just pick one at configure time? And, given that the hard part is the configure piece, I'm wondering how shm_mkstemp differs from what the code currently does with mkstemp. > 2. shm_open(3) (and shm_mkstemp(3)) will set the FD_CLOEXEC flag on > the file descriptor. This is actually a good thing, but it means > you'll have to unset that flag if you want to share the > filedescriptor by doing a fork(2) and exec(2). > 3. Some systems don't have shm_open(3). But I guess pretty much all > systems that support file descriptor passing using the 4.4BSD > interface do support it. And it's always possible to fall back to > code that's more or less equivalent to what we have now. Using shm_open is just a security disaster; we're definitely not going to use that. -- [email protected]
pgpcUiU6yERbM.pgp
Description: PGP signature
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
