mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
(submit/recv-fds) os: read file descriptors into client struct at once
Instead of having the request handler ask for fd's one by one, just read them all into a little array in ClientRec struct. And also automatically clean up after request had been handled. Request handlers need to set the entries to -1 if they shouldn't be closed automatically. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -73,6 +73,9 @@ typedef struct _saveSet {
|
||||
#define SaveSetAssignToRoot(ss,tr) ((ss).toRoot = (tr))
|
||||
#define SaveSetAssignMap(ss,m) ((ss).map = (m))
|
||||
|
||||
/* currently largest one in use is 4 */
|
||||
#define MAX_CLIENT_RECV_FD 8
|
||||
|
||||
typedef struct _Client {
|
||||
void *requestBuffer;
|
||||
void *osPrivate; /* for OS layer, including scheduler */
|
||||
@@ -110,7 +113,9 @@ typedef struct _Client {
|
||||
|
||||
DeviceIntPtr clientPtr;
|
||||
ClientIdPtr clientIds;
|
||||
int req_fds;
|
||||
|
||||
int recv_fd_count;
|
||||
int recv_fd_list[MAX_CLIENT_RECV_FD];
|
||||
} ClientRec;
|
||||
|
||||
typedef struct _WorkQueue {
|
||||
|
||||
Reference in New Issue
Block a user