aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/fpathconf.c10
-rw-r--r--sysdeps/posix/sysconf.c77
2 files changed, 86 insertions, 1 deletions
diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c
index 5c91c4a..649a2a4 100644
--- a/sysdeps/posix/fpathconf.c
+++ b/sysdeps/posix/fpathconf.c
@@ -21,6 +21,7 @@ Cambridge, MA 02139, USA. */
#include <stddef.h>
#include <unistd.h>
#include <limits.h>
+#include <sys/statfs.h>
/* Get file-specific information about descriptor FD. */
@@ -73,7 +74,14 @@ DEFUN(__fpathconf, (fd, name), int fd AND int name)
case _PC_PATH_MAX:
#ifdef PATH_MAX
- return PATH_MAX;
+ {
+ struct statfs buf;
+
+ if (__fstatfs (fd, &buf) < 0)
+ return errno == ENOSYS ? PATH_MAX : -1;
+ else
+ return buf.f_namelen;
+ }
#else
errno = ENOSYS;
return -1;
diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
index bf3c5b8..a52258f 100644
--- a/sysdeps/posix/sysconf.c
+++ b/sysdeps/posix/sysconf.c
@@ -196,6 +196,83 @@ DEFUN(__sysconf, (name), int name)
case _SC_PAGESIZE:
return __getpagesize ();
+ case _SC_AIO_LISTIO_MAX:
+#ifdef AIO_LISTIO_MAX
+ return AIO_LISTIO_MAX;
+#else
+ return -1;
+#endif
+
+ case _SC_AIO_MAX:
+#ifdef AIO_MAX
+ return AIO_MAX;
+#else
+ return -1;
+#endif
+
+ case _SC_AIO_PRIO_DELTA_MAX:
+#ifdef AIO_PRIO_DELTA_MAX
+ return AIO_PRIO_DELTA_MAX;
+#else
+ return -1;
+#endif
+
+ case _SC_DELAYTIMER_MAX:
+#ifdef DELAYTIMER_MAX
+ return DELAYTIMER_MAX;
+#else
+ return -1;
+#endif
+
+ case _SC_MQ_OPEN_MAX:
+#ifdef MQ_OPEN_MAX
+ return MQ_OPEN_MAX;
+#else
+ return -1;
+#endif
+
+ case _SC_MQ_PRIO_MAX:
+#ifdef MQ_PRIO_MAX
+ return MQ_PRIO_MAX;
+#else
+ return -1;
+#endif
+
+ case _SC_RTSIG_MAX:
+#ifdef RTSIG_MAX
+ return RTSIG_MAX;
+#else
+ return -1;
+#endif
+
+ case _SC_SEM_NSEMS_MAX:
+#ifdef SEM_NSEMS_MAX
+ return SEM_NSEMS_MAX;
+#else
+ return -1;
+#endif
+
+ case _SC_SEM_VALUE_MAX:
+#ifdef SEM_VALUE_MAX
+ return SEM_VALUE_MAX;
+#else
+ return -1;
+#endif
+
+ case _SC_SIGQUEUE_MAX:
+#ifdef SIGQUEUE_MAX
+ return SIGQUEUE_MAX;
+#else
+ return -1;
+#endif
+
+ case _SC_TIMER_MAX:
+#ifdef TIMER_MAX
+ return TIMER_MAX;
+#else
+ return -1;
+#endif
+
case _SC_BC_BASE_MAX:
#ifdef BC_BASE_MAX
return BC_BASE_MAX;