summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-02-17 11:51:38 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-02-17 12:05:47 -0800
commit10820586db1bc1817d437c207b6c43cdf36a7bbe (patch)
treec61ce9f3de9d25503be83ce5d882e54fbcc91b22
parent0378e3cc9a0e036b0c1fb53341c9ab5db3e1342c (diff)
Simplify remaining OPEN_MAX logic in FSlibos.h
Since the FS_OPEN_MAX value is only used for calculating a hardcoded array size, we can't really use a sysconf call to find it, so stop pretending that's a valid answer that we'll just ignore later. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/FSlibos.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/FSlibos.h b/src/FSlibos.h
index 3233c0e..fdcfe95 100644
--- a/src/FSlibos.h
+++ b/src/FSlibos.h
@@ -89,24 +89,22 @@ in this Software without prior written authorization from The Open Group.
# ifdef NOFILE
# define OPEN_MAX NOFILE
# else
-# if defined(__GNU__) || defined(__sun)
-# define OPEN_MAX (sysconf(_SC_OPEN_MAX))
-# else /* !__GNU__ || __sun */
+# ifdef NOFILES_MAX
# define OPEN_MAX NOFILES_MAX
-# endif /*__GNU__ || __sun */
+# endif
# endif
# endif
# endif
-# if defined(__GNU__) || defined(__sun)
+# ifndef OPEN_MAX
# define FS_OPEN_MAX 256
-# else /* !__GNU__ || __sun */
+# else /* !OPEN_MAX */
# if OPEN_MAX > 256
# define FS_OPEN_MAX 256
# else
# define FS_OPEN_MAX OPEN_MAX
# endif
-# endif /* __GNU__ || __sun */
+# endif /* OPEN_MAX */
# endif /* FS_OPEN_MAX */