summaryrefslogtreecommitdiffstats
path: root/sys/i386/linux
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Use ALIGN_TEXT macro for alignment to avoid ambiguity.marcel1999-08-251-2/+1
| | | | Pointed out by: bde
* 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
* Fix lingo: 'is not implemented or obsoleted' is not the same as 'is obsoletedmarcel1999-08-251-2/+2
| | | | or not implemented'.
* Change all UNIMPL syscalls to STD and add them to linux_dummy. Now we alwaysmarcel1999-08-256-77/+247
| | | | | | | | | | | | 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.
* Change all UNIMPL syscalls to STD and add them to linux_dummy. Now we alwaysmarcel1999-08-251-86/+87
| | | | | | | | | | | | | | 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. Lastly, make line-continuation and indentation more uniform.
* Fix stack misalignment for Linux binaries caused by `linux_sigcode' not beingmarcel1999-08-251-1/+1
| | | | | | | a multiple of 4 bytes in size. This solves the recent SIGBUS errors for glibc2.1 configurations. Explained by: bde
* 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-164-5/+27
| | | | linux_fork() implementation.
* Implement vfork() syscall.marcel1999-08-161-2/+2
|
* Major rewrite.marcel1999-08-151-239/+50
| | | | | | | | | | | | | | | | | The first reason for this rewrite is KNF conformance. The second reason is to avoid redundancy. Each function printed the same string, with only the syscall name being different. The actual printing is now performed by a single function, which gets the syscall name as an argument. The third reason is that of convenience. It's now very easy to add a new dummy implementation. Just add ``DUMMY(foo);'' to the file. It's also a lot easier now to see if a syscall has a dummy implementation or not. The dummies are ordered on syscall number. Please maintain this when adding new dummies (there're 32 candidates at the time of writing :-) Reviewed by: bde
* Provide wrappers for sched_{s|g}etscheduler. We need to convert the policymarcel1999-08-155-9/+88
| | | | | | | argument. PR: 12006 Originator: Jean-Claude MICHOT <jcmichot@teaser.fr>
* Provide wrappers for sched_{s|g}etscheduler. We need to convert the policymarcel1999-08-151-3/+4
| | | | | | argument. PR: 12006
* 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-144-5/+34
|
* Extend the number of syscalls to include those present in Linux 2.2.10. Thesemarcel1999-08-141-1/+9
| | | | | are syscalls 183 to 190. Also implement syscall 183: linux_getcwd. This is needed to support a RH 6.0 environment.
* Implementation of linux_rt_sigaction and linux_rt_sigprocmask syscalls. Bothmarcel1999-08-145-81/+252
| | | | | | | | | | 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.
* Implementation of linux_rt_sigaction and linux_rt_sigprocmask syscalls. Thesemarcel1999-08-141-3/+9
| | | | syscalls are needed to support a RH 6.0 environment.
* 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...
* 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-132-2/+69
|
* 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-125-8/+32
| | | | | 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-115-9/+84
| | | | | | | | The linux syscalls translate the arguments first before invoking the FreeBSD native syscalls. PR: kern/9591 Originator: John Plevyak <jplevyak@inktomi.com>
* Do not map {s|g}etrlimit onto the FreeBSD syscalls. The arguments do notmarcel1999-08-111-5/+5
| | | | | | | match. 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.
* Use the vn_todev() function, rather than VOP_GETATTRphk1999-07-181-7/+3
|
* Implementation of TCXONC.marcel1999-07-172-3/+38
| | | | Reviewed by: bde
* Implement VT_RELDISP ioctlmarcel1999-07-082-2/+8
| | | | 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-062-22/+22
| | | | | | | 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.
* Tweak include ordering so sys/systm.h is before sys/buf.h to keep buf.h'speter1999-06-281-2/+2
| | | | inlines happy.
* 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).
* Fix a couple of warnings and some bitrot in comments.peter1999-05-092-6/+5
|
* 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.
* - Handle mixer read ioctls correctly. They have the same group, number andluoqi1999-04-292-20/+178
| | | | | argument size as their write counterparts and were handled as write ioctls. - Emulate some cdrom ioctls.
* Enable vmspace sharing on SMP. Major changes are,luoqi1999-04-284-17/+12
| | | | | | | | | | | | | | | | | - %fs register is added to trapframe and saved/restored upon kernel entry/exit. - Per-cpu pages are no longer mapped at the same virtual address. - Each cpu now has a separate gdt selector table. A new segment selector is added to point to per-cpu pages, per-cpu global variables are now accessed through this new selector (%fs). The selectors in gdt table are rearranged for cache line optimization. - fask_vfork is now on as default for both UP and SMP. - Some aio code cleanup. Reviewed by: Alan Cox <alc@cs.rice.edu> John Dyson <dyson@iquest.net> Julian Elischer <julian@whistel.com> Bruce Evans <bde@zeta.org.au> David Greenman <dg@root.com>
* Change suser_xxx() to suser() where it applies.phk1999-04-271-2/+2
|
* Suser() simplification:phk1999-04-271-3/+3
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* unifdef -DVM_STACK - it's been on for a while for x86 and was checkedpeter1999-04-192-19/+2
| | | | and appeared to be working for the Alpha some time ago.
* Fix thread/process tracking and differentiation for Linux threads emulation.julian1999-03-021-19/+16
| | | | | | Submitted by: Richard Seaman, Jr." <dick@tar.com> Also clean some compiler warnings in surrounding code.
* Added call to elf_brand_inuse() to prevent you from cutting your ownnewton1999-02-041-3/+11
| | | | legs out from under you.
OpenPOWER on IntegriCloud