Commit Graph

30 Commits

Author SHA1 Message Date
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
njoly
8fbf55addb Regen (aliases cleanup). 2007-02-08 12:32:17 +00:00
njoly
fb1562ae0f Remove some aliases, for syscalls that use their netbsd32 equivalent.
This makes the ktrace output more consistent.

ok by manu.
2007-02-08 12:29:39 +00:00
njoly
835e659d6b Regen (poll argument fix). 2007-02-07 15:35:00 +00:00
njoly
398ec1833a Use netbsd32_pollfdp_t instead of wrong `struct pollfd *'.
ok by manu.
2007-02-07 15:32:52 +00:00
christos
91ad430f6c adjust_limits takes p, not l again 2006-11-22 13:56:09 +00:00
christos
1882355e27 From Nicolas Joly:
> It seems that 32bits programs, running under compat_netbsd32, using
> setrlimit force all other programs to have their maximum data size
> fixed at 3GB, where native 64bits apps used 8GB previously.

I tracked this one to the `netbsd32_adjust_limits()' function (called
when creating a new process under compat_netbsd32), where data and
stack limits are set without checking for shared `p_limit' structure
(p_limit->p_refcnt > 1). This explain the side effect where processes
have their limits changed when a compat_netbsd32 (or compat_linux32)
program is run.

The fix is to use `dosetrlimit()' to ensure the needed copy-on-write
behaviour for shared structure.
2006-11-21 14:32:27 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
elad
68f43d80fe Clean some KAUTH_GENERIC_ISSUSER usage in compat code. 2006-11-14 13:34:29 +00:00
manu
63ac93df54 Add sysctl tracing to emulations.
While we are there, fix a bug in FreeBSD sysctl emulation: use copyin for
moving data to the kernel
2006-09-23 22:11:59 +00:00
manu
717102f4bb Jumbo COMPAT_LINUX/COMPAT_LINUX32 bugfix, with the help of Nicolas Joly
- Fix shmat return value on amd64: it uses no black magic with retval[0]
- Fix integer overflows in sysinfo
- Implement sysinfo, mmap2, sched_getparam, sched_getscheduler, mremap,
  and madvise in COMPAT_LINUX32
- Fix improper types used in setgroups16/getgroups16
- Implement mmap2 for COMPAT_LINUX32
- Ifdef debug messages by DEBUG_LINUX
2006-09-13 19:55:49 +00:00
manu
99bb1b27be This file was not used anymore 2006-09-13 19:47:30 +00:00
manu
f0cbe4f3bf Implement Linux's fdatasync, patch from Nicolas Joly 2006-09-06 12:01:23 +00:00
manu
84b03d19fe Fix linux32_sys_setres{uid|gid}: -1 does not means the same thing on i386
and amd64...
2006-09-06 08:32:00 +00:00
manu
4d5f807455 Fix linux32_sys_sysctl, it was horribly broken. 2006-09-05 17:12:19 +00:00
manu
ea514e44f5 typo 2006-09-05 08:17:09 +00:00
matt
280b69066a Regen. 2006-09-01 21:19:44 +00:00
manu
753fce01f4 netbsd32_sys_ioctl was called with improper syscall argument structure, this
caused any X11 program to fail because FIONREAD ioctl always returned an
error.
2006-08-25 16:17:05 +00:00
manu
01f2e16aa8 Add support for socket ioctl. 2006-08-25 08:25:03 +00:00
manu
81c909dd45 1) Complete Linux exit_group() emulation
Members of the thread group must die without reporting to the parent and
without going to zombie stage. We do that by reparenting to init before
catching a SIGKILL. The parent will not see the child death.

The thread group leader must report the exit status, even if it exits
because of another thread calling exit_group(). We do that by storing the
exit status in struct linux_emuldata_shared, and the exit hook has the
duty of setting struct proc's p_xstat for the thread group leader.

2) For exit/fork/exec hooks, move the NPTL specific code to separate functions
that are shared between COMPAT_LINUX and COMPAT_LINUX32

3) Fix LINUX_CLONE_PARENT_SETTID semantics
2006-08-23 19:49:09 +00:00
manu
05c8a1b827 Add a new signature test for linux probe function. We look for a .debuglink
section, which is specific to the Linux dynamic interpeter (yes, Linux
can execute it as a stand alone program)
2006-08-07 14:19:57 +00:00
ad
f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
manu
ce7e36a5a9 Regen 2006-06-25 16:16:52 +00:00
manu
b7432513dc - Complete exit_group() implementation. We now maintain a list of Linux
threads in a processes and kill them properly. The code is a bit too
complicated, but I could not find a simplier way of dealing with it

- Change getpid() and getppid() semantics to match what Linux does,
and implement gettid(). In the Linux kernel, threads are implemnted
as plain old processes. A thread group is just a set of processes,
with the parent called leader. Thread ID, which are returned by gettid(),
are just the PID of the plain old processes, and getpid() returns the
PID of the thread group leader.

- Remove struct linux32_emuldata. COMPAT_LINUX32 uses a lot of COMPAT_LINUX
code, where a struct linux_emuldata is assumed. By having distinct emuldata
structure with different sizes and layouts, we caused kernel memory
corruptions.

- Fix setprioriry() and getpriority()

Thanks to Nicolas Joly for tracking down the problem and providing me the
hardware to fix them.
2006-06-25 16:15:39 +00:00
skd
99e52fdeb8 include kauth.h
workaround a gcc4 warning.
2006-06-13 16:23:57 +00:00
elad
874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
manu
c7fca50583 Fix compat_linux32 time(2) emulation 2006-02-24 06:39:47 +00:00
manu
5e9b532be2 Add getcwd (for real this time), fix dup and dup2 2006-02-15 15:23:18 +00:00
manu
f806470fb3 - Move the BSD to Linux and Linux to BSD termio/termios conversion functions
to a header where they can be shared between COMPAT_LINUX and COMPAT_LINUX32
- Add termios ioctl emulation to COMPAT_LINUX32
- Add the getcwd system call to COMPAT_LINUX32/amd64

That makes Linux's bash working with COMPAT_LINUX32.
2006-02-15 09:31:17 +00:00
manu
ee0c5b44de Add initial (but unfinished) COMPAT_LINUX32 for amd64. This is good enough so
that the i386 license manager part of amd64 version of Fluent works.

While I'm here, add SysV IPC to COMPAT_LINUX/amd64
2006-02-09 19:18:56 +00:00