Commit Graph

3293 Commits

Author SHA1 Message Date
provos cb0252af40 avoid a panic due to recent changes in kern_fork.c; prepare for lwp by
keeping messages independent of the process itself
2003-03-30 00:40:05 +00:00
wiz 0acfa3bb9e Consistently spell occurrence with two rs. 2003-03-29 22:48:37 +00:00
jdolecek 5fe02453b5 put back nmaxproc check mistakely changed in rev.1.132
checking against nprocs is wrong in any case btw - we do allow
maxproc higher than number of current processes, it would just mean
no new process could be started until number of processes would
be lower than the new limit
2003-03-27 18:34:18 +00:00
jdolecek 479a3334a4 sys_setreuid(): parenthesize the ruid check in ?: condition, so that
it would be more difficult to mistake == for = when reading it
2003-03-27 17:47:45 +00:00
jdolecek 0be1da3379 switch to LIST_FOREACH() in selrecord() 2003-03-26 17:50:16 +00:00
jdolecek a834690527 use LIST_FOREACH() in selwakeup() for the process's lwp walk loop 2003-03-22 14:13:06 +00:00
dsl 6f803e005b Correct rewinding if FIONBIO or FIOASYNC fail in F_SETFL
(code use to always turn off FIONBIO if FIOASYNC fails)
(approved by christos)
2003-03-22 10:39:47 +00:00
dsl 1f2e35430b Change caddr_t to void * 2003-03-22 10:35:01 +00:00
dsl bd99e3429d Use 'void *' instead of 'caddr_t' in prototypes of VOP_IOCTL, VOP_FCNTL
and VOP_ADVLOCK, delete casts from callers (and some to copyin/out).
2003-03-21 23:11:19 +00:00
dsl 60418b39b7 Change 'data' argument to fo_ioctl and fo_fcntl from 'caddr_t' to 'void *'.
Avoids a lot of casting and removes the need for some line breaks.
Removed a load of (caddr_t) casts from calls to copyin/copyout as well.
(approved by christos - he has a plan to remove caddr_t...)
2003-03-21 21:13:50 +00:00
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