Commit Graph

116 Commits

Author SHA1 Message Date
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
perry 0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
christos fb4b40b7e8 - sprinkle const.
- add XXXUNCONST to the emul_find() pbuf argument free'ing. XXX: this needs
  an api change.
- avoid variable shadowing.
2005-05-29 22:08:16 +00:00
christos a5fb891bb9 PR/29696: Joel Carnat: NetBSD freezes when accessing smbfs mounted FS with
firefox/linux due to compat getdents() call assumption that all filesystems
support cookies.
2005-04-19 19:00:25 +00:00
perry 477853c351 nuke trailing whitespace 2005-02-26 22:58:54 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
christos 34728fd71f more statvfs1 fallout. 2004-04-21 02:40:05 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
dsl 0342c9586a - Count number of zombies and stopped children and requeue them at the top
of the sibling list so that find_stopped_child can be optimised to avoid
  traversing the entire sibling list - helps when a process has a lot of
  children.
- Modify locking in pfind() and pgfind() to that the caller can rely on the
  result being valid, allow caller to request that zombies be findable.
- Rename pfind() to p_find() to ensure we break binary compatibility.
- Remove svr4_pfind since p_find willnow do the job.
- Modify some of the SMP locking of the proc lists - signals are still stuffed.

Welcome to 1.6ZF
2003-11-12 21:07:37 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
itojun 51110d0c20 use strlcpy
[compat/svr4_32 should have bound check for SVR4_32_AUX_ARGSIZ]
2003-05-16 14:36:30 +00:00
thorpej 24ab4adb9c Use PAGE_SIZE rather than NBPG. 2003-04-01 01:53:40 +00:00
dsl 71d53fb2ed Use find_stopped_child() and proc_free() in compat wait() code to
avoid code duplication.
(approved by christos)
2003-02-14 10:19:14 +00:00
atatat bede65472d Cull unused variables. Sigh.
PS - Cross compilers are cool.
2003-01-29 07:00:35 +00:00
atatat 59b8237f5e No need to pick a "default address" for mmap in compat code, since we
merely call sys_mmap() at the end anyway, and that will pick the
address for us, if it's needed.

Likewise for checking if /dev/zero is being mapped.
2003-01-28 21:57:42 +00:00
thorpej 9b46ebe0bd Merge the nathanw_sa branch. 2003-01-18 08:44:26 +00:00
jdolecek 02eb342b57 Make sure that the pointer to old parent process for ptraced children
gets reset properly when the old parent exits before the child. A flag
is set in old parent process when the child is reparented in ptrace(2).
If it's set when process is exiting, all running processes have their
'old parent process' pointer checked and reset if appropriate. Also
change to use 'struct proc *' pointer directly, rather than pid_t.
This fixes security/14444 by David Sainty.

Reviewed by Christos Zoulas.
2002-07-25 20:04:02 +00:00
christos ac29fb3782 make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
2002-03-31 22:22:43 +00:00
christos 381e6a7764 make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
2002-03-16 20:43:48 +00:00
tv aa7e03f796 Handle MAP_ANON (0x100 in Solaris8, not 0x1000) properly, by factoring out
the flags common to SVR4 and NetBSD, and mapping the rest manually.
2002-02-07 23:22:24 +00:00
jdolecek bf65eb50af add appropriate cast to debug printf 2001-11-18 13:29:29 +00:00
lukem dab6ef8b56 add RCSIDs (including regeneration of files as appropriate) 2001-11-13 02:07:52 +00:00
christos 50a347501a compile in the absense of SYSVSHM and SYSVSEM. pointed out by @@@. 2001-11-11 21:21:02 +00:00
ross 6b9d94cd8c Fix overflow errors in brk(2). 2001-05-06 04:32:08 +00:00
chs ac3bc537bd eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS			0
KERN_INVALID_ADDRESS		EFAULT
KERN_PROTECTION_FAILURE		EACCES
KERN_NO_SPACE			ENOMEM
KERN_INVALID_ARGUMENT		EINVAL
KERN_FAILURE			various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE		ENOMEM
KERN_NOT_RECEIVER		<unused>
KERN_NO_ACCESS			<unused>
KERN_PAGES_LOCKED		<unused>
2001-03-15 06:10:32 +00:00
jdolecek 01040d97a2 add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
2000-12-01 12:28:30 +00:00
jdolecek a777f280d1 fix obvious bug in svr4_sys_resolvepath():
since we have not requested locked vnode (LOCKLEAF is not used for namei()
call), the vnode is returned unlocked, so we need to use vrele(), not vput()

This fixes kern/11044.
2000-09-21 21:24:33 +00:00
thorpej 72a24b4eae Add an align argument to uvm_map() and some callers of that
routine.  Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.
2000-09-13 15:00:15 +00:00
thorpej 7cc27a88c0 Convert namei pathname buffer allocation to use the pool allocator. 2000-08-03 20:41:05 +00:00
mrg 705b50bf32 fix LP64 warnings. 2000-07-27 14:00:56 +00:00
mrg 13f211c52e remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-28 15:39:24 +00:00
christos 9813882e34 Add new sysconfig bits.
Fix the bogus numbering of the old bits.
2000-04-09 05:33:04 +00:00
kleink 230876cf26 Merge parts of chs-ubc2 into the trunk:
* Remove the casts to vaddr_t from the round_page() and trunc_page() macros to
  make them type-generic, which is necessary i.e. to operate on file offsets
  without truncating them.
* In due course, cast pointer arguments to these macros to an appropriate
  integral type (paddr_t, vaddr_t).

Originally done by Chuck Silvers, updated by myself.
2000-03-26 20:42:21 +00:00
christos d205cc9cd4 oops, forgot to include new files. 1999-09-07 18:20:18 +00:00
rh cfa2c0bd79 Remove superfluous NULL argument from proclist_lock_read() call. 1999-07-25 08:55:46 +00:00
thorpej 01a8cffe77 Add a read/write lock to the proclists and PID hash table. Use the
write lock when doing PID allocation, and during the process exit path.
Use a read lock every where else, including within schedcpu() (interrupt
context).  Note that holding the write lock implies blocking schedcpu()
from running (blocks softclock).

PID allocation is now MP-safe.

Note this actually fixes a bug on single processor systems that was probably
extremely difficult to tickle; it was possible that schedcpu() would run
off a bad pointer if the right clock interrupt happened to come in the
middle of a LIST_INSERT_HEAD() or LIST_REMOVE() to/from allproc.
1999-07-22 21:08:30 +00:00
thorpej 32e1fd0d03 Move the call of cpu_wait() out of the wait4() functions, and into the
body of reaper(), right before the call to uvm_exit().  cpu_wait() must
be done before uvm_exit() because the resources it frees might be located
in the PCB.
1999-07-20 21:54:05 +00:00
kleink fe0ce0cd42 Need to explicitly include <machine/cpu.h> for a cpu_wait() macro definition. 1999-05-08 01:23:01 +00:00
thorpej e3669c3393 Add "use counting" to file entries. When closing a file, and it's reference
count is 0, wait for use count to drain before finishing the close.

This is necessary in order for multiple processes to safely share file
descriptor tables.
1999-05-05 20:01:01 +00:00
mrg d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
sommerfe 166f97ecf3 Use regular system fchroot, now that we have it. 1999-03-22 17:30:37 +00:00
christos dcee031682 const poisoning and CHECK_ALT_CREAT fixes. 1999-02-09 20:46:40 +00:00
christos 1dd3565a09 Fix a long standing bug in wait(2) where the signal was left untranslated,
and defensively code the signal translation.
1998-12-16 10:36:50 +00:00
christos 298d9e0d50 Deal with {get,set}rlimit{,64} properly, respecting the RLIM_INFINITY,
RLIM_SAVED_MAX, and RLIM_SAVED_CUR values. We should fix our own implementation
to do this and use unsigned numbers for rlim_t as solaris does.
1998-11-28 21:53:02 +00:00
christos 87308428af take a stab at implementing resolvepath(2) 1998-11-27 15:08:50 +00:00
christos 913cee1069 Merge in lite2 changes, and fix a typo that caused pool memory corruption. 1998-10-03 21:29:07 +00:00
eeh fc6c67ff5d Fixup big-endian syscall args. 1998-10-03 19:33:32 +00:00
christos 4a904760a4 the pool boy forgot to convert this to use pool stuff. Goodbye long uptime! 1998-10-01 19:26:30 +00:00