summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_file.c
Commit message (Collapse)AuthorAgeFilesLines
* Implement linux_chown and linux_lchown. The fchown syscall mapsmarcel2001-10-161-0/+42
| | | | | | | directly to the native syscall, because no filename handling needs to be done. Tested by: Martin Blapp <mb@imp.ch>
* Whitespace fix.jhb2001-09-121-1/+1
|
* KSE Milestone 2julian2001-09-121-107/+108
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Round of cleanups and enhancements. These include (in random order):marcel2001-09-081-387/+558
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Introduce private types for use in linux syscalls for two reasons: 1. establish type independence for ease in porting and, 2. provide a visual queue as to which syscalls have proper prototypes to further cleanup the i386/alpha split. Linuxulator types are prefixed by 'l_'. void and char have not been "virtualized". o Provide dummy functions for all syscalls and remove dummy functions or implementations of truely obsolete syscalls. o Sanitize the shm*, sem* and msg* syscalls. o Make a first attempt to implement the linux_sysctl syscall. At this time it only returns one MIB (KERN_VERSION), but most importantly, it tells us when we need to add additional sysctls :-) o Bump the kenel version up to 2.4.2 (this is not the same as the KERN_VERSION MIB, BTW). o Implement new syscalls, of which most are specific to i386. Our syscall table is now up to date with Linux 2.4.2. Some highlights: - Implement the 32-bit uid_t and gid_t bases syscalls. - Implement a couple of 64-bit file size/offset bases syscalls. o Fix or improve numerous syscalls and prototypes. o Reduce style(9) violations while I'm here. Especially indentation inconsistencies within the same file are addressed. Re-indenting did not obfuscate actual changes to the extend that it could not be combined. NOTE: I spend some time testing these changes and found that if there were regressions, they were not caused by these changes AFAICT. It was observed that installing a RH 7.1 runtime environment did make matters worse. Hangs and/or reboots have been observed with and without these changes, so when it failed to make life better in cases it doesn't look like it made it worse.
* Fix linux_getcwd() so that if the cwd isn't cached (__getcwd() fails),gallatin2001-08-291-28/+0
| | | | | | | | | | 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
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-5/+6
| | | | | | | | | | | 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)
* 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.
* Allow debugging output to be controlled on a per-syscall granularity.jlemon2001-02-161-41/+48
| | | | | | 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-161-0/+89
|
* Back out proc locking to protect p_ucred for obtaining additionaljhb2001-01-271-8/+1
| | | | references along with the actual obtaining of additional references.
* Lock access to proc members.jhb2000-12-151-2/+12
| | | | Glanced over by: marcel
* Don't auto-generate the syscalls.marcel2000-12-031-4/+0
|
* 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-101-0/+4
| | | | Syncing with it is wrong.
* Sync with Alpha:marcel2000-11-091-4/+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.
* The MI/MD split wasn't perfect and the MI files need hacks for theobrien2000-11-011-3/+15
| | | | | | AlphaLinux compat bits. This will be better cleaned up soon. Agreed to what ever was necessary by: marcel
* Update include directives and remove linux_execve.marcel2000-08-221-23/+3
|
* Implement pread and pwrite.marcel2000-07-171-0/+28
| | | | | PR: 17991 Submitted by: Geoffrey Speicher <geoff@caribbean.sea-incorporated.com>
* 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>
* Implement fdatasync in terms of fsync. The regeneration of proto.h,marcel1999-11-261-0/+11
| | | | | syscall.h and sysent.h was probably forgotten after the last change syscalls.master.
* simplify check for device.phk1999-11-081-1/+1
|
* Fix the duplicate filenames that are the result of using getdents.marcel1999-10-211-1/+1
| | | | | | | | | | | glibc2 defines struct dirent differently than the Linux kernel does. The getdents function therefore needs to read a heuristically defined number of kernel dirents to satisfy the request. In case where too many kernel dirents have been read, the function lseeks on the directory so that a next call will start with the right dirent. The offset used in lseeking is the offset-field in the last dirent passed to the application. This can only mean that the offset-field holds the offset of the next dirent and not the offset of the dirent itself.
* This patch clears the way for removing a number of tty relatedphk1999-09-251-4/+5
| | | | | | | | | | | | | | | | | | | | | fields in struct cdevsw: d_stop moved to struct tty. d_reset already unused. d_devtotty linkage now provided by dev_t->si_tty. These fields will be removed from struct cdevsw together with d_params and d_maxio Real Soon Now. The changes in this patch consist of: initialize dev->si_tty in *_open() initialize tty->t_stop remove devtotty functions rename ttpoll to ttypoll a few adjustments to these changes in the generic code a bump of __FreeBSD_version add a couple of FreeBSD tags
* This is what was "fdfix2.patch," a fix for fd sharing. It's prettygreen1999-09-191-1/+1
| | | | | | | | | | | | | | | | | far-reaching in fd-land, so you'll want to consult the code for changes. The biggest change is that now, you don't use fp->f_ops->fo_foo(fp, bar) but instead fo_foo(fp, bar), which increments and decrements the fp refcount upon entry and exit. Two new calls, fhold() and fdrop(), are provided. Each does what it seems like it should, and if fdrop() brings the refcount to zero, the fd is freed as well. Thanks to peter ("to hell with it, it looks ok to me.") for his review. Thanks to msmith for keeping me from putting locks everywhere :) Reviewed by: peter
* Fix getcwd. It must return the length of the path including the terminating 0.marcel1999-09-171-6/+19
| | | | | | While I'm here, fix style and debug printf. Fix derived from patch by: Darryl Okahata <darrylo@sr.hp.com>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix bug in the fcntl syscall where 'arg' was not set properly.marcel1999-08-151-2/+4
| | | | | PR: 12147 Submitted by: Allan Saddi <asaddi@philosophysw.com>
* Implementation of the linux_getcwd syscall.marcel1999-08-141-1/+16
|
* In doing lock type conversion (struct flock), make sure that carbage in resultsmarcel1999-08-131-2/+5
| | | | | | | | in deterministic behaviour. In this case known garbage out. The fix is different than suggested in the PR. PR: 12749 Originator: Boris Nikolaus <boris@cs.tu-berlin.de>
* Use a wrapper for the link syscall that does name translations.marcel1999-08-121-1/+20
| | | | | PR: 12749 Submitted by: Boris Nikolaus <boris@cs.tu-berlin.de>
* Use the vn_todev() function, rather than VOP_GETATTRphk1999-07-181-7/+3
|
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-081-2/+2
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Fix up a few easy 'assignment used as truth value' and 'suggest parenspeter1999-05-061-2/+3
| | | | | around && within ||' type warnings. I'm pretty sure I have not masked any problems here, I've committed real problem fixes seperately.
* Use truncate() instead of otruncate() - step on the way to stoppingeivind1999-01-101-3/+3
| | | | the linulator from depending on COMPAT_43.
* Make async I/O on a socket work.jfieber1998-10-051-1/+4
| | | | | Although the current Sybase license does not permit running under emulation, FreeBSD 3.0 is now "Sybase Ready" should the license change.
* Fixed print format errors.bde1998-07-291-5/+5
|
* The linux chown syscall is more like lchown, a new chown syscall thatpeter1998-03-291-1/+22
| | | | follows links was added.
* sigh....forgot to update the DEBUG printfjmb1998-01-051-3/+3
| | | | | | | to show both the path and the length args to linux emulation truncate() Submitted by: jmb
* length argument to truncate() in linux emulationjmb1998-01-051-1/+2
| | | | | | | | | was not being set copied to the bsd arguments.. frequently, resulting in files of over 100MB of NULs PR: 386/5044 Reviewed by: jmb Submitted by: (Richard Winkel) rich@math.missouri.edu
* Make hidden COMPAT_43 dependencies explict. Options in headers is aeivind1997-12-161-1/+3
| | | | pain in the backside.
* Don't include <sys/lock.h> in headers when only `struct simplelock' isbde1997-12-051-1/+2
| | | | required. Fixed everything that depended on the pollution.
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-58/+59
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Remove dependancy on UFS' DIRBLKSIZ definition.dfr1997-04-061-6/+2
| | | | | | 2.2 candidate. Submitted by: bde
* Fix linux_getdents so that it can cope with filesystems which translatedfr1997-04-051-10/+46
| | | | | | | | the directory format (ext2fs, cd9660). For these filesystems, it must use cookies to find the correct offset to use for subsequent reads. Without it, linux /bin/ls tends to loop re-reading the same block over and over again. 2.2 candidate.
* Don't include <sys/ioctl.h> in the kernel. Stage 1: don't includebde1997-03-241-2/+1
| | | | | it when it is not used. In most cases, the reasons for including it went away when the special ioctl headers became self-sufficient.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make this compile again after the Lite2 merge.mpp1997-02-101-3/+2
| | | | | | VOP_UNLOCK was being called with the wrong mumber of arguments. Also silenced a -Wall warning.
* This is the kernel Lite/2 commit. There are some requisite userlanddyson1997-02-101-2/+2
| | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org>
OpenPOWER on IntegriCloud