summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* <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>
* Do not map {s|g}etrlimit onto FreeBSD syscalls. The arguments don't match.marcel1999-08-111-1/+52
| | | | | | | | The linux syscalls translate the arguments first before invoking the FreeBSD native syscalls. PR: kern/9591 Originator: John Plevyak <jplevyak@inktomi.com>
* Fix page fault in linux_uselib syscall.marcel1999-08-081-2/+2
| | | | | PR: 12910 Submitted by: Peter Holm <peter@holm.cc>
* We don't end up checking for a return value of EFAULT from the copyinstr()green1999-08-071-5/+12
| | | | | | | | | | | | in the pathname translation procedure. This proves fatal, and can be easily fixed. This or a similar change needs to be committed to svr4_util.h and ibcs2_util.h. I will update ibcs2_util.h, if noone else thinks of a better way to do this, in the same manner. I will leave svr4 to the respective maintainer. This closes the problem of the only crash I've been able to produce as a user recently, except for (currently not-in-the-source tree) fd table sharing fixes. Thanks goes to pho for his stress-testers.
* Previous commit also removed some 'const' qualifiers on args fornewton1999-07-301-1/+1
| | | | svr4_sys_sendto() which probably shouldn't have been 'const'.
* Previous commit also finished cleaning up some dev_t -> udev_t transformationsnewton1999-07-305-5/+5
| | | | | | related to the commit for rev 1.3 of svr4_stat.c. svr4_sysvec.c also received a copyright message (which is why it grew by 28 lines).
* Fix svr4_sys_poll(); SysV STREAMS produce return values from poll() whichnewton1999-07-301-6/+2
| | | | | BSD sockets don't. Guess at a correct emulation for those values (it seems to work for telnet, ftp and friends)
* Add $Id$ tagsnewton1999-07-3048-23/+140
|
* Fix panic caused when *stat64() family of syscalls try to fill-innewton1999-07-303-46/+28
| | | | | | | their svr4_stat64 structures with old dev_t values instead of udev_t's. Panic was caused when major() and minor() were called with args which weren't pointers. The panic was probably introduced in rev 1.51 of kern_conf.c
* Use the vn_todev() function, rather than VOP_GETATTRphk1999-07-181-7/+3
|
* Implementation of TCXONC.marcel1999-07-171-1/+32
| | | | Reviewed by: bde
* Implement VT_RELDISP ioctlmarcel1999-07-081-1/+6
| | | | Submitted by: Kazutaka Yokota <yokota@FreeBSD.org>
* Trivial implementation of TIOCM{S|G}ET and TIOCMBI{S|C} ioctls. No needmarcel1999-07-061-1/+17
| | | | to convert the arguments.
* Rename struct members sa_siginfo. POSIX reserves identifiers startingcracauer1999-07-063-39/+39
| | | | | | | with sa_ when <signal.h> is included. They would conflict with the upcoming SA_SIGINFO implementation. Reviewed by: BDE
* Let newuname return "Linux" as the OS name and not "FreeBSD". Also, return amarcel1999-07-051-3/+3
| | | | | more sensible (for Linux applications) release number. Hardcoding a release number has its drawbacks, but it will do for now.
* sys/buf.h needs to have included sys/systm.h for spl prototypes.green1999-07-031-1/+1
|
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-112-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* Ack! I deleted "struct", not "const".. Oh boy...peter1999-05-101-1/+1
| | | | Submitted by: jkh
* Fix a couple of warnings and some bitrot in comments.peter1999-05-092-4/+4
|
* Yet another place which knew too much. Still not sure how muchphk1999-05-091-2/+2
| | | | good this does in the end.
* 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-065-24/+43
| | | | | around && within ||' type warnings. I'm pretty sure I have not masked any problems here, I've committed real problem fixes seperately.
OpenPOWER on IntegriCloud