We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 535e111 commit d235fc7Copy full SHA for d235fc7
1 file changed
src/common/kqueue.c
@@ -80,21 +80,23 @@ get_fd_limit(void)
80
unsigned int
81
get_fd_used(void)
82
{
83
+#ifdef __linux__
84
unsigned int fd_max = get_fd_limit();
85
unsigned int i;
86
unsigned int used = 0;
87
int our_errno = errno; /* Preserve errno */
88
-#ifdef __linux__
89
for (i = 0; i < fd_max; i++) {
90
if (fcntl(i, F_GETFD) == 0)
91
used++;
92
}
93
-#endif
94
95
errno = our_errno;
96
97
return used;
+#else
98
+ return 0;
99
+#endif
100
101
102
static struct map *kqmap;
0 commit comments