summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Synchronize syscalls.master(s) with recent Giant pushdown workdillon2001-09-011-8/+8
|
* Speculatively add this file. It's part of the Linuxulator updatemarcel2001-09-011-0/+285
| | | | | | | | to make it emulate Linux kernel version 2.4.2, which is required in order to upgrade the linux_base port to RH 7.1. Note that this file is only needed for 32-bit architectures. To us this means i386 (for now?)
* Fix linux_getcwd() so that if the cwd isn't cached (__getcwd() fails),gallatin2001-08-292-28/+466
| | | | | | | | | | the cwd is looked up inside the kernel. The native getcwd() in libc handles this in userland if __getcwd() fails. Obtained from: NetBSD via OpenBSD Tested by: Chris Casey <chriss@phys.ksu.edu>, Markus Holmberg <markush@acc.umu.se> Reviewed by: Darrell Anderson <anderson@cs.duke.edu> PR: kern/24315
* Added the linux_sysinfo function to implement sysinfo(2).pirzyk2001-07-231-0/+76
| | | | | | | PR: kern/27759 Reviewed by: marcel Approved by: marcel MFC after: 1 week
* get rid of some printf and pointer type warningsassar2001-07-227-15/+17
|
* o Replace calls to p_can(..., P_CAN_xxx) with calls to p_canxxx().rwatson2001-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | | The p_can(...) construct was a premature (and, it turns out, awkward) abstraction. The individual calls to p_canxxx() better reflect differences between the inter-process authorization checks, such as differing checks based on the type of signal. This has a side effect of improving code readability. o Replace direct credential authorization checks in ktrace() with invocation of p_candebug(), while maintaining the special case check of KTR_ROOT. This allows ktrace() to "play more nicely" with new mandatory access control schemes, as well as making its authorization checks consistent with other "debugging class" checks. o Eliminate "privused" construct for p_can*() calls which allowed the caller to determine if privilege was required for successful evaluation of the access control check. This primitive is currently unused, and as such, serves only to complicate the API. Approved by: ({procfs,linprocfs} changes) des Obtained from: TrustedBSD Project
* Bah, back out part of previous commit. I got too carried away.peter2001-06-151-1/+1
| | | | linux_debug_map[] is referred to from elsewhere.
* Fix warnings:peter2001-06-151-5/+5
| | | | | 235: warning: unsigned int format, pointer arg (arg 3) 621: warning: cast discards qualifiers from pointer target type
* Fix warning:peter2001-06-151-2/+2
| | | | 239: warning: no previous prototype for `linux_debug'
* Fix warning:peter2001-06-151-1/+1
| | | | 413: warning: long unsigned int format, vm_offset_t arg (arg 2)
* With this commit, I hereby pronounce gensetdefs past its use-by date.peter2001-06-131-34/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind
* Say one thing, do the other... nextpid -> lastpiddes2001-06-111-1/+1
|
* Implement proc/cpuinfo for the Alpha (thanks to gallatin).des2001-06-111-10/+160
| | | | Implement proc/pid/cmdline.
* Minor whitespace changes.des2001-06-111-57/+57
|
* These aren't needed any more.des2001-06-105-2163/+0
|
* New pseudofs-based linprocfs (repo-copied from linprocfs_misc.c).des2001-06-101-210/+142
|
* S_IFCHR is not a bit mask, it's just a value in a field. The correctpaul2001-06-041-1/+1
| | | | | | way to clear that field is to use S_IFMT. Pointed out by BDE.
* Remove vestiges of MFS.ru2001-06-011-1/+1
|
* Remove MFSphk2001-05-291-2/+0
|
* - sys/n[tw]fs moved to sys/fs/n[tw]fsru2001-05-261-1/+1
| | | | - /usr/include/n[tw]fs moved to /usr/include/fs/n[tw]fs
* o Merge contents of struct pcred into struct ucred. Specifically, add therwatson2001-05-256-34/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | real uid, saved uid, real gid, and saved gid to ucred, as well as the pcred->pc_uidinfo, which was associated with the real uid, only rename it to cr_ruidinfo so as not to conflict with cr_uidinfo, which corresponds to the effective uid. o Remove p_cred from struct proc; add p_ucred to struct proc, replacing original macro that pointed. p->p_ucred to p->p_cred->pc_ucred. o Universally update code so that it makes use of ucred instead of pcred, p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo, cr_{r,sv}{u,g}id instead of p_*, etc. o Remove pcred0 and its initialization from init_main.c; initialize cr_ruidinfo there. o Restruction many credential modification chunks to always crdup while we figure out locking and optimizations; generally speaking, this means moving to a structure like this: newcred = crdup(oldcred); ... p->p_ucred = newcred; crfree(oldcred); It's not race-free, but better than nothing. There are also races in sys_process.c, all inter-process authorization, fork, exec, and exit. o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid; remove comments indicating that the old arrangement was a problem. o Restructure exec1() a little to use newcred/oldcred arrangement, and use improved uid management primitives. o Clean up exit1() so as to do less work in credential cleanup due to pcred removal. o Clean up fork1() so as to do less work in credential cleanup and allocation. o Clean up ktrcanset() to take into account changes, and move to using suser_xxx() instead of performing a direct uid==0 comparision. o Improve commenting in various kern_prot.c credential modification calls to better document current behavior. In a couple of places, current behavior is a little questionable and we need to check POSIX.1 to make sure it's "right". More commenting work still remains to be done. o Update credential management calls, such as crfree(), to take into account new ruidinfo reference. o Modify or add the following uid and gid helper routines: change_euid() change_egid() change_ruid() change_rgid() change_svuid() change_svgid() In each case, the call now acts on a credential not a process, and as such no longer requires more complicated process locking/etc. They now assume the caller will do any necessary allocation of an exclusive credential reference. Each is commented to document its reference requirements. o CANSIGIO() is simplified to require only credentials, not processes and pcreds. o Remove lots of (p_pcred==NULL) checks. o Add an XXX to authorization code in nfs_lock.c, since it's questionable, and needs to be considered carefully. o Simplify posix4 authorization code to require only credentials, not processes and pcreds. Note that this authorization, as well as CANSIGIO(), needs to be updated to use the p_cansignal() and p_cansched() centralized authorization routines, as they currently do not take into account some desirable restrictions that are handled by the centralized routines, as well as being inconsistent with other similar authorization instances. o Update libkvm to take these changes into account. Obtained from: TrustedBSD Project Reviewed by: green, bde, jhb, freebsd-arch, freebsd-audit
* Sort includes.jhb2001-05-211-1/+1
|
* Add new 'loadavg' entry, fix overflow with meminfo.jlemon2001-05-194-16/+84
| | | | | PR: 27253, 27350 Submitted by: Jim Pirzyk
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-193-0/+3
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* Avoid overflow when converting ticks to jiffies.des2001-05-092-2/+2
| | | | | PR: 27215 Submitted by: Jim Pirzyk <Jim.Pirzyk@disney.com>
* Fix the problem of some directory entries going missing whenjlemon2001-05-041-2/+1
| | | | | | read by the linux version of 'ls'. Spotted by: rwatson
* 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.
OpenPOWER on IntegriCloud