summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Implement linux_ustat.marcel1999-11-271-3/+56
| | | | Reviewed by: bde
* 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.
* General clean-up of socket.h and associated sources to synchronise upphk1999-11-241-1/+1
| | | | | | | | | | | | with NetBSD and the Single Unix Specification v2. This updates some structures with other, almost equivalent types and effort is under way to get the whole more consistent. Also removes a double definition of INET6 and some other clean-ups. Reviewed by: green, bde, phk Some part obtained from: NetBSD, SUSv2 specification
* s/p_cred->pc_ucred/p_ucred/gphk1999-11-211-1/+1
|
* simplify check for device.phk1999-11-081-1/+1
|
* Use fo_stat() rather than Yet Another duplication of kern_descrip.c's statpeter1999-11-081-15/+1
| | | | code.
* useracc() the prequel:phk1999-10-293-3/+0
| | | | | | | | | | | Merge the contents (less some trivial bordering the silly comments) of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts the #defines for the vm_inherit_t and vm_prot_t types next to their typedefs. This paves the road for the commit to follow shortly: change useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE} as argument.
* 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.
* Remove unnecessary includes.newton1999-10-172-20/+0
| | | | | | | | phk's script walked through .c and .h files, but some of the ones on the list are actually derived from sys/svr4/syscalls.master. Make the necessary changes here and the others will implicitly follow... Submitted by: phk
* Remove unnecessary includes.newton1999-10-1715-55/+4
| | | | Submitted by: phk
* Add a per-signal flag to mark handlers registered with osigaction, so weluoqi1999-10-111-1/+1
| | | | | | | | | | | | | | | can provide the correct context to each signal handler. Fix broken sigsuspend(): don't use p_oldsigmask as a flag, use SAS_OLDMASK as we did before the linuxthreads support merge (submitted by bde). Move ps_sigstk from to p_sigacts to the main proc structure since signal stack should not be shared among threads. Move SAS_OLDMASK and SAS_ALTSTACK flags from sigacts::ps_flags to proc::p_flag. Move PS_NOCLDSTOP and PS_NOCLDWAIT flags from proc::p_flag to procsig::ps_flag. Reviewed by: marcel, jdp, bde
* Swap IOC_OUT and IOC_IN for the SETDIR macro. The linux ioctl read andjhay1999-10-061-1/+1
| | | | | | write bits are swapped. Reviewed by: luoqi, marcel
* Removal of sys/device.hn_hibma1999-10-051-1/+0
| | | | | | | | | | | | | - Move intrhook stuff into kernel.h - Remove all occurrences of #device <device.h> - Add kernel.h were necessary (nowhere) - delete device.h This file contained the structures for cfdata (old style config) and is no longer used. It was included by most drivers. It confuses the remote debugger as the definition of 'struct device' in device.h is found before the one in bus_private.h.
* Oops. That'll teach me to commit without testing. I either replacedpeter1999-10-011-1/+1
| | | | | one trigraph with another, or completely missed the point. Kill it for real this time.
* Zap a trigraph (???)peter1999-10-011-1/+1
|
* sigset_t change (part 4 of 5)marcel1999-09-296-355/+428
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------- The compatibility code and/or emulators have been updated: iBCS2 now mostly uses the older syscalls. SVR4 now properly handles all signals. This has been achieved by using the new sigset_t throughout the emulator. The Linuxulator has been severely updated. Internally the new Linux sigset_t is made the default. These are then mapped to and from the new FreeBSD sigset_t. Also, rt_sigsuspend has been implemented in the Linuxulator. Implementing this syscall basicly caused all this sigset_t changing in the first place and the syscall has been used throughout the change as a means for testing. It basicly is too much work to undo the implementation so that it can later be added again. A special note on the use of sv_sigtbl and sv_sigsize in struct sysentvec: Every signal larger than sv_sigsize is not translated and is passed on to the signal handler unmodified. Signals in the range 1 upto and including sv_sigsize are translated. The rationale is that only the system defined signals need to be translated. The emulators also have been updated so that the translation tables are only indexed for valid (system defined) signals. This change also fixes the translation bug already in the SVR4 emulator.
* 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
* Linux doesn't complain if you remove a msg queue that doesn't existmarcel1999-09-231-1/+3
| | | | (given the proper permissions).
* Implement linux_ioperm() syscall. Fix linux_iopl() to use the level argument.luoqi1999-09-221-6/+25
| | | | | | SVGAlib should now work. Reviewed by: marcel
* This is what was "fdfix2.patch," a fix for fd sharing. It's prettygreen1999-09-198-55/+41
| | | | | | | | | | | | | | | | | 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>
* <machine/soundcard.h> -> <sys/soundcard.h>, since it's an exported APIpeter1999-09-041-1/+1
| | | | that's arch neutral and OSS API and Linux API compatable.
* I missed the namechange of field desc in struct i386_ldt_args into descs whilemarcel1999-09-031-2/+2
| | | | | | reviewing luoqi's changes... Pointed out by: luoqi
* Implementation of the modify_ldt syscall. Use the sysarch() interface to domarcel1999-09-021-0/+84
| | | | | | | the actual work. When USER_LDT is not defined for a kernel, sysarch returns EOPNOTSUPP. Display a message in that case and return ENOSYS to userland. Reviewed by: luoqi
* Add MAINTAINER linenewton1999-09-011-0/+2
|
* Fix a braino: Linux minor device numbers are 8 bits wide and not 10.marcel1999-08-291-1/+1
|
* Fix a missing '-1' in the size argument of copyout in getgroups. Spotted whilemarcel1999-08-291-6/+6
| | | | reviewing the MFC in -stable.
* Implement the OSS_GETVERSION ioctl. The version returned can be changed throughmarcel1999-08-281-0/+8
| | | | | | | the sysctl variable `compat.linux.oss_version'. PR: 12917 Originator: Dean Lombardo <dlombardo@excite.com>
* $Id$ -> $FreeBSD$peter1999-08-282-2/+2
|
* $Id$ -> $FreeBSD$peter1999-08-2861-61/+61
|
* Add sysctl variables for the Linuxulator. These reside under `compat.linux' asmarcel1999-08-273-3/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | discussed on current. The following variables are defined (for now): osname (defaults to "Linux") Allow users to change the name of the OS as returned by uname(2), specially added for all those Linux Netscape users and statistics maniacs :-) We now have what we all wanted! osrelease (defaults to "2.2.5") Allow users to change the version of the OS as returned by uname(2). Since -current supports glibc2.1 now, change the default to 2.2.5 (was 2.0.36). oss_version (defaults to 198144 [0x030600]) This one will be used by the OSS_GETVERSION ioctl (PR 12917) which I can commit now that we have the MIB. The default version number is the lowest version possible with the current 'encoding'. A note about imprisoned processes (see jail(2)): These variables are copy-on-write (as suggested by phk). This means that imprisoned processes will use the system wide value unless it is written/set by the process. From that moment on, a copy local to the prison will be used. A note about the implementation: I choose to add a single pointer to struct prison, because I didn't like the idea of changing struct prison every time I come up with a new variable. As a side effect, the extra storage is only needed when a variable is set from within the prison. This also minimizes kernel bloat when the Linuxulator is not used; both compiled in or as a module. Reviewed by: bde (first version only) and phk
* Simplify the handling of VCHR and VBLK vnodes using the new dev_t:phk1999-08-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make the alias list a SLIST. Drop the "fast recycling" optimization of vnodes (including the returning of a prexisting but stale vnode from checkalias). It doesn't buy us anything now that we don't hardlimit vnodes anymore. Rename checkalias2() and checkalias() to addalias() and addaliasu() - which takes dev_t and udev_t arg respectively. Make the revoke syscalls use vcount() instead of VALIASED. Remove VALIASED flag, we don't need it now and it is faster to traverse the much shorter lists than to maintain the flag. vfs_mountedon() can check the dev_t directly, all the vnodes point to the same one. Print the devicename in specfs/vprint(). Remove a couple of stale LFS vnode flags. Remove unimplemented/unused LK_DRAINED;
* Fix linux_newlstat in that it doesn't return the attributes of its containingmarcel1999-08-251-117/+104
| | | | | | | | directory. Also, update arguments of NDINIT for both newstat and newlstat. While I'm at it, fix style bugs in all {s|ls|fs}tat syscalls. Reported by: bde
* Fix {g|s}etgroups semantics. We use cr_groups[0] to hold egid. This means thatmarcel1999-08-251-53/+70
| | | | | | | | | egid will be twice in the set and that setting cr_groups[0] will change egid. This is simply solved by ignoring cr_groups[0]. That is; linux_getgroups does not return cr_groups[0] and linux_setgroups does not touch it. Noticed by: bde Brought to my attention by: sheldonh
* Change all UNIMPL syscalls to STD and add them to linux_dummy. Now we alwaysmarcel1999-08-251-28/+14
| | | | | | | | | | | | know if and when an unimplemented or obsoleted syscall is being used. Make the message more end-user friendly. And as long as we're here, rename some unimplemeted syscalls (linux_phys -> linux_umount2, linux_vm86 -> linux_vm86old, linux_new_vm86 -> linux_vm86). Change prototype for linux_newuname from `struct linux_newuname_t *' into `struct linux_new_utsname *'. This change is reflected in linux.h and linux_misc.c.
* Fix a bug in debug-printfs of struct linux_termios fields, where I forgot tomarcel1999-08-171-5/+5
| | | | | | | change the format specifier after changing the definition of the structure. Submitted by: billf Commented on by: bde
* Fix bug in the debug-printf of the vfork syscall, where the format specifiermarcel1999-08-171-24/+24
| | | | | | | | | | didn't match the argument (p->p_pid). While I'm at it, also fix the dupo in the format string and fix the annoying inconsistency in all the debug-printfs wrt p_pid arguments. Change all of them to use the %ld format specifier and cast the p_pid arguments to long. Submitted by: billf
* Implement linux_vfork() syscall by calling vfork(). Analogous to themarcel1999-08-161-1/+18
| | | | linux_fork() implementation.
* Provide wrappers for sched_{s|g}etscheduler. We need to convert the policymarcel1999-08-151-1/+65
| | | | | | | argument. PR: 12006 Originator: Jean-Claude MICHOT <jcmichot@teaser.fr>
* 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>
* Include opt_compat.h so that COMPAT_43 is defined. This gives us the propermarcel1999-08-151-10/+15
| | | | | | | prototypes of o{s|g}etrlimit (from sys/sysproto.h). Update linux_{s|g}etrlimit so that the arguments to o{s|g}etrlimit are corresponding the prototypes. Pointed out by: bde
* Implementation of the linux_getcwd syscall.marcel1999-08-141-1/+16
|
* Implementation of linux_rt_sigaction and linux_rt_sigprocmask syscalls. Bothmarcel1999-08-141-75/+216
| | | | | | | | | | functions use the new sigset_t and sigaction_t which allows support for more than 32 signals. Only the lower 32 signals are supported for now. linux_rt_sigaction, linux_sigaction and linux_signal use linux_do_sigaction to do the actual work. That way unnecessary redundancy is avoided. The same has been done for linux_rt_sigprocmask and linux_sigprocmask. They call linux_do_sigprocmask to do the actual work.
* Fix LINUX_TIOC{S|G}SERIAL implementation. Both do not copy data in or outmarcel1999-08-141-25/+21
| | | | | | | | | of kernel space. Remove the ioctl supporting functions, and move the actual code to the switch-statement. Now everybody can clearly see that the implementation is really poor. Also fix a typo in LINUX_TIOCGETD. The underlying function was given command TIOCSETD instead op TIOCGETD...
* Avoid possible panic by checking for EFAULT from copyinstr() duringnewton1999-08-141-5/+12
| | | | | | pathname translation. Submitted by: green
* Fix the LINUX_TCSET{A|AW|AF} and LINUX_TCSET{S|SW|SF} ioctls. These all suffermarcel1999-08-141-7/+28
| | | | | from the same bug in that the argument is not first copied from user space before it is used. This is part 2 (of 2) of the termios fixes.
* Fix a couple of termio/termios conversion bugs/typos/dupos/brainos and othermarcel1999-08-141-18/+23
| | | | | | | | | | | | | | | | | | | | | | changes. This is part 1 of the complete termios ioctl fixes. o change type of c_{i|o|c|l}flag in struct termios from unsigned long to unsigned int. The type now matches the Linux definitions. o replaced constants by the corresponding defines in sptab[] for clarity. Since there's no define for 135 baud, its mapping has been dropped. function bsd_to_linux_termios: o Fix typo IXON -> IXANY. o Remove bogus assignment to c_cc[LINUX_VSWTC]. function linux_to_bsd_termios: o Fix dupo LINUX_IXON -> LINUX_IXANY. o Add LINUX_CREAD mapping. o Fix typo IEXTEN -> LINUX_IEXTEN. function linux_to_bsd_termio: o Small optimization: Don't preset the complete c_cc array when we next assign to the first LINUX_NCC entries.
* Implementation of the CDROMSUBCHNL ioctl.marcel1999-08-131-1/+65
|
* 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>
OpenPOWER on IntegriCloud