Commit Graph

2489 Commits

Author SHA1 Message Date
lukem b4e2b14fe6 convert to ANSI KNF 2001-03-22 04:52:25 +00:00
thorpej 20fe4e2d96 Add a protosw flag, PR_ABRTACPTDIS (Abort on Accept of Disconnected
Socket), and add it to the protocols that use that behavior (all
PR_LISTEN protocols except for PF_LOCAL stream sockets).
2001-03-21 19:22:27 +00:00
pooka 6c3e28927e fix typo in comment 2001-03-17 09:38:36 +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
chs 941da355cf in getnewbuf(), when we need to write a buffer before reusing it,
return NULL instead of restarting the loop since we might sleep
while starting the i/o.  this tells getblk() to check if someone else
created the buffer while we slept.  from OpenBSD.
2001-03-10 18:43:55 +00:00
tsutsui d507b847c6 Declare constty extern. 2001-03-09 13:35:50 +00:00
chs 83d071a318 add UBC memory-usage balancing. we track the number of pages in use for
each of the basic types (anonymous data, executable image, cached files)
and prevent the pagedaemon from reusing a given page if that would reduce
the count of that type of page below a sysctl-setable minimum threshold.
the thresholds are controlled via three new sysctl tunables:
vm.anonmin, vm.vnodemin, and vm.vtextmin.  these tunables are the
percentages of pageable memory reserved for each usage, and we do not allow
the sum of the minimums to be more than 95% so that there's always some
memory that can be reused.
2001-03-09 01:02:10 +00:00
cgd d45416e707 when executing args in the ccode=0 case, send output to a tmp file and
(only if cmd exited successfully) use tmp file as input to sed pipeline.
This works around two issues:
(1) a pathological case where the script would fail in ... interesting
    ways if the command being executed closed its stdout.  (Certain
    commands are used only for their side effects, but not their output,
    and doing some testing on my own i got into hot water when one
    of my mods caused a command to close its output).
(2) the fact that genassym would succeed even when the command in
    fact failed (because the last cmd in the pipeline is the one whose
    exit status would be reported).
2001-03-06 02:20:18 +00:00
fvdl f28b5d3d94 Avoid spinning forever when hardclock() wants to grab the kernel lock
held by the reaper. From Bill Sommerfeld.
2001-03-05 20:38:21 +00:00
eeh 59c87936e0 Oops. Forgot to add this to execsw. Seems like SVR4 64 is not used much. 2001-03-03 01:46:04 +00:00
lukem de1c2690b6 convert to ANSI KNF 2001-02-27 05:19:13 +00:00
lukem 1fa336cced oops; accidentally dropped an initialisation in pollscan() in previous.
called poll() to fail in interesting ways. noted by chs/nathanw
2001-02-27 04:44:51 +00:00
lukem 602451ac6e convert to ANSI KNF 2001-02-26 21:58:30 +00:00
lukem 4637391f86 minor KNF 2001-02-26 21:09:57 +00:00
lukem 735e1dcaa8 convert to ANSI KNF 2001-02-26 20:43:25 +00:00
lukem 7fee352603 convert to ANSI KNF 2001-02-26 20:24:30 +00:00
jdolecek 5a8911a72d Call module "stat" entry where appropriate.
Problem reported and patch provided by SATOU Takashi in kern/12037.
2001-02-24 10:16:46 +00:00
nathanw 214bc3e43f All of our ports have reasonable cpu_coredump()'s that set
core.c_midmag. Garbage collect the "traditional dump" code that
handled the core.c_midmag == 0 case.
2001-02-23 22:01:50 +00:00
jdolecek 522f569810 make some more constant arrays 'const' 2001-02-21 21:39:52 +00:00
eeh 6a9224a06d Remove old compatibility hack. Should no longer be needed. 2001-02-21 00:47:21 +00:00
eeh 8a4a682091 Support flexible process address space limits and bump kernel version number. 2001-02-14 18:21:42 +00:00
itojun d64f080341 make sure we do not return shared M_EXT mbuf. it will avoid possible mbuf
overwrites if bridge/loopback/multicast/whatever is used.  sync with kame
2001-02-14 17:09:19 +00:00
itojun 02bc628319 add pfctlinput2() (pfctlinput() with args). 2001-02-11 06:38:45 +00:00
eeh 52af2be8e9 Add COMPAT_SVR4_32 entries. 2001-02-11 01:29:43 +00:00
eeh 24defd04da Rename the tablet line discipline "tablet". 2001-02-11 01:28:47 +00:00
thorpej b016744976 Don't uvm_deallocate() the address space in exit1(). The address
space is already torn down in uvmspace_free() when the vmspace
refrence count reaches 0.  Move the shmexit() call into uvmspace_free().

Note that there is a beneficial side-effect of deferring the unmap
to uvmspace_free() -- on systems where TLB invalidations are
particularly expensive, the unmapping of the address space won't
have to cause TLB invalidations; uvmspace_free() is going to be
run in a context other than the exiting process's, so the "pmap is
active" test will evaluate to FALSE in the pmap module.
2001-02-10 05:05:27 +00:00
itojun d1507261c4 return ECONNABORTED, if the socket (tcp connection for example)
is disconnected by RST right before accept(2).  fixes PR 10698/12027.
checked with SUSv2, XNET 5.2, and Stevens (unix network programming
vol 1 2nd ed) section 5.11.
2001-02-07 12:20:43 +00:00
eeh ec22628573 Move maxdmap and maxsmap where they belong and make them big enough. 2001-02-06 19:54:43 +00:00
eeh 4380259bc7 Specify a process' address space limits for uvmspace_exec(). 2001-02-06 17:01:51 +00:00
chs eef7499a6c in vtruncbuf(), pass 0 (meaning everything at or past the start of the range)
instead of the vnode's size to pgo_flush() since there can be pages past EOF.
in the same call, cast "lbn" to voff_t to avoid overflow.
2001-02-06 10:58:55 +00:00
pk 11c1f60120 When freeing a session, remove the reference to it from the associated tty. 2001-02-04 22:32:24 +00:00
eeh e938c4e842 *NEVER* cast a reference parameter (unless you're using C++). 2001-02-04 19:12:09 +00:00
mrg d4dfeaf200 add sunos32 support. 2001-02-02 07:30:22 +00:00
enami 6dcc7e3de4 Don't use PR_URGENT to allocate page header. We don't want to just panic
on memory shortage.  Instead, use the same wait/nowait condition with the
item requested, and just cleanup and return failure if we can't allocate
page header while we aren't allowed to wait.
2001-01-29 02:38:02 +00:00
thorpej cfa7048975 Regen; getpid(2) is MP-safe. 2001-01-27 07:48:28 +00:00
thorpej 8740614bad getpid(2), our first MP-safe syscall! 2001-01-27 07:47:26 +00:00
thorpej 1b6a66420e Regen; add sy_flags. 2001-01-27 07:23:06 +00:00
thorpej 1628dd441e Add a "sy_flags" to struct sysent, define a SYCALL_MPSAFE
system call flag (indicating that the kernel lock does not
need to be acquired when entering the kernel on that syscall).
2001-01-27 07:21:43 +00:00
itojun 6e24d735f0 when the peer is disconnected before accept(2) is issued,
do not return junk data in mbuf (= sockaddr on accept(2)'s 2nd arg).
set the length zero.

behavior checked with bsdi and freebsd.
partial solution to PR 12027 and 10698 (need more investigation).
2001-01-22 18:14:11 +00:00
jdolecek d9466585b7 make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const 2001-01-22 12:17:35 +00:00
jdolecek d0a540b250 rename vfs_op_init() to vfs_op_check() and make it only check the offsets
and number of ops, not touch anything - vnode_if.sh now generated
proper offset numbers; vfs_op_check() is only defined and called for DEBUG
kernels

constify extern declaration of vfs_op_descs[]
g/c vfs_opv_numops, use VNODE_OPS_COUNT instead
make vfs_opv_init_explicit() and vfs_opv_init_default() static
2001-01-22 09:57:25 +00:00
jdolecek c3f6f769a3 regen: *_desc are generated correctly, new VNODE_OPS_COUNT,
structures constified
2001-01-22 09:53:31 +00:00
jdolecek 950412b4f5 when generating individual *_desc, generate also proper offsets so that
then don't need to be patched at runtime
add new define VNODE_OPS_COUNT (to vnode_if.h) so that the number is known
at compile-time
make stuff const, it now can be
2001-01-22 09:52:21 +00:00
martin d1ff650a0c Regen after de-const-ing. 2001-01-19 12:24:09 +00:00
martin c9803fbf98 Remove over-const-ification.
This structures are actually modified at kernel init time by vfs_op_init.

XXX - looks like the state after initialization is pretty const and with
some magic in the generator script (and appropriate changes to vfs_op_init)
it could be made const.
2001-01-19 12:22:56 +00:00
jdolecek 34c8ae80da constify 2001-01-18 20:28:15 +00:00
thorpej 2f89e3d744 Explicitly include <machine/intr.h> if __HAVE_GENERIC_SOFT_INTERRUPTS. 2001-01-17 18:21:41 +00:00
fvdl ea08a209b5 Adapt for procfs_valid* argument change. 2001-01-17 01:13:23 +00:00
thorpej d74e432ed3 Make softclock a generic soft interrupt of the API is available,
adding the requisite void * argument to softclock().
2001-01-15 20:19:50 +00:00
thorpej 7200d34a76 Whenever ps_sigcheck is set to true, signotify() the process, and
wrap this all up in a CHECKSIGS() macro.  Also, in psignal1(),
signotify() SRUN and SIDL processes if __HAVE_AST_PERPROC is defined.

Per discussion w/ mycroft.
2001-01-14 22:31:58 +00:00