Deleted Added
full compact
posix4_mib.c (34030) posix4_mib.c (34925)
1/*-
2 * Copyright (c) 1998
3 * HD Associates, Inc. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 */
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/sysctl.h>
1/*-
2 * Copyright (c) 1998
3 * HD Associates, Inc. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 */
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/sysctl.h>
37#include <sys/unistd.h>
37#include <posix4/posix4.h>
38
38
39static int facility[CTL_POSIX4_N_CTLS];
39static int facility[CTL_P1003_1B_MAXID - 1];
40
40
41#define P4_SYSCTL(num, name) \
42 SYSCTL_INT(_posix4, num, name, CTLFLAG_RD, facility + num - 1, 0, "");
41/* OID_AUTO isn't working with sysconf(3). I guess I'd have to
42 * modify it to do a lookup by name from the index.
43 * For now I've left it a top-level sysctl.
44 */
43
45
44P4_SYSCTL(CTL_POSIX4_ASYNCHRONOUS_IO, asynchronous_io);
45P4_SYSCTL(CTL_POSIX4_MAPPED_FILES, mapped_files);
46P4_SYSCTL(CTL_POSIX4_MEMLOCK, memlock);
47P4_SYSCTL(CTL_POSIX4_MEMLOCK_RANGE, memlock_range);
48P4_SYSCTL(CTL_POSIX4_MEMORY_PROTECTION, memory_protection);
49P4_SYSCTL(CTL_POSIX4_MESSAGE_PASSING, message_passing);
50P4_SYSCTL(CTL_POSIX4_PRIORITIZED_IO, prioritized_io);
51P4_SYSCTL(CTL_POSIX4_PRIORITY_SCHEDULING, priority_scheduling);
52P4_SYSCTL(CTL_POSIX4_REALTIME_SIGNALS, realtime_signals);
53P4_SYSCTL(CTL_POSIX4_SEMAPHORES, semaphores);
54P4_SYSCTL(CTL_POSIX4_FSYNC, fsync);
55P4_SYSCTL(CTL_POSIX4_SHARED_MEMORY_OBJECTS, shared_memory_objects);
56P4_SYSCTL(CTL_POSIX4_SYNCHRONIZED_IO, synchronized_io);
57P4_SYSCTL(CTL_POSIX4_TIMERS, timers);
58P4_SYSCTL(CTL_POSIX4_AIO_LISTIO_MAX, aio_listio_max);
59P4_SYSCTL(CTL_POSIX4_AIO_MAX, aio_max);
60P4_SYSCTL(CTL_POSIX4_AIO_PRIO_DELTA_MAX, aio_prio_delta_max);
61P4_SYSCTL(CTL_POSIX4_DELAYTIMER_MAX, delaytimer_max);
62P4_SYSCTL(CTL_POSIX4_MQ_OPEN_MAX, mq_open_max);
63P4_SYSCTL(CTL_POSIX4_PAGESIZE, pagesize);
64P4_SYSCTL(CTL_POSIX4_RTSIG_MAX, rtsig_max);
65P4_SYSCTL(CTL_POSIX4_SEM_NSEMS_MAX, sem_nsems_max);
66P4_SYSCTL(CTL_POSIX4_SEM_VALUE_MAX, sem_value_max);
67P4_SYSCTL(CTL_POSIX4_SIGQUEUE_MAX, sigqueue_max);
68P4_SYSCTL(CTL_POSIX4_TIMER_MAX, timer_max);
46#if 1
69
47
70/* posix4_facility: Set a facility to a value. This is
71 * probably a temporary measure until the LKM code is combined with this.
48#define P1B_SYSCTL(num, name) \
49SYSCTL_INT(_p1003_1b, num, \
50 name, CTLFLAG_RD, facility + num - 1, 0, "");
51
52#else
53
54#define P1B_SYSCTL(num, name) \
55SYSCTL_INT(_kern_p1003_1b, OID_AUTO, \
56 name, CTLFLAG_RD, facility + num - 1, 0, "");
57SYSCTL_NODE(_kern, OID_AUTO, p1003_1b, CTLFLAG_RW, 0, "P1003.1B");
58
59#endif
60
61
62P1B_SYSCTL(CTL_P1003_1B_ASYNCHRONOUS_IO, asynchronous_io);
63P1B_SYSCTL(CTL_P1003_1B_MAPPED_FILES, mapped_files);
64P1B_SYSCTL(CTL_P1003_1B_MEMLOCK, memlock);
65P1B_SYSCTL(CTL_P1003_1B_MEMLOCK_RANGE, memlock_range);
66P1B_SYSCTL(CTL_P1003_1B_MEMORY_PROTECTION, memory_protection);
67P1B_SYSCTL(CTL_P1003_1B_MESSAGE_PASSING, message_passing);
68P1B_SYSCTL(CTL_P1003_1B_PRIORITIZED_IO, prioritized_io);
69P1B_SYSCTL(CTL_P1003_1B_PRIORITY_SCHEDULING, priority_scheduling);
70P1B_SYSCTL(CTL_P1003_1B_REALTIME_SIGNALS, realtime_signals);
71P1B_SYSCTL(CTL_P1003_1B_SEMAPHORES, semaphores);
72P1B_SYSCTL(CTL_P1003_1B_FSYNC, fsync);
73P1B_SYSCTL(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, shared_memory_objects);
74P1B_SYSCTL(CTL_P1003_1B_SYNCHRONIZED_IO, synchronized_io);
75P1B_SYSCTL(CTL_P1003_1B_TIMERS, timers);
76P1B_SYSCTL(CTL_P1003_1B_AIO_LISTIO_MAX, aio_listio_max);
77P1B_SYSCTL(CTL_P1003_1B_AIO_MAX, aio_max);
78P1B_SYSCTL(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, aio_prio_delta_max);
79P1B_SYSCTL(CTL_P1003_1B_DELAYTIMER_MAX, delaytimer_max);
80P1B_SYSCTL(CTL_P1003_1B_MQ_OPEN_MAX, mq_open_max);
81P1B_SYSCTL(CTL_P1003_1B_PAGESIZE, pagesize);
82P1B_SYSCTL(CTL_P1003_1B_RTSIG_MAX, rtsig_max);
83P1B_SYSCTL(CTL_P1003_1B_SEM_NSEMS_MAX, sem_nsems_max);
84P1B_SYSCTL(CTL_P1003_1B_SEM_VALUE_MAX, sem_value_max);
85P1B_SYSCTL(CTL_P1003_1B_SIGQUEUE_MAX, sigqueue_max);
86P1B_SYSCTL(CTL_P1003_1B_TIMER_MAX, timer_max);
87
88/* p31b_setcfg: Set the configuration
72 */
89 */
73void posix4_facility(int num, int value)
90void p31b_setcfg(int num, int value)
74{
91{
75 if (num >= 1 && num <= CTL_POSIX4_N_CTLS)
92 if (num >= 1 && num < CTL_P1003_1B_MAXID)
76 facility[num - 1] = value;
77}
93 facility[num - 1] = value;
94}