Commit Graph

4716 Commits

Author SHA1 Message Date
kardel
97b1c42feb keep NetBSD boottime semantics:
- only set at boot
- only tracking delta of set-time operations
-> will keep boottime stable across ACPI sleeps
   uptime(1) will report the time since last boot
2006-07-14 22:44:28 +00:00
kardel
9a7410ffff reduce sleep time by slept time for retrys 2006-07-14 22:35:15 +00:00
kardel
ac3f10a8d9 make inittimeleft() and gettimeleft() available (for e. g. kern_event.c) 2006-07-14 22:33:27 +00:00
elad
1c8d298b89 move security.setid_core.* to kern.coredump.setid.*, as requested by yamt@. 2006-07-14 21:55:19 +00:00
elad
b5d09ef065 okay, since there was no way to divide this to two commits, here it goes..
introduce fileassoc(9), a kernel interface for associating meta-data with
files using in-kernel memory. this is very similar to what we had in
veriexec till now, only abstracted so it can be used more easily by more
consumers.

this also prompted the redesign of the interface, making it work on vnodes
and mounts and not directly on devices and inodes. internally, we still
use file-id but that's gonna change soon... the interface will remain
consistent.

as a result, veriexec went under some heavy changes to conform to the new
interface. since we no longer use device numbers to identify file-systems,
the veriexec sysctl stuff changed too: kern.veriexec.count.dev_N is now
kern.veriexec.tableN.* where 'N' is NOT the device number but rather a
way to distinguish several mounts.

also worth noting is the plugging of unmount/delete operations
wrt/fileassoc and veriexec.

tons of input from yamt@, wrstuden@, martin@, and christos@.
2006-07-14 18:41:40 +00:00
yamt
a1c2fd0906 introduce filehandle size limits:
- FHANDLE_SIZE_MAX: refuse unreasonable size allocation, esp. when
  it's a user-specified value.

- FHANDLE_SIZE_MIN: pad small filehandles with zero for compatibility.
  XXX it might be better to push this into filesystem dependent code so that
  new filesystems can choose smaller handles.
2006-07-14 18:30:35 +00:00
yamt
cf80fa09d3 - sys___getfh30:
- restructure code so that it doesn't try to allocate user-specified
	  unbound amount of memory.
	- don't ignore copyout failure in the case of E2BIG.
- rename vfs_copyinfh to vfs_copyinfh_alloc for consistency.
2006-07-14 18:29:40 +00:00
christos
a2f707bc1b factor out common code. 2006-07-14 16:02:45 +00:00
yamt
2d1ef0388d - fix buffer overruns in fhopen and friends.
- share some code among them.
2006-07-14 15:59:29 +00:00
christos
199b3952c8 - rename sleepts to sleeptv since it is a timeval.
- don't initialize it needlessly.
- fix the poll code the same way the select code was fixed, so that it
  computes the remaining time to sleep properly.
2006-07-14 15:52:44 +00:00
yamt
e221f55a3b sys___getfh30: fix a vnode lock botch in rev.1.244. 2006-07-14 14:28:58 +00:00
yamt
387e1097ba sys___getfh30: remove unnecessary casts. 2006-07-14 14:00:46 +00:00
pavel
a360a47f63 regenerate again to have correct source RCS Id 2006-07-13 23:26:24 +00:00
martin
edf136d748 fix typo 2006-07-13 21:51:50 +00:00
martin
a3b5baed42 Fix alignement problems for fhandle_t, exposed by gcc4.1.
While touching all vptofh/fhtovp functions, get rid of VFS_MAXFIDSIZ,
version the getfh(2) syscall and explicitly pass the size available in
the filehandle from userland.

Discussed on tech-kern, with lots of help from yamt (thanks!).
2006-07-13 12:00:24 +00:00
blymn
af4af92111 Fix behaviour of files with no signatures on exec. 2006-07-09 10:13:53 +00:00
kardel
b36308b48b when adjusting the left over timeout value in selcommon()
do actually subtract the elapsed time instead of adding it.
2006-07-08 16:01:25 +00:00
kardel
e472b9091e fix a bug reported by Steven M. Bellovin regarding oversleeping
select(2) timeouts. Introduced via timecounter branch from a
tvtohz() conversion.
The left over timeout was not decremented when re-starting
the sleep in select.
2006-07-08 12:16:09 +00:00
kardel
d788cc37f6 report true clock resolution based on the frequency information
from the underlying counter in clock_getres(). For frequencies
above 1GHz report a resolution if 1 nsec.
2006-07-08 12:10:33 +00:00
yamt
d9530c47ba add DEBUG code to detect modifications on free memory. 2006-07-08 06:01:53 +00:00
matt
34b5f92bac Don't define bpendtsleep on vax (gcc4 optimizer will duplicate the asm
that contains it result in a multiple symbol definition in gas).
2006-07-08 00:23:29 +00:00
drochner
8c61e0077d Request executable memory for LKM code/data areas. This fixes LKMs
on alpha (which were broken for more than a year appearently and noone
noticed). (The other archs didn't suffer because their pmap_kenter_pa()
doesn't support non-executable mappings.)
2006-07-05 14:31:00 +00:00
yamt
d145ea66dc change KMEM_QUANTUM_SIZE from sizeof(void *) to (ALIGNBYTES + 1).
the latter is larger on eg. sparc.

noted by Christos Zoulas.
http://mail-index.NetBSD.org/port-sparc/2006/07/02/0001.html
2006-07-03 09:18:35 +00:00
christos
2f4b451441 Make sure we have at least PIPE_BUF bytes available in the socket send buffer.
Review and comment by yamt.
2006-07-03 02:34:39 +00:00
christos
5f5ceecc09 Revert previous change to bump the socket low watermark to sock_loan_thresh.
With sock_loan_thresh=4096, sb_lowat==sb_hiwat, and sowritable will never
be true (even if only a single byte is pending). Some programs (like screen)
expect select() to return that a socket is writable on a socket when there
is space to write to it. XXX: What is the right thing to do here?
2006-07-01 15:38:28 +00:00
kardel
6dc2fb00a7 L_CLR(time_adj) each round so adjtime() corrections don't
accumulate over time resulting in a constantly speeding/
slowing clock. found with wiz@ in a timecounter non NTP
kernel configuration.
2006-07-01 05:44:26 +00:00
kardel
596d823cde always call ntp initialisation for timecounter systems as
the ntp code degenerates to the adjtime implementation in the
non NTP case
2006-07-01 05:41:10 +00:00
mrg
1b7ff51599 regenerate. 2006-06-26 21:30:50 +00:00
mrg
e2eb31d3a3 version the socket(2) syscall. for compat30 socket, we use
EPROTONOSUPPORT instead of EAFNOSUPPORT.

from pavel@ with a little bit of clean up from myself.

XXX: netbsd32 (and perhaps other emulations) should be able
XXX: to call the standard socket calls for this i think, but
XXX: revisit this at another time.
2006-06-26 21:23:56 +00:00
yamt
ffa1c23e58 fix VM_BESTFIT. 2006-06-26 10:23:20 +00:00
yamt
9595f19850 wrap long lines. 2006-06-26 10:21:59 +00:00
yamt
a3b2d62857 sa_stackused, sa_setstackfree: share some common code. 2006-06-26 10:21:34 +00:00
yamt
f374633f81 remove some unnecessary casts. 2006-06-25 08:13:28 +00:00
yamt
0fca5c447b move SA related pools to where they are used. make them static. 2006-06-25 08:12:54 +00:00
yamt
44c017beb2 sa_makeupcalls: don't leak kernel stack garbage to userland. 2006-06-25 08:12:10 +00:00
yamt
8308eb1f7a implement kmem_zalloc. 2006-06-25 08:10:04 +00:00
yamt
23fcb7c3d3 sa_makeupcalls: cleanup usage of sae_sacopyout. 2006-06-25 08:09:10 +00:00
yamt
d038c11b60 sa_makeupcalls: simplify code and fix an sau leak on error. 2006-06-25 08:08:13 +00:00
yamt
5df39bb5be sa_makeupcalls: don't allocate big structures on stack. 2006-06-25 08:05:36 +00:00
yamt
bc4977819f 1. implement solaris-like vmem. (still primitive, though)
2. implement solaris-like kmem_alloc/free api, using #1.
   (note: this implementation is backed by kernel_map, thus can't be
   used from interrupt context.)
2006-06-25 08:00:01 +00:00
yamt
6108244889 remove unused M_SA. 2006-06-25 07:46:39 +00:00
mrg
8075fe8705 don't put the bpendtsleep handy breakpoint in sun2 kernels as the
output asm includes it twice causing multiply-defined symbols.
2006-06-24 05:23:06 +00:00
drochner
99f30cd9d2 add a comment telling which structure members are zero-initialized,
as requested by YAMAMOTO Takashi
2006-06-23 16:17:23 +00:00
yamt
e408053d1b fix a simonb-timecounters regression.
the precision of getnanotime() is not suitable for file timestamps.
esp. when it's nfs-exported.

- introduce vfs_timestamp().
  (the name is from freebsd.  currently merely a wrapper of nanotime())
- for ufs-like filesystems, use it rather than getnanotime().

XXX check other filesystems.
2006-06-23 14:13:02 +00:00
drochner
9b00231778 zero-init callback_head by memset(). code is 12 bytes shorter 2006-06-21 17:16:00 +00:00
christos
ece76dd170 Don't leak memory on success. Allocate only the type of struct that we'll
need for efficiency.
2006-06-21 13:46:17 +00:00
yamt
300d4b1ed6 bump default so_snd.sb_lowat to increase chance to use loaning.
the idea to tweak the watermark from Jonathan Stone.
reviewed by Bill Studenmund.
2006-06-21 12:55:12 +00:00
christos
709b2e6f55 don't allocate too much stuff on the stack. 2006-06-20 03:20:44 +00:00
yamt
7d3142aa6a - introduce vfs_composefh() and use it where appropriate.
- fix lock/unlock mismatch in sys_getfh.
2006-06-17 07:06:50 +00:00
yamt
7b37f4549b sysctl_security_setidcorename: don't allocate MAXPATHLEN bytes on stack. 2006-06-17 06:54:58 +00:00