summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
Commit message (Collapse)AuthorAgeFilesLines
* Device megapatch 5/6:phk2004-02-211-4/+4
| | | | | | | | | | | | Remove the unused second argument from udev2dev(). Convert all remaining users of makedev() to use udev2dev(). The semantic difference is that udev2dev() will only locate a pre-existing dev_t, it will not line makedev() create a new one. Apart from the tiny well controlled windown in D_PSEUDO drivers, there should no longer be any "anonymous" dev_t's in the system now, only dev_t's created with make_dev() and make_dev_alias()
* Add BSD compatibility tty ioctls LINUX_TIOCSBRK and LINUX_TIOCCBRK. Thisbms2004-02-192-0/+13
| | | | | | | addition appears to allow VMware 3 Workstation to operate with nmdm(4) as a virtual COM device. Tested by: Guido van Rooij
* Locking for the per-process resource limits structure.jhb2004-02-041-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64
* VOP_GETATTR() wants the vnode passed to it to be locked. Insteadtruckman2004-01-141-13/+1
| | | | | | | | of adding the code to lock and unlock the vnodes and taking care to avoid deadlock, simplify linux_emul_convpath() by comparing the vnode pointers directly instead of comparing their va_fsid and va_fileid attributes. This allows the removal of the calls to VOP_GETATTR().
* Lock the traversal of the vm object list. Use TAILQ_FOREACH consistently.alc2004-01-021-2/+3
|
* Quick fix for LINT breakage caused by interface changes in accept(2), etc.bde2003-12-251-33/+36
| | | | | | | | | | | | | | | | | | | The log message for rev.1.160 of kern/uipc_syscalls.c and associated changes only claimed to add restrict qualifiers (which have no effect in the kernel so they probably shouldn't be added), but the following interface changes were also made: - caddr_t to `void *' and `struct sockaddr_t *' - `int *' to `socklen_t *'. These interface changes are not quite null, and this fix is quick (like the changes in uipc_syscalls 1.160) because it uses bogus casts instead of complete bounds-checked conversions. Things should be fixed better when the conversions can be done without using the stack gap. linux_check_hdrincl() already uses the stack gap and is fixed completely though the type mismatches in it were not fatal (there were only fatal type mismatches from unopaquing pointers to [o]sockaddr't's -- the difference between accept()'s args and oaccept()'s args is now non-opaque, but this is not reflected in their args structs).
* Do not call VOP_GETATTR in getdents function. It does not serve anykan2003-11-191-6/+0
| | | | | | | | | | purpose and the resulting vattr structure was ignored. In addition, the VOP_GETATTR call was made with no vnode lock held, resulting in vnode locking violation panic with debug kernels. Reported by: truckman Approved by: re@ (rwatson)
* Add a MAC check for VOP_LOOKUP() in the Linux getwcd() implementation.rwatson2003-11-171-1/+5
| | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Pull latest changes from OpenBSD:sobomax2003-11-161-3/+13
| | | | | | | | | | | - improve sysinfo(2) syscall; - add dummy fadvise64(2) syscall; - add dummy *xattr(2) family of syscalls; - add protos for the syscalls 222-225, 238-249 and 253-267; - add exit_group(2) syscall, which is currently just wired to exit(2). Obtained from: OpenBSD MFC after: 2 weeks
* Use kern_sendit rather than sendit for the Linux send* syscalls.dwmalone2003-11-091-144/+105
| | | | | This means we can avoid using the stack gap for most send* syscalls now (it is still used in the IP_HDRINCL case).
* Prevent leaking of fsid to non-root users in linux_statfs and linux_fstatfs.anholt2003-11-051-4/+14
| | | | | | | | Matches native syscalls now. PR: kern/58793 Submitted by: David P. Reese Jr. <daver@gomerbud.com> MFC after: 1 week
* Back out the following revisions:fjoe2003-11-051-6/+6
| | | | | | | | | | | | | | | | | | 1.36 +73 -60 src/sys/compat/linux/linux_ipc.c 1.83 +102 -48 src/sys/kern/sysv_shm.c 1.8 +4 -0 src/sys/sys/syscallsubr.h That change was intended to support vmware3, but wantrem parameter is useless because vmware3 uses SYSV shared memory to talk with X server and X server is native application. The patch worked because check for wantrem was not valid (wantrem and SHMSEG_REMOVED was never checked for SHMSEG_ALLOCATED segments). Add kern.ipc.shm_allow_removed (integer, rw) sysctl (default 0) which when set to 1 allows to return removed segments in shm_find_segment_by_shmid() and shm_find_segment_by_shmidx(). MFC after: 1 week
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-7/+4
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* Reject negative ngrp arguments in linux_setgroups() and linux_setgroups16();tjr2003-10-212-2/+2
| | | | | stops users being able to cause setgroups to clobber the kernel stack by copying in data past the end of the linux_gidset array.
* fix build: linux_to_bsd_msf_lba is no longer used because of previous commitsam2003-10-201-12/+0
|
* We dont support CDROMREADAUDIO anymore.sos2003-10-201-18/+1
|
* Fix some problems in linux_sendmsg() and linux_recvmsg().iwasaki2003-10-111-36/+38
| | | | | | | | | | | - Allocate storage for uap->msg always because it is copyin()'ed in native sendmsg(). - Convert sockopt level from Linux to FreeBSD after native recvmsg() calling. - Some cleanups. Tested with: Oracle 9i shared server connection mode. MFC after: 1 week
* Restored a non-egregious cast so that this file compiles on i386'sbde2003-09-071-1/+1
| | | | | | | | | | | | | with 64-bit longs again. This was fixed in rev.1.42 but the fix rotted non-fatally in rev.1.105 and fatally in rev.1.137. Many more non-egregrious casts are strictly required for conversions from semi-opaque types to pointers, but we avoid most of them by using types that are almost certain to be compatible with uintptr_t for representing pointers (e.g., vm_offset_t). Here we don't really want the u_longs, but we have them because a.out.h and its support code doesn't use typedefs (it uses unsigned in V7 and unsigned long in FreeBSD) and is too obsolete to fix now.
* Try to make 'uname -a' look more like it does on Linux:des2003-07-291-0/+30
| | | | | | | | | | - cut the version string at the newline, suppressing information about who built the kernel and in what directory. Most of this information was already lost to truncation. - on i386, return the precise CPU class (if known) rather than just "i386". Linux software which uses this information to select which binary to run often does not know what to make of "i386".
* Add a "int fd" argument to VOP_OPEN() which in the future willphk2003-07-261-1/+1
| | | | | | | | | contain the filedescriptor number on opens from userland. The index is used rather than a "struct file *" since it conveys a bit more information, which may be useful to in particular fdescfs and /dev/fd/* For now pass -1 all over the place.
* Add a new function swap_pager_status() which reports the total size of thephk2003-07-181-8/+4
| | | | | | | paging space and how much of it is in use (in pages). Use this interface from the Linuxolator instead of groping around in the internals of the swap_pager.
* Don't map LINUX_POSIX_VDISABLE to _POSIX_VDISABLE and vice versa formarcel2003-06-281-2/+4
| | | | | | | | | | | | | | | | the VMIN and VTIME members of the c_cc array. These members are not special control characters. By not excluding these members we changed the noncanonical mode input processing when both members were 0 on entry (=LINUX_POSIX_VDISABLE) as we would remap them to 255 (=_POSIX_VDISABLE). See termios(4) case A for how that screws up your terminal I/O. PR: 23173 Originator: Bjarne Blichfeldt <bbl@dk.damgaard.com> Patch by: Boris Nikolaus <bn@dali.tellique.de> (original submission) Philipp Mergenthaler <philipp.mergenthaler@stud.uni-karlsruhe.de> Reminders by: Joseph Holland King <gte743n@cad.gatech.edu> MFC after: 5 days
* Add a f_vnode field to struct file.phk2003-06-222-2/+2
| | | | | | | | | | | | Several of the subtypes have an associated vnode which is used for stuff like the f*() functions. By giving the vnode a speparate field, a number of checks for the specific subtype can be replaced simply with a check for f_vnode != NULL, and we can later free f_data up to subtype specific use. At this point in time, f_data still points to the vnode, so any code I might have overlooked will still work.
* Use __FBSDID().obrien2003-06-1012-23/+37
|
* Change the semantics of sysv shm emulation to take a additionalmbr2003-05-051-60/+73
| | | | | | | | | | | | | | | | | argument to the functions shm{at,ctl}1 and shm_find_segment_by_shmid{x}. The BSD semantics didn't allow the usage of shared segment after being marked for removal through IPC_RMID. The patch involves the following functions: - shmat - shmctl - shm_find_segment_by_shmid - shm_find_segment_by_shmidx - linux_shmat - linux_shmctl Submitted by: Orlando Bassotto <orlando.bassotto@ieo-research.it> Reviewed by: marcel
* Initialize tbuf in newstat_copyout() too.mbr2003-04-291-0/+1
| | | | Reviewed by: phk
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-293-6/+3
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Do the same thing for stat64_copyout() as we alreadymbr2003-04-291-0/+19
| | | | | | | | | | | | do for newstat_copyout(). Lie about disk drives which are character devices in FreeBSD but block devices under Linux. PR: 37227 Submitted by: Vladimir B. Grebenschikov <vova@sw.ru> Reviewed by: phk MFC after: 2 weeks
* Argh! We want to return the old signal set when the error return is zerojhb2003-04-281-1/+1
| | | | | | | (i.e. success), not non-zero (failure). Submitted by: tegge Pointy hat to: jhb
* Use a switch to convert the Linux sigprocmask flags to the equivalentjhb2003-04-251-3/+14
| | | | | | | | | | | FreeBSD flags instead of just adding one to the Linux flags. This should be identical to the previous version except that I have at least one report of this patch fixing problems people were having with Linux apps after my last commit to this file. It is safer to use the switch then to make assumptions about the flag values anyways, esp. since we currently use MD defines for the values of the flags and this is MI code. Tested by: Michael Class <michael_class@gmx.net>
* Add an ioctl handler for the DRM. This removes the need for the DRM_LINUXanholt2003-04-242-0/+17
| | | | option, which has been a source of frustration for many users.
* Fix a lock order reversal. Unlock the proc before calling fget().jhb2003-04-231-1/+1
| | | | Reported by: kris
* - Replace inline implementations of sigprocmask() with calls tojhb2003-04-221-29/+11
| | | | | | | kern_sigprocmask() in the various binary compatibility emulators. - Replace calls to sigsuspend(), sigaltstack(), sigaction(), and sigprocmask() that used the stackgap with calls to the corresponding kern_sig*() functions instead without using the stackgap.
* Don't hold the proc lock while performing sigset conversions on localjhb2003-04-171-1/+1
| | | | variables.
* Use local struct proc variables to reduce repeated td->td_proc dereferencesjhb2003-04-171-10/+14
| | | | and improve readability.
* Don't include <sys/disklabel.h>phk2003-04-161-1/+0
|
* Explicitly cast a l_ulong to an unsigned long to make all arch's happyjhb2003-04-161-1/+1
| | | | with the printf format.
* Fix printf format in a debug printf.jhb2003-04-161-1/+1
|
* Add #include <sys/conf.h> so we don't rely on <sys/disk.h> doing it.phk2003-04-011-0/+1
|
* - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread withjeff2003-03-311-14/+15
| | | | | | | a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
* Fix an XXX: and implement LINUX_BLKGETSIZE correctly.phk2003-03-281-6/+14
|
* Add a cleanup function to destroy the osname_lock and call it on modulejhb2003-03-262-0/+9
| | | | | | | unload. Submitted by: gallatin Reported by: Martin Karlsson <mk-freebsd@bredband.net>
* Use td->td_ucred instead of td->td_proc->p_ucred.jhb2003-03-202-5/+4
|
* Backout the getcwd changes, a more comprehensive effort will be needed.phk2003-03-201-2/+409
|
* (This commit certainly increases the need for a wash&clean of vfs_cache.c,phk2003-03-171-409/+2
| | | | | | | | | | | | | | | | | but I decided that it was important for this patch to not bit-rot, and since it is mainly moving code around, the total amount of entropy is epsilon /phk) This is a patch to move the common parts of linux_getcwd() back into kern/vfs_cache.c so that the standard FreeBSD libc getcwd() can use it's extended functionality. The linux syscall linux_getcwd() in compat/linux/linux_getcwd.c has been rewritten to use it too. It should be possible to simplify libc's getcwd() after this. No doubt this code needs some cleaning up, since I've left in the sysctl variables I used for debugging. PR: 48169 Submitted by: James Whitwell <abacau@yahoo.com.au>
* - Change the linux_[gs]et_os{name, release, s_version}() functions tojhb2003-03-134-113/+107
| | | | | | | | | | | | | 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.
* Clean up whitespace and remove register keyword.des2003-03-036-48/+48
|
* More caddr_t removal, in conjunction with copy{in,out}(9) this time.des2003-03-038-94/+78
| | | | Also clean up some egregious casts and incorrect use of sizeof.
* Clean up whitespace, s/register //, refrain from strong urge to ANSIfy.des2003-03-021-22/+22
|
* uiomove-related caddr_t -> void * (just the low-hanging fruit)des2003-03-021-2/+1
|
OpenPOWER on IntegriCloud