Commit Graph

3483 Commits

Author SHA1 Message Date
dsl 9c29dd1922 Indentation fixes 2003-03-19 20:35:04 +00:00
christos a56ea22f68 - use __predict_false for DIAGNOSTIC code.
- #ifdef out a DIAGNOSTIC printf() that was too annoying (rule of thumb,
  don't make DIAGNOSTIC printfs() that print *very* frequently...)
- fix DIAGNOSTIC test that would always get triggered on a new session.
2003-03-19 16:47:36 +00:00
christos 3bd89478f7 make this compile again (-DDIAGNOSTIC) 2003-03-19 16:02:31 +00:00
dsl 9be8ac5294 Alternative pid/proc allocater, removes all searches associated with pid
lookup and allocation, and any dependency on NPROC or MAXUSERS.
NO_PID changed to -1 (and renamed NO_PGID) to remove artificial limit
on PID_MAX.
As discussed on tech-kern.
2003-03-19 11:36:32 +00:00
christos 46bb05bc86 regen 2003-03-18 18:09:48 +00:00
christos 1623253ed2 _lwp_setprivate returns void 2003-03-18 18:08:49 +00:00
jdolecek 46eb0d5bf0 make it possible for UNION fs to be loaded via LKM - instead of
having some #ifdef UNION code in vfs_vnops.c, introduce variable
'vn_union_readdir_hook' which is set to address of appropriate
vn_readdir() hook by union filesystem when it's loaded & mounted
2003-03-17 09:11:29 +00:00
martin 358b4d4e49 When being passed bogus file descriptors make close(2) return EBADF.
From Stephen Ma in PR kern/20762.
2003-03-17 07:57:13 +00:00
jdolecek a0deb3e9c4 move union filesystem code from sys/miscfs/union to sys/fs/union 2003-03-16 08:26:46 +00:00
matt e86e032c61 Make cfroots const. 2003-03-16 08:09:58 +00:00
matt 137a763c9b Only define POOL_LOGSIZE/pool_size if POOL_DIAGNOSTIC is defined. 2003-03-16 08:06:51 +00:00
dsl a8a18df708 cpu times were miscalculated because 'usecs' could go -ve...
There is still a problem that 'st = (u * st) / tot;' can overflow,
but that is harder to fix, and requires cpu times of ~5days.
(approved by christos)
2003-03-14 21:38:26 +00:00
dsl a485005f79 Ensure that the pgid arg to TIOCSPGRP is in the current session.
Correctly treat a +ve value as a pgid and a -ve one as a pid.
2003-03-13 10:20:06 +00:00
dsl 741870b7ef Validate that pgid argument to TIOCSPGRP in part of current session.
Treat +ve numbers as process group ids and -ve as pids (see tcsetpgrp() in part of current session.
Treat +ve numbers as process group ids and -ve as pids - see tcsetpgrp(3).
(approved by christos)
2003-03-12 23:00:03 +00:00
dsl 5786e3a6e8 Add pgid_in_session() for validating TIOCSPGRP requests
(approved by christos)
2003-03-12 22:54:44 +00:00
dsl 8bf20eda9b KNF function prototypes 2003-03-12 16:39:01 +00:00
dsl 4f78d8c26a Need to call calcru while l->l_stat == LSONPROC 2003-03-12 15:26:33 +00:00
nathanw 11aebbf730 Change the contract for timer_settime() (the internal routine, not the
syscall sys_timer_settime()) to take an absolute value for realtime
timers. This avoids a pair of gratiuitous conversions with the
possibility that the timer's intermediate value would be 0.0, which
would signal timer_settime() to cancel the timer.

Adjust callers of timer_settime() to compensate; catch the case where
sys_timer_settime() with an absolute time value of now and a virtual
timer would also be subtracted down to a timer-cancelling 0.0.

This should fix the bug seen in libpthread's nanosleep() where certain
applications, such as xmms, would wedge with unexpired userlevel
alarms.
2003-03-10 21:49:56 +00:00
thorpej 9e7bb2595e Based on the feedback on wasabisystems.com!bsd-api-discuss (sure wish
people would read that list in a more timely fashion!), change the new
64-bit memory reporting sysctl nodes to report bytes.  This should not
be a problem, since it's only a week old, and no applications use the
new nodes yet.
2003-03-06 20:32:59 +00:00
darrenr bacf7b9b2b When unblocking threads, do not call setrunnable() on the thread we will
be returning because the code path that calls is will very likely call
setrunnable() again on the returned thread, leading to a panic because
the thread returned is already at LSRUN.  This fixes a problem where netbsd
would panic when using gdb (5.3) on a process with multiple lwp's like this:
% gdb program
(gdb) run
^C
(gdb) quit
2003-03-06 15:31:14 +00:00
matt 6221ccd63f Make sure to flush each line after printf. 2003-03-06 00:39:42 +00:00
dsl a5de203f9f Add do_setresuid() and do_setresgid() and implement sys_setuid, sys_seteuid,
sys_setreuid (and gid equivs) in terms of them.
2003-03-05 18:42:19 +00:00
mycroft adddd74e0e DANGER WILL ROBINSON!
We cannot store LWP pointers permanently in lock structures, for two reasons:
1) They are somewhat ephemeral.  Dangling pointers are bad.
2) A different LWP may issue the unlock, and in this case, we were not actually
   doing the unlock at all.  This was causing processes to exit without undoing
   fcntl(2) locks.  Furthermore, the locks are process-specific to begin with,
   so the test was just plain wrong.

Instead, we go back to storing a proc pointer for POSIX locks.  In addition, we
add an extra pointer to the LWP, which is used in deadlock detection.  After
the lock is granted, this pointer is 0ed and there is no reference to the LWP.

Now evolution can inc my mail again.
2003-03-05 18:28:22 +00:00
dsl 35df36296b Report correct values for p_uutime_{u}sec, p_ustime_{u}sec and p_uctime_{u}sec 2003-03-05 11:46:49 +00:00
dsl 15cb5a5b82 Apportion execution time evenly between stime and utime when the process
hasn't been interrupted by any profiling interrupts.
Collect time from all active LWPs.
2003-03-05 11:44:01 +00:00
dsl dc55700b28 Get processes execution time before the LWPs state is changed 2003-03-05 11:40:55 +00:00
jdolecek b83db8c688 only pull in/declare veriexec related stuff with VERIFIED_EXEC 2003-03-03 21:25:09 +00:00
enami ca4393664d ... and no need to aqcuire lock while free'ing old hash which no one
refers it.
2003-03-02 13:26:22 +00:00
enami e8083140e3 Cosmetic changes. 2003-03-01 23:48:44 +00:00
yamt ddb9465f5f make fdcheckstd f_slock friendly. 2003-03-01 09:19:53 +00:00
matt 6c3a6223d4 If we are doing TOPDOWN, we want to truncate the address downwards. If not,
we want to round the address upwards.  I hope this is the last change.
2003-03-01 05:55:51 +00:00
atatat 40f3045957 Add p_svuid and p_svgid to kinfo_proc2. Populate them in the kernel
and in libkvm.  Then teach ps how to show them to you.

Also, teach ps how to show the names for all the uids, the rest of the
group numbers, and the "group access list".
2003-03-01 05:41:55 +00:00
enami 5bb41745ed Cosmetic changes. 2003-02-28 23:24:40 +00:00
matt ad22a09f59 Make sure that the initial address is aligned correctly. Note that before
this alignment would have been backward into the dataspace covered by
MAXDSIZ.  Now the alignment is done forward.  XXX  It is expected that
in the TOPDOWN case, VM_DEFAULT_ADDRESS will make sure any address it
returns has the proper alignment for that architecure.
2003-02-28 19:44:42 +00:00
matt 261ba66908 When aligned to > PAGE_SIZE boundary, don't map any pages before where the
psection starts.  Allocate unused VA space between psections as unreadable.
2003-02-28 19:09:08 +00:00
matt f34e724286 Remove MAXDSIZ since VM_DEFAULT_ADDRESS adds it. Sigh. It was correct. 2003-02-28 00:11:14 +00:00
matt e39f39ac47 Note only trunc_page the psection vaddr, but truncate it accordoring to its
psection alignment.  XXX If the psection alignment is greater than the page
alignment, extra pages may be mapped that will never be needed.  This is
inefficient and wasteful of swap space and needs to be fixed.
2003-02-27 23:48:29 +00:00
matt 0731ed5a3d Fix a c&p bug when moving VM_DEFAULT_ADDRESS. (restore MAXDSIZ) 2003-02-27 23:10:52 +00:00
matt bc859d628d Remove VMCMD_TOPDOWN since it's no longer. Redo my last rework. Move
VM_DEFAULT_ADDRESS from elf*_makecmds to elf*_load_file.  In load_file,
actually determine ahead of time how much space will be needed and pass
that to VM_DEFAULT_ADDRESS.  Now we have a relatistic starting address
so we can do the loading of psections normally with no extra topdown
code in load_psection.  Also, if there is a gap in betweeen psections
zero map an inaccessible region between (just like ld.elf_so does) to
avoid inadvertant mmaps in the gap.
2003-02-27 01:58:56 +00:00
thorpej 922f0e9b78 Add hw.physpages and hw.userpages, which return the physmem and usermem
values as a u_quad (page count).  Necessary for reporting memory on systems
with >=4G.  Per disussion on wasabisystems.com!bsd-api-discuss.
2003-02-27 01:39:56 +00:00
thorpej b9d81d9cc9 Change a printf to an event counter. Callout event counters are conditional
on CALLOUT_EVENT_COUNTERS.
2003-02-26 23:13:19 +00:00
matt 9c3775aadf Make elf32 load_file work properly with TOPDOWN by mapping psections in
reverse order.  Remove TOPDOWN support from VMCMDs since elf32 does the
right stuff now.  With these changes, VAX can now use TOPDOWN.
2003-02-26 21:18:22 +00:00
matt a6c7337fa2 Remove leftover MBUFTRACE asserts. 2003-02-26 18:22:10 +00:00
drochner 72d6120d24 deactivate MBUFTRACE related KASSERT()s in the !MBUFTRACE case 2003-02-26 14:36:43 +00:00
matt 65e5548a17 Add MBUFTRACE kernel option.
Do a little mbuf rework while here.  Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *).  These are not performance critical and making them
call m_get saves considerable space.  Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.
2003-02-26 06:31:08 +00:00
jdolecek 3f362c0871 it appears one list of vnode type names should be enough 2003-02-25 23:35:03 +00:00
jdolecek b06fa82f3e make iftovt_tab[] const 2003-02-25 23:01:39 +00:00
thorpej eb14e86676 Add a new BUF_INIT() macro which initializes b_dep and b_interlock, and
use it.  This fixes a few places where either b_dep or b_interlock were
not properly initialized.
2003-02-25 20:35:31 +00:00
pk f82deea4bf Fix a simple_lock() mismatch in unp_internalize().
We may need to merge the passes over the files contained in the message
as noted by enami tsugutomo on tech-smp.
2003-02-25 09:56:15 +00:00
atatat 524df47498 Tweak some comments so that they match the other comments more properly. 2003-02-25 05:27:35 +00:00
perseant bd6cf7e127 Allow filesystems' VOP_IOCTL to catch ioctl calls on directories and
regular files.  Approved thorpej, fvdl.
2003-02-24 08:34:30 +00:00
pk 025e435477 Protect the event queue with a simple mutex; this only partially addresses
MP-safety issues in the event handling system.
2003-02-23 22:05:35 +00:00
pk f326711134 Use splsched() instead of splhigh() to protect the triggered event queues. 2003-02-23 21:44:26 +00:00
pk 8f9c32194c Use splvm() instead of splhigh() when accessing the internal page header pool. 2003-02-23 21:25:19 +00:00
pk 2931081a79 Make updating a file's reference and use count MP-safe. 2003-02-23 14:37:32 +00:00
tsutsui d6458621a3 Fix too many arguments for format warning in #ifdef DIAGNOSTIC part
detected by gcc-3.x.
2003-02-22 12:42:28 +00:00
nathanw fb8a5b2205 Set P_WEXIT earlier; specifically, before a pool_get(, PR_WAITOK) that
could sleep.

Pointed out by enami.
2003-02-22 01:00:14 +00:00
jdolecek b4a06ab5af simplify timeout handling code in kqueue_scan() 2003-02-21 20:57:09 +00:00
skrll e8f64a20cb typo in comment. 2003-02-21 16:30:48 +00:00
matt b411ef736c In topdown mode, subtract the page rounded memory size of the psection,
not the rounded file size.  Otherwise if BSS needs more pages beyond
data you'll extend too far.
2003-02-21 03:53:43 +00:00
atatat df0a9badc6 Introduce "top down" memory management for mmap()ed allocations. This
means that the dynamic linker gets mapped in at the top of available
user virtual memory (typically just below the stack), shared libraries
get mapped downwards from that point, and calls to mmap() that don't
specify a preferred address will get mapped in below those.

This means that the heap and the mmap()ed allocations will grow
towards each other, allowing one or the other to grow larger than
before.  Previously, the heap was limited to MAXDSIZ by the placement
of the dynamic linker (and the process's rlimits) and the space
available to mmap was hobbled by this reservation.

This is currently only enabled via an *option* for the i386 platform
(though other platforms are expected to follow).  Add "options
USE_TOPDOWN_VM" to your kernel config file, rerun config, and rebuild
your kernel to take advantage of this.

Note that the pmap_prefer() interface has not yet been modified to
play nicely with this, so those platforms require a bit more work
(most notably the sparc) before they can use this new memory
arrangement.

This change also introduces a VM_DEFAULT_ADDRESS() macro that picks
the appropriate default address based on the size of the allocation or
the size of the process's text segment accordingly.  Several drivers
and the SYSV SHM address assignment were changed to use this instead
of each one picking their own "default".
2003-02-20 22:16:05 +00:00
jmc ff58e08182 Move simple_lock after the hashinit's to avoid possible sleeping/malloc'ing
with a simplelock held.
2003-02-20 02:49:51 +00:00
pk 9ead24ac7a Use lock_printf() in SPINLOCK_SPINCHECK() and SLOCK_TRACE(). 2003-02-19 22:34:42 +00:00
jdolecek 382f8f9883 if emulation uses elf32_copyargs(), it shouldn't use it's own idea
of how many AUX arguments are actually passed

this fixes PR kern/20423 by Shingo WATANABE
2003-02-19 09:44:42 +00:00
jdolecek 2e574d6a8b add "VT_SMBFS" to vnode_tags[]
constify vnode_tags[] and vnode_types[]
2003-02-18 20:37:38 +00:00
wiz 9ceb9b4b15 Add newline character to logname change warning.
Noted missing by Sean Davis on tech-kern.
2003-02-18 19:26:23 +00:00
dsl b80a5f24c5 KNF kern_prot.c 2003-02-18 08:37:41 +00:00
nathanw 0cfe2d1c69 Test p->p_sa instead of p->p_flag & P_SA, as the latter may have been
cleared by sigexit().
2003-02-17 23:45:47 +00:00
nathanw 1e8f36c002 Clear L_SA from all LWPs in sigexit() to prevent any upcalls or
sa_switch() invocations while exiting. Test P_SA instead of L_SA, out
of paranoia. Avoids a possible remrunqueue panic reported by Havard
Eidnes.

Release the kernel lock before calling the userret function to exit in
sigexit(). Problem noted by Paul Kranenburg.
2003-02-17 23:45:00 +00:00
nathanw a87506d477 Note yet another SMP danger spot. 2003-02-17 23:32:33 +00:00
christos e2b7a1ed43 Add a ttyprintf_nolock() to be called when we are printing the ttyinfo
stuff, since we already have the lock.
Adjust tputchar so that it does not lock, when NOLOCK is passed in flags.
2003-02-17 22:23:14 +00:00
christos e5323a474c - remove __STDC__ crap. It did not work anyway with pre-ansi compilers, since
va_start() takes one arg, and va_alist must be the only argument of a
  varyadic in the K&R world.
- pass flags to tputchar.
2003-02-17 22:21:52 +00:00
provos 9a5e533a1a do not demand LLSLEEP in p_stat; this does not seem to happen with lwps;
todo: a proper fix that takes lwps into consideration
2003-02-16 20:24:47 +00:00
jdolecek fa2b78c32c regen:
- added __sigtimedwait(2)
- g/c sigwaitinfo(2) slot, move sigqueue(2) slot and free slot #246
2003-02-15 20:56:48 +00:00
jdolecek c58bfd1c36 add __sigtimedwait(2) - wait for specified set of signals, with optional
timeout
the semantics of 'timeout' parameter differ to POSIX for the syscall
(not const, may be modified by kernel if interrupted from the wait) -
libc will provide appropriate wrapper

since sigwaitinfo(2) will be implemented as wrapper around sigtimedwait()
too, remove it's reserved slot and move sigqueue slot 'up', freeing
slot #246
2003-02-15 20:54:38 +00:00
dsl 9926e89884 Fix support for 16 character lognames
(approved by christos)
2003-02-15 18:47:41 +00:00
dsl aed442201d Fix support of 15 and 16 character lognames.
Warn if the logname is changed within a session - usually a missing setsid.
(approved by christos)
2003-02-15 18:10:15 +00:00
pk 9ca040e74e Make the memory allocation code MP-safe. 2003-02-14 21:51:36 +00:00
pk 9a853301e6 Use a mutex to protect the global list of open files. 2003-02-14 21:50:10 +00:00
pk 87978ebf11 Make cache insertion, removal and lookup MP-safe. 2003-02-14 21:39:46 +00:00
nathanw 49f53e20ea Make sa_yieldcall also allocate a new LWP for the cache if it's empty.
(XXX sa_yieldcall() and sa_switchcall() should be combined and take
arg as the function to call, but I'm somewhat nervous about void *
vs. void (*)()).
2003-02-14 20:45:12 +00:00
drochner 36e90ce9e3 fix typo in comment 2003-02-14 18:25:34 +00:00
pk d2b7e43b18 On pipe reads, check for EOF before FNONBLOCK to avoid spurious EAGAIN errors. 2003-02-14 13:16:44 +00:00
dsl db17a870e0 Split sys_wait4 so that code isn't duplicated in compat tree.
(approved by christos)
2003-02-14 10:11:56 +00:00
pk 3cba4a9f1b Make the pipe code mostly MP-safe. There are a few unaddressed race
conditions at points where it's necessary to access both the up-stream
and down-stream parts of the bi-directional pipe data structure. These
are marked `XXXSMP' in the code.

Also, since the changes are pretty invasive, there little point in keeping
all the "#ifdef FreeBSD" code around; so all of that has been stripped out.
2003-02-12 21:54:15 +00:00
yamt f4585f067a - don't compare c_time directly.
- in callout_hardclock, test if timeout_todo is empty or not
  before release the lock.
2003-02-11 09:43:37 +00:00
nathanw 158b157b2a Move stack allocation in case 1 of sa_switch() to after the
sau == NULL check, to avoid a stack leak in the error case.

Spotted by enami.
2003-02-11 00:03:47 +00:00
drochner d229e1e550 replace &(a?b:c) by (a?&b:&c), so that it looks more like an lvalue
(to lint at least)
approved by thorpej
2003-02-10 19:18:56 +00:00
nathanw 695bc028ab Since sadata_upcall_alloc(1) can sleep, call it before checking the
supply of stacks, to avoid a race. Problem pointed out by Lars
Heidieker on current-users.
2003-02-10 19:02:52 +00:00
atatat a8481319cb Add a kern.dump_on_panic sysctl variable (and documentation, and a
kernel config option) that controls whether the kernel dumps to the
dump device on panic.  Dumps can still be forced via the ``sync''
command from ddb.  Defaults to ``on''.
2003-02-10 00:35:15 +00:00
jdolecek 573bb6afc9 const msgs[] some more 2003-02-09 09:14:58 +00:00
nathanw b5a9638ee1 Adapt to the new conventions of proc_unstop() and don't try to call
setrunnable(NULL).
2003-02-07 21:44:45 +00:00
nathanw 4c99df7fcc Two fixes:
* Change the semantics of proc_unstop() slightly, so that it is
   responsible for making all stopped LWPs runnable, instead of
   all-but-one. Return value is a LWP that can be interrupted if doing
   so is necessary to take a signal. Adjust callers of proc_stop() to
   the new, simpler semantics.

 * When a non-continue signal is delivered to a stopped process and
   there is a LWP sleeping interruptably, call setrunnable() (by way
   of the 'out:' target in psignal1) instead of calling unsleep() so
   that it becomes LSSTOP in issignal() and continuable by
   proc_unstop(). Addresses PR kern/19990 by Martin Husemann, with
   suggestions from enami tsugutomo.
2003-02-07 21:43:18 +00:00
jdolecek 018aae11cd use LIST_FOREACH() macro in proc_stop()/proc_unstop()
rewrite contents of the loop in proc_unstop to be a bit more easily
comprehensible
2003-02-07 09:02:14 +00:00
pk 9d74642196 XXX ttioctl(): some drivers call back on us from t_param(), so delay acquiring
tty spin lock until after t_param() returns.

Require t_param() to unlock upon callback?
2003-02-06 12:21:21 +00:00
pk 1262bf7cb5 bdwrite(): remove check for MFS major device number (why was 255 changed
to 4096?). In any case, bdevsw_lookup() will take care of it.
2003-02-06 11:46:49 +00:00
pk 9df517d22e In getnewbuf(), release the buffer queue lock before calling bawrite() and
re-acquire it afterward.
2003-02-06 11:22:35 +00:00
pk 408ae56abd Require the bdirty() be called at splbio() and with the buffer interlock held.
This is essentially just a helper routine called from biodone() through
ffs softdep's I/O completion, to re-queue the buffer.
2003-02-06 09:46:46 +00:00
pk 338f31f581 Make the buffer cache code MP-safe. 2003-02-05 21:38:38 +00:00
pk bb52ffdf64 Make the tty subsystem MP-safe..
..as far as mere mortals are able to, since this code illustrates the finest
points that Italian haute cuisine has to offer.
2003-02-05 15:49:02 +00:00
briggs c17a890fc8 Fix DIAGNOSTIC printf format. 2003-02-05 15:38:14 +00:00
nakayama 8920acd333 Switch to use cycle counter (%tick) based microtime().
This is derived from alpha/microtime.c and i386/tsc_microtime.c,
and will share with both ports.

This should fix PR port-sparc64/18452.
(approved by martin)
2003-02-05 12:06:51 +00:00
pk e148067544 ltsleep(): deal with PNOEXITERR after re-taking the interlock (if necessary). 2003-02-04 20:15:59 +00:00
jdolecek f02bf3cc39 add XXX coment to sadata_upcall_alloc() noting this might need to zero memory
use 'l' for sa_yield() tsleep call; sa->sa_idle == l there
add DIAGNOSTIC printf on one more place in sa_upcall_userret() where
we kill process with SIGILL
2003-02-04 15:54:26 +00:00
jdolecek 920114e6e6 itimerfire(): fix bug in previous - if two or more timers would
fire close together, the second (and every other) timer would be
added to mask incorrectly - timerid value would be shifted twice,
and sa_upcall() would later kill process with SIGILL
2003-02-04 15:50:06 +00:00
jdolecek e74edaffe1 cosmetic - use type 'timer_t' for timerid local in sys_timer_create()
and sys_timer_delete()
2003-02-04 15:46:39 +00:00
yamt 05628fc8d1 constify wait channels of ltsleep/wakeup. they are never dereferenced. 2003-02-04 13:41:48 +00:00
martin 968efa18d6 Format fix for archs where ptrdiff_t != int. 2003-02-04 10:14:53 +00:00
jdolecek 97ec641999 Introduce EVFILT_TIMER, which allows a process to establish an
arbitrary number of timers, both oneshot and periodic.

from FreeBSD, only adapted to NetBSD kernel API - mstohz() instead
of tvtohz(), and takes advantage of callout_schedule() in filt_timerexpire()
2003-02-04 09:02:04 +00:00
thorpej 1b84adbe5f New callout implementation. This is based on callwheel implementation
done by Artur Grabowski and Thomas Nordin for OpenBSD, which is more
efficient in several ways than the callwheel implementation that it is
replacing.  It has been adapted to our pre-existing callout API, and
also provides the slightly more efficient (and much more intuitive)
API (adapted to the callout_*() naming scheme) that the OpenBSD version
provides.

Among other things, this shaves a bunch of cycles off rescheduling-in-
the-future a callout which is already scheduled, which the common case
for TCP timers (notably REXMT and KEEP).

The API has been simplified a bit, as well.  The (very confusing to
a good many people) "ACTIVE" state for callouts has gone away.  There
is now only "PENDING" (scheduled to fire in the future) and "EXPIRED"
(has fired, and the function called).

Kernel version bump not done; we'll ride the 1.6N bump that happened
with the malloc(9) change.
2003-02-04 01:21:03 +00:00
nathanw 86c56c4ffe Prevent one timer from overrunning another with the current userret
mechanism by keeping a list (bitset) of which timers have fired and using
that list in the upcall (Does this sound familiar? SEND HELP NEED SIGINFO).

Provoke the idle LWP into running again with setrunnable(sa->sa_idle)
instead of a wakeup() call, since we know what it is.
2003-02-03 23:39:40 +00:00
nathanw 6722952b21 In sa_yield(), sleep on a p->p_sa->sa_idle instead of just p, to avoid
being woken up by the the reaper when a child process is cleaned up
(SIGCHLD will still cause this to run, and threads actually waiting
for the child will still see the wakeup, of course).

Should fix various spurious wakeups that manifest as assertion
failures in pthread__idle().
2003-02-03 23:31:42 +00:00
jdolecek 373f926356 use LIST_FOREACH() for iteration over p_lwps
when panniccing with 'Invalid process state', print the state too
2003-02-03 22:56:23 +00:00
kleink 71d7654509 Add sysconf(3) knobs for recent additions. 2003-02-02 20:33:05 +00:00
erh 982065fbae Remove nswbuf since it is entirely unused. 2003-02-01 21:07:01 +00:00
mrg bf26b4d9e4 in devsw_name2blk(), as we use strncmp(), make sure the next character
in the device is either nul or a digit.  this avoids "raid0" being
matched as the "ra" device (and thus failing to find anything at all
causing my raid0 root to fail) on my vax.
2003-02-01 11:12:35 +00:00
atatat df8c6eff19 Check for (and deny) negative values passed to FIOGETBMAP. 2003-02-01 07:23:56 +00:00
thorpej b193480908 Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
2003-02-01 06:23:35 +00:00
thorpej 515d52e9e7 Change ext_size to a size_t, and update the signature of ext_free. 2003-01-31 05:00:24 +00:00
thorpej e5e7fae215 ANSI'ify. 2003-01-31 04:55:52 +00:00
atatat 7a8e4b4bc4 Two small changes to the ELF exec code:
(1) ELFNAME(load_file)() now takes a pointer to the entry point
offset, instead of taking a pointer to the entry point itself.  This
allows proper adjustment of the ultimate entry point at a higher level
if the object containing the entry point is moved before the exec is
finished.

(2) Introduce VMCMD_FIXED, which means the address at which a given
vmcmd describes a mapping is fixed (ie, should not be moved).  Don't
set this for entries pertaining to ld.so.

Also some minor comment/whitespace tweaks.
2003-01-30 20:03:46 +00:00
matt 161af1dd62 Add a KASSERT when copying l1->l_cpu to l2->l_cpu 2003-01-30 05:51:58 +00:00
nathanw d2027d4d00 Fix _lwp_wakeup() so that it stands a chance of working (although it
turns out to be insufficent for signal-level interruption of system
calls. guess we need _lwp_kill(), ugh).
2003-01-29 23:27:54 +00:00
nathanw 892c25bc38 Fix proc_representative_lwp(); a closing brace was in the wrong place,
which means it would return the first non-dead LWP.

Pointed out by Stephan Uphoff.
2003-01-28 02:20:35 +00:00
pk 5e14aa69a8 There's a locking order issue with the scheduler and the callwheel locks
as ltsleep() may call callout_reset() with the scheduler lock held.
So, prevent interrupts that may take the scheduler lock while holding
the callwheel lock.
2003-01-27 22:38:24 +00:00
nathanw 01ca174f62 Call exit_lwps() from exit1() if there is more than one LWP (as
recorded by p_nlwps) *or* if the process was a SA process. Since
cached SA LWPs aren't counted in p_nlwps, it was possible for
them to not be cleaned up and remain on the alllwp list, pointing to a
dead proc.
2003-01-27 20:30:32 +00:00
fvdl a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
thorpej 0139305811 Major overhaul of this code, fixing locking protocol issues and handling
of semaphores at fork time.
2003-01-24 01:46:27 +00:00
thorpej 3ff1552cc5 Add "fork hooks", a'la "exec hooks" and "exit hooks" which allow
subsystems to do special processing to the parent and/or child at
fork time.
2003-01-24 01:42:52 +00:00
thorpej 157e66459d Regen; reserve slots for <mqueue.h> and <sched.h> system calls. 2003-01-24 01:28:05 +00:00
thorpej 237ebf04da Reserve slots for the p1003.1b scheduler system calls. 2003-01-24 01:27:21 +00:00
thorpej c8c6d5ea40 Reserve slots for p1003.1b message queue calls. 2003-01-24 01:23:27 +00:00
thorpej 30427190e0 Regen; allocate slot for _ksem_timedwait(). 2003-01-24 01:18:50 +00:00
thorpej 9331f2b780 Allocate a slot for _ksem_timedwait(), although it is not currently
implemented.
2003-01-24 01:17:53 +00:00
thorpej 9243a2a667 Regen; allow ktruss/kdump to properly see _ksem_*(). 2003-01-23 23:31:36 +00:00
thorpej 5db6496bbc Allow the _ksem_*() syscalls to be properly seen by ktruss/kdump. 2003-01-23 23:29:46 +00:00
christos 3ea86aec06 PT_DUMPCORE support. 2003-01-23 17:35:18 +00:00
yamt 41ad61ee76 make KSTACK_CHECK_* compile after sa merge. 2003-01-22 12:52:14 +00:00
christos d00d441811 step 4: don't de-reference l, if you are going to test if it is NULL a couple
of lines below.
2003-01-21 00:02:07 +00:00
christos 2cc65e9f5e step 2: fix sync so that it does not dereference null lwp and assign p properly. 2003-01-21 00:00:10 +00:00
christos 416978b15b The hunt to make sync work from ddb again begins here.
Protect against lwp null dereference. set proc p properly.
2003-01-20 23:59:14 +00:00
christos 0f6167a798 name the component that should be leaf in the diagnostic. 2003-01-20 23:57:49 +00:00
christos 326105323e regen 2003-01-20 20:25:04 +00:00
christos 1dbdd7cc6d sys_ksem -> sys__ksem 2003-01-20 20:24:21 +00:00
christos f82c14c1fc regen 2003-01-20 20:06:25 +00:00
christos 4a037b0375 actually, remove ksem.h 2003-01-20 20:04:28 +00:00
christos f64e9a84b1 semaphore.h -> ksem.h 2003-01-20 20:03:38 +00:00
christos 1df6f4ff40 add support for p1003.1b semaphores. From FreeBSD 2003-01-20 20:02:56 +00:00
thorpej 5da0f97ce6 Make this compile again on i386 by avoiding an unused variable
warning.
2003-01-20 01:40:48 +00:00
simonb 1354fecf22 b_to_q() and q_to_b() take a "u_char *" argument, so use a u_char array
in one place, and don't cast a "u_char *" to a "char *" in the q_to_b()
call(!) in another.
2003-01-19 23:11:46 +00:00
simonb 81b473285b Make the char_type array "unsigned char" since we stuff values > 0x80
into it.
2003-01-19 23:07:32 +00:00
simonb d446cbf4ee Remove variable that is only assigned too but not referenced. 2003-01-19 22:52:11 +00:00
pk 7f03dc8c13 _simple_lock(): revert to IPL at entry while spinning on the lock; raise
to spllock() again after we get it.
2003-01-19 14:40:55 +00:00
scw 34db3d4652 Cast integer to pointer via intptr_t. 2003-01-19 12:59:59 +00:00
thorpej a03cb2b851 Regen to get correct RCS ID. 2003-01-18 23:28:15 +00:00
thorpej 022e5e7902 Regen: Merge the nathanw_sa branch. 2003-01-18 10:08:00 +00:00
thorpej e0d8d366df Merge the nathanw_sa branch. 2003-01-18 10:06:22 +00:00
itojun 40606ab8f2 switch from kame-based m_aux mbuf auxiliary data, to openbsd m_tag
implementation.  it will simplify porting across *bsd (such as kame/altq),
and make us more synchronized.  from Joel Wilsson
2003-01-17 08:11:49 +00:00
pk c70db21e38 lock_printf(): use vsnprintf/printf_nolog to avoid covertly using the system
log and thereby invoking scheduler code.
2003-01-15 23:11:05 +00:00
thorpej b9cdec841a Pass the process priority we want to compare to resched_proc(). Restores
resetpriority() behavior.  Thanks to Enami Tsugutomo for pointing out my
mistake.
2003-01-15 07:12:20 +00:00
matt c838a0fb9e In vmcmd_readvn, if the page is mapped executable and PMAP_NEED_PROCWR
is defined, call pmap_procwr to synchronize the icache.  This fixes the
problem of dynamic programs crashing on powerpc systems.
2003-01-12 05:24:17 +00:00
pk da40c6dd43 schedcpu(): after updating the process CPU tick counters, we no longer need
to run at splstatclock(); continue at splsched().
2003-01-12 01:48:56 +00:00
msaitoh f0f871744a remove cinit()
This functions is completely null, not called from anywhere and
defined since rev. 1.1 (July 1993).
2003-01-08 12:00:25 +00:00
wiz 1035faff1d writable, not writeable. 2003-01-06 20:30:28 +00:00
wiz a2278794f4 descriptor, not decriptor. 2003-01-06 13:19:51 +00:00
mrg 78ccb64bb2 move #include <sys/reboot.h> with the rest of the <sys/...> headers. 2003-01-02 00:12:16 +00:00
augustss 33c067f13e Make it compile without USERCONF. 2003-01-01 17:06:59 +00:00
mycroft d73e77b28c Update copyright notice. 2003-01-01 00:00:13 +00:00
thorpej 0d3b1b8a4f Add support for quiet and silent boots to the autoconfiguration
message machinery.

Quiet boots look like this (inspired by BSD/OS):
.
.
Found tlp0 at pci0
.
.
Found wd0 at wdc0
.
.

Silent boots look like this:
.
.
Detecting hardware...<twiddle>done.
.
.

NOTE: This requires cooperation on the part of all device drivers,
changes to which have not yet been checked in.
2002-12-31 23:59:11 +00:00
thorpej f631b51555 Add aprint_error(), which is like aprint_normal(), but also records
the number of times it is called.  This allows subsystems to report
the number of errors that occurred during a quiet/silent subsystem
startup.  aprint_get_error_count() reports this count and resets it
to 0.

Also add printf_nolog(), which is like printf(), but prevents the
output from hitting the system log.
2002-12-31 23:45:36 +00:00
thorpej 3770328cab Add the following message printing routines, designed for printing
autoconfiguration messages:

aprint_normal: Send to console unless AB_QUIET.  Always goes to the log.
aprint_naive: Send to console only if AB_QUIET.  Never goes to the log.
aprint_verbose: Send to console only if AB_VERBOSE.  Always goes to the log.
aprint_debug: Send to console and log only if AB_DEBUG.

API inspired by the same routines in BSD/OS.

Will be used to address kern/5155.
2002-12-31 17:48:03 +00:00
thorpej 438dc24855 Partially expose some of the kernel printf internals in the new
<sys/kprintf.h> header file.  This allows subsystems that need
printf semantics other than what are provided by the standard
kernel printf routines to implement exactly what they want.
2002-12-31 16:53:26 +00:00
thorpej 85c31b11c3 * Move the resched check from setrunnable() and resetpriority() to
a new inline, resched_proc().
* When performing the resched check, check the priority against the
  current priority on the CPU the process last ran on, not always the
  current CPU.
2002-12-29 17:40:26 +00:00
yamt 78d9abec0c sync comment for vflush with reality.
from FreeBSD.
2002-12-29 06:47:57 +00:00
thorpej 63ccfc36f6 Add a comment about affinity to awaken(). 2002-12-29 02:08:39 +00:00
gmcgarry f8f2c11fe0 Re-add yield(). Only used by compat code at the moment. 2002-12-21 23:52:05 +00:00
manu 4a06119a9d Pass the system call table to trace_enter() and ktrsys() so that it is
possible to use alternate system call tables. This is usefull for
displaying correctly the arguments in Mach binaries traces.

If NULL is given, then the regular systam call table for the process is used.
2002-12-21 16:23:56 +00:00
gmcgarry a5424a9df1 Remove yield() until the scheduler supports the sched_yield(2) system
call.
2002-12-20 05:43:09 +00:00
gmcgarry 74da856861 yield() -> preempt(). 2002-12-20 05:06:25 +00:00
thorpej 4c82425f5e Regen: reserved syscall slots for sigwaitinfo(2), sigtimedwait(2),
and sigqueue(2).
2002-12-19 23:53:42 +00:00
thorpej 39e4cd68c4 Reserve syscall slots for sigwaitinfo(2), sigtimedwait(2), and
sigqueue(2).
2002-12-19 23:51:00 +00:00
manu 5ba396cfb3 Added support for exchange of Mach messages between processes.
This does not buy us new functionnality for now, because we still have to
discover how mach_init (which acts as a name server, enabling processes to
discover each other's ports) is able to receive messages from other processes
(this is a bootstrap problem, and the bootstrap port might be the place to
search).

While we are there:
- removed a lot of debug which is now available using ktrace.
- reworked message handling to avoid mutliple copyin/copyout of the
same data. ktrace of Mach message now uses the in-kernel copy of the
message instead of copying it from userland.
- packed mach trap handlers arguments into a structure to avoid modifying
everything next time we have to add an argument.
2002-12-17 18:42:54 +00:00
jdolecek 94062cc04a add support for optional arch-specific restriction of valid value
for kern.maxproc
2002-12-16 18:15:18 +00:00
jdolecek 300acddf8c don't allow kern.maxproc bigger than PID_MAX - PID_SKIP; the pid allocation
code in fork1() would enter endless loop if all the allowed pids are taken
by running processes
2002-12-12 20:54:58 +00:00
jdolecek d18332248c replace magic number '500' in pid allocation code with a macro PID_SKIP,
defined in <sys/proc.h> (along PID_MAX, NO_PID)
2002-12-12 20:41:45 +00:00
christos 80564fa341 always compile in mach ktrace support; it is to small to bother. 2002-12-12 17:40:40 +00:00
abs 39387a63f4 Define nofile and maxuprc variables (set to NOFILE and MAXUPRC), so they can
be patched in a compiled kernel.
2002-12-11 23:23:45 +00:00
manu 4d607adf4f Load __OBJC and ____CGSERVER sections of Mach-O binaries as __TEXT. 2002-12-11 19:28:41 +00:00
jdolecek 5fd22809a5 Add kern.forkfsleep sysctl - set/get time (in miliseconds) for which
process would be forced to sleep in fork() if it hits either global
or user maxproc limit. Default is zero (no forced sleep).
Maximum is 20 seconds.
2002-12-11 19:14:34 +00:00
atatat 7ede0eeb03 Provide a ioctl called FIOGETBMAP (there are some who call
it...FIBMAP) that translates a logical block number to a physical
block number from the underlying device.  Via VOP_BMAP().
2002-12-11 18:25:03 +00:00
jdolecek f13ab92159 put back portion of fork-bomb protection removed in last commit,
and make the sleep length depend on value of variable forkfsleep;
it's set to zero by default (no sleep)
this is a preparation for making the sleep length settable via sysctl
2002-12-11 18:09:07 +00:00
scw 39a5a9dc76 Add two sysctls: kern.labelsector and kern.labeloffset.
These are of use to userland code which previously depended on the
hard-coded values of LABELSECTOR and LABELOFFSET to figure out the
location of the disklabel for a particular platform.

With the introduction of umbrella ports such as evbarm, evbmips, etc,
the location of the disklabel may vary between kernels for the same
MACHINE. This sysctl will allow userland programs to remain independent
of the particular flavour of MACHINE in such cases.
2002-12-11 12:59:29 +00:00
groo b9df764f32 Remove portion of fork-bomb protection that has unfortunate side effects. 2002-12-11 05:01:22 +00:00
thorpej e8cc3884de Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is. 2002-12-10 17:14:02 +00:00
thorpej 78ea2dd367 Use __LDPGSZ (which must be == USRTEXT) as the text address for a.out
executables, and eliminate the USRTEXT constant, which was only used
by the a.out exec code.
2002-12-10 05:14:24 +00:00
manu 6492e2171f Added support for dumping mach messages in ktrace/kdump. While we are
there, KNFify a few functions.
2002-12-09 21:29:20 +00:00
christos 0948705ad2 s/NOSYMLINK/O_NOFOLLOW/ 2002-12-06 22:44:49 +00:00
jdolecek 4c7e9f23da pipe_stat(): add S_IRUSR and S_IWUSR to mode; this is what Linux does,
and seems like generally sensible (more sensible than not doing so), so done
in generic code rather than compat glue only

Change proposed in PR kern/18767 by Emmanuel Dreyfus.
2002-12-05 16:30:55 +00:00
jdolecek 16e3e3cd55 Couple fork-bomb defense changes:
- leave 5 processes for root-only use, the previous value of 1
  was unsufficient to execute additional commands once logged, and
  perhaps also not enough to actually login remotely with recent (open)sshd
- protect the log of "proc: table full" with ratecheck(), so that
  the message is only logged once per 10 seconds; though syslogd normally
  doesn't pass the repeated messages through, this avoids flooding
  syslogd and potentially also screen/logs
- If the process hits either system limit of number of processes in system,
  or user's limit of same, force the process to sleep for 0.5 seconds
  before returning failure. This turns 2000 rampaging fork monsters into
  2000 harmlessly snoozing fork monsters.
  The sleep is intentionally uninterruptible by signals.

These are not intended as ultimate protection agains fork-bombs.
Determined attacker can eat CPU differently than via repeating
fork() calls. But this is good enough to help protect against
programming mistakes or simple-minded tests.

Based on FreeBSD kern_fork.c change in revision 1.132 by
Mike Silbersack <silby at FreeBSD org>

Change also discussed on tech-kern@NetBSD.org, thread
'Fork bomb protection patch'.
2002-12-05 16:24:46 +00:00
yamt 172a847692 initialize uvm.aiodoned_proc. 2002-12-05 10:30:00 +00:00
jdolecek 2c21ec9d61 Unfortunately, we can't really know if select collision is needed
until after wakeup event, so we can't clear the SI_COLL flag
in selrecord(). Thus, effectively back rev. 1.57 off.

Problem reported in PR kern/17517 by David Laight, program triggering
the problem is in regress/sys/kern/poll/poll3w.c.
2002-11-30 13:46:58 +00:00
jdolecek 555659c55c there is single emul_irix now
use irix_n32_setregs for the IRIX n32 execsw entry
2002-11-30 13:19:37 +00:00
manu 005949afda cosmetic fix 2002-11-30 11:20:51 +00:00
jdolecek 615f789e98 fix typo in comment. pointed out by David Sainty 2002-11-30 09:59:22 +00:00
jdolecek e0d29a5578 fix bug in previous - if child was traced and p_opptr == p_pptr,
need to reparent the process to initproc, so that child wouldn't
have its p_pptr pointer still pointing on the exited parent

pointed out by Dave Sainty in private mail (the patch in kern/14443
didn't have this bug)
2002-11-30 09:54:43 +00:00
jdolecek a45e0497c5 selwakeup(): don't bother with pfind() in SI_COLL case; sel_pid is always zero
in this case, and even if not, the process would be already woken up by the
wakeup() call
change sent as part of kern/17517 by David Laight

XXX perhaps should KASSERT() sel_pid is zero in the SI_COLL case
2002-11-29 19:48:22 +00:00
manu 39b522c107 back out the previous change, which is useless. Darwin loads the libraries
that are required by the binary, not the libraries required by the libraries
required by the binary.

Hopefully, binaries should load again on i386.
2002-11-29 15:49:09 +00:00
manu b36d0c1bf6 Maitain a chainedlist of already loaded Mach-O objects, to avoid loading
the same file multiple times because of recursive loading (ie: libx require
liby and libz and liby require libz, so libz would be loaded twice)

This is probably suboptimal, but it enable /bin/sh to load on the PowerPC,
so it's a good interim solution until we figure precisely how things should
work.

I'm not sure whether this makes the excessive recursive check useless or not.
2002-11-29 11:31:11 +00:00
jdolecek b439ca6951 exit1(): make sure that, if orphaned child is being traced, it's
reparented back to original parent before it's killed.
This makes the original parent aware that the child has exited if
the debugger failed to wait() on the debugged zombie before exiting.
Since we clear tracing flags before killing the child, the reparenting
logic in wait4() wouldn't be triggered, so it's necessary to do it here.

Problem reported and fix provided in kern/14443 by David Sainty.
2002-11-28 21:41:29 +00:00
jdolecek dc55168cb6 issignal(): put apparently long-forgotten (at least since 4.4BSD)
debug printf inside #ifdef DEBUG_ISSIGNAL

This adresses kern/16760 by Love.
2002-11-28 21:00:27 +00:00
itojun ae1b88aa21 "tv->tv_sec * hz" could overflow a long. millert@openbsd 2002-11-27 04:07:42 +00:00
itojun dfd721e53e small SO_RCVTIMEO values are mistakenly taken to be zero. FreeBSD PR kern/32827. 2002-11-27 03:36:04 +00:00
christos e22906f6d0 si_ -> sel_ to avoid conflicts with siginfo. 2002-11-26 18:44:34 +00:00
itojun f81516ac1f 1.8 committed by mistake 2002-11-25 08:50:07 +00:00
itojun a1a2fcda1e no need for error check after MEXTMALLOC - jdolecek 2002-11-25 08:31:58 +00:00
itojun 387ba53bc6 MEXTMALLOC() can fail even if M_WAITOK, if arg is too big for malloc(). 2002-11-25 06:32:37 +00:00
manu 589ff87f68 Rewrite the excessive recursive loading protection by actually counting the
recursions instead of the total function calls. We limit to 6 recursion,
which is what Darwin does.
2002-11-24 21:59:43 +00:00
thorpej 3d64e26035 Add an EVCNT_ATTACH_STATIC() macro which gathers static evcnts
into a link set, which are added to the list of event counters
at boot time.
2002-11-24 17:33:43 +00:00
scw 0f91ed3dfa Quell uninitialised variable warnings. 2002-11-24 11:37:54 +00:00
manu 0e734a6755 Libraries do not use relative addresses, they are absolute and should be
treated as such if we want the same mapping as in Darwin.

While we are there KNFify function names
2002-11-22 23:09:46 +00:00
manu f528c56f39 Check for excessive recursive Mach-O loading 2002-11-21 22:30:32 +00:00
manu ae6b5562b1 Remove a debug message that has been committed by mistake. 2002-11-21 22:01:45 +00:00
manu af59b63bbd We now have the exact stack initial stack layout of Darwin:
macho_hdr, argc, *argv, NULL, *envp, NULL, progname, NULL,
*progname, **argv, **envp

Where progname is a pointer to the program name as given in the first
argument to execve(), and macho_hdr a pointer to the Mach-O header at
the beginning of the executable file.
2002-11-21 19:53:40 +00:00
simonb 928196073c White-space nits. 2002-11-20 04:29:31 +00:00
chs ab17ec89d1 add support for __MACHINE_STACK_GROWS_UP platforms. from fredette@ 2002-11-17 22:53:46 +00:00
chs ab08c3ab73 support a variant of the "member" keyword where the symbol defined
is different from the actual member name.
2002-11-17 19:24:50 +00:00
chs 4b2625143d change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.
2002-11-17 08:32:43 +00:00
uebayasi c041971257 Fix compilation errors introduced by recent trace_enter()/ktrsyscall() changes.
Provided by FUKAUMI Naoki <naoki at fukaumi dot org> in kern/19070.
2002-11-16 07:40:38 +00:00
manu d584ed9598 Add a realcode argument to trace_enter and ktrsyscall. realcode is the
original system call number, which can be negative for a Mach trap.
We cannot just replace code by realcode, because ktrsyscall uses it as
an index in the system call table, thus crashing the kernel when the
value is negative.
2002-11-15 20:06:00 +00:00
jdolecek cedc87712e ELF copyargs: at the time this is executed, process's ucred doesn't
contain the new uid/gid for suid/sgid binaries yet; determine AT_EUID
and AT_EGID by checking executed program vnode attributes in this case
2002-11-13 15:49:44 +00:00
jdolecek cee43b67cc add generic linux compat ELF copyargs function
this gives:
* linux sysconf(_SC_CLK_TCK) gives correct value for linux binaries (hz)
  even if hz != 100
* glibc gets proper information on real/effective uid and enables
  secure mode for suid binaries

g/c LINUX_COPYARGS_FUNCTION, replaced by linux ELF copyargs function
g/c alpha-specific linux ELF copyargs function and linux ELF defines
2002-11-13 15:16:27 +00:00
provos a5883f1616 fix systrace panic that was introduced when postponing pid number allocation
approved itojun
2002-11-13 00:51:02 +00:00
manu 530968e795 The kernel now builds with COMPAT_DARWIN. 2002-11-12 23:40:19 +00:00
blymn c4774e1260 * Don't keep evaluating fingerprint if there is no fingerprints for the
device.  Should help performance when no fingerprints are loaded.
* Back down the securelevel, now securelevel of 2 will make lack of
  fingerprint or fingerprint mismatch a fatal error.  Previously this
  was done at securelevel 3 or greater.
2002-11-12 12:54:36 +00:00
jdolecek c771eafacf add comments for trace_enter()/trace_exit(); particularily comment
expected value of 'code'
2002-11-11 10:43:54 +00:00
fvdl d0e6437e6d Back out previous, it caused compile errors in kern_fork.c. ISSET
and friends should either be made first-class citizens and moved
to an include file (systm.h perhaps), or nuked completely, but
not be redefined in a lot of files.
2002-11-10 14:01:57 +00:00
jdolecek 0a0804119d move definitions of custom SET()/ISSET()/CLR() macros from
sys/systrace.h to kern/kern_systrace.c
2002-11-10 10:01:03 +00:00
thorpej e0fb587e4e Avoid signed/unsigned comparison and strict alias warnings. 2002-11-10 03:35:31 +00:00
thorpej dccc71f1fe Fix signed/unsigned comparison warnings. 2002-11-10 03:28:59 +00:00
thorpej ff114c4a59 Fix signed/unsigned comparison warnings. 2002-11-09 20:06:07 +00:00
manu 99bc517790 Added sysctl to change all IRIX kernel values reported by uname and systeminfo:
OS name, hw name, kernel version, and so forth.
2002-11-09 09:03:56 +00:00
jdolecek 1e0e4766d3 kevent(2): if the specified timeout is >=1ns and <1us, perform a poll
rather than waiting forever due to TIMESPEC_TO_TIMEVAL() conversion
2002-11-08 20:26:50 +00:00
enami c07ab7ce9f Parse the modifier of ddb command as documented. 2002-11-08 02:08:57 +00:00
manu 9a4dfe85fa Added two sysctl-able flags: proc.curproc.stopfork and proc.curproc.stopexec
that can be used to block a process after fork(2) or exec(2) calls. The
new process is created in the SSTOP state and is never scheduled for running.

This feature is designed so that it is esay to attach the process using gdb
before it has done anything.

It works also with sproc, kthread_create, clone...
2002-11-07 00:22:28 +00:00
enami 8f82ec28ee Factor out the COMPAT_16 code. 2002-11-06 02:31:34 +00:00
mrg 3e8df71794 - do the COMPAT_16 dance in sysctl_diskstats() for the where == NULL case
as well.  pointed out by enami@.
- defflag COMPAT_16.
2002-11-05 13:22:32 +00:00
thorpej 80f8dbe30a Add a new VM map, lkm_map, which machine-dependent code can provide
in the event that it needs to use a special VM range (x86_64 falls
into this category).  We fall back onto kernel_map if machine-dependent
code doesn't create a special map.
2002-11-05 01:24:35 +00:00
mrg 5cad86b3ea repair backwards compatibility with netbsd 1.6 - if we are not given the
wanted sizeof(struct disk_sysctl), use the old size.  for non-COMPAT_16,
however, we return EINVAL so that all future programs are forced into
passing the wanted size.  1.6 iostat(8) works with -current kernel again.

as seen on tech-kern.
2002-11-04 03:50:07 +00:00
nisimura da22f42379 Add some informative comments about setrunqueue and remrunqueue. 2002-11-03 13:59:12 +00:00
perry 6858187df6 /*CONTCOND*/ while (0)'ed macros 2002-11-02 07:20:42 +00:00