[PATCH] miext: Move SyncShm FDs out of the way of clients

2013-11-22 Thread Keith Packard
Applications may end up allocating a bunch of shmfence objects, each of which uses a file descriptor, which must be kept open lest some other client ask for a copy of it later on. Lacking an API that can turn a memory mapping back into a file descriptor, about the best we can do is push the file d

Re: [PATCH] miext: Move SyncShm FDs out of the way of clients

2013-11-22 Thread Keith Packard
Alan Coopersmith writes: > On 11/21/13 10:19 PM, Keith Packard wrote: >> +newfd = fcntl(fd, F_DUPFD, MAXCLIENTS); > > Should probably do something like: > > #ifdef F_DUPFD_CLOEXEC > newfd = fcntl(fd, F_DUPFD_CLOEXEC, MAXCLIENTS); > #else > newfd = fcntl(fd, F_DUPFD, MAXCLIENTS); >

Re: [PATCH] miext: Move SyncShm FDs out of the way of clients

2013-11-22 Thread Alan Coopersmith
On 11/21/13 10:19 PM, Keith Packard wrote: +newfd = fcntl(fd, F_DUPFD, MAXCLIENTS); Should probably do something like: #ifdef F_DUPFD_CLOEXEC newfd = fcntl(fd, F_DUPFD_CLOEXEC, MAXCLIENTS); #else newfd = fcntl(fd, F_DUPFD, MAXCLIENTS); #endif if (newfd < 0)

Re: [PATCH] miext: Move SyncShm FDs out of the way of clients

2013-11-22 Thread Keith Packard
Daniel Stone writes: > ITYM F_DUPFD. heh. the code, at least, is correct :-) > In either case, would be nice to make this an os/ > function instead, Yes, could be an OS function. > so we can also do this for input devices. input devices need to be in the select mask though. -- keith.pack..

Re: [PATCH] miext: Move SyncShm FDs out of the way of clients

2013-11-22 Thread Daniel Stone
Hi, On 22 November 2013 06:19, Keith Packard wrote: > Applications may end up allocating a bunch of shmfence objects, each > of which uses a file descriptor, which must be kept open lest some > other client ask for a copy of it later on. > > Lacking an API that can turn a memory mapping back into

[PATCH] miext: Move SyncShm FDs out of the way of clients

2013-11-21 Thread Keith Packard
Applications may end up allocating a bunch of shmfence objects, each of which uses a file descriptor, which must be kept open lest some other client ask for a copy of it later on. Lacking an API that can turn a memory mapping back into a file descriptor, about the best we can do is push the file d