aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_misc.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC: Linux/alpha uses the same BSDish return mechanism we do forAndrew Gallatin2002-02-031-0/+4
| | | | | | | | | getpid, getuid, getgid and pipe, since they bootstrapped from OSF/1 and never cleaned up. Switch to the native syscalls on alpha so that the above functions work. Notes: svn path=/stable/4/; revision=90151
* Mega MFC: This syncs-up the Linuxulator with -current and henceMarcel Moolenaar2001-11-051-703/+740
| | | | | | | | | | allows Linux_base-7 to work properly. tested on alpha by: gallatin (thanks!) tested on i386 by: marcel (among others probably) Notes: svn path=/stable/4/; revision=86095
* MFC:Paul Saab2001-11-031-1/+1
| | | | | | | | | | | | - Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader tunable. - Change TUNABLE_*_FETCH to have a return value of 0 if the variable was not found or successfully converted and true otherwise. - Use vm_offset_t instead of caddr_t to fix a warning and remove two casts in kern_exec.c. Notes: svn path=/stable/4/; revision=85936
* MFC: Add linux_sched_get_priority_max() and linux_sched_get_priority_min().Alan Cox2001-08-271-0/+56
| | | | | | | Approved by: re (jkh) Notes: svn path=/stable/4/; revision=82403
* Added the linux_sysinfo function to implement sysinfo(2).Jim Pirzyk2001-07-301-0/+77
| | | | | | | | | | | | | | | | | | | MFC'ed the following files from HEAD: 1.41 +2 -2 src/sys/i386/linux/syscalls.master 1.104 +77 -1 src/sys/compat/linux/linux_misc.c 1.29 +1 -2 src/sys/i386/linux/linux_dummy.c 1.43 +1 -1 src/sys/i386/linux/linux_proto.h 1.38 +0 -0 src/sys/i386/linux/linux_syscall.h 1.44 +1 -1 src/sys/i386/linux/linux_sysent.c PR: kern/27759 Submitted by: henrich@sigbus.com Reviewed by: marcel Approved by: marcel Notes: svn path=/stable/4/; revision=80600
* MFC: fix linux_times() on alphaAndrew Gallatin2001-03-281-0/+5
| | | | | | | Approved by: jkh Notes: svn path=/stable/4/; revision=74899
* MFC: allow AlphaLinux compat bits to build.David E. O'Brien2000-11-021-7/+33
| | | | | | | Approved by: JKH Notes: svn path=/stable/4/; revision=68265
* This commit was manufactured by cvs2svn to create branch 'RELENG_4'.cvs2svn2000-08-281-0/+1120
| | | | Notes: svn path=/stable/4/; revision=65163
* This commit was manufactured by cvs2svn to create branch 'RELENG_4'.cvs2svn2000-03-131-1461/+0
| | | | Notes: svn path=/stable/4/; revision=57955
* Fix bug in linux_wait4 and linux_waitpid where garbage in the statusMarcel Moolenaar2000-03-091-0/+2
| | | | | | | | | | | argument could panic the kernel. Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Prompted by: jkh, gallatin Approved by: prompters Notes: svn path=/head/; revision=57867
* Introduce NDFREE (and remove VOP_ABORTOP)Eivind Eklund1999-12-151-0/+6
| | | | Notes: svn path=/head/; revision=54655
* useracc() the prequel:Poul-Henning Kamp1999-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. Notes: svn path=/head/; revision=52635
* sigset_t change (part 4 of 5)Marcel Moolenaar1999-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. Notes: svn path=/head/; revision=51793
* Implement linux_ioperm() syscall. Fix linux_iopl() to use the level argument.Luoqi Chen1999-09-221-6/+25
| | | | | | | | | SVGAlib should now work. Reviewed by: marcel Notes: svn path=/head/; revision=51569
* I missed the namechange of field desc in struct i386_ldt_args into descs whileMarcel Moolenaar1999-09-031-2/+2
| | | | | | | | | reviewing luoqi's changes... Pointed out by: luoqi Notes: svn path=/head/; revision=50833
* Implementation of the modify_ldt syscall. Use the sysarch() interface to doMarcel Moolenaar1999-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 Notes: svn path=/head/; revision=50818
* Fix a missing '-1' in the size argument of copyout in getgroups. Spotted whileMarcel Moolenaar1999-08-291-6/+6
| | | | | | | reviewing the MFC in -stable. Notes: svn path=/head/; revision=50546
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Add sysctl variables for the Linuxulator. These reside under `compat.linux' asMarcel Moolenaar1999-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 Notes: svn path=/head/; revision=50465
* Fix {g|s}etgroups semantics. We use cr_groups[0] to hold egid. This means thatMarcel Moolenaar1999-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 Notes: svn path=/head/; revision=50350
* Change all UNIMPL syscalls to STD and add them to linux_dummy. Now we alwaysMarcel Moolenaar1999-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. Notes: svn path=/head/; revision=50345
* Fix bug in the debug-printf of the vfork syscall, where the format specifierMarcel Moolenaar1999-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 Notes: svn path=/head/; revision=49959
* Implement linux_vfork() syscall by calling vfork(). Analogous to theMarcel Moolenaar1999-08-161-1/+18
| | | | | | | linux_fork() implementation. Notes: svn path=/head/; revision=49890
* Provide wrappers for sched_{s|g}etscheduler. We need to convert the policyMarcel Moolenaar1999-08-151-1/+65
| | | | | | | | | | argument. PR: 12006 Originator: Jean-Claude MICHOT <jcmichot@teaser.fr> Notes: svn path=/head/; revision=49849
* Include opt_compat.h so that COMPAT_43 is defined. This gives us the properMarcel Moolenaar1999-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 Notes: svn path=/head/; revision=49842
* Do not map {s|g}etrlimit onto FreeBSD syscalls. The arguments don't match.Marcel Moolenaar1999-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> Notes: svn path=/head/; revision=49626
* Fix page fault in linux_uselib syscall.Marcel Moolenaar1999-08-081-2/+2
| | | | | | | | PR: 12910 Submitted by: Peter Holm <peter@holm.cc> Notes: svn path=/head/; revision=49523
* Let newuname return "Linux" as the OS name and not "FreeBSD". Also, return aMarcel Moolenaar1999-07-051-3/+3
| | | | | | | | more sensible (for Linux applications) release number. Hardcoding a release number has its drawbacks, but it will do for now. Notes: svn path=/head/; revision=48595
* Fix up a few easy 'assignment used as truth value' and 'suggest parensPeter Wemm1999-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. Notes: svn path=/head/; revision=46571
* Enable vmspace sharing on SMP. Major changes are,Luoqi Chen1999-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> Notes: svn path=/head/; revision=46129
* Change suser_xxx() to suser() where it applies.Poul-Henning Kamp1999-04-271-2/+2
| | | | Notes: svn path=/head/; revision=46116
* Suser() simplification:Poul-Henning Kamp1999-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. Notes: svn path=/head/; revision=46112
* unifdef -DVM_STACK - it's been on for a while for x86 and was checkedPeter Wemm1999-04-191-14/+1
| | | | | | | and appeared to be working for the Alpha some time ago. Notes: svn path=/head/; revision=45821
* Fix thread/process tracking and differentiation for Linux threads emulation.Julian Elischer1999-03-021-19/+16
| | | | | | | | | Submitted by: Richard Seaman, Jr." <dick@tar.com> Also clean some compiler warnings in surrounding code. Notes: svn path=/head/; revision=44384
* Enable Linux threads support by default.Julian Elischer1999-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> Notes: svn path=/head/; revision=43208
* Add (but don't activate) code for a special VM option to makeJulian Elischer1999-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> Notes: svn path=/head/; revision=42360
* Commit #2 ofSøren Schmidt1998-12-301-1/+73
| | | | | | | | PR: 9235 Submitted by: marcel@scc.nl <Marcel Moolenaar> Notes: svn path=/head/; revision=42185
* According to the author..Julian Elischer1998-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> Notes: svn path=/head/; revision=42054
* Reviewed by: Luoqi Chen, Jordan HubbardJulian Elischer1998-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. Notes: svn path=/head/; revision=41931
* linux_pipe does not preserve the edx register. Linux andJordan K. Hubbard1998-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> Notes: svn path=/head/; revision=41650
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()Archie Cobbs1998-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> Notes: svn path=/head/; revision=41514
* In linux_newuname bzero the right type of struct (linux_newuname_t).Søren Schmidt1998-10-051-2/+2
| | | | Notes: svn path=/head/; revision=39977
* MF22: revert time bogon.Jordan K. Hubbard1998-09-241-2/+1
| | | | Notes: svn path=/head/; revision=39620
* return time in proper format for linux.Jordan K. Hubbard1998-09-231-1/+2
| | | | Notes: svn path=/head/; revision=39598
* Use [u]intptr_t instead of [u_]long for casts between pointers andBruce Evans1998-08-161-3/+3
| | | | | | | integers. Don't forget to cast to (void *) as well. Notes: svn path=/head/; revision=38354
* Converted the second last instance of hzto() to tvtohz().Bruce Evans1998-08-051-20/+15
| | | | | | | | | | | | | | | | | | | | Fixed nearby bugs (in linux_alarm()): - the itimer for the alarm was relative to the epoch instead of relative to the boot time. This was harmless because the itimer's interval is 0. - the seconds arg was not checked for validity before converting it to a possibly different value. - printf format errors. Improvements: Don't use splclock(). splsoftclock() suffices. Don't complicate things by micro-optimizing interrupt latency. Minor improvements: Various micro-optimizations to exploit the specialness of the alarm itimer and the value 0. Notes: svn path=/head/; revision=38127
* Fixed print format errors.Bruce Evans1998-07-291-26/+31
| | | | Notes: svn path=/head/; revision=37950
* Quick and dirty support for Linux's mremap. Not used by anythingJordan K. Hubbard1998-07-101-1/+32
| | | | | | | | | but quake2 AFAIK. Submitted by: Luoqi Chen <luoqi@watermarkgroup.com> Notes: svn path=/head/; revision=37548
* s/nanoruntime/nanouptime/gPoul-Henning Kamp1998-05-171-2/+2
| | | | | | | | | s/microruntime/microuptime/g Reviewed by: bde Notes: svn path=/head/; revision=36119
* Make a kernel version of the timer* functions called timerval* to bePoul-Henning Kamp1998-04-061-9/+9
| | | | | | | | | more consistent. OK'ed by: bde Notes: svn path=/head/; revision=35058