summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_misc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Protect calcru() with sched_lock.jhb2001-01-231-0/+2
|
* Lock access to proc members.jhb2000-12-151-5/+20
| | | | Glanced over by: marcel
* Don't auto-generate the syscalls.marcel2000-12-031-4/+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
* 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.
* The MI/MD split wasn't perfect and the MI files need hacks for theobrien2000-11-011-7/+33
| | | | | | AlphaLinux compat bits. This will be better cleaned up soon. Agreed to what ever was necessary by: marcel
* 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.
* 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.
* Add bounds checking to stackgap_alloc. Previously it was possiblemarcel2000-07-231-0/+2
| | | | | | | | | | | 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 setfsuid and setfsgid. Implementation derived from patchmarcel2000-07-161-0/+20
| | | | | | | in PR. PR: 16993 Submitted by: Bjoern Groenvall <bg@sics.se>
* 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
* Remove unneeded #include <vm/vm_zone.h>phk2000-04-301-1/+0
| | | | Generated by: src/tools/tools/kerninclude
* Fix bug in linux_wait4 and linux_waitpid where garbage in the statusmarcel2000-03-091-0/+2
| | | | | | | | argument could panic the kernel. Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Prompted by: jkh, gallatin Approved by: prompters
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-151-0/+6
|
* useracc() the prequel:phk1999-10-291-1/+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.
* sigset_t change (part 4 of 5)marcel1999-09-291-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------- 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.
* Implement linux_ioperm() syscall. Fix linux_iopl() to use the level argument.luoqi1999-09-221-6/+25
| | | | | | SVGAlib should now work. Reviewed by: marcel
* 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
* Fix a missing '-1' in the size argument of copyout in getgroups. Spotted whilemarcel1999-08-291-6/+6
| | | | reviewing the MFC in -stable.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add sysctl variables for the Linuxulator. These reside under `compat.linux' asmarcel1999-08-271-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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 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>
* 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
* 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>
* 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.
* Fix up a few easy 'assignment used as truth value' and 'suggest parenspeter1999-05-061-7/+13
| | | | | around && within ||' type warnings. I'm pretty sure I have not masked any problems here, I've committed real problem fixes seperately.
* Enable vmspace sharing on SMP. Major changes are,luoqi1999-04-281-9/+5
| | | | | | | | | | | | | | | | | - %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-191-14/+1
| | | | 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.
* Enable Linux threads support by default.julian1999-01-261-33/+3
| | | | | | | | | This takes the conditionals out of the code that has been tested by various people for a while. ps and friends (libkvm) will need a recompile as some proc structure changes are made. Submitted by: "Richard Seaman, Jr." <dick@tar.com>
* Add (but don't activate) code for a special VM option to makejulian1999-01-061-47/+46
| | | | | | | | | | | | | downward growing stacks more general. Add (but don't activate) code to use the new stack facility when running threads, (specifically the linux threads support). This allows people to use both linux compiled linuxthreads, and also the native FreeBSD linux-threads port. The code is conditional on VM_STACK. Not using this will produce the old heavily tested system. Submitted by: Richard Seaman <dick@tar.com>
* Commit #2 ofsos1998-12-301-1/+73
| | | | | PR: 9235 Submitted by: marcel@scc.nl <Marcel Moolenaar>
* According to the author..julian1998-12-241-9/+4
| | | | | | | | | | | | | | | | | | "I've been having a problem running the patches [committed to current] installed with the COMPAT_LINUX_THREADS option along with the VM_STACK patches I did. I'm not sure what the problem is, since it seemed to work before. In any event, the attached patch fixes the problem for me. While I've had no report of problems from anyone else, possibly it would be wise to commit the patch until the problem is found. Also, there was some left-over junk in the linux_misc.c file from some earlier work I did. The attached patch cleans that up too." Submitted by: "Richard Seaman, Jr." <dick@tar.com>
* Reviewed by: Luoqi Chen, Jordan Hubbardjulian1998-12-191-1/+173
| | | | | | | | | | | | Submitted by: "Richard Seaman, Jr." <lists@tar.com> Obtained from: linux :-) Code to allow Linux Threads to run under FreeBSD. By default not enabled This code is dependent on the conditional COMPAT_LINUX_THREADS (suggested by Garret) This is not yet a 'real' option but will be within some number of hours.
* linux_pipe does not preserve the edx register. Linux andjkh1998-12-101-3/+12
| | | | | | | | | programs using glibc expect edx to be preserved accross syscalls. As a result, linux programs running in emulation mode can have whatever value may be represented by edx clobbered. PR: 9038 Submitted-By: Richard Seaman, Jr. <dick@tar.com>
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-7/+13
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* In linux_newuname bzero the right type of struct (linux_newuname_t).sos1998-10-051-2/+2
|
* MF22: revert time bogon.jkh1998-09-241-2/+1
|
* return time in proper format for linux.jkh1998-09-231-1/+2
|
OpenPOWER on IntegriCloud