Commit Graph

4137 Commits

Author SHA1 Message Date
christos ae9d3eacae Avoid a possible race during the time we give up our lock in order to
allocate memory. (From yamt)
2005-03-23 04:01:04 +00:00
christos e0ba8227a7 Don't call malloc with a simple_lock held. Thanks to Greg Oster for pointing
my stupid mistake.
2005-03-23 01:16:44 +00:00
christos cb282cd325 Keep track and limit the number of locks per uid. From OpenBSD 2005-03-20 19:16:33 +00:00
christos f7c5085de0 It does not make sense to free the uidinfo struct since it is used now
for multiple things (proccnt,lockcnt,sbsize) and it adds too much code
complexity. Instead add a uid_find() routine that returns the existing
struct or allocates a new one.

Re-enable the sbsize limit code.
2005-03-20 19:15:48 +00:00
bouyer e97ceab999 Fix off-by-one bug which would cause a region at the end of the extent
to be alloctated multiple times:
- we're allocating region of size 1
- there are holes in the extent, but all of size larger than 1
- there are 2 contigous allocations at the end of the extent, the last one
  being of size 1.
While there fix a DIAGNOSTIC check: to check that a region is inside the extent
we need to check start and end, not only start.
2005-03-15 18:22:24 +00:00
christos d232675d86 PR/29679: Gunnar.Ritter: fstat() blksize on the write side of the pipe returns
0. Fix it by returning the peer's block size.
XXX: This is the minimal fix. Probably the buffer size should be initialized
somewhere else, but probably this would need some more code changes.
2005-03-12 18:43:42 +00:00
atatat 5b8a6c916d Revert the change that made kern.file2 and net.*.*.pcblist into nodes
instead of structs.  It had other deleterious side-effects that are
rather nasty.  Another solution must be found.
2005-03-11 06:16:15 +00:00
atatat ca63da437a Change types of kern.file2 and net.*.*.pcblist to NODE 2005-03-10 05:43:25 +00:00
atatat 7c62c74d09 Add the following nodes to the sysctl tree:
net.local.stream.pcblist
	net.local.dgram.pcblist
	net.inet.tcp.pcblist
	net.inet.udp.pcblist
	net.inet.raw.pcblist
	net.inet6.tcp6.pcblist
	net.inet6.udp6.pcblist
	net.inet6.raw6.pcblist

which allow retrieval of the pcbs in use for those protocols.  The
struct involved is 32/64 bit clean and incorporates parts of struct
inpcb, struct unpcb, a bit of struct tcpcb, and two socket addresses.
2005-03-09 05:07:19 +00:00
atatat 529b14ddf5 Add kern.file2. As kern.proc2 is to kern.proc, so is kern.file2 to
kern.file, namely a 32/64 bit clean sysctl interface to the same data.
It also borrows a few things from struct vnode (if applicable) and
from struct proc, just to tie things together a bit more.

You can walk this list "by file" or "by pid".  The former method is
similar to kern.file but omits the filehead, and the latter can give
you duplicates if multiple processes have the same struct file open,
but tells you which process it is.
2005-03-09 05:02:17 +00:00
wrstuden a758abc39e Adjust error case handling. If the VOP_LOOKUP() call unlocked the
parent directory node, remember that.

Addresses locking/lookup issues seen in:

http://mail-index.NetBSD.org/tech-kern/2004/06/20/0019.html
http://mail-index.netbsd.org/tech-kern/2005/01/08/0000.html
2005-03-08 17:29:29 +00:00
yamt f81c9770f3 bufq_priocscan_get: don't update state in the case of !remove. fix BUFQ_PEEK. 2005-03-03 05:00:22 +00:00
christos 8eb274055a Some ibcs2 binaries need executable stacks. Thanks to J Chapman Flack
for determining this and coming up with a fix.
2005-03-03 04:39:37 +00:00
mycroft b9c71ccc7a Copyright maintenance. 2005-03-02 11:05:34 +00:00
perry 77f2a006d0 regen 2005-02-26 23:58:19 +00:00
perry aaec764348 get rid of trailing spaces in the "created from" line (constructed by
stripping the $s from $NetBSD$ in the source file.)
2005-02-26 23:32:31 +00:00
perry b244cb9316 regen 2005-02-26 22:15:10 +00:00
perry 573311af21 revert trailing whitespace change -- it had unintended consequences 2005-02-26 22:14:39 +00:00
perry ba7c4ed2a6 regen 2005-02-26 22:10:31 +00:00
perry f05ce97c60 remove some trailing spaces in generated output when removing $s from $NetBSD$ 2005-02-26 22:06:38 +00:00
perry deef459f67 Change the DO NOT EDIT warning slightly, including the text "DO NOT EDIT".
(It is nice if all files that should not be edited have DO NOT EDIT in them.)
2005-02-26 21:40:45 +00:00
perry da8abec863 nuke trailing whitespace 2005-02-26 21:34:55 +00:00
matt 7eddba88c0 Add the code for pselect and pollts. Add selcommon and pollcommon to
<sys/select.h> and <sys/poll.h>.
2005-02-25 19:56:07 +00:00
matt 47a6f2d4b0 Regen. (for pselect and pollts) 2005-02-25 19:55:18 +00:00
matt 124745835a Add pselect and pollts 2005-02-25 19:53:56 +00:00
heas 57cef74601 Expose sysctl_root node to kernel sources. It will be used by FreeBSD sysctl
emulation.
2005-02-20 19:43:46 +00:00
matt 832084d8ae Regen. (no actual differences) 2005-02-19 22:19:02 +00:00
matt 16cf76fdc3 Add placeholders for sys_pselect and sys_pollts 2005-02-19 22:15:51 +00:00
peter e5d29518c6 Remove one repeated word. From Martin Végiard. 2005-02-18 00:21:37 +00:00
peter dc3b7c44eb Fix a typo, recieve -> receive. From Martin Végiard. 2005-02-18 00:17:13 +00:00
elric e6e79dacef The API for ksyms_getval_from_kernel changed. 2005-02-16 00:30:28 +00:00
cube 9367bbf87b The way I handled /dev/ksyms requests vs. kernel requests was completely
broken.  Inside the kernel, we always have to use the real values of the
st_name fields, and only do the math when the request comes from userland.

No need for ksyms_getval_from{kernel,userland} hack anymore.  However, a
different version will be asked for pull-up in -2{,-0}, one that doesn't
break the API, that is.

Fixes PR#29133 from Jens Kessmeier.
2005-02-15 21:09:57 +00:00
christos be3704c73f pass the flag to fdclone. 2005-02-12 23:14:03 +00:00
fvdl 7b10f1cabc Don't panic when lwp_suspend finds an LWP on another CPU, just return
EINVAL for now.
2005-02-12 21:39:00 +00:00
jmc 02a4880993 vm_map_max needs a struct pointer, so add a missing deref here 2005-02-12 09:38:25 +00:00
chs 467487d274 use vm_map_{min,max}() instead of dereferencing the vm_map pointer directly.
define and use vm_map_set{min,max}() for modifying these values.
remove the {min,max}_offset aliases for these vm_map fields to be more
namespace-friendly.  PR 26475.
2005-02-11 02:12:03 +00:00
christos 7651651a23 Don't de-reference a NULL ktd on error. Fix from enami, thanks. 2005-02-09 16:15:16 +00:00
fvdl af5309b07c Change the 'sz' variable in bounds_check_* to int64_t to avoid overflows
when a very large blocknumber is passed in.
2005-02-08 08:56:21 +00:00
christos a9fed9480a Allow 32K instead of 1K of section headers. Solaris opera binary has 15K
section headers. We only allocate memory for those headers on compat_linux
and compat_ibcs2 while we probe, and although 32K is not such a big number,
we could fix the code in those two places to read section-by-section instead
of all the sections at once as it does now, if we really felt like it.
2005-02-07 00:12:49 +00:00
christos 4cf9bb2fc2 Change an if/panic statement to a KASSERT and disable a chatty printf. 2005-02-06 23:57:29 +00:00
chs 9a3f782ac4 define a new LWP flag which indicates that we're in the process of
doing a context switch.  use this on sparc and sparc64 to avoid trying
to access user memory (writing the register windows back to the stack)
in this case (since it's both unnecessary and wrong).
2005-01-30 16:56:26 +00:00
christos 8633e293d5 make sure that bss size > 0 before we add a vmcmd for it. 2005-01-29 20:14:04 +00:00
wrstuden e384a44e9d Extend fsync_range(2) to support the FDISKSYNC flag, which requests
that the sync be propogated out through the disk drive caches.
2005-01-25 23:55:20 +00:00
dbj 208b0b3a89 clear p->p_cwdi of exiting processes and
avoid dereferencing invalid p_cwdi in checkdirs
this fixes a race condition between exiting processes and mount
see discussion on tech-kern:
 http://mail-index.netbsd.org/tech-kern/2004/10/04/0006.html
 http://mail-index.netbsd.org/tech-kern/2004/10/08/0005.html
2005-01-24 21:27:02 +00:00
matt 027c11539b Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them. 2005-01-24 21:25:09 +00:00
chs ad79fc3015 move the call to link_pool_init() to the end of uvm_init(). needed for sun3. 2005-01-23 19:02:02 +00:00
matt d341be30f4 Change initialzie of domains to use link sets. Switch to using STAILQ.
Add a convenience macro DOMAIN_FOREACH to interate through the domain.
2005-01-23 18:41:56 +00:00
yamt f6e639255b lkmunreserve: free memory to the correct vm_map when kernel_map != lkm_map. 2005-01-23 08:41:02 +00:00
yamt c3b17808da cc_microset: #if 0 out a diagnositc printf.
this functions is called from ipi handler.
2005-01-23 08:39:51 +00:00
christos 201de1bdd0 Cast nkmempages to vsize_t before shifting to avoid overflow. Requested
by soda.
XXX: should be pulled up to 2.0.
2005-01-14 17:03:58 +00:00