Commit Graph

3805 Commits

Author SHA1 Message Date
cube c7565916df Regen (missing lwp syscalls). 2007-02-18 15:00:14 +00:00
dsl 923424a8c0 Keep proclist_lock held across p_find and use of result proc. 2007-02-18 11:45:35 +00:00
dsl 1564fa5d82 ANSI prototypes 2007-02-18 11:38:15 +00:00
dsl c7907fd992 Factor out the replicated code that verifies that the caller is allowed
to acces the required process into a separate function (hi cut and paste).
Acquire the proclist_lock across p_find().
2007-02-18 09:45:39 +00:00
cube c376ba15d1 Add missing lwp syscalls. Put them all together into a new file,
netbsd32_lwp.c, and remove remaining traces of SA.

This still needs some MD (and possibly MI, depending on the chosen
solution) changes to actually work.
2007-02-18 09:03:54 +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
njoly 5f6b6270e4 Regen. 2007-02-16 20:49:40 +00:00
njoly 11f77cf45a Add support for a few syscalls:
setfsuid16/getfsuid16
setfsuid/getfsuid
sched_yield

ok by manu
2007-02-16 20:49:06 +00:00
ad 57aa4fbf3b proc_free() was returning a NULL rusage pointer to wait() when a traced
process was reparented. Change proc_free() to copy the rusage to a buffer
on the stack if required, so it can be passed both to the debugger and
to the real parent process.

Fixes kern/35582 (kernel panics with gdb).
2007-02-16 00:39:16 +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 12460decf9 Fix COMPAT_LINUX32. 2007-02-15 15:29:07 +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 6faf4c1b76 Sprinkle some more locks. 2007-02-10 10:12:34 +00:00
ad 8cfae44a35 Sprinkle a couple more locks. 2007-02-10 10:09:01 +00:00
tsutsui 18f2cde2bd Make COMPAT_HPUX compile by mechanical replacements.
XXX1: not sure if it still works even before newlock2 merge
XXX2: some more mutex locks might be required
2007-02-10 02:42:30 +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 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
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
he a128c1c544 Adapt to the addition of vfs_suspendctl in struct vfsops. 2007-01-23 10:35:05 +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 8d28e56e22 Remove KAUTH_GENERIC_ISSUSER. 2007-01-04 15:21:09 +00:00
elad 0ffd2bf379 Adapt to recent machdep scope changes.
Pointed out by Kouichirou Hiratsuka, thanks!
2006-12-26 16:42:06 +00:00
wiz 0ec178eea9 Spell "relevant" correctly. From Zafer Aydogan. 2006-12-25 18:31:18 +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 09cb1d6f1c s/existance/existence/, from Zafer. 2006-11-24 22:52:16 +00:00
wiz 6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +00:00
christos d8f5d5f044 fix capitalization of NetBSD; from Zapher 2006-11-24 19:38:55 +00:00
christos 91ad430f6c adjust_limits takes p, not l again 2006-11-22 13:56:09 +00:00
christos d6bc4d2b49 deal with RLIM_INFINITY in the setrlimit case. 2006-11-21 18:50:01 +00:00
christos 887f588c92 adjust limits takes struct proc again. 2006-11-21 15:02:18 +00:00
christos 0470afd097 Simplify previous commit not to use dosetrlimit(), since we don't want the
kauth tests etc.
2006-11-21 14:57:54 +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
jmmv c963ce01ee Pull in opt_ktrace.h (and sys/ktrace.h) so that the ktrace-related code
is compiled when enabled.  You know, preprocessor hell...
2006-11-13 17:01:06 +00:00
jmmv 870dd91500 Let this build when KTRACE is not enabled. Closes PR kern/33210. 2006-11-13 16:57:40 +00:00
cube 3574e17e23 Regen (PR#34951 fixes). 2006-11-09 14:10:21 +00:00
cube 1277ee639e - Make better use of COMPAT_XX type in syscalls.master
- Remove useless (thanks to COMPAT_XX behaviour) #ifdefs in
  syscalls.master
- Make netbsd32_compat_43.c compiled per COMPAT_LINUX32 because the latter
  needs stuff from it.

Fixes Perry's PR#34951.
2006-11-09 14:09:37 +00:00
drochner b1af2cb9b9 -SUS says that a successful call to setcontext(2) does not return. This
implies that _UC_CPU must be set in the context passed. Check for this
 and return EINVAL if not; this gives a cheap test for corrupted
 ucontexts eg on a signal handler stack which would go unnoticed otherwise.
-Don't ckeck for NULL ucontext pointers explicitely. This is an error,
 except in the swapcontext() case where it can be easily caught in
 userland.
2006-11-08 20:18:32 +00:00
cbiere 4b14bb6309 Changed error message of ENOPROTOOPT to "Protocol option not available". 2006-10-31 00:38:06 +00:00
christos 9e34b4bbee ktruser checks for length now. 2006-10-22 18:18:49 +00:00
christos 0838967c65 ktruser now returns an error if the buffer length is too big. 2006-10-22 18:18:08 +00:00