summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
Commit message (Collapse)AuthorAgeFilesLines
* Neuter linux_ustat() until somebody finds time to try to fix it.phk2005-02-221-4/+9
| | | | | | | | | | | | | | | The fundamental problem is that we get only the lower 8 bits of the minor device number so there is no guarantee that we can actually find the disk device in question at all. This was probably a bigger issue pre-GEOM where the upper bits signaled which slice were in use. The secondary problem is how we get from (partial) dev_t to vnode. The correct implementation will involve traversing the mount list looking for a perfect match or a possible match (for truncated minor).
* Unbreak the kernel build. Pointy hat to: sobomax.njl2005-02-131-1/+1
|
* Backout previous change (disabling of security checks for signals deliveredsobomax2005-02-131-2/+2
| | | | | | in emulation layers), since it appears to be too broad. Requested by: rwatson
* Split out kill(2) syscall service routine into user-level and kernel part, thesobomax2005-02-131-1/+1
| | | | | | | | | | | | | | | | | former is callable from user space and the latter from the kernel one. Make kernel version take additional argument which tells if the respective call should check for additional restrictions for sending signals to suid/sugid applications or not. Make all emulation layers using non-checked version, since signal numbers in emulation layers can have different meaning that in native mode and such protection can cause misbehaviour. As a result remove LIBTHR from the signals allowed to be delivered to a suid/sugid application. Requested (sorta) by: rwatson MFC after: 2 weeks
* Semctl with IPC_STAT command should return zero in case of success.sobomax2005-02-111-2/+3
| | | | | | PR: 73778 Submitted by: Andriy Gapon <avg@icyb.net.ua> MFC after: 2 weeks
* - Use kern_{l,f,}stat() and kern_{f,}statfs() functions rather thanjhb2005-02-071-132/+39
| | | | | | duplicating the contents of the same functions inline. - Consolidate common code to convert a BSD statfs struct to a Linux struct into a static worker function.
* Make linux_emul_convpath() a simple wrapper for kern_alternate_path().jhb2005-02-071-98/+3
|
* - Tweak kern_msgctl() to return a copy of the requested message queue idjhb2005-02-071-3/+2
| | | | | | | | | | | | | | | | | structure in the struct pointed to by the 3rd argument for IPC_STAT and get rid of the 4th argument. The old way returned a pointer into the kernel array that the calling function would then access afterwards without holding the appropriate locks and doing non-lock-safe things like copyout() with the data anyways. This change removes that unsafeness and resulting race conditions as well as simplifying the interface. - Implement kern_foo wrappers for stat(), lstat(), fstat(), statfs(), fstatfs(), and fhstatfs(). Use these wrappers to cut out a lot of code duplication for freebsd4 and netbsd compatability system calls. - Add a new lookup function kern_alternate_path() that looks up a filename under an alternate prefix and determines which filename should be used. This is basically a more general version of linux_emul_convpath() that can be shared by all the ABIs thus allowing for further reduction of code duplication.
* Use kern_setitimer() to implement linux_alarm() instead of fondling thejhb2005-02-071-19/+7
| | | | real interval timer directly.
* Boot away another stackgap (one of the lest ones in linuxlator/i386) bysobomax2005-01-301-14/+13
| | | | | | | | | | providing special version of CDIOCREADSUBCHANNEL ioctl(), which assumes that result has to be placed into kernel space not user space. In the long run more generic solution has to be designed WRT emulating various ioctl()s that operate on userspace buffers, but right now there is only one such ioctl() is emulated, so that it makes little sense. MFC after: 2 weeks
* Extend kern_sendit() to take another enum uio_seg argument, which specifiessobomax2005-01-301-24/+20
| | | | | | | where the buffer to send lies and use it to eliminate yet another stackgap in linuxlator. MFC after: 2 weeks
* Split out kernel side of msgctl(2) into two parts: the first that pops datasobomax2005-01-261-17/+10
| | | | | | | | from the userland and pushes results back and the second which does actual processing. Use the latter to eliminate stackgap in the linux wrapper of that syscall. MFC after: 2 weeks
* Split out kernel side of {get,set}itimer(2) into two parts: the first thatsobomax2005-01-251-64/+33
| | | | | | | | pops data from the userland and pushes results back and the second which does actual processing. Use the latter to eliminate stackgap in the linux wrappers of those syscalls. MFC after: 2 weeks
* Match the LINUX32's style with existing styleobrien2005-01-1411-65/+65
| | | | | | Submitted by: Jung-uk Kim <jkim@niksun.com> Use positive, not negative logic.
* Fix Linux compat 'uname -m' on AMD64.obrien2005-01-141-1/+7
| | | | | Submitted by: Jung-uk Kim <jkim@niksun.com> (patch reworked by me)
* Start each of the license/copyright comments with /*-imp2005-01-054-4/+4
|
* Do not blindly pass linux filesystem specific mount data across.phk2004-12-031-1/+1
|
* Ignore MNT_NODEV option, it is implicit in choice of filesystem.phk2004-11-261-2/+0
|
* Rename thread args to be called "td" rather than "p" to bedwmalone2004-10-101-6/+6
| | | | | | | | consistent with other bits of this file. There should be no functional change. Submitted by: Andrea Campi (many moons ago) MFC after: 2 month
* Rework how we store process times in the kernel such that we always storejhb2004-10-051-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the raw values including for child process statistics and only compute the system and user timevals on demand. - Fix the various kern_wait() syscall wrappers to only pass in a rusage pointer if they are going to use the result. - Add a kern_getrusage() function for the ABI syscalls to use so that they don't have to play stackgap games to call getrusage(). - Fix the svr4_sys_times() syscall to just call calcru() to calculate the times it needs rather than calling getrusage() twice with associated stackgap, etc. - Add a new rusage_ext structure to store raw time stats such as tick counts for user, system, and interrupt time as well as a bintime of the total runtime. A new p_rux field in struct proc replaces the same inline fields from struct proc (i.e. p_[isu]ticks, p_[isu]u, and p_runtime). A new p_crux field in struct proc contains the "raw" child time usage statistics. ruadd() has been changed to handle adding the associated rusage_ext structures as well as the values in rusage. Effectively, the values in rusage_ext replace the ru_utime and ru_stime values in struct rusage. These two fields in struct rusage are no longer used in the kernel. - calcru() has been split into a static worker function calcru1() that calculates appropriate timevals for user and system time as well as updating the rux_[isu]u fields of a passed in rusage_ext structure. calcru() uses a copy of the process' p_rux structure to compute the timevals after updating the runtime appropriately if any of the threads in that process are currently executing. It also now only locks sched_lock internally while doing the rux_runtime fixup. calcru() now only requires the caller to hold the proc lock and calcru1() only requires the proc lock internally. calcru() also no longer allows callers to ask for an interrupt timeval since none of them actually did. - calcru() now correctly handles threads executing on other CPUs. - A new calccru() function computes the child system and user timevals by calling calcru1() on p_crux. Note that this means that any code that wants child times must now call this function rather than reading from p_cru directly. This function also requires the proc lock. - This finishes the locking for rusage and friends so some of the Giant locks in exit1() and kern_wait() are now gone. - The locking in ttyinfo() has been tweaked so that a shared lock of the proctree lock is used to protect the process group rather than the process group lock. By holding this lock until the end of the function we now ensure that the process/thread that we pick to dump info about will no longer vanish while we are trying to output its info to the console. Submitted by: bde (mostly) MFC after: 1 month
* Hold thread reference while frobbing cdevsw.phk2004-09-241-18/+24
|
* Fix the ABI wrappers to use kern_fcntl() rather than calling fcntl()jhb2004-08-241-11/+4
| | | | | | | | directly. This removes a few more users of the stackgap and also marks the syscalls using these wrappers MP safe where appropriate. Tested on: i386 with linux acroread5 Compiled on: i386, alpha LINT
* Don't try to translate the control message unless we're certain it'sdes2004-08-231-1/+2
| | | | | | | | valid; otherwise a caller could trick us into changing any 32-bit word in kernel memory to LINUX_SOL_SOCKET (0x00000001) if its previous value is SOL_SOCKET (0x0000ffff). MFC after: 3 days
* Fix the 'DEBUG' argument code to unbreak the amd64 LINT build.obrien2004-08-161-1/+1
|
* Fix the 'DEBUG' argument code to unbreak the amd64 LINT build.obrien2004-08-161-2/+2
|
* Fix the 'DEBUG' argument code to unbreak the LINT build.obrien2004-08-161-2/+2
|
* Changes to MI Linux emulation code necessary to run 32-bit Linux binariestjr2004-08-1612-112/+244
| | | | | | | | | | | | | | | on AMD64, and the general case where the emulated platform has different size pointers than we use natively: - declare certain structure members as l_uintptr_t and use the new PTRIN and PTROUT macros to convert to and from native pointers. - declare some structures __packed on amd64 when the layout would differ from that used on i386. - include <machine/../linux32/linux.h> instead of <machine/../linux/linux.h> if compiling with COMPAT_LINUX32. This will need to be revisited before 32-bit and 64-bit Linux emulation support can coexist in the same kernel. - other small scattered changes. This should be a no-op on i386 and Alpha.
* Replace linux_getitimer() and linux_setitimer() with implementationstjr2004-08-151-24/+77
| | | | | based on those in freebsd32_misc.c, removing the assumption that Linux uses the same layout for struct itimerval as we use natively.
* Avoid assuming that l_timeval is the same as the native struct timevaltjr2004-08-151-2/+7
| | | | in linux_select().
* Use sv_psstrings from the current process's sysentvec structure insteadtjr2004-08-151-2/+3
| | | | | | of PS_STRINGS. This is a no-op at present, but it will be needed when running 32-bit Linux binaries on amd64 to ensure PS_STRINGS is in addressable memory.
* Add XXX comment about findcdev() misuse.phk2004-08-141-0/+6
|
* Use kernel_vmount() instead of vfs_nmount().phk2004-07-271-15/+4
|
* Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This iscperciva2004-07-262-2/+2
| | | | | | | | | | | somewhat clearer, but more importantly allows for a consistent naming scheme for suser_cred flags. The old name is still defined, but will be removed in a few days (unless I hear any complaints...) Discussed with: rwatson, scottl Requested by: jhb
* I missed two pieces of the commit to this file. Robert has alreadydwmalone2004-07-181-1/+1
| | | | added one, this adds the other.
* Remove 'sg' argument to linux_sendto_hdrincl, which is what I think wasrwatson2004-07-181-1/+1
| | | | intended. This fixes the build, but might require revision.
* Add a kern_setsockopt and kern_getsockopt which can read the optiondwmalone2004-07-171-65/+19
| | | | | | values from either user land or from the kernel. Use them for [gs]etsockopt and to clean up some calls to [gs]etsockopt in the Linux emulation code that uses the stackgap.
* Clean up and wash struct iovec and struct uio handling.phk2004-07-101-20/+7
| | | | | | | | | | | | Add copyiniov() which copies a struct iovec array in from userland into a malloc'ed struct iovec. Caller frees. Change uiofromiov() to malloc the uio (caller frees) and name it copyinuio() which is more appropriate. Add cloneuio() which returns a malloc'ed copy. Caller frees. Use them throughout.
* Use a couple of regular kernel entry points, rather than COMPAT_43phk2004-07-081-4/+12
| | | | entry points.
* Implement SNDCTL_DSP_SETDUPLEX. This may fix sound apps which want tonetchild2004-07-022-0/+5
| | | | | | use full duplex mode. Approved by: matk
* Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead ofbde2004-06-231-2/+4
| | | | | | | depending on namespace pollution in <sys/vnode.h> for the definition of GIANT_REQUIRED. Sorted includes.
* Mark linux_emul_convpath() as GIANT_REQUIRED.rwatson2004-06-221-0/+2
|
* Add stub for Linux SOUND_MIXER_READ_RECMASK, required by some Linux soundbms2004-06-182-0/+5
| | | | | | | applications. PR: misc/27471 Submitted by: Gavin Atkinson (with cleanups)
* Add a stub for the Linux SOUND_MIXER_INFO ioctl (even though we don'tbms2004-06-182-0/+5
| | | | | | | | actually implement it), as some applications, such as RealProducer, expect to be able to use it. PR: kern/65971 Submitted by: Matt Wright
* Linux applications expect to be able to call SIOCGIFCONF with anbms2004-06-181-0/+14
| | | | | | | | | | NULL ifc.ifc_buf pointer, to determine the expected buffer size. The submitted fix only takes account of interfaces with an AF_INET address configured. This could no doubt be improved. PR: kern/45753 Submitted by: Jacques Garrigue (with cleanups)
* Fix the VT_SETMODE/CDROMIOCTOCENTRY problem correctly.bms2004-06-181-15/+17
| | | | Reviewed by: tjr
* Fix two attempts to use an unchecked NULL pointer provided from thebms2004-06-181-7/+10
| | | | | | userland, for the CDIOREADTOCENTRY and VT_SETMODE cases respectively. Noticed by: tjr
* Second half of the dev_t cleanup.phk2004-06-171-4/+4
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-6/+6
| | | | Bump __FreeBSD_version accordingly.
* Add support for more linux ioctls.phk2004-06-142-2/+117
| | | | | | | | I've had this sitting in my tree for a long time and I can't seem to find who sent it to me in the first place, apologies to whoever is missing out on a Contributed by: line here. I belive it works as it should.
* Deorbit COMPAT_SUNOS.phk2004-06-112-2/+2
| | | | | We inherited this from the sparc32 port of BSD4.4-Lite1. We have neither a sparc32 port nor a SunOS4.x compatibility desire these days.
OpenPOWER on IntegriCloud