Commit Graph

4582 Commits

Author SHA1 Message Date
njoly
5932e6a6cd Add the mask value returned by siggetmask. 2009-06-02 16:53:07 +00:00
njoly
7c47c56d95 Make nice(2) return EPERM on error, not EACCES (from sys_setpriority). 2009-06-02 13:00:23 +00:00
njoly
d22e6f64ab Add native to linux siginfo si_status translation, used on i386 and
amd64.
2009-05-29 14:19:12 +00:00
njoly
05d61dcbbd Make getdirentries set a correct block read position for basep
argument.
2009-05-29 09:32:41 +00:00
njoly
c2d83ad5c5 Redo previous, by simply updating basep earlier, before label. 2009-05-28 15:21:26 +00:00
njoly
2a614502ab Make getdirentries(2) correctly fail with EINVAL for an invalid file
descriptor (not for a directory), by not updating basep syscall
argument on error.
2009-05-28 14:48:20 +00:00
njoly
a88fd78513 Use correct linux_clock_t type for _stime, not native clock_t. 2009-05-27 12:20:37 +00:00
ad
d991fcb3b6 More changes to improve kern_descrip.c.
- Avoid atomics in more places.
- Remove the per-descriptor mutex, and just use filedesc_t::fd_lock.
  It was only being used to synchronize close, and in any case we needed
  to take fd_lock to free the descriptor slot.
- Optimize certain paths for the <NDFDFILE case.
- Sprinkle more comments and assertions.
- Cache more stuff in filedesc_t.
- Fix numerous minor bugs spotted along the way.
- Restructure how the open files array is maintained, for clarity and so
  that we can eliminate the membar_consumer() call in fd_getfile().  This is
  mostly syntactic sugar; the main functional change is that fd_nfiles now
  lives alongside the open file array.

Some measurements with libmicro:

- simple file syscalls are like close() are between 1 to 10% faster.
- some nice improvements, e.g. poll(1000) which is ~50% faster.
2009-05-24 21:41:25 +00:00
njoly
eb51be4e79 Adjust compat osf1 to recent pad -> PAD change. 2009-05-18 12:39:02 +00:00
pooka
bb7d994504 pad -> PAD. Fixes build problem reported by Paul Goyette in private email. 2009-05-17 05:57:01 +00:00
pooka
ed09069bac regen: pad -> PAD 2009-05-17 05:55:42 +00:00
pooka
5b4deca5cb pad -> PAD 2009-05-17 05:54:22 +00:00
nakayama
a7ae1082e0 Follow pad to PAD change. 2009-05-16 17:45:23 +00:00
pooka
dfb36ab4e4 pad -> PAD 2009-05-15 16:59:07 +00:00
cegger
cb0f831638 use device_xname() 2009-05-11 21:34:55 +00:00
cegger
2dc0e43978 use device_xname() 2009-05-11 20:53:47 +00:00
ad
6977231a34 G/C reference to LK_CANRECURSE. 2009-05-06 22:38:31 +00:00
njoly
692b478fd5 Add IPC_64 support to all semctl(2) commands, following corresponding
compat linux change.
2009-04-27 13:24:18 +00:00
njoly
d3dabe1260 Add IPC_64 support for all semctl(2)/msgctl(2). Needed, at least on
i386 for Linux 2.6 emulation.
2009-04-23 17:40:57 +00:00
njoly
c4fb0248d2 Convert si_code value from native to linux. 2009-04-23 17:37:51 +00:00
ad
4d8f47ae2f cpuctl:
- Add interrupt shielding (direct hardware interrupts away from the
  specified CPUs). Not documented just yet but will be soon.

- Redo /dev/cpu time_t compat so no kernel changes are needed.

x86:

- Make intr_establish, intr_disestablish safe to use when !cold.

- Distribute hardware interrupts among the CPUs, instead of directing
  everything to the boot CPU.

- Add MD code for interrupt sheilding. This works in most cases but there is
  a bug where delivery is not accepted by an LAPIC after redistribution. It
  also needs re-balancing to make things fair after interrupts are turned
  back on for a CPU.
2009-04-19 14:11:36 +00:00
skrll
66aaa2e514 Typo in comment. 2009-04-16 07:42:28 +00:00
elad
2d1c968399 Remove a few KAUTH_GENERIC_ISSUSER in favor of more descriptive
alternatives.

Discussed on tech-kern:

	http://mail-index.netbsd.org/tech-kern/2009/04/11/msg004798.html

Input from ad@, christos@, dyoung@, tsutsui@.

Okay ad@.
2009-04-15 20:44:24 +00:00
ad
c6367674d6 Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.

Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.

thr0	accept(fd, ...)
thr1	close(fd)
2009-04-04 10:12:51 +00:00
christos
802d07dbca cast segsz to int. 2009-04-01 21:15:23 +00:00
dogcow
36ffab86d9 fix what looks like a mechanical stuffup in the timeval -> timespec conversion. 2009-04-01 03:06:06 +00:00
cegger
456f7ba595 buildfix: NEW_VMCMD(2 -> NEW_VMCMD2( 2009-03-31 06:03:31 +00:00
christos
2b1b4bc6ef Move the internal poll/select related API's to use timespec instead
of timeval (rides the uvm bump).
2009-03-29 19:21:19 +00:00
mrg
fcc023545e - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes.  this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS.  (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information.  (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897.  it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
2009-03-29 01:02:48 +00:00
gmcgarry
65b9855fd5 Replace gcc initialisers with c99 designated initialisers. 2009-03-26 22:22:14 +00:00
ad
d16d704d62 PR port-i386/40143 Viewing an mpeg transport stream with mplayer causes crash
Fix numerous problems:

1. LDT updates are not atomic.

2. Number of processes running with private LDTs and/or I/O bitmaps
   is not capped. System with high maxprocs can be paniced.

3. LDTR can be leaked over context switch.

4. GDT slot allocations can race, giving the same LDT slot to two procs.

5. Incomplete interrupt/trap frames can be stacked.

6. In some rare cases segment faults are not handled correctly.
2009-03-21 14:41:29 +00:00
cegger
e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
cegger
35fb64746b bcmp -> memcmp 2009-03-18 15:14:29 +00:00
cegger
df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
dyoung
a3bde60951 #include "opt_compat_netbsd.h" for COMPAT_20. 2009-03-17 00:08:10 +00:00
dyoung
1290eea0cb Add #include "opt_compat_netbsd.h" for COMPAT_09. 2009-03-17 00:01:54 +00:00
dsl
7cc9af7d64 ANSIfy functions with function-pointer arguments 2009-03-16 23:11:09 +00:00
njoly
fd24f7c917 Regen for netbsd32_dev_t. 2009-03-16 20:49:16 +00:00
njoly
0f21bb4a22 Fix dev_t alignment, by not using the new 64bit value directly but
rather a 32bit aligned version (netbsd32_dev_t = netbsd32_uint64).

ok by cube@.
2009-03-16 20:48:13 +00:00
cegger
9fca5da616 ansify function definitions 2009-03-15 15:55:51 +00:00
cegger
7038d1e471 ansify function definition 2009-03-15 15:54:43 +00:00
dsl
82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
christos
7fd1fc871c fix robust_list pointer mess! 2009-03-14 20:18:27 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
christos
7ef7e1b997 disable PTHREAD_CONCURRENCY until the bugs are fixed. 2009-03-06 14:00:40 +00:00
msaitoh
16ed711ed3 fix typo (s/stucture/structure/) 2009-03-05 01:21:57 +00:00
skrll
5ccc095a3e Fix the posix_fadvise return value... finally.
Tested martin on sparc64/m68k and me on hppa.
2009-03-04 18:11:24 +00:00
ad
dd1969c253 PR kern/40730 any user can crash the system with KERN_SA
Disable SA. It can be re-enabled with sysctl -w kern.no_sa_support=0.
2009-03-02 22:11:28 +00:00
christos
4538aa34ee Regen 2009-02-26 21:09:00 +00:00