- sync linuxulator:
* de-COMPAT_43-ify:
+ socket related ioctl's
This differs from -current, as the kernel ABI is different
(kern_bind() and kern_connect() free the struct sockaddr on -stable
themself, so two calls to free() are not included in this MFC).
* bug-/compatibility-fixes
* ioctl TIOCGPTN
* 1 style(9)-fix
Tested by: "Arno J. Klaassen" <arno@heho.snv.jussieu.fr>
- linuxulator mmap handling
- memleak fixes
- extend linux errno mapping
- handle address space limits for linux processes
- sync linprocfs (/proc/sys/... part)
Compile tested by: scf (i386, as part of a mega-MFC-patch)
Tested by: Arno J. Klaassen <arno@heho.snv.jussieu.fr> (amd64)
- don't limit number of syscalls to 255
- handle more socket options
- bug-/compatibility-fixes to linux
* file related (includes fixes which prevent creation of strange files
which can only be removed with a fsck)
* make ping work
* ...
- add devfs to the file system type handling/translation
Compile tested by: scf (i386, as part of a mega-MFC-patch)
Tested by: Arno J. Klaassen <arno@heho.snv.jussieu.fr> (amd64)
- some linuxulator style(9) fixes
- add datatypes and definitions in preparation of further commits
- use one (l_sigval) of the new datatypes on amd64 and get rid of a now unused
include (this may or may not fix some signal handling issues on amd64) [1]
- convert some unconditional debug handling into the common linuxulator way
- use some more appropriate format string types in some debug printf's
- convert signal validation into a macro
Except for [1] on amd64 there is no visible change to a normal user.
Tested by: scf (i386), Arno J. Klaassen <arno@heho.snv.jussieu.fr> (amd64)
- easy linuxulator style(9) fixes (easy = hand removal of non-style code
change sections in a full diff)
Tested by: scf (i386), Arno J. Klaassen <arno@heho.snv.jussieu.fr> (amd64)
amd64 including:
- Add 32-bit wrappers for thr_new(), thr_suspend(), and the umtx system
calls.
- Add support to amd64 for constructing thread upcalls for 32-bit
processes.
- Leave %fs and %gs alone in the signal trampoline for 32-bit processes on
amd64.
- Add 'casuword32()' to amd64 and ia64.
Tested by: emaste
a 64-bit process exec'd by a 32-bit process doesn't end up with 32-bit
limits.
This doesn't break the ABI as neither of the 32-bit ABIs (COMPAT_LINUX32
and COMPAT_IA32) are buildable as modules on 6.x/amd64 and none of the
other ABIs use this hook.
Hook up audit functions in the freebsd32 compatibility code. It is
believed these likely don't require wrappers.
Include's sobomax's compile fix.
Requested by: sobomax
Approved by: re (kensmith, hrs)
Change getpagesize() system call audit event to more clearly indicate
that we don't audit it.
Obtained from: TrustedBSD Project
Approved by: re (kensmith)
- don't reboot() when feed with wrong parameters (and enough permissions) [1]
- add support to power off the system [2]
- check the linux magic values [3]
Submitted by: Marcin Cieslak <saper@SYSTEM.PL> [1,2]
Modelled after: linux man page of the reboot() syscall [3]
Found by: LTP testcase "reboot02" [1]
Tested with: LTP testcase "reboot02" [1,3]
Approved by: re (hrs)
from HEAD to RELENG_6: syscalls.master:1.63, 1.72, 1.73, 1.75. With
this change, 6.x 32-bit binary compatibility will also generate system
call audit events.
Approved by: re (mux)
The Linux unlink syscall uses a different errno value when trying to unlink
a directory.
PR: 102897 [1] http://www.FreeBSD.org/cgi/query-pr.cgi?pr=102897
Noticed by: Knut Anders Hatlen <kahatlen@gmail.com> [1], testrun with LTP
Submitted by: Marcin Cieslak <saper@SYSTEM.PL>
Tested by: netchild (LTP test run)
Approved by: re
Lock the vnode around the call to VOP_GETATTR. Move the locked code
and vn_fullpath (that call malloc(..., M_WAITOK)) from under the
vm object lock, since sleep is not allowed while holding the mutex.
Being there, wrap VOP_GETATTR call with conditional Giant aquire.
Currently this is (almost) noop because pseudofs is Giant-locked.
Approved by: pjd (mentor)
- linux_misc.c 1.179
Don't copyout/do unneccesary work if the buffer is a NULL pointer.
Noticed by: Dmitry Ganenko <dima@apk-inform.com>
Reviewed by: rdivacky (the original version as in emulation@)
- linprocfs.c 1.96:
Improve linprovfs to provide/fix the
- process state (idle, sleeping, running, ...) [1]
- the process group ID of the process which owns the connected tty
- some page fault stats
- time spend in kernel/userland
- priority/nice value
- starttime [1]
- memory/swap stats
- scheduling policy
Additionally add some new fields and correct some not filled out ones.
This brings us down to 15 dummy fields.
The fields marked with [1] are needed to get Oracle 10 running. The starttime
field is not completely right, since it displays the _same_ starttime for
_every_ process, but at least it is not 0 and Oracle accepts this.
Noticed by: Dmitry Ganenko <dima@apk-inform.com> [1]
Reviewed by: des, rdivacky
- pseudofs_vnops.c 1.60:
Correctly calculate a buffer length. It was off by one so a read() returned
one byte less than needed.
Noticed by: Dmitry Ganenko <dima@apk-inform.com>
Testcase by: Dmitry Ganenko <dima@apk-inform.com>
Reviewed by: des
Submitted by: rdivacky
Sponsored by: Google SoC 2006
All of those are needed for Oracle 10. Since previous Oracle versions work
just fine without those fixes, these patches can be seen as regression fixes
too. Because of this I think they are a RELENG_6_x candidate (MFC reminder
set).
MFC after: 1 month
management tools can work. This is not totally connected to the build
yet. The mfi(4) change have not been MFC'ed yet. This will be done
shortly. I'm trying to do this in chunks so I don't totally break
the build on a missed commit. This has passed make universe a while
ago:
Enhance the Linux emulation layer to make MegaRAID SAS managements tool happy.
Add back in a scheme to emulate old type major/minor numbers via hooks into
stat, linprocfs to return major/minors that Linux app's expect. Currently
only /dev/null is always registered. Drivers can register via the Linux
type shim similar to the ioctl shim but by using
linux_device_register_handler/linux_device_unregister_handler functions.
The structure is:
struct linux_device_handler {
char *bsd_driver_name;
char *linux_driver_name;
char *bsd_device_name;
char *linux_device_name;
int linux_major;
int linux_minor;
int linux_char_device;
};
Linprocfs uses this to display the major number of the driver. The
soon to be available linsysfs will use it to fill in the driver name.
Linux_stat uses it to translate the major/minor into Linux type values.
Note major numbers are dynamically assigned via passing in a -1 for
the major number so we don't need to keep track of them.
This is somewhat needed due to us switching to our devfs.
Don't truncate f_mntfromname & f_mntonname to 16 characters when
translating statfs into ostatfs. Also use strlcpy instead of bcopy
to make sure the copied strings are properly terminated.
Approved by: re (scottl)
date: 2005/12/13 15:32:52; author: delphij; state: Exp; lines: +5 -5
In Linux, kernel parameters passed to ioctl are by value, while in FreeBSD
they are passed by reference. Handle the difference within the
linux_ioctl_termio on the LINUX_TCFLSH path.
Submitted by: Jaroslav Drzik <jaro_AT_coop-voz_dot_sk>
Reminded by: glebius
osigpending, osigvec, osigblock, osigsetmask, osigsuspend, osigstack,
clock_gettime, clock_settime, and clock_getres.
Also correct the prototype for freebsd32_nanosleep in syscalls.master.