summaryrefslogtreecommitdiff
path: root/Ports/make/patches/0002-Stub-getdtablesize-for-serenity.patch
blob: d44cce6e9948bf94158b0a54c55a4199f7871e59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andreas Kling <kling@serenityos.org>
Date: Tue, 15 Dec 2020 01:06:18 +0100
Subject: [PATCH] Stub getdtablesize() for serenity

---
 lib/getdtablesize.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
index 0fe7092..a14d697 100644
--- a/lib/getdtablesize.c
+++ b/lib/getdtablesize.c
@@ -20,6 +20,10 @@
 /* Specification.  */
 #include <unistd.h>
 
+#ifdef __serenity__
+# include <sys/select.h>
+#endif
+
 #if defined _WIN32 && ! defined __CYGWIN__
 
 # include <stdio.h>
@@ -109,6 +113,9 @@ getdtablesize (void)
 int
 getdtablesize (void)
 {
+#ifdef __serenity__
+  return FD_SETSIZE;
+#else
   struct rlimit lim;
 
   if (getrlimit (RLIMIT_NOFILE, &lim) == 0
@@ -119,6 +126,7 @@ getdtablesize (void)
     return lim.rlim_cur;
 
   return INT_MAX;
+#endif
 }
 
 #endif