summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
Commit message (Collapse)AuthorAgeFilesLines
* 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-011-16/+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.
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectrwatson2001-02-211-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-061-1/+1
| | | | Seperate does not exist in the english language.
* Back out proc locking to protect p_ucred for obtaining additionaljhb2001-01-273-35/+9
| | | | references along with the actual obtaining of additional references.
* Protect calcru() with sched_lock.jhb2001-01-231-0/+2
|
* 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.
* 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.
* 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
* Remove call to bzero after MALLOC and instead add M_ZEROmarcel2000-12-051-2/+1
| | | | to MALLOC.
* Don't auto-generate the syscalls.marcel2000-12-037-28/+0
|
* Use callout_reset instead of timeout(9). Most callouts are staticallyjake2000-11-271-2/+2
| | | | | | allocated, 2 have been added to struct proc for setitimer and sleep. Reviewed by: jhb, jlemon
* Use the linux_connect() on alpha rather than passing directly throughgallatin2000-11-161-1/+9
| | | | | | | | | | to our native connect(). This is required to deal with the differences in the way linux handles connects on non-blocking sockets. This gets the private beta of the Compaq Linux/alpha JDK working on FreeBSD/alpha Approved by: marcel
* Fix F_SETOWN on pipes. Linux returns EINVAL while we send a SIGIOmarcel2000-11-131-5/+19
| | | | | | | | signal. There's at least 1 program that is known to break. Submitted patch has been edited to match current code. MFC: yes Submitted by: bde
* Revert auto-generation. The Alpha port is broken.marcel2000-11-107-0/+28
| | | | Syncing with it is wrong.
* Sync with Alpha:marcel2000-11-097-28/+0
| | | | | Do not use sysent.c, proto.h and syscall.h in source tree; use auto-generated versions.
* Fix getdents syscall.marcel2000-11-051-1/+4
| | | | | | | | | | The offset field in struct dirent was set to the offset of the next dirent in rev 1.36. The offset was calculated from the current offset and the record length. This offset does not necessarily match the real offset when we are using cookies. Therefore, also use the cookies to set the offset field in struct dirent if we're using cookies to iterate through the dirents.
* zap a stray include that snuck in with rev 1.56gallatin2000-11-021-1/+0
| | | | Submitted by: Clive Lin <clive@CirX.ORG>
* fix a comment that was inadvertantly changed by a cvs mergegallatin2000-11-021-1/+1
| | | | pointed out by: obrien
* Fix linux_ustat syscall. We only have cdevs now, so lookingmarcel2000-11-021-2/+2
| | | | | | | | for a block device isn't that useful anymore. Reported by: Wesley Morgan <morganw@chemicals.tacorp.com> Submitted by: gallatin Acknowledged by: phk
* Support for the linux ipc syscalls on the alpha, where each one hasgallatin2000-11-012-27/+44
| | | | | its own syscall rather than going through a demux function like linux_ipc() on i386
* fix linux_termio and linux_termios structs on alpha. alpha differencesgallatin2000-11-011-7/+7
| | | | | are in the termios struct (probably because linux wants to be compatible with the osf/1 termios struct), not the termio struct.
* The MI/MD split wasn't perfect and the MI files need hacks for theobrien2000-11-0110-26/+156
| | | | | | AlphaLinux compat bits. This will be better cleaned up soon. Agreed to what ever was necessary by: marcel
* A start at an implemention of linux_rt_sendsig & linux_rt_sigreturngallatin2000-10-171-1/+1
| | | | | | | | | | | | | | and associated user-level signal trampoline glue. Without this patch, an SA_SIGINFO style handler can be installed by a linux app, but if the handler accesses its sip argument, it will get a garbage pointer and likely segfault. We currently supply a valid pointer, but its contents are mainly garbage. Filling this in properly is future work. This is the second of 3 commits that will get IBM's JDK 1.3 working with FreeBSD ...
* Initiate deorbit burn sequence for <machine/console.h>.phk2000-10-081-2/+2
| | | | | | | | | Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>. This is also the appropriate fix for exo-tree sources. Put warnings in <machine/console.h> to discourage use. November 15th 2000 the warnings will be converted to errors. January 15th 2001 the <machine/console.h> files will be removed.
* Whitespace change: (near) KNFmarcel2000-08-261-649/+679
|
* Fix bug in previous commit. We need to trim the limits to fitmarcel2000-08-261-0/+5
| | | | | the datatype (= long). Use ULONG_MAX and LONG_MAX to avoid creating MD code.
* Re-implement linux_{g|s}etrlimit in terms of {g|s}etrlimitmarcel2000-08-261-24/+45
| | | | | instead of the o{g|s}etrlimit so that the dependency on COMPAT_43 is removed.
* Fix typo in license.marcel2000-08-255-5/+5
|
* Update include directives.marcel2000-08-223-9/+7
|
* Update include directives.marcel2000-08-221-158/+6
| | | | | | | Make linux_to_bsd_sigset and linux_do_sigaction non-static. Move linux_sigaction. linux_sigsuspend, linux_rt_sigsuspend, linux_pause and linux_sigaltstack to MD code.
* Update include directives.marcel2000-08-221-381/+5
| | | | | | | | Move linux_select to MD code (i386 compat. syscall). Move linux_fork, linux_vfork, linux_clone, linux_mmap, linux_pipe, linux_ioperm, linux_iopl and linux_modify_ldt to MD code.
* Update include directives.marcel2000-08-222-7/+7
|
* Update include directives.marcel2000-08-221-58/+15
| | | | | | | Make the sem*, msg* and shm* function non-static as they are called from MD code. Move linux_ipc to MD code.
* Update include directives and remove linux_execve.marcel2000-08-221-23/+3
|
* Provide prototypes for functions used by MD code.marcel2000-08-222-0/+87
|
* Remove the only use of SCARG and perform dead code elimination.marcel2000-07-271-4/+0
|
* Add bounds checking to stackgap_alloc. Previously it was possiblemarcel2000-07-233-11/+14
| | | | | | | | | | | to construct a path that was long enough (ie longer than SPARE_USRSPACE bytes) and trash the stack. Note that SPARE_USRSPACE is much smaller than MAXPATHLEN so that the Linuxulator will now return ENAMETOOLONG even if the path is smaller than MAXPATHLEN. PR: 12749
* Revert implementation of setfsuid and setfsgid due to securitymarcel2000-07-201-20/+0
| | | | | | | issues. Requested by: rwatson Backed by: kris
* Implement pread and pwrite.marcel2000-07-171-0/+28
| | | | | PR: 17991 Submitted by: Geoffrey Speicher <geoff@caribbean.sea-incorporated.com>
* Implement setfsuid and setfsgid. Implementation derived from patchmarcel2000-07-161-0/+20
| | | | | | | in PR. PR: 16993 Submitted by: Bjoern Groenvall <bg@sics.se>
* Simplify the F_GETOWN and F_SETOWN fcntl commands. The workaroundmarcel2000-07-151-49/+7
| | | | | | | | is not needed since the FreeBSD native implementation switched from TIOC{G|S}PGRP to FIO{G|S}ETOWN (kern_descrip.c rev 1.55). PR: 16946 Submitted by: Victor Salaman <salaman@teknos.com>
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.phk2000-07-041-3/+3
| | | | Pointed out by: bde
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:phk2000-07-031-3/+3
| | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
* Linux allows to mmap annonymous with a file descriptor passed, FreeBSDcracauer2000-06-151-2/+10
| | | | | | | | | | | | doesn't. In the Linux emulation layer, ignore the fd passed when MAP_ANON is specified. Known application to be fixed: Xanalys/Harlequin Lispworks Also improve debug output for mmap, now showing what the emulation layer mapped to what (-DDEBUG). Reviewed by: marcel
OpenPOWER on IntegriCloud