summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-0114-65/+87
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Add a vop_stdbmap(), and make it part of the default vop vector.phk2001-04-291-32/+0
| | | | | | Make 7 filesystems which don't really know about VOP_BMAP rely on the default vector, rather than more or less complete local vop_nopbmap() implementations.
* A bogus check for a char device also matched symbolic links.paul2001-04-251-1/+1
| | | | | | Replace it with a correct check using S_ISCHR() Symbolic links will now work again in linux compatibility.
* o Change a suser() call to a suser_xxx(..., PRISON_ROOT) call in therwatson2001-04-241-1/+1
| | | | | | | | | | linuxulator so as to allow privileged processes within a jail() to invoke the Linux initgroups() system call. This allows the Linux "su" to work properly (better) when running a complete Linux environment under jail(). This problem was reported by Attila Nagy <bra@fsn.hu>. Reviewed by: marcel
* Change the pfind() and zpfind() functions to lock the process that theyjhb2001-04-247-36/+39
| | | | | | find before releasing the allproc lock and returning. Reviewed by: -smp, dfr, jake
* Add linux_sched_get_priority_max() and linux_sched_get_priority_min(): Thealc2001-04-011-0/+56
| | | | policy parameter requires translation.
* Add missing includes of <sys/sx.h>jhb2001-03-282-0/+2
| | | | Reported by: peter
* Convert the allproc and proctree locks from lockmgr locks to sx locks.jhb2001-03-282-11/+11
|
* fix linux_times() to take into account linux's value of CLK_TCK on the alpha.gallatin2001-03-231-0/+5
| | | | | | Previously, results were off by a factor of 10 Tested by: Yoriaki FUJIMORI <fujimori@grafin.fujimori.cache.waseda.ac.jp>
* Eliminate global node types and instead use an operations vector forjlemon2001-03-126-687/+564
| | | | | | | | | each node in order to make it easier to add new entries. Rewrite the internal directory structure so that it is possible to have independent subdirectories. Utilize this to add /proc/net/dev. Reviewed by: DES
* Grab the process lock while calling psignal and before calling psignal.jhb2001-03-072-4/+7
|
* Just hold the proc lock while getting the parent's PID rather than ajhb2001-03-072-20/+10
| | | | proctree lock.
* - Hold both an exclusive proctree lock and the proc lock when reparentingjhb2001-03-071-10/+11
| | | | | a traced process during exit. - Lock the parent process while sending it SIGCHLD.
* Only pick up so_error the first time through with EISCONN, as advertised.jlemon2001-03-021-1/+1
| | | | | | The sense of the test was reversed, so we were returning EISCONN, then 0. Pointed out and tested by: Martin Blapp <mb@imp.ch>
* Correctly emulate linux_connect. For nonblocking sockets, the behaviorjlemon2001-03-011-51/+21
| | | | | | | | is to return EINPROGRESS, EALREADY, (so_error ONCE), EISCONN. Certain linux applications rely on the so_error (normally 0) being returned in order to operate properly. Tested by: Thomas Moestl <tmoestl@gmx.net>
* Reviewed by: jlemonadrian2001-03-012-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | An initial tidyup of the mount() syscall and VFS mount code. This code replaces the earlier work done by jlemon in an attempt to make linux_mount() work. * the guts of the mount work has been moved into vfs_mount(). * move `type', `path' and `flags' from being userland variables into being kernel variables in vfs_mount(). `data' remains a pointer into userspace. * Attempt to verify the `type' and `path' strings passed to vfs_mount() aren't too long. * rework mount() and linux_mount() to take the userland parameters (besides data, as mentioned) and pass kernel variables to vfs_mount(). (linux_mount() already did this, I've just tidied it up a little more.) * remove the copyin*() stuff for `path'. `data' still requires copyin*() since its a pointer into userland. * set `mount->mnt_statf_mntonname' in vfs_mount() rather than in each filesystem. This variable is generally initialised with `path', and each filesystem can override it if they want to. * NOTE: f_mntonname is intiailised with "/" in the case of a root mount.
* MFS: bring the consistent `compat_3_brand' support into -CURRENTobrien2001-02-241-0/+1
| | | | | (the work was first done in the RELENG_4 branch near a release during a MFC to make the code cleaner and more consistent)
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectrwatson2001-02-214-16/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | credential structure, ucred (cr->cr_prison). o Allow jail inheritence to be a function of credential inheritence. o Abstract prison structure reference counting behind pr_hold() and pr_free(), invoked by the similarly named credential reference management functions, removing this code from per-ABI fork/exit code. o Modify various jail() functions to use struct ucred arguments instead of struct proc arguments. o Introduce jailed() function to determine if a credential is jailed, rather than directly checking pointers all over the place. o Convert PRISON_CHECK() macro to prison_check() function. o Move jail() function prototypes to jail.h. o Emulate the P_JAILED flag in fill_kinfo_proc() and no longer set the flag in the process flags field itself. o Eliminate that "const" qualifier from suser/p_can/etc to reflect mutex use. Notes: o Some further cleanup of the linux/jail code is still required. o It's now possible to consider resolving some of the process vs credential based permission checking confusion in the socket code. o Mutex protection of struct prison is still not present, and is required to protect the reference count plus some fields in the structure. Reviewed by: freebsd-arch Obtained from: TrustedBSD Project
* Allow debugging output to be controlled on a per-syscall granularity.jlemon2001-02-166-147/+259
| | | | | | Also clean up debugging output in a slightly more uniform fashion. The default behavior remains the same (all debugging output is turned on)
* Add mount syscall to linux emulation. Also improve emulation of reboot.jlemon2001-02-162-0/+109
|
* Change and clean the mutex lock interface.bmilekic2001-02-094-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Fix typo: seperate -> separate.asmodai2001-02-062-2/+2
| | | | Seperate does not exist in the english language.
* Fix typo: wierd -> weird.asmodai2001-02-061-1/+1
| | | | There is no such thing as wierd in the english language.
* Back out proc locking to protect p_ucred for obtaining additionaljhb2001-01-276-84/+18
| | | | references along with the actual obtaining of additional references.
* - Back out over-aggressive locking of p->p_cred.jhb2001-01-261-12/+3
| | | | - Back out locking ucred's and bumping refcounts for vnode operations.
* Use queue macros.jhb2001-01-241-1/+1
|
* - Proc locking.jhb2001-01-233-27/+73
| | | | | | | - Use queue macros. - Use NULL instead of 0 for pointers. Reviewed by: des
* Argh, atomic_store_rel -> atomic_store_rel_int.jhb2001-01-231-1/+1
|
* Woops, add in missing headers.jhb2001-01-231-1/+3
|
* Proc locking.jhb2001-01-235-17/+63
|
* Use queue macros.jhb2001-01-231-5/+4
|
* - Add proc locking.jhb2001-01-231-35/+104
| | | | | | | | - Fix several bugs in the wait syscall, including freeing the actual proc start, freeing the args, freeing the prison, and other minor nits. - Use appropriate queue(3) macros. - Use zpfind() instead of walking zombproc ourselves.
* - Use proper atomic operations to make the run time initializationjhb2001-01-231-10/+20
| | | | controlled by svr_str_initialized be MP safe.
* FreeBSD doesn't have p_emuldata, and our stackgap_init() doesn't take anjhb2001-01-231-3/+3
| | | | argument.
* Use proc lock to safely obtain references to p_ucred before vnodejhb2001-01-231-3/+13
| | | | operations.
* Protect calcru() with sched_lock.jhb2001-01-231-0/+2
|
* Map BSS section in PECOFF executable.takawata2001-01-231-1/+1
| | | | Submitted by: KUROSAWA Takahiro <fwkg7679@mb.infoweb.ne.jp>
* Finish deprecating <sys/select.h> in favor of <sys/selinfo.h> in kernel code.wollman2001-01-201-1/+0
|
* Instead of hard coding the major numbers for IDE and SCSI disksjoe2001-01-141-10/+17
| | | | look in the device's cdevsw for the D_DISK flag.
* Protect proc.p_pptr with the proctree lock.jake2001-01-102-4/+20
|
* Take 10 seconds to actually fix the chgproccnt rather than just make itgreen2001-01-091-2/+1
| | | | | explicitly error. If the module is horribly broken, it should be temporarily removed from src/sys/modules.
* With some trepidation, add a `#error' directive to this module. It waswollman2001-01-091-0/+1
| | | | | broken and not fixed by whoever changed the interface of chgproccnt(); in the state it is in it could not possibly work (dereferencing an integer).
* Map FreeBSD character device hard disks to Linux block device hard disks.paul2000-12-291-0/+14
| | | | This fixes the problem with VMWARE not being able to use raw disks.
* Protect proc.p_pptr and proc.p_children/p_sibling with thejake2000-12-231-8/+16
| | | | | | | | proctree_lock. linprocfs not locked pending response from informal maintainer. Reviewed by: jhb, -smp@
* Add PECOFF (WIN32 Execution file format) support.takawata2000-12-202-0/+783
| | | | | | | | | To use it, some dll is needed. And currently, the dll is only for NetBSD. So one more kernel module is needed. For more infomation, http://chiharu.haun.org/peace/ . Reviewed by: bp
* translate the flags in recvfrom and recvmsg from linux to bsd onesassar2000-12-192-2/+121
| | | | Approved by: marcel
* Lock access to proc members.jhb2000-12-154-18/+51
| | | | Glanced over by: marcel
* Use kinfo_proc instead of eproc (which Kirk deep-sixed earlier this week)des2000-12-132-216/+260
| | | | | | | | | | Generate a version string that looks just like a real Linux one - almost :) Use sbufs everywhere instead of sprintf(). Note that this is still imperfect, as the code does not check whether the sbuf overflowed - but it'll still work better than before, since if the sbuf overflows, the code now simply copies out 0 bytes instead of causing a trap (or worse, corrupting kernel structures)
* Add dependency on linux, which is needed for proc/version.des2000-12-131-0/+1
|
* Lock the allproc list.jake2000-12-131-1/+4
| | | | Approved by: DES
OpenPOWER on IntegriCloud