summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERICrwatson2009-06-056-8/+0
| | | | | | | | and used in a large number of files, but also because an increasing number of incorrect uses of MAC calls were sneaking in due to copy-and-paste of MAC-aware code without the associated opt_mac.h include. Discussed with: pjd
* Add forgotten in previous commit flags argument.dchagin2009-06-011-2/+2
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Implement accept4 syscall.dchagin2009-06-011-1/+19
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Implement a variation of the accept_common() which takesdchagin2009-06-011-14/+21
| | | | | | | | | | a flags argument. Do not preserve td_retval before kern_fcntl(F_SETFL) as it does not changed. Approved by: kib (mentor) MFC after: 1 month
* Split linux_accept() syscall onto linux_accept_common() which shoulddchagin2009-06-011-13/+22
| | | | | | | be used by linuxulator and linux_accept() itself. Approved by: kib (mentor) MFC after: 1 month
* Regenerate generated syscall files following changes to struct sysent inrwatson2009-06-012-759/+759
| | | | r193234.
* Implement a variation of the socketpair() syscall which takes a flagsdchagin2009-05-311-2/+28
| | | | | | | in addition to the type argument. Approved by: kib (mentor) MFC after: 1 month
* Move new socket flags handling into a separate function as Linuxdchagin2009-05-311-15/+23
| | | | | | | introduced more syscalls which uses these flags. Approved by: kib (mentor) MFC after: 1 month
* Remove empty lines.dchagin2009-05-311-2/+0
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Attempt to fix build by updating hostid to follow the new world order.delphij2009-05-301-1/+4
|
* Place hostnames and similar information fully under the prison system.jamie2009-05-292-15/+15
| | | | | | | | | | | | | | | | | The system hostname is now stored in prison0, and the global variable "hostname" has been removed, as has the hostname_mtx mutex. Jails may have their own host information, or they may inherit it from the parent/system. The proper way to read the hostname is via getcredhostname(), which will copy either the hostname associated with the passed cred, or the system hostname if you pass NULL. The system hostname can still be accessed directly (and without locking) at prison0.pr_host, but that should be avoided where possible. The "similar information" referred to is domainname, hostid, and hostuuid, which have also become prison parameters and had their associated global variables removed. Approved by: bz (mentor)
* s/usb2_/usb_/ on all typedefs for the USB stack.thompsa2009-05-291-16/+16
|
* Implement SI_ISALIST.delphij2009-05-291-1/+13
| | | | | | PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD
* Fix the sysinfo(SI_HW_SERIAL, emulation so that we actually get thedelphij2009-05-291-4/+6
| | | | | | | | hostid of the machine rather than always getting "0". PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD
* copyinstr(9) takes parameter 'len' as a size_t *, not int *.delphij2009-05-291-1/+2
| | | | | | PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD
* de-register.delphij2009-05-297-43/+43
| | | | | | Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD PR: kern/91293
* svr4_sys_getdents64() should not assume that the cookie would existdelphij2009-05-291-1/+4
| | | | | | | | everywhere. PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD
* Add new sysconfig bits, Fix the bogus numbering of the old bits.delphij2009-05-292-20/+71
| | | | | | Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD PR: kern/91293
* Use strlcpy().delphij2009-05-281-2/+2
|
* s/usb2_/usb_/ on all C structs for the USB stack.thompsa2009-05-281-17/+17
|
* linux_ioctl_cdrom: reduce stack usageavg2009-05-271-11/+16
| | | | | | | | | | | ... by moving two ~2KB structures from stack to heap allocation. I experienced stack overflow in linux emulation on i386 (8K stack) when LINUX_DVD_READ_STRUCT ioctl was performed on atapicam cd device and there was an error that resulted in additional quite heavy stack use in cam layer. Reviewed by: dchagin Approved by: jhb (mentor)
* Add hierarchical jails. A jail may further virtualize its environmentjamie2009-05-272-289/+107
| | | | | | | | | | | | | | | | | | | | | | by creating a child jail, which is visible to that jail and to any parent jails. Child jails may be restricted more than their parents, but never less. Jail names reflect this hierarchy, being MIB-style dot-separated strings. Every thread now points to a jail, the default being prison0, which contains information about the physical system. Prison0's root directory is the same as rootvnode; its hostname is the same as the global hostname, and its securelevel replaces the global securelevel. Note that the variable "securelevel" has actually gone away, which should not cause any problems for code that properly uses securelevel_gt() and securelevel_ge(). Some jail-related permissions that were kept in global variables and set via sysctls are now per-jail settings. The sysctls still exist for backward compatibility, used only by the now-deprecated jail(2) system call. Approved by: bz (mentor)
* Remove an unused variable.antoine2009-05-241-1/+1
|
* Comment nits.jhb2009-05-201-3/+3
|
* Put the vnode returned from namei() immediately after namei() returns injhb2009-05-201-5/+3
| | | | svr4_sys_resolvepath().
* Validate user-supplied arguments values.dchagin2009-05-191-1/+28
| | | | | | | | | Args argument is a pointer to the structure located in user space in which the socketcall arguments are packed. The structure must be copied to the kernel instead of direct dereferencing. Approved by: kib (mentor) MFC after: 1 week
* Implement MSG_CMSG_CLOEXEC flag for linux_recvmsg().dchagin2009-05-182-9/+25
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Somewhere between 2.6.23 and 2.6.27, Linux added SOCK_CLOEXEC anddchagin2009-05-162-2/+30
| | | | | | | | | | SOCK_NONBLOCK flags, that allow to save fcntl() calls. Implement a variation of the socket() syscall which takes a flags in addition to the type argument. Approved by: kib (mentor) MFC after: 1 month
* Return EINVAL in case when the incorrect or unsupporteddchagin2009-05-162-0/+12
| | | | | | | | | type argument is specified. Do not map type argument value as its Linux values are identical to FreeBSD values. Approved by: kib (mentor)
* Use the protocol family constants for the domain argument validation.dchagin2009-05-161-3/+5
| | | | | | | Return immediately when the socket() failed. Approved by: kib (mentor) MFC after: 1 month
* Emulate SO_PEERCRED socket option.dchagin2009-05-162-1/+26
| | | | | | | | | | Temporarily use 0 for pid member as the FreeBSD does not cache remote UNIX domain socket peer pid. PR: kern/102956 Reviewed by: rwatson Approved by: kib (mentor) MFC after: 1 month
* Remove an unused variable.brueffer2009-05-141-2/+0
| | | | | Found with: Coverity Prevent(tm) CID: 1167
* Fix memory leak in an error case.brueffer2009-05-131-0/+3
| | | | | | Found with: Coverity Prevent(tm) CID: 371 MFC after: 2 weeks
* Translate l_timeval arg to native struct timeval indchagin2009-05-111-0/+40
| | | | | | | | | | | | linux_setsockopt()/linux_getsockopt() for SO_RCVTIMEO, SO_SNDTIMEO opts as l_timeval has MD members. Remove bogus __packed attribute from l_timeval struct on __amd64__. PR: kern/134276 Submitted by: Thomas Mueller <tmueller sysgo com> Approved by: kib (mentor) MFC after: 2 weeks
* Add forgotten linux to bsd flags argument mapping into the linux_recv().dchagin2009-05-111-1/+1
| | | | | | | PR: kern/134276 Submitted by: Thomas Mueller <tmueller sysgo com> Approved by: kib (mentor) MFC after: 2 weeks
* Do not export AT_CLKTCK when emulating Linux kernel priordchagin2009-05-102-1/+14
| | | | | | | | | | | | | | 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-102-17/+62
| | | | | | | | | 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)
* Rework r189362, r191883.dchagin2009-05-102-1/+5
| | | | | | | | | The frequency of the statistics clock is given by stathz. Use stathz if it is available, otherwise use hz. Pointed out by: bde Approved by: kib (mentor)
* Regenerate system call tables to use SVN ids.ed2009-05-084-5/+11
|
* Burn TTY ioctl bridges in compat layers.ed2009-05-084-514/+0
| | | | | | | | | I really don't want any pieces of code to include ioctl_compat.h, so let the ibcs2 and svr4 compat leave sgtty alone. If they want to support sgtty, they should emulate it on top of termios, not sgtty. The code has been marked with BURN_BRIDGES for a long time. ibcs2 and svr4 are not really popular pieces of code anyway.
* Introduce a new virtualization container, provisionally named vprocg, to holdzec2009-05-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | virtualized instances of hostname and domainname, as well as a new top-level virtualization struct vimage, which holds pointers to struct vnet and struct vprocg. Struct vprocg is likely to become replaced in the near future with a new jail management API import. As a consequence of this change, change struct ucred to point to a struct vimage, instead of directly pointing to a vnet. Merge vnet / vimage / ucred refcounting infrastructure from p4 / vimage branch. Permit kldload / kldunload operations to be executed only from the default vimage context. This change should have no functional impact on nooptions VIMAGE kernel builds. Reviewed by: bz Approved by: julian (mentor)
* Give vfs_getopt the type it's expecting.jamie2009-05-071-4/+2
| | | | | | Write 100 times: "32 bits is so twentieth century." Noticed by: dchagin
* Move the per-prison Linux MIB from a private one-off pointer to the newjamie2009-05-073-96/+326
| | | | | | | | | 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)
* Add KTR(9) tracing for futex emulation.dchagin2009-05-071-11/+49
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Linux exports HZ value to user space via AT_CLKTCK auxiliary vector entry,dchagin2009-05-071-3/+1
| | | | | | | | | | | | | which is available for Glibc as sysconf(_SC_CLK_TCK). If AT_CLKTCK entry is not exported, Glibc uses 100. linux_times() shall use the value that is exported to user space. Pointyhat to: dchagin PR: kern/134251 Approved by: kib (mentor) MFC after: 2 weeks
* Change linux struct tms definition to match actual linux one.dchagin2009-05-071-4/+4
| | | | | Approved by: kib (mentor) MFC after: 2 weeks
* Add preliminary KTR(9) support to the linux emulation layer.dchagin2009-05-072-2/+31
| | | | | Approved by: kib (mentor) MFC after: 1 month
* To avoid excessive code duplication move MI definitions to the MIdchagin2009-05-072-0/+11
| | | | | | | header file. As it is defined in Linux. Approved by: kib (mentor) MFC after: 1 month
* Return EAFNOSUPPORT instead of EINVAL in case when the incorrect ordchagin2009-05-071-1/+1
| | | | | | unsupported domain argument is specified. Approved by: kib (mentor)
* Rework r191742.dchagin2009-05-071-5/+12
| | | | | | | | | | | | | | | Use the protocol family constants for the domain argument validation. Return EAFNOSUPPORT in case when the incorrect domain argument is specified. Return EPROTONOSUPPORT instead of passing values that are not 0 to the BSD layer. Suggested by: rwatson Approved by: kib (mentor) MFC after: 1 month
OpenPOWER on IntegriCloud