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 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by HD Associates, Inc 16 * 4. Neither the name of the author nor the names of any co-contributors 17 * may be used to endorse or promote products derived from this software 18 * without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND 21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * $FreeBSD: src/sys/posix4/posix4_mib.c,v 1.3.2.1 2000/08/03 01:09:59 peter Exp $ 33 */ 34 35 #include <sys/param.h> 36 #include <sys/kernel.h> 37 #include <sys/queue.h> 38 #include <sys/sysctl.h> 39 #include <sys/posix4.h> 40 41 static int facility[CTL_P1003_1B_MAXID - 1]; 42 43 /* OID_AUTO isn't working with sysconf(3). I guess I'd have to 44 * modify it to do a lookup by name from the index. 45 * For now I've left it a top-level sysctl. 46 */ 47 48 SYSCTL_DECL(_p1003_1b); 49 50 #define P1B_SYSCTL(num, name, desc) \ 51 SYSCTL_INT(_p1003_1b, num, \ 52 name, CTLFLAG_RD, facility + num - 1, 0, desc); 53 54 P1B_SYSCTL(CTL_P1003_1B_ASYNCHRONOUS_IO, asynchronous_io, 55 "POSIX Asynchronous input/output support"); 56 P1B_SYSCTL(CTL_P1003_1B_MAPPED_FILES, mapped_files, 57 "POSIX Memory mapped file support"); 58 P1B_SYSCTL(CTL_P1003_1B_MEMLOCK, memlock, 59 "Support for POSIX process memory locking"); 60 P1B_SYSCTL(CTL_P1003_1B_MEMLOCK_RANGE, memlock_range, 61 "Support for POSIX range memory locking"); 62 P1B_SYSCTL(CTL_P1003_1B_MEMORY_PROTECTION, memory_protection, 63 "POSIX Memory protection support"); 64 P1B_SYSCTL(CTL_P1003_1B_MESSAGE_PASSING, message_passing, 65 "Support for POSIX message passing"); 66 P1B_SYSCTL(CTL_P1003_1B_PRIORITIZED_IO, prioritized_io, 67 "POSIX prioritized input/output support"); 68 P1B_SYSCTL(CTL_P1003_1B_PRIORITY_SCHEDULING, priority_scheduling, 69 "Support for POSIX process scheduling"); 70 P1B_SYSCTL(CTL_P1003_1B_REALTIME_SIGNALS, realtime_signals, 71 "POSIX real time signal support"); 72 P1B_SYSCTL(CTL_P1003_1B_SEMAPHORES, semaphores, 73 "POSIX semaphores support"); 74 P1B_SYSCTL(CTL_P1003_1B_FSYNC, fsync, 75 "Support of POSIX file synchronization"); 76 P1B_SYSCTL(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, shared_memory_objects, 77 "Support of POSIX share memory objects"); 78 P1B_SYSCTL(CTL_P1003_1B_SYNCHRONIZED_IO, synchronized_io, 79 "POSIX synchronized input/output support"); 80 P1B_SYSCTL(CTL_P1003_1B_TIMERS, timers, 81 "POSIX timers support"); 82 P1B_SYSCTL(CTL_P1003_1B_AIO_LISTIO_MAX, aio_listio_max, 83 "Maximum number of operations in a single list I/O call"); 84 P1B_SYSCTL(CTL_P1003_1B_AIO_MAX, aio_max, 85 "Maximum outstanding AIO operations"); 86 P1B_SYSCTL(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, aio_prio_delta_max, 87 "Maximum AIO priority deviation from the own scheduling priority"); 88 P1B_SYSCTL(CTL_P1003_1B_DELAYTIMER_MAX, delaytimer_max, 89 "Maximum timer expiration overruns"); 90 P1B_SYSCTL(CTL_P1003_1B_PAGESIZE, pagesize, 91 "Size of a page in bytes"); 92 P1B_SYSCTL(CTL_P1003_1B_RTSIG_MAX, rtsig_max, 93 "Maximum number of realtime signals reserved for application use"); 94 P1B_SYSCTL(CTL_P1003_1B_SEM_NSEMS_MAX, sem_nsems_max, 95 "Maximum number of semaphores per process"); 96 P1B_SYSCTL(CTL_P1003_1B_SIGQUEUE_MAX, sigqueue_max, 97 "Maximum number of queued signals per process"); 98 P1B_SYSCTL(CTL_P1003_1B_TIMER_MAX, timer_max, 99 "Maximum number of timers per process"); 100 101 /* p31b_setcfg: Set the configuration 102 */ 103 void p31b_setcfg(int num, int value) 104 { 105 if (num >= 1 && num < CTL_P1003_1B_MAXID) 106 facility[num - 1] = value; 107 } 108