summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_mib.h
Commit message (Collapse)AuthorAgeFilesLines
* Update Linux compat revision to 32.dchagin2015-05-241-1/+1
| | | | | Differential Revision: https://reviews.freebsd.org/D1122 Reviewed by: emaste
* Introduce a new module linux_common.ko which is intended for thedchagin2015-05-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | following primary purposes: 1. Remove the dependency of linsysfs and linprocfs modules from linux.ko, which will be architecture specific on amd64. 2. Incorporate into linux_common.ko general code for platforms on which we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit). 3. Move malloc(9) declaration to linux_common.ko, to enable getting memory usage statistics properly. Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko. Temporarily remove dtrace garbage from linux_mib.c and linux_util.c Differential Revision: https://reviews.freebsd.org/D1072 In collaboration with: Vassilis Laganakos. Reviewed by: trasz
* Introduce LINUX_VERSION_STR, LINUX_VERSION_CODE macro for use insteaddchagin2015-05-241-2/+13
| | | | | | | | of harcoded pr_osrelease, pr_osrel values. This will be used later in the VDSO. Differential Revision: https://reviews.freebsd.org/D1042 Reviewed by: trasz
* Staticize functions which are not used somewhere else, move thenetchild2011-03-151-3/+0
| | | | corresponding prototypes from the header to the code file.
* Do not export AT_CLKTCK when emulating Linux kernel priordchagin2009-05-101-0/+1
| | | | | | | | | | | | | | to 2.4.0, as it has appeared in the 2.4.0-rc7 first time. Being exported, AT_CLKTCK is returned by sysconf(_SC_CLK_TCK), glibc falls back to the hard-coded CLK_TCK value when aux entry is not present. Glibc versions prior to 2.2.1 always use hard-coded CLK_TCK value. For older applications/libc's which depends on hard-coded CLK_TCK value user should set compat.linux.osrelease less than 2.4.0. Approved by: kib (mentor)
* Introduce linux_kernver() interface which is intended for an exactdchagin2009-05-101-1/+5
| | | | | | | | | designation of the emulated kernel version. linux_kernver() returns integer value formatted as 'VVVMMMIII' where VVV - version, MMM - major revision, III - minor revision. Approved by: kib (mentor)
* Move the per-prison Linux MIB from a private one-off pointer to the newjamie2009-05-071-0/+3
| | | | | | | | | OSD-based jail extensions. This allows the Linux MIB to accessed via jail_set and jail_get, and serves as a demonstration of adding jail support to a module. Reviewed by: dchagin, kib Approved by: bz (mentor)
* MFp4 (111746+):netchild2006-12-311-0/+2
| | | | | | | | | | | | | | Redo the checking for 2.6 emulation. We now cache the value of use26 and replace calls to linux_get_osrelease() + parsing with a call to linux_use26(). Typical path is lockless now. Pointed out by: kib This allows to ship RELENG_7_0 with a default osrelease of 2.4.2 and the possibility to enable 2.6.x emulation without the possible performance impact of the previous version of the check. Submitted by: rdivacky
* Remove linux_mib_destroy() (which I actually added in between 5.0 and 5.1)jhb2005-12-151-2/+0
| | | | | | | | | which existed to cleanup the linux_osname mutex. Now that MTX_SYSINIT() has grown a SYSUNINIT to destroy mutexes on unload, the extra destroy here was redundant and resulted in panics in debug kernels. MFC after: 1 week Reported by: Goran Gajic ggajic at afrodita dot rcub dot bg dot ac dot yu
* Add a cleanup function to destroy the osname_lock and call it on modulejhb2003-03-261-0/+2
| | | | | | | unload. Submitted by: gallatin Reported by: Martin Karlsson <mk-freebsd@bredband.net>
* - Change the linux_[gs]et_os{name, release, s_version}() functions tojhb2003-03-131-6/+6
| | | | | | | | | | | | | take a thread instead of a proc for their first argument. - Add a mutex to protect the system-wide Linux osname, osrelease, and oss_version variables. - Change linux_get_prison() to take a thread instead of a proc for its first argument and to use td_ucred rather than p_ucred. This is ok because a thread's prison does not change even though it's ucred might. - Also, change linux_get_prison() to return a struct prison * instead of a struct linux_prison * since it returns with the struct prison locked and this makes it easier to safely unlock the prison when we are done messing with it.
* Fixed some style bugs in the removal of __P(()). Tabs before "__P(("bde2002-03-241-6/+6
| | | | were not removed.
* Remove __P.alfred2002-03-201-6/+6
|
* o Introduce pr_mtx into struct prison, providing protection for therwatson2001-12-031-2/+2
| | | | | | | | | | | | | | | | | | mutable contents of struct prison (hostname, securelevel, refcount, pr_linux, ...) o Generally introduce mtx_lock()/mtx_unlock() calls throughout kern/ so as to enforce these protections, in particular, in kern_mib.c protection sysctl access to the hostname and securelevel, as well as kern_prot.c access to the securelevel for access control purposes. o Rewrite linux emulator abstractions for accessing per-jail linux mib entries (osname, osrelease, osversion) so that they don't return a pointer to the text in the struct linux_prison, rather, a copy to an array passed into the calls. Likewise, update linprocfs to use these primitives. o Update in_pcb.c to always use prison_getip() rather than directly accessing struct prison. Reviewed by: jhb
* Fix typo in license.marcel2000-08-251-1/+1
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add sysctl variables for the Linuxulator. These reside under `compat.linux' asmarcel1999-08-271-0/+43
discussed on current. The following variables are defined (for now): osname (defaults to "Linux") Allow users to change the name of the OS as returned by uname(2), specially added for all those Linux Netscape users and statistics maniacs :-) We now have what we all wanted! osrelease (defaults to "2.2.5") Allow users to change the version of the OS as returned by uname(2). Since -current supports glibc2.1 now, change the default to 2.2.5 (was 2.0.36). oss_version (defaults to 198144 [0x030600]) This one will be used by the OSS_GETVERSION ioctl (PR 12917) which I can commit now that we have the MIB. The default version number is the lowest version possible with the current 'encoding'. A note about imprisoned processes (see jail(2)): These variables are copy-on-write (as suggested by phk). This means that imprisoned processes will use the system wide value unless it is written/set by the process. From that moment on, a copy local to the prison will be used. A note about the implementation: I choose to add a single pointer to struct prison, because I didn't like the idea of changing struct prison every time I come up with a new variable. As a side effect, the extra storage is only needed when a variable is set from within the prison. This also minimizes kernel bloat when the Linuxulator is not used; both compiled in or as a module. Reviewed by: bde (first version only) and phk
OpenPOWER on IntegriCloud