summaryrefslogtreecommitdiff
path: root/sys/posix4
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2002-11-17 04:15:34 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2002-11-17 04:15:34 +0000
commitf51c1e897d8ca640a0c8f4be276f067117767d9c (patch)
treee2dfa1f642b4d621b045178bb552f0214e31be7a /sys/posix4
parent9df5c871ce6255ba4cbaa7b267ffb69d7b76caca (diff)
Notes
Diffstat (limited to 'sys/posix4')
-rw-r--r--sys/posix4/posix4.h1
-rw-r--r--sys/posix4/posix4_mib.c24
2 files changed, 23 insertions, 2 deletions
diff --git a/sys/posix4/posix4.h b/sys/posix4/posix4.h
index e59737073881..b17e9270e675 100644
--- a/sys/posix4/posix4.h
+++ b/sys/posix4/posix4.h
@@ -63,6 +63,7 @@ int p31b_proc(struct proc *, pid_t, struct proc **);
void p31b_setcfg(int, int);
int p31b_getcfg(int);
+int p31b_iscfg(int);
#ifdef _KPOSIX_PRIORITY_SCHEDULING
diff --git a/sys/posix4/posix4_mib.c b/sys/posix4/posix4_mib.c
index 6f1fe4653c14..12d5fecb4fbc 100644
--- a/sys/posix4/posix4_mib.c
+++ b/sys/posix4/posix4_mib.c
@@ -40,6 +40,7 @@
#include <posix4/posix4.h>
static int facility[CTL_P1003_1B_MAXID - 1];
+static int facility_initialized[CTL_P1003_1B_MAXID - 1];
/* OID_AUTO isn't working with sysconf(3). I guess I'd have to
* modify it to do a lookup by name from the index.
@@ -92,25 +93,38 @@ P1B_SYSCTL(CTL_P1003_1B_SEM_VALUE_MAX, sem_value_max);
P1B_SYSCTL(CTL_P1003_1B_SIGQUEUE_MAX, sigqueue_max);
P1B_SYSCTL(CTL_P1003_1B_TIMER_MAX, timer_max);
+#define P31B_VALID(num) ((num) >= 1 && (num) < CTL_P1003_1B_MAXID)
+
/* p31b_setcfg: Set the configuration
*/
void
p31b_setcfg(int num, int value)
{
- if (num >= 1 && num < CTL_P1003_1B_MAXID)
+ if (P31B_VALID(num)) {
facility[num - 1] = value;
+ facility_initialized[num - 1] = 1;
+ }
}
int
p31b_getcfg(int num)
{
- if (num >= 1 && num < CTL_P1003_1B_MAXID)
+ if (P31B_VALID(num))
return (facility[num - 1]);
return (0);
}
+int
+p31b_iscfg(int num)
+{
+
+ if (P31B_VALID(num))
+ return (facility_initialized[num - 1]);
+ return (0);
+}
+
/*
* Turn on indications for standard (non-configurable) kernel features.
*/
@@ -121,6 +135,12 @@ p31b_set_standard(void *dummy)
p31b_setcfg(CTL_P1003_1B_MAPPED_FILES, 1);
p31b_setcfg(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, 1);
p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE);
+ if (!p31b_iscfg(CTL_P1003_1B_AIO_LISTIO_MAX))
+ p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, -1);
+ if (!p31b_iscfg(CTL_P1003_1B_AIO_MAX))
+ p31b_setcfg(CTL_P1003_1B_AIO_MAX, -1);
+ if (!p31b_iscfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX))
+ p31b_setcfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, -1);
}
SYSINIT(p31b_set_standard, SI_SUB_P1003_1B, SI_ORDER_ANY, p31b_set_standard,