[Xproto] Increase the number of file descriptors

Submitted by Olivier Fourdan on May 29, 2015, 4:16 p.m.

Details

Message ID 1432916194-13507-1-git-send-email-ofourdan@redhat.com
State Accepted
Commit 2c94cdb453bc641246cc8b9a876da9799bee1ce7
Headers show

Not browsing as part of any series.

Commit Message

Olivier Fourdan May 29, 2015, 4:16 p.m.
To allow up to 512 clients, the number of file descriptors being
monitored need to be increased accordingly.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
---
 Xpoll.h.in | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/Xpoll.h.in b/Xpoll.h.in
index 0a05424..01be164 100644
--- a/Xpoll.h.in
+++ b/Xpoll.h.in
@@ -67,7 +67,7 @@  typedef long fd_mask;
 # endif
 #endif
 
-#define XFD_SETSIZE	256
+#define XFD_SETSIZE	512
 
 #ifndef FD_SETSIZE
 #define FD_SETSIZE	XFD_SETSIZE
@@ -127,7 +127,16 @@  typedef struct fd_set {
         (howmany(FD_SETSIZE, NFDBITS) > 4 && (__XFDS_BITS(p, 4))) || \
         (howmany(FD_SETSIZE, NFDBITS) > 5 && (__XFDS_BITS(p, 5))) || \
         (howmany(FD_SETSIZE, NFDBITS) > 6 && (__XFDS_BITS(p, 6))) || \
-        (howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7))))
+        (howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7))) || \
+        (howmany(FD_SETSIZE, NFDBITS) > 8 && (__XFDS_BITS(p, 8))) || \
+        (howmany(FD_SETSIZE, NFDBITS) > 9 && (__XFDS_BITS(p, 9))) || \
+        (howmany(FD_SETSIZE, NFDBITS) > 10 && (__XFDS_BITS(p, 10))) || \
+        (howmany(FD_SETSIZE, NFDBITS) > 11 && (__XFDS_BITS(p, 11))) || \
+        (howmany(FD_SETSIZE, NFDBITS) > 12 && (__XFDS_BITS(p, 12))) || \
+        (howmany(FD_SETSIZE, NFDBITS) > 13 && (__XFDS_BITS(p, 13))) || \
+        (howmany(FD_SETSIZE, NFDBITS) > 14 && (__XFDS_BITS(p, 14))) || \
+        (howmany(FD_SETSIZE, NFDBITS) > 15 && (__XFDS_BITS(p, 15))))
+
 
 #define XFD_COPYSET(src,dst) { \
         int __i__; \

Comments

On 05/29/15 09:16 AM, Olivier Fourdan wrote:
> To allow up to 512 clients, the number of file descriptors being
> monitored need to be increased accordingly.
>
> Signed-off-by: Adam Jackson <ajax@redhat.com>
> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
> ---
>   Xpoll.h.in | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/Xpoll.h.in b/Xpoll.h.in
> index 0a05424..01be164 100644
> --- a/Xpoll.h.in
> +++ b/Xpoll.h.in
> @@ -67,7 +67,7 @@ typedef long fd_mask;
>   # endif
>   #endif
>
> -#define XFD_SETSIZE	256
> +#define XFD_SETSIZE	512
>
>   #ifndef FD_SETSIZE
>   #define FD_SETSIZE	XFD_SETSIZE
> @@ -127,7 +127,16 @@ typedef struct fd_set {
>           (howmany(FD_SETSIZE, NFDBITS) > 4 && (__XFDS_BITS(p, 4))) || \
>           (howmany(FD_SETSIZE, NFDBITS) > 5 && (__XFDS_BITS(p, 5))) || \
>           (howmany(FD_SETSIZE, NFDBITS) > 6 && (__XFDS_BITS(p, 6))) || \
> -        (howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7))))
> +        (howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7))) || \
> +        (howmany(FD_SETSIZE, NFDBITS) > 8 && (__XFDS_BITS(p, 8))) || \
> +        (howmany(FD_SETSIZE, NFDBITS) > 9 && (__XFDS_BITS(p, 9))) || \
> +        (howmany(FD_SETSIZE, NFDBITS) > 10 && (__XFDS_BITS(p, 10))) || \
> +        (howmany(FD_SETSIZE, NFDBITS) > 11 && (__XFDS_BITS(p, 11))) || \
> +        (howmany(FD_SETSIZE, NFDBITS) > 12 && (__XFDS_BITS(p, 12))) || \
> +        (howmany(FD_SETSIZE, NFDBITS) > 13 && (__XFDS_BITS(p, 13))) || \
> +        (howmany(FD_SETSIZE, NFDBITS) > 14 && (__XFDS_BITS(p, 14))) || \
> +        (howmany(FD_SETSIZE, NFDBITS) > 15 && (__XFDS_BITS(p, 15))))
> +
>
>   #define XFD_COPYSET(src,dst) { \
>           int __i__; \
>

Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
On Wed, 2015-06-03 at 22:34 -0700, Alan Coopersmith wrote:
> On 05/29/15 09:16 AM, Olivier Fourdan wrote:
> > To allow up to 512 clients, the number of file descriptors being
> > monitored need to be increased accordingly.
> > 
> > Signed-off-by: Adam Jackson <ajax@redhat.com>
> > Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>

Merged:

To ssh://git.freedesktop.org/git/xorg/proto/x11proto
   2dc2c38..2c94cdb  master -> master

- ajax