Commit Graph

1232 Commits

Author SHA1 Message Date
cube
632ece3eaf Introduce a new member to struct emul, e_startlwp, to be used by
sys__lwp_create.  It allows using the said syscall under COMPAT_NETBSD32.

The libpthread regression tests now pass on amd64 and sparc64.
2007-02-19 15:10:02 +00:00
ad
cee712ad2f Make this build. 2007-02-19 01:19:16 +00:00
pavel
934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +00:00
dsl
2b491f69ce Acquire proclist_lock across the calls to p_find() and pg_find(). 2007-02-17 21:40:19 +00:00
ad
087fdb9080 Count the number of CPUs at boot and stash in 'ncpu'. Eventually should
have each CPU register at attach, so we can figure out the topology for
the scheduler.
2007-02-15 20:32:47 +00:00
ad
d0a51fd23b Fix Linux compat on amd64. 2007-02-15 15:13:33 +00:00
mlelstv
8d08c62fcc Make setsockopt return compatible error codes for AF_UNIX sockets. 2007-02-11 08:00:59 +00:00
ad
88cb6cb846 Acquire proclist_mutex before sending signals. 2007-02-09 23:51:20 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
njoly
0d81683020 Add a new linux_emuldata_shared flag value LINUX_LES_USE_NPTL to allow
both NPTL and old linuxthreads behaviour depending on process needs.

Apply to exit_group(), getpid() and getppid() to share them between
compat linux32 (non NPTL) and compat linux (NPTL) on amd64.

ok by manu and christos
2007-02-05 18:31:36 +00:00
hubertf
eda05c6413 Remove more duplicate headers.
Patch by Slava Semushin <slava.semushin@gmail.com>

Again, this was tested by comparing obj files from a pristine and a patched
source tree against an i386/ALL kernel, and also for src/sbin/fsck_ffs,
src/sbin/fsdb and src/usr.sbin/makefs. Only changes in assert() line numbers
were detected in 'objdump -d' output.
2007-01-29 01:52:43 +00:00
elad
1113a3afe4 Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-05 15:40:51 +00:00
elad
b31e9c44cf Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 18:27:36 +00:00
elad
0ffd2bf379 Adapt to recent machdep scope changes.
Pointed out by Kouichirou Hiratsuka, thanks!
2006-12-26 16:42:06 +00:00
elad
c96fdfd49b Part of PR/33280: Christian Ehrhardt: The call to FILE_USE should be
immediatly before the FREAD | FWRITE test not after it or FILE_UNUSE will
be called after the jump to out without a corresponding FILE_USE.
2006-11-25 22:03:41 +00:00
wiz
6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +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
cbiere
4b14bb6309 Changed error message of ENOPROTOOPT to "Protocol option not available". 2006-10-31 00:38:06 +00:00
christos
a2161fece4 sprinkle __unused. 2006-10-14 18:57:06 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos
ed106f137b Coverity CID 2990: fix memory leak (from Arnaud Lacombe) 2006-09-29 14:24:55 +00:00
pavel
3cdb79bdae Replace homegrown tests for FIFO (... & S_IFIFO) by S_ISFIFO. The old code
was "correct" by luck - we don't have any other file type whose S_IF* bits
in sys/stat.h overlap with S_IFIFO.

Originally discovered by Paul Stoeber in OpenBSD.
2006-09-25 16:16:18 +00:00
dbj
2df12fb8b5 use _KERNEL_OPT instead of _LKM to check whether to include "opt_ktrace.h" 2006-09-24 21:44:58 +00:00
dogcow
e15e9231e6 opt_ktrace.h doesn't exist when building LKMs. 2006-09-24 05:48:27 +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
christos
487c57538b Pretend to implement TIOCSPTLCK. Although failing is harmless, there is no
point in doing so.
2006-09-22 15:12:02 +00:00
manu
876294b403 Proprely convert devices on amd64 2006-09-20 09:54:55 +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
christos
46c5717199 avoid empty if body. 2006-09-13 00:52:07 +00:00
christos
6a76f8e0d2 Avoid empty body in if 2006-09-13 00:51:12 +00:00
christos
193447d4bd avoid empty if 2006-09-13 00:49:07 +00:00
christos
de02317b32 comment out impossible code 2006-09-02 06:53:17 +00:00
christos
c4501e2800 fix incomplete initializer 2006-09-02 06:52:13 +00:00
matt
2e04559304 When calling PTRACE from an LKM, use sysent[SYS_ptrace].sy_call in case
the sys_ptrace symbol isn't present.
2006-09-01 21:20:46 +00:00
matt
280b69066a Regen. 2006-09-01 21:19:44 +00:00
matt
30183e299f Don't conditionalize *sys_ptrace. The lack of sys_ptrace will be dealt
with differently.
2006-09-01 20:58:18 +00:00
he
7fae0d129f Allow this to build as an LKM by testing for _KERNEL_OPT before
including opt_ptrace.h.
2006-08-30 17:14:34 +00:00
matt
3a7b10b907 Regen 2006-08-30 11:19:23 +00:00
matt
ad6aa2b08e Update to deal with options PTRACE 2006-08-30 11:14:39 +00:00
manu
432f035fa6 The return value for Linux shmat on amd64 does not suffer the same horrible
hack as on i386.
2006-08-24 16:36:59 +00:00
dogcow
51faed03f9 move #ifdef up a few lines to prevent unused variable warning/error 2006-08-23 21:17:48 +00:00
bjh21
a707189c87 Use VALID_R15_PSR() to check the context we're restoring in
linux_sys_sigreturn().  Somehow this got missed when I introduced that macro.
2006-08-23 21:16:58 +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
manu
a640310a53 typo 2006-07-24 19:01:49 +00:00
ad
f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
manu
2e26811b6b If the user process requests a non null timeout, make sure we do not turn
it into an infinite timeout because of a conversion
2006-07-09 18:51:28 +00:00
pavel
a78062784c Use the new socket call for Linux and SVR4, because those systems (at
least Linux 2.4.31, Irix 6.5.20 and Solaris 10) use EAFNOSUPPORT.

Only the Linux emulation has been tested.

XXX somebody should audit the other emulations...
2006-06-27 09:09:40 +00:00
mrg
e2eb31d3a3 version the socket(2) syscall. for compat30 socket, we use
EPROTONOSUPPORT instead of EAFNOSUPPORT.

from pavel@ with a little bit of clean up from myself.

XXX: netbsd32 (and perhaps other emulations) should be able
XXX: to call the standard socket calls for this i think, but
XXX: revisit this at another time.
2006-06-26 21:23:56 +00:00