The NetBSD Project

CVS log for src/sys/kern/kern_descrip.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.262 / (download) - annotate - [select for diffs], Wed Oct 4 22:17:09 2023 UTC (5 months, 3 weeks ago) by ad
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.261: +4 -6 lines
Diff to previous 1.261 (colored) to selected 1.127 (colored)

kauth_cred_hold(): return cred verbatim so that donating a reference to
another data structure can be done more elegantly.

Revision 1.261 / (download) - annotate - [select for diffs], Sat Sep 23 18:21:11 2023 UTC (6 months ago) by ad
Branch: MAIN
Changes since 1.260: +23 -26 lines
Diff to previous 1.260 (colored) to selected 1.127 (colored)

Repply this change with a couple of bugs fixed:

- Do away with separate pool_cache for some kernel objects that have no special
  requirements and use the general purpose allocator instead. On one of my
  test systems this makes for a small (~1%) but repeatable reduction in system
  time during builds presumably because it decreases the kernel's cache /
  memory bandwidth footprint a little.
- vfs_lockf: cache a pointer to the uidinfo and put mutex in the data segment.

Revision 1.260 / (download) - annotate - [select for diffs], Tue Sep 12 16:17:21 2023 UTC (6 months, 2 weeks ago) by ad
Branch: MAIN
Changes since 1.259: +26 -23 lines
Diff to previous 1.259 (colored) to selected 1.127 (colored)

Back out recent change to replace pool_cache with then general allocator.
Will return to this when I have time again.

Revision 1.259 / (download) - annotate - [select for diffs], Sun Sep 10 14:45:52 2023 UTC (6 months, 2 weeks ago) by ad
Branch: MAIN
Changes since 1.258: +23 -26 lines
Diff to previous 1.258 (colored) to selected 1.127 (colored)

- Do away with separate pool_cache for some kernel objects that have no special
  requirements and use the general purpose allocator instead.  On one of my
  test systems this makes for a small (~1%) but repeatable reduction in system
  time during builds presumably because it decreases the kernel's cache /
  memory bandwidth footprint a little.
- vfs_lockf: cache a pointer to the uidinfo and put mutex in the data segment.

Revision 1.258 / (download) - annotate - [select for diffs], Sun Sep 10 14:44:08 2023 UTC (6 months, 2 weeks ago) by ad
Branch: MAIN
Changes since 1.257: +9 -3 lines
Diff to previous 1.257 (colored) to selected 1.127 (colored)

It's easy to exhaust the open file limit on a system with many CPUs due to
caching.  Allow a bit of leeway to reduce the element of surprise.

Revision 1.257 / (download) - annotate - [select for diffs], Sat Apr 22 14:23:59 2023 UTC (11 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.256: +5 -3 lines
Diff to previous 1.256 (colored) to selected 1.127 (colored)

fcntl(2), flock(2): Assert FHASLOCK is clear if no fo_advlock.

Revision 1.256 / (download) - annotate - [select for diffs], Sat Apr 22 13:52:46 2023 UTC (11 months, 1 week ago) by riastradh
Branch: MAIN
Changes since 1.255: +7 -7 lines
Diff to previous 1.255 (colored) to selected 1.127 (colored)

file(9): New fo_advlock operation.

This moves the vnode-specific logic from sys_descrip.c into
vfs_vnode.c, like we did for fo_seek.

XXX kernel revbump -- struct fileops API and ABI change

Revision 1.255 / (download) - annotate - [select for diffs], Fri Feb 24 11:02:27 2023 UTC (13 months ago) by riastradh
Branch: MAIN
Changes since 1.254: +2 -16 lines
Diff to previous 1.254 (colored) to selected 1.127 (colored)

kern: Eliminate most __HAVE_ATOMIC_AS_MEMBAR conditionals.

I'm leaving in the conditional around the legacy membar_enters
(store-before-load, store-before-store) in kern_mutex.c and in
kern_lock.c because they may still matter: store-before-load barriers
tend to be the most expensive kind, so eliding them is probably
worthwhile on x86.  (It also may not matter; I just don't care to do
measurements right now, and it's a single valid and potentially
justifiable use case in the whole tree.)

However, membar_release/acquire can be mere instruction barriers on
all TSO platforms including x86, so there's no need to go out of our
way with a bad API to conditionalize them.  If the procedure call
overhead is measurable we just could change them to be macros on x86
that expand into __insn_barrier.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2023/02/23/msg028729.html

Revision 1.254 / (download) - annotate - [select for diffs], Thu Feb 23 03:00:15 2023 UTC (13 months ago) by riastradh
Branch: MAIN
Changes since 1.253: +38 -3 lines
Diff to previous 1.253 (colored) to selected 1.127 (colored)

kern_descrip.c: Change membar_enter to membar_acquire in fd_getfile.

membar_acquire is cheaper on many CPUs, and unlikely to be costlier
on any CPUs, than the legacy membar_enter.

Add a long comment explaining the interaction between fd_getfile and
fd_close and why membar_acquire is safe.

XXX pullup-10

Revision 1.253 / (download) - annotate - [select for diffs], Thu Feb 23 02:58:40 2023 UTC (13 months ago) by riastradh
Branch: MAIN
Changes since 1.252: +4 -10 lines
Diff to previous 1.252 (colored) to selected 1.127 (colored)

kern_descrip.c: Use atomic_store_relaxed/release for ff->ff_file.

1. atomic_store_relaxed in fd_close avoids the appearance of race in
   sanitizers (minor bug).

2. atomic_store_release in fd_affix is necessary because the lock
   activity was not, in fact, enough to guarantee ordering (real bug
   some architectures like aarch64).

   The premise appears to have been that the mutex_enter/exit earlier
   in fd_affix is enough to guarantee that initialization of fp (A)
   happens before use of fp by a user once fp is published (B):

	fp->f_... = ...;		// A

	/* fd_affix */
	mutex_enter(&fp->f_lock);
	fp->f_count++;
	mutex_exit(&fp->f_lock);
	...
	ff->ff_file = fp;		// B

   But actually mutex_enter/exit allow the following reordering by
   the CPU:

	mutex_enter(&fp->f_lock);
	ff->ff_file = fp;		// B
	fp->f_count++;
	fp->f_... = ...;		// A
	mutex_exit(&fp->f_lock);

   The only constraints they imply are:

	1. fp->f_count++ and B cannot precede mutex_enter
	2. mutex_exit cannot precede A and fp->f_count++

   They imply no constraint on the relative ordering of A, B, and
   fp->f_count++ amongst each other, however.

   This affects any architecture that has a native load-acquire or
   store-release operation in mutex_enter/exit, like aarch64, instead
   of explicit load-before-load/store and load/store-before-store
   barrier.

No need for atomic_store_* in fd_copy or fd_free because we have
exclusive access to ff as is.

XXX pullup-9
XXX pullup-10

Revision 1.252 / (download) - annotate - [select for diffs], Thu Feb 23 02:58:28 2023 UTC (13 months ago) by riastradh
Branch: MAIN
Changes since 1.251: +14 -5 lines
Diff to previous 1.251 (colored) to selected 1.127 (colored)

kern_descrip.c: Fix membars around reference count decrement.

In general, the `last one out hit the lights' style of reference
counting (as opposed to the `whoever's destroying must wait for
pending users to finish' style) requires memory barriers like so:

	... usage of resources associated with object ...
	membar_release();
	if (atomic_dec_uint_nv(&obj->refcnt) != 0)
		return;
	membar_acquire();
	... freeing of resources associated with object ...

This way, all usage happens-before all freeing.  This fixes several
errors:

- fd_close failed to ensure whatever its caller did would
  happen-before the freeing, in the case where another thread is
  concurrently trying to close the fd (ff->ff_file == NULL).

  Fix: Add membar_release before atomic_dec_uint(&ff->ff_refcnt) in
  that branch.

- fd_close failed to ensure all loads its caller had issued will have
  happened-before the freeing, in the case where the fd is still in
  use by another thread (fdp->fd_refcnt > 1 and ff->ff_refcnt-- > 0).

  Fix: Change membar_producer to membar_release before
  atomic_dec_uint(&ff->ff_refcnt).

- fd_close failed to ensure that any usage of fp by other callers
  would happen-before any freeing it does.

  Fix: Add membar_acquire after atomic_dec_uint_nv(&ff->ff_refcnt).

- fd_free failed to ensure that any usage of fdp by other callers
  would happen-before any freeing it does.

  Fix: Add membar_acquire after atomic_dec_uint_nv(&fdp->fd_refcnt).

While here, change membar_exit -> membar_release.  No semantic
change, just updating away from the legacy API.

XXX pullup-8
XXX pullup-9
XXX pullup-10

Revision 1.251 / (download) - annotate - [select for diffs], Tue Jun 29 22:40:53 2021 UTC (2 years, 8 months ago) by dholland
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2, netbsd-10-base, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Branch point for: netbsd-10
Changes since 1.250: +32 -18 lines
Diff to previous 1.250 (colored) to selected 1.127 (colored)

Add containment for the cloning devices hack in vn_open.

Cloning devices (and also things like /dev/stderr) work by allocating
a struct file, stuffing it in the file table (which is a layer
violation), stuffing the file descriptor number for it in a magic
field of struct lwp (which is gross), and then "failing" with one of
two magic errnos, EDUPFD or EMOVEFD.

Before this commit, all callers of vn_open in the kernel (there are
quite a few) were expected to check for these errors and handle the
situation. Needless to say, none of them except for open() itself did,
resulting in internal negative errnos being returned to userspace.

This hack is fairly deeply rooted and cannot be eliminated all at
once. This commit adds logic to handle the magic errnos inside
vn_open; now on success vn_open returns either a vnode or an integer
file descriptor, along with a flag that says whether the underlying
code requested EDUPFD or EMOVEFD. Callers not prepared to cope with
file descriptors can pass NULL for the extra return values, in which
case if a file descriptor would be produced vn_open fails with
EOPNOTSUPP.

Since I'm rearranging vn_open's signature anyway, stop exposing struct
nameidata. Instead, take three arguments: an optional vnode to use as
the starting point (like openat()), the path, and additional namei
flags to use, restricted to NOCHROOT and TRYEMULROOT. (Other namei
behavior, e.g. NOFOLLOW, can be requested via the open flags.)

This change requires a kernel bump. Ride the one an hour ago.
(That was supposed to be coordinated; did not intend to let an hour
slip by. My fault.)

Revision 1.250 / (download) - annotate - [select for diffs], Thu Dec 24 12:14:50 2020 UTC (3 years, 3 months ago) by nia
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-i2c-spi-conf
Changes since 1.249: +5 -2 lines
Diff to previous 1.249 (colored) to selected 1.127 (colored)

Avoid negating the minimum size of pid_t (this overflows).

Reported-by: syzbot+e2eb02f9dfaf4f2e6626@syzkaller.appspotmail.com

Revision 1.249 / (download) - annotate - [select for diffs], Fri Aug 28 10:20:14 2020 UTC (3 years, 7 months ago) by christos
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.248: +2 -3 lines
Diff to previous 1.248 (colored) to selected 1.127 (colored)

We already zeroed the struct, no point in zeroing things twice.

Revision 1.248 / (download) - annotate - [select for diffs], Fri Aug 28 06:47:18 2020 UTC (3 years, 7 months ago) by riastradh
Branch: MAIN
Changes since 1.247: +3 -3 lines
Diff to previous 1.247 (colored) to selected 1.127 (colored)

Just zero out struct file::f_lock when exposed to userland.

Userland has no business examining a snapshot of the lock state, even
if pseudonymized.  Should fix hppa build, where kmutex_t is somewhat
larger than anticipated by recent changes.

Revision 1.247 / (download) - annotate - [select for diffs], Wed Aug 26 22:56:55 2020 UTC (3 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.246: +8 -8 lines
Diff to previous 1.246 (colored) to selected 1.127 (colored)

Instead of returning 0 when sysctl kern.expose_address=0, return a random
hashed value of the data. This allows sockstat to work without exposing
kernel addresses or being setgid kmem.

Revision 1.246 / (download) - annotate - [select for diffs], Sat May 23 23:42:43 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.245: +14 -14 lines
Diff to previous 1.245 (colored) to selected 1.127 (colored)

Move proc_lock into the data segment.  It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.

Revision 1.245 / (download) - annotate - [select for diffs], Sat Feb 1 02:23:23 2020 UTC (4 years, 1 month ago) by riastradh
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3
Changes since 1.244: +15 -12 lines
Diff to previous 1.244 (colored) to selected 1.127 (colored)

Load struct fdfile::ff_file with atomic_load_consume.

Exceptions: when we're only testing whether it's there, not about to
dereference it.

Note: We do not use atomic_store_release to set it because the
preceding mutex_exit should be enough.

(That said, it's not clear the mutex_enter/exit is needed unless
refcnt > 0 already, in which case maybe it would be a win to switch
from the membar implied by mutex_enter to the membar implied by
atomic_store_release -- which I would generally expect to be much
cheaper.  And a little clearer without a long comment.)

Revision 1.244 / (download) - annotate - [select for diffs], Sat Feb 1 02:23:04 2020 UTC (4 years, 1 month ago) by riastradh
Branch: MAIN
Changes since 1.243: +26 -26 lines
Diff to previous 1.243 (colored) to selected 1.127 (colored)

Load struct filedesc::fd_dt with atomic_load_consume.

Exceptions: when fd_refcnt <= 1, or when holding fd_lock.

While here:

- Restore KASSERT(mutex_owned(&fdp->fd_lock)) in fd_unused.
  => This is used only in fd_close and fd_abort, where it holds.
- Move bounds check assertion in fd_putfile to where it matters.
- Store fd_dt with atomic_store_release.
- Move load of fd_dt under lock in knote_fdclose.
- Omit membar_consumer in fdesc_readdir.
  => atomic_load_consume serves the same purpose now.
  => Was needed only on alpha anyway.

Revision 1.243 / (download) - annotate - [select for diffs], Wed Feb 20 19:42:14 2019 UTC (5 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.242: +4 -4 lines
Diff to previous 1.242 (colored) to selected 1.127 (colored)

handle O_NOSIGPIPE too.

Revision 1.242 / (download) - annotate - [select for diffs], Thu Jan 3 10:16:43 2019 UTC (5 years, 2 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118
Changes since 1.241: +3 -2 lines
Diff to previous 1.241 (colored) to selected 1.127 (colored)

Add KASSERT.

Revision 1.241 / (download) - annotate - [select for diffs], Sat Nov 24 16:41:48 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-1226, pgoyette-compat-1126
Changes since 1.240: +37 -6 lines
Diff to previous 1.240 (colored) to selected 1.127 (colored)

Fix kernel pointer leaks in the kern.file sysctl, same as kern.file2.

Revision 1.240 / (download) - annotate - [select for diffs], Sat Nov 24 16:25:20 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.239: +5 -5 lines
Diff to previous 1.239 (colored) to selected 1.127 (colored)

Rename fill_file -> fill_file2, since that's the KERN_FILE2 sysctl.

Revision 1.239 / (download) - annotate - [select for diffs], Fri Nov 2 12:27:47 2018 UTC (5 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.238: +4 -2 lines
Diff to previous 1.238 (colored) to selected 1.127 (colored)

Add LIST_INIT for filehead.

Revision 1.238 / (download) - annotate - [select for diffs], Fri Oct 5 22:12:38 2018 UTC (5 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-1020
Changes since 1.237: +9 -21 lines
Diff to previous 1.237 (colored) to selected 1.127 (colored)

Provide a sysctl kern.expose_address to expose kernel addresses in
sysctl structure returns for non-root. Defaults to off. Turning it
on will restore sockstat/fstat and friends for regular users.

Revision 1.237 / (download) - annotate - [select for diffs], Thu Sep 13 14:44:09 2018 UTC (5 years, 6 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-compat-0930
Changes since 1.236: +23 -8 lines
Diff to previous 1.236 (colored) to selected 1.127 (colored)

Don't leak kernel pointers to userland in kern.file2, same as kern.proc2.

Revision 1.236 / (download) - annotate - [select for diffs], Mon Sep 3 16:29:35 2018 UTC (5 years, 6 months ago) by riastradh
Branch: MAIN
CVS Tags: pgoyette-compat-0906
Changes since 1.235: +4 -4 lines
Diff to previous 1.235 (colored) to selected 1.127 (colored)

Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)

Revision 1.235 / (download) - annotate - [select for diffs], Tue Jul 3 23:14:57 2018 UTC (5 years, 8 months ago) by kamil
Branch: MAIN
CVS Tags: pgoyette-compat-0728
Changes since 1.234: +6 -6 lines
Diff to previous 1.234 (colored) to selected 1.127 (colored)

Avoid unportable signed integer left shift in fd_unused()

Detected with Kernel Undefined Behavior Sanitizer.

There were at least a single place reported, for consistency fix all the
left bit shift operations.
sys/kern/kern_descrip.c:345:2, left shift of 1 by 31 places cannot be represented in type 'int'
sys/kern/kern_descrip.c:346:28, left shift of 1 by 31 places cannot be represented in type 'int'

Reported by <Harry Pantazis>

Revision 1.234 / (download) - annotate - [select for diffs], Tue Jul 3 23:11:06 2018 UTC (5 years, 8 months ago) by kamil
Branch: MAIN
Changes since 1.233: +4 -4 lines
Diff to previous 1.233 (colored) to selected 1.127 (colored)

Avoid unportable signed integer left shift in fd_copy()

Detected with Kernel Undefined Behavior Sanitizer.

There were at least a single place reported, for consistency fix all the
left bit shift operations.
sys/kern/kern_descrip.c:1492:3, left shift of 1 by 31 places cannot be represented in type 'int'
sys/kern/kern_descrip.c:1493:28, left shift of 1 by 31 places cannot be represented in type 'int'

Reported by <Harry Pantazis>

Revision 1.233 / (download) - annotate - [select for diffs], Tue Jul 3 22:49:51 2018 UTC (5 years, 8 months ago) by kamil
Branch: MAIN
Changes since 1.232: +3 -3 lines
Diff to previous 1.232 (colored) to selected 1.127 (colored)

Avoid unportable signed integer left shift in fd_isused()

Detected with Kernel Undefined Behavior Sanitizer.

sys/kern/kern_descrip.c:188:34, left shift of 1 by 31 places cannot be represented in type 'int'

Reported by <Harry Pantazis>

Revision 1.232 / (download) - annotate - [select for diffs], Tue Jul 3 12:17:54 2018 UTC (5 years, 8 months ago) by kamil
Branch: MAIN
Changes since 1.231: +6 -6 lines
Diff to previous 1.231 (colored) to selected 1.127 (colored)

Avoid unportable signed integer left shift in fd_used()

Detected with Kernel Undefined Behavior Sanitizer.

There were at least a single place reported, for consistency fix all the
left bit shift operations.
sys/kern/kern_descrip.c:302:26, left shift of 1 by 31 places cannot be represented in type 'int'

Reported by <Harry Pantazis>

Revision 1.231 / (download) - annotate - [select for diffs], Thu Jun 1 02:45:13 2017 UTC (6 years, 9 months ago) by chs
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.230: +3 -5 lines
Diff to previous 1.230 (colored) to selected 1.127 (colored)

remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.230 / (download) - annotate - [select for diffs], Thu May 11 22:38:56 2017 UTC (6 years, 10 months ago) by nat
Branch: MAIN
CVS Tags: prg-localcount2-base3
Changes since 1.229: +3 -3 lines
Diff to previous 1.229 (colored) to selected 1.127 (colored)

Explicitly set the flags instead of masking set values in.

This fixes FNONBLOCK weirdness seen in audio.c

OK christos@ and martin@.

Revision 1.229 / (download) - annotate - [select for diffs], Mon Aug 3 04:55:15 2015 UTC (8 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: prg-localcount2
Changes since 1.228: +9 -3 lines
Diff to previous 1.228 (colored) to selected 1.127 (colored)

1. mask fflags so we don't tack on whateve oflags were passed from userland
2. honor O_CLOEXEC, so the children of daemons that use cloning devices, don't
   end up with the parents descriptors
fd_clone and in general the fd approach of 'allocate' > 'play with guts' >
'attach' should be converted to be more constructor like.
XXX: pullup-{6,7}

Revision 1.228 / (download) - annotate - [select for diffs], Sun Sep 21 17:17:15 2014 UTC (9 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base
Branch point for: nick-nhusb
Changes since 1.227: +3 -3 lines
Diff to previous 1.227 (colored) to selected 1.127 (colored)

remove casts to the same type.

Revision 1.227 / (download) - annotate - [select for diffs], Fri Sep 5 09:20:59 2014 UTC (9 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.226: +7 -7 lines
Diff to previous 1.226 (colored) to selected 1.127 (colored)

Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.

Revision 1.226 / (download) - annotate - [select for diffs], Fri Sep 5 05:57:21 2014 UTC (9 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.225: +24 -24 lines
Diff to previous 1.225 (colored) to selected 1.127 (colored)

Don't next structure and enum definitions.
Don't use C++ keywords new, try, class, private, etc.

Revision 1.225 / (download) - annotate - [select for diffs], Fri Jul 25 08:10:40 2014 UTC (9 years, 8 months ago) by dholland
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-base, netbsd-7-0-RC2, netbsd-7-0-RC1
Branch point for: netbsd-7
Changes since 1.224: +3 -2 lines
Diff to previous 1.224 (colored) to selected 1.127 (colored)

Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.

Revision 1.224 / (download) - annotate - [select for diffs], Sun Mar 16 05:20:30 2014 UTC (10 years ago) by dholland
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.223: +13 -4 lines
Diff to previous 1.223 (colored) to selected 1.127 (colored)

Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.

Revision 1.223 / (download) - annotate - [select for diffs], Tue Feb 25 18:30:11 2014 UTC (10 years, 1 month ago) by pooka
Branch: MAIN
Changes since 1.222: +2 -5 lines
Diff to previous 1.222 (colored) to selected 1.127 (colored)

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.

Revision 1.222 / (download) - annotate - [select for diffs], Sun Sep 15 13:03:59 2013 UTC (10 years, 6 months ago) by martin
Branch: MAIN
Changes since 1.221: +2 -4 lines
Diff to previous 1.221 (colored) to selected 1.127 (colored)

Remove __CT_LOCAL_.. hack

Revision 1.221 / (download) - annotate - [select for diffs], Sat Sep 14 13:46:52 2013 UTC (10 years, 6 months ago) by martin
Branch: MAIN
Changes since 1.220: +4 -2 lines
Diff to previous 1.220 (colored) to selected 1.127 (colored)

Avoid warnings for a local CTASSERT

Revision 1.220 / (download) - annotate - [select for diffs], Thu Sep 5 12:23:07 2013 UTC (10 years, 6 months ago) by pooka
Branch: MAIN
Changes since 1.219: +3 -2 lines
Diff to previous 1.219 (colored) to selected 1.127 (colored)

In fd_abort(), reset ff_exclose to preserve invariants expected by fd_free()

Revision 1.219 / (download) - annotate - [select for diffs], Sat Nov 24 15:07:44 2012 UTC (11 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: rmind-smpnet
Changes since 1.218: +3 -3 lines
Diff to previous 1.218 (colored) to selected 1.127 (colored)

Return EOPNOTSUPP for fnullop_kqfilter to prevent registration of unsupported
fds. XXX: We should really fix the fd's to be supported in the future.
Unsupported fd's have a NULL f_event, so registering crashes the kernel with
a NULL function dereference of f_event.

Revision 1.218 / (download) - annotate - [select for diffs], Wed Jan 25 00:28:35 2012 UTC (12 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10
Branch point for: tls-maxphys, netbsd-6-0, netbsd-6
Changes since 1.217: +14 -9 lines
Diff to previous 1.217 (colored) to selected 1.127 (colored)

As discussed in tech-kern, provide the means to prevent delivery of SIGPIPE
on EPIPE for all file descriptor types:

- provide O_NOSIGPIPE for open,kqueue1,pipe2,dup3,fcntl(F_{G,S}ETFL) [NetBSD]
- provide SOCK_NOSIGPIPE for socket,socketpair [NetBSD]
- provide SO_NOSIGPIPE for {g,s}seckopt [NetBSD/FreeBSD/MacOSX]
- provide F_{G,S}ETNOSIGPIPE for fcntl [MacOSX]

Revision 1.217 / (download) - annotate - [select for diffs], Sun Sep 25 13:40:37 2011 UTC (12 years, 6 months ago) by chs
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.216: +5 -4 lines
Diff to previous 1.216 (colored) to selected 1.127 (colored)

in fd_allocfile(), free the fd if we fail to allocate a file.

Revision 1.216 / (download) - annotate - [select for diffs], Fri Jul 15 14:50:19 2011 UTC (12 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.215: +4 -2 lines
Diff to previous 1.215 (colored) to selected 1.127 (colored)

fail with EINVAL if flags not are not O_CLOEXEC|O_NONBLOCK in pipe2(2) and
dup3(2)

Revision 1.215 / (download) - annotate - [select for diffs], Sun Jun 26 16:42:41 2011 UTC (12 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.214: +5 -3 lines
Diff to previous 1.214 (colored) to selected 1.127 (colored)

* Arrange for interfaces that create new file descriptors to be able to
  set close-on-exec on creation (http://udrepper.livejournal.com/20407.html).

    - Add F_DUPFD_CLOEXEC to fcntl(2).
    - Add MSG_CMSG_CLOEXEC to recvmsg(2) for unix file descriptor passing.
    - Add dup3(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
    - Add pipe2(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
    - Add flags SOCK_CLOEXEC, SOCK_NONBLOCK to the socket type parameter
      for socket(2) and socketpair(2).
    - Add new paccept(2) syscall that takes an additional sigset_t to alter
      the sigmask temporarily and a flags argument to set SOCK_CLOEXEC,
      SOCK_NONBLOCK.
    - Add new mode character 'e' to fopen(3) and popen(3) to open pipes
      and file descriptors for close on exec.
    - Add new kqueue1(2) syscall with a new flags argument to open the
      kqueue file descriptor with O_CLOEXEC, O_NONBLOCK.

* Fix the system calls that take socklen_t arguments to actually do so.

* Don't include userland header files (signal.h) from system header files
  (rump_syscallargs.h).

* Bump libc version for the new syscalls.

Revision 1.214 / (download) - annotate - [select for diffs], Sun Apr 24 20:30:38 2011 UTC (12 years, 11 months ago) by rmind
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp
Changes since 1.213: +3 -3 lines
Diff to previous 1.213 (colored) to selected 1.127 (colored)

Drop extern inline for fd_getfile().  Apparently, GCC already ignores it.

Revision 1.213 / (download) - annotate - [select for diffs], Sat Apr 23 18:57:27 2011 UTC (12 years, 11 months ago) by rmind
Branch: MAIN
Changes since 1.212: +47 -57 lines
Diff to previous 1.212 (colored) to selected 1.127 (colored)

- Sprinkle __cacheline_aligned and __read_mostly in file descriptor code.
- While here, remove trailing whitespaces, KNF.

Revision 1.212 / (download) - annotate - [select for diffs], Sun Apr 10 15:45:33 2011 UTC (12 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.211: +12 -2 lines
Diff to previous 1.211 (colored) to selected 1.127 (colored)

- Add O_CLOEXEC to open(2)
- Add fd_set_exclose() to encapsulate uses of FIO{,N}CLEX, O_CLOEXEC, F{G,S}ETFD
- Add a pipe1() function to allow passing flags to the fd's that pipe(2)
  opens to ease implementation of linux pipe2(2)
- Factor out fp handling code from open(2) and fhopen(2)

Revision 1.211 / (download) - annotate - [select for diffs], Tue Feb 15 15:54:28 2011 UTC (13 years, 1 month ago) by pooka
Branch: MAIN
CVS Tags: bouyer-quota2-nbase, bouyer-quota2-base
Changes since 1.210: +53 -2 lines
Diff to previous 1.210 (colored) to selected 1.127 (colored)

Support FD_CLOEXEC in rump kernels.

Revision 1.210 / (download) - annotate - [select for diffs], Fri Jan 28 18:44:44 2011 UTC (13 years, 2 months ago) by pooka
Branch: MAIN
Changes since 1.209: +410 -2 lines
Diff to previous 1.209 (colored) to selected 1.127 (colored)

Move sysctl routines from init_sysctl.c to kern_descrip.c (for
descriptors) and kern_proc.c (for processes).  This makes them
usable in a rump kernel, in case somebody was wondering.

Revision 1.209 / (download) - annotate - [select for diffs], Sat Jan 1 22:05:11 2011 UTC (13 years, 2 months ago) by pooka
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Changes since 1.208: +5 -5 lines
Diff to previous 1.208 (colored) to selected 1.127 (colored)

Update comment and inspired by that update variable naming too.
no functional change.

Revision 1.208 / (download) - annotate - [select for diffs], Fri Dec 17 22:06:31 2010 UTC (13 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.207: +7 -7 lines
Diff to previous 1.207 (colored) to selected 1.127 (colored)

update some comments

Revision 1.207 / (download) - annotate - [select for diffs], Fri Oct 29 15:32:23 2010 UTC (13 years, 5 months ago) by pooka
Branch: MAIN
CVS Tags: uebayasi-xip-base4
Changes since 1.206: +2 -3 lines
Diff to previous 1.206 (colored) to selected 1.127 (colored)

Attach implicit threads to initproc instead of proc0.  This way
applications which alter, by purpose or by accident, the uid in an
implicit thread are don't affect kernel threads.

from discussion with njoly

Revision 1.206 / (download) - annotate - [select for diffs], Wed Sep 1 15:15:18 2010 UTC (13 years, 7 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, uebayasi-xip-base3
Changes since 1.205: +3 -2 lines
Diff to previous 1.205 (colored) to selected 1.127 (colored)

Actually, the comment probably meant "would be nice to KASSERT here,
but can't".  So turn it into a KASSERT now that it's possible.

Revision 1.205 / (download) - annotate - [select for diffs], Wed Sep 1 15:12:16 2010 UTC (13 years, 7 months ago) by pooka
Branch: MAIN
Changes since 1.204: +2 -3 lines
Diff to previous 1.204 (colored) to selected 1.127 (colored)

Remove XXX comment.  I'm not sure what it precisely means, but I'm
guessing it's from a time when rump used filedesc0 for everything
(and that isn't true anymore).

Revision 1.204 / (download) - annotate - [select for diffs], Wed Aug 4 14:25:16 2010 UTC (13 years, 7 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base10, uebayasi-xip-base2
Changes since 1.203: +2 -3 lines
Diff to previous 1.203 (colored) to selected 1.127 (colored)

Remove overzealous KASSERT: the refcount can be non-zero if another
thread attempts to use a non-open file descriptor.  from ad

fixes PR kern/43694

Revision 1.203 / (download) - annotate - [select for diffs], Thu Jul 1 02:38:30 2010 UTC (13 years, 9 months ago) by rmind
Branch: MAIN
Changes since 1.202: +19 -14 lines
Diff to previous 1.202 (colored) to selected 1.127 (colored)

Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour.  Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.

Revision 1.202 / (download) - annotate - [select for diffs], Sun Dec 20 09:36:05 2009 UTC (14 years, 3 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base1, uebayasi-xip-base
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.201: +16 -6 lines
Diff to previous 1.201 (colored) to selected 1.127 (colored)

If a multithreaded app closes an fd while another thread is blocked in
read/write/accept, then the expectation is that the blocked thread will
exit and the close complete.
Since only one fd is affected, but many fd can refer to the same file,
the close code can only request the fs code unblock with ERESTART.
Fixed for pipes and sockets, ERESTART will only be generated after such
a close - so there should be no change for other programs.
Also rename fo_abort() to fo_restart() (this used to be fo_drain()).
Fixes PR/26567

Revision 1.201 / (download) - annotate - [select for diffs], Wed Dec 9 21:32:59 2009 UTC (14 years, 3 months ago) by dsl
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.200: +4 -4 lines
Diff to previous 1.200 (colored) to selected 1.127 (colored)

Rename fo_drain() to fo_abort(), 'drain' is used to mean 'wait for output
do drain' in many places, whereas fo_drain() was called in order to force
blocking read()/write() etc calls to return to userspace so that a close()
call from a different thread can complete.
In the sockets code comment out the broken code in the inner function,
it was being called from compat code.

Revision 1.200 / (download) - annotate - [select for diffs], Tue Oct 27 02:58:28 2009 UTC (14 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: jym-xensuspend-nbase
Changes since 1.199: +6 -4 lines
Diff to previous 1.199 (colored) to selected 1.127 (colored)

- Amend fd_hold() to take an argument and add assert (reflects two cases,
  fork1() and the rest, e.g. kthread_create(), when creating from lwp0).

- lwp_create(): do not touch filedesc internals, use fd_hold().

Revision 1.199 / (download) - annotate - [select for diffs], Sun Aug 16 11:00:20 2009 UTC (14 years, 7 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7
Changes since 1.198: +3 -2 lines
Diff to previous 1.198 (colored) to selected 1.127 (colored)

assertion

Revision 1.198 / (download) - annotate - [select for diffs], Tue Jun 30 20:32:49 2009 UTC (14 years, 9 months ago) by martin
Branch: MAIN
CVS Tags: yamt-nfs-mp-base6, jymxensuspend-base
Changes since 1.197: +4 -2 lines
Diff to previous 1.197 (colored) to selected 1.127 (colored)

Update fd_freefile when kqueue descriptors are not copied from
parent to child. From Wolfgang Solfrank in PR kern/41651.
Approved by Andrew Doran.

Revision 1.197 / (download) - annotate - [select for diffs], Mon Jun 8 00:19:56 2009 UTC (14 years, 9 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-nfs-mp-base5
Changes since 1.196: +9 -7 lines
Diff to previous 1.196 (colored) to selected 1.127 (colored)

fd_free: fix posix advisory locks.  PR/41549 from HITOSHI OSADA.

Revision 1.196 / (download) - annotate - [select for diffs], Sun Jun 7 09:39:02 2009 UTC (14 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.195: +14 -3 lines
Diff to previous 1.195 (colored) to selected 1.127 (colored)

shut up the following assertion failure and add a comment.

	panic: kernel diagnostic assertion "!fd_isused(fdp, fd)" failed: file "/siro/nbsd/src/sys/kern/kern_descrip.c", line 175

Revision 1.195 / (download) - annotate - [select for diffs], Fri May 29 00:10:52 2009 UTC (14 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.194: +8 -4 lines
Diff to previous 1.194 (colored) to selected 1.127 (colored)

fd_free: reset fd_himap/lomap to make fd_checkmaps comfortable.  PR/41487.

Revision 1.194 / (download) - annotate - [select for diffs], Thu May 28 22:17:04 2009 UTC (14 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.193: +4 -3 lines
Diff to previous 1.193 (colored) to selected 1.127 (colored)

wrap a long line.

Revision 1.193 / (download) - annotate - [select for diffs], Tue May 26 00:42:33 2009 UTC (14 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.192: +2 -3 lines
Diff to previous 1.192 (colored) to selected 1.127 (colored)

PR kern/41487: kern_descrip.c assertion failure

Remove bogus assertion.

Revision 1.192 / (download) - annotate - [select for diffs], Sun May 24 21:41:26 2009 UTC (14 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.191: +327 -310 lines
Diff to previous 1.191 (colored) to selected 1.127 (colored)

More changes to improve kern_descrip.c.

- Avoid atomics in more places.
- Remove the per-descriptor mutex, and just use filedesc_t::fd_lock.
  It was only being used to synchronize close, and in any case we needed
  to take fd_lock to free the descriptor slot.
- Optimize certain paths for the <NDFDFILE case.
- Sprinkle more comments and assertions.
- Cache more stuff in filedesc_t.
- Fix numerous minor bugs spotted along the way.
- Restructure how the open files array is maintained, for clarity and so
  that we can eliminate the membar_consumer() call in fd_getfile().  This is
  mostly syntactic sugar; the main functional change is that fd_nfiles now
  lives alongside the open file array.

Some measurements with libmicro:

- simple file syscalls are like close() are between 1 to 10% faster.
- some nice improvements, e.g. poll(1000) which is ~50% faster.

Revision 1.191 / (download) - annotate - [select for diffs], Sat May 23 18:28:05 2009 UTC (14 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.190: +76 -44 lines
Diff to previous 1.190 (colored) to selected 1.127 (colored)

Make descriptor access and file allocation cheaper in many cases,
mostly by avoiding a bunch of atomic operations.

Revision 1.190 / (download) - annotate - [select for diffs], Sat Apr 4 10:12:51 2009 UTC (14 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jym-xensuspend-base
Changes since 1.189: +19 -5 lines
Diff to previous 1.189 (colored) to selected 1.127 (colored)

Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.

Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.

thr0	accept(fd, ...)
thr1	close(fd)

Revision 1.189 / (download) - annotate - [select for diffs], Sun Mar 29 04:40:01 2009 UTC (15 years ago) by rmind
Branch: MAIN
Changes since 1.188: +22 -8 lines
Diff to previous 1.188 (colored) to selected 1.127 (colored)

fownsignal: pre-check for zero pgid, avoids locking of proc_lock.

Revision 1.188 / (download) - annotate - [select for diffs], Wed Mar 11 06:05:29 2009 UTC (15 years ago) by mrg
Branch: MAIN
Changes since 1.187: +13 -2 lines
Diff to previous 1.187 (colored) to selected 1.127 (colored)

completely rework the way that orphaned sockets that are being fdpassed
via SCM_RIGHTS messages are dealt with:

1. unp_gc: make this a kthread.

2. unp_detach: go not call unp_gc directly. instead, wake up unp_gc kthread.

3. unp_scan: do not close files here. instead, put them on a global list
   for unp_gc to close, along with a per-file "deferred close count". if
   file is already enqueued for close, just increment deferred close count.
   this eliminates the recursive calls.

3. unp_gc: scan files on global deferred close list. close each file N
   times, as specified by deferred close count in file. continue processing
   list until it becomes empty (closing may cause additional files to be
   queued for close).

4. unp_gc: add additional bit to mark files we are scanning. set during
   initial scan of global file list that currently clears FMARK/FDEFER.
   during later scans, never examine / garbage collect descriptors that
   we have not marked during the earlier scan. do not proceed with this
   initial scan until all deferred closes have been processed. be careful
   with locking to ensure no races are introduced between deferred close
   and file scan.

5. unp_gc: use dummy file_t to mark position in list when scanning. allow
   us to drop filelist_lock. in turn allows us to eliminate kmem_alloc()
   and safely close files, etc.

6. prohibit transfer of descriptors within SCM_RIGHTS messages if
   (num_files_in_transit > maxfiles / unp_rights_ratio)

7. fd_allocfile: ensure recycled filse don't get scanned.


this is 97% work done by andrew doran, with a couple of minor bug fixes
and a lot of testing by yours truly.

Revision 1.187 / (download) - annotate - [select for diffs], Sun Mar 8 12:52:08 2009 UTC (15 years ago) by ad
Branch: MAIN
Changes since 1.186: +2 -3 lines
Diff to previous 1.186 (colored) to selected 1.127 (colored)

Don't bother with file_t::f_iflags any more, as it's not used.
Noted by mrg@.

Revision 1.186 / (download) - annotate - [select for diffs], Mon Mar 2 19:28:08 2009 UTC (15 years, 1 month ago) by rmind
Branch: MAIN
CVS Tags: nick-hppapmap-base2
Changes since 1.185: +4 -4 lines
Diff to previous 1.185 (colored) to selected 1.127 (colored)

fd_copy: fix off-by-one bug in a race condition path and assert.
Should fix PR/40625.  OK by <ad>.

Revision 1.185 / (download) - annotate - [select for diffs], Sun Dec 21 09:58:22 2008 UTC (15 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: mjf-devfs2-base
Branch point for: jym-xensuspend
Changes since 1.184: +89 -36 lines
Diff to previous 1.184 (colored) to selected 1.127 (colored)

- Fix a bug where we trashed descriptor zero in the old open files array
  while ironically trying to preserve the same during copy. Would only have
  occurred if a multithreaded program expanded the descriptor table and,
  within a tiny window of exposure, another thread in the program tried to
  access descriptor zero.

- Convert to use kmem_alloc/kmem_free.

Revision 1.184 / (download) - annotate - [select for diffs], Tue Nov 18 13:01:41 2008 UTC (15 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Changes since 1.183: +4 -122 lines
Diff to previous 1.183 (colored) to selected 1.127 (colored)

Move fd_closeexec() and fd_checkstd() from kern_descrip to their
own file, subr_exec_fd.c (they're used only by exec).

After this change, the kernel source modules are in a partitioned
enough state to allow building a system without vfs at all.

Revision 1.183 / (download) - annotate - [select for diffs], Tue Nov 18 11:36:58 2008 UTC (15 years, 4 months ago) by pooka
Branch: MAIN
Changes since 1.182: +4 -96 lines
Diff to previous 1.182 (colored) to selected 1.127 (colored)

cwd is logically a vfs concept, so take it out from the bosom of
kern_descrip and into vfs_cwd.  No functional change.

Revision 1.182 / (download) - annotate - [select for diffs], Wed Jul 2 16:45:19 2008 UTC (15 years, 9 months ago) by matt
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, simonb-wapbl-nbase, simonb-wapbl-base, netbsd-5-base, netbsd-5-0-RC1, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5, haad-dm
Changes since 1.181: +6 -6 lines
Diff to previous 1.181 (colored) to selected 1.127 (colored)

Change {ff,fd}_exclose and ff_allocated to bool.  Change exclose arg to
fd_dup to bool.  Switch assignments from 1/0 to true/false.

This make alpha kernels compile.  Bump kern to 4.99.69 since structure
changed.

Revision 1.181 / (download) - annotate - [select for diffs], Wed Jul 2 14:47:34 2008 UTC (15 years, 9 months ago) by matt
Branch: MAIN
Changes since 1.180: +3 -3 lines
Diff to previous 1.180 (colored) to selected 1.127 (colored)

Switch from KASSERT to CTASSERT for those asserts testing sizes of types.

Revision 1.180 / (download) - annotate - [select for diffs], Tue Jun 24 10:26:26 2008 UTC (15 years, 9 months ago) by gmcgarry
Branch: MAIN
Changes since 1.179: +4 -4 lines
Diff to previous 1.179 (colored) to selected 1.127 (colored)

ioctl commands are unsigned long.  Changes ABI for fsetown() and fgetown() on 64-bit architectures.

Revision 1.179 / (download) - annotate - [select for diffs], Mon May 5 17:11:17 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa, simonb-wapbl
Changes since 1.178: +3 -3 lines
Diff to previous 1.178 (colored) to selected 1.127 (colored)

- Convert hashinit() to use kmem_alloc(). The hash tables can be large
  and it's better to not have them in kmem_map.
- Convert a couple of minor items along the way to kmem_alloc().
- Fix some memory leaks.

Revision 1.178 / (download) - annotate - [select for diffs], Mon Apr 28 20:24:02 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
Changes since 1.177: +2 -9 lines
Diff to previous 1.177 (colored) to selected 1.127 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.177 / (download) - annotate - [select for diffs], Thu Apr 24 18:39:23 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Changes since 1.176: +4 -4 lines
Diff to previous 1.176 (colored) to selected 1.127 (colored)

Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.

Revision 1.176 / (download) - annotate - [select for diffs], Thu Apr 24 15:35:29 2008 UTC (15 years, 11 months ago) by ad
Branch: MAIN
Changes since 1.175: +9 -10 lines
Diff to previous 1.175 (colored) to selected 1.127 (colored)

Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.

Revision 1.175 / (download) - annotate - [select for diffs], Wed Apr 9 19:36:59 2008 UTC (15 years, 11 months ago) by wiz
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Changes since 1.174: +3 -3 lines
Diff to previous 1.174 (colored) to selected 1.127 (colored)

Commit fix for the fdfile leak described in PR 38374.

Patch provided by YAMAMOTO Takashi.

Ok ad@

Revision 1.174 / (download) - annotate - [select for diffs], Thu Mar 27 18:33:39 2008 UTC (16 years ago) by ad
Branch: MAIN
Changes since 1.173: +6 -6 lines
Diff to previous 1.173 (colored) to selected 1.127 (colored)

Replace use of CACHE_LINE_SIZE in some obvious places.

Revision 1.173 / (download) - annotate - [select for diffs], Fri Mar 21 21:53:35 2008 UTC (16 years ago) by ad
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, ad-socklock-base1
Changes since 1.172: +1099 -1340 lines
Diff to previous 1.172 (colored) to selected 1.127 (colored)

File descriptor changes, discussed on tech-kern:

- Redo reference counting to be sane.  LWPs accessing files take a short
  term reference on the local file descriptor.  This is the most common
  case.  While a file is in a process descriptor table, a reference is
  held to the file.  The file reference count only changes during control
  operations like open() or close().  Code that comes at files from an
  unusual direction (i.e. foreign to the process) like procfs or sysctl
  takes a reference on the file (f_count), and not on a descriptor.

- Remove knowledge of reference counting and locking from most code that
  deals with files.

- Make the usual case of file descriptor lookup lockless.

- Make kqueue MP and MT safe. PR kern/38098, PR kern/38137.

- Fix numerous file handling bugs, and bugs in the descriptor code that
  affected multithreaded processes.

- Split descriptor system calls out into sys_descrip.c.

- A few stylistic changes: KNF, remove unused casts now that caddr_t is
  gone. Replace dumb gotos with loop control in a few places.

- Don't do redundant pointer passing (struct proc, lwp, filedesc *) unless
  the routine is likely to be inlined.  Most of the time it's about the
  current process.

Revision 1.172 / (download) - annotate - [select for diffs], Wed Feb 6 21:51:36 2008 UTC (16 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base
Branch point for: mjf-devfs2
Changes since 1.171: +11 -8 lines
Diff to previous 1.171 (colored) to selected 1.127 (colored)

- Shrink 'struct file' to 60 bytes on 32-bit platforms.
- Align 'struct file' and 'struct filedesc' to CACHE_LINE_SIZE.

Revision 1.171 / (download) - annotate - [select for diffs], Sun Jan 27 19:48:53 2008 UTC (16 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.170: +2 -4 lines
Diff to previous 1.170 (colored) to selected 1.127 (colored)

Move the prototype for do_posix_fadvise() somewhere useful.

Revision 1.170 / (download) - annotate - [select for diffs], Sun Jan 27 16:16:50 2008 UTC (16 years, 2 months ago) by martin
Branch: MAIN
Changes since 1.169: +23 -12 lines
Diff to previous 1.169 (colored) to selected 1.127 (colored)

Implement new version of posix_fadvise as a stub callinig the real
worker function, and compatibility stub doing the same with old argument
sturcture.

Revision 1.169 / (download) - annotate - [select for diffs], Sat Jan 5 23:53:21 2008 UTC (16 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: matt-armv6-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.168: +23 -2 lines
Diff to previous 1.168 (colored) to selected 1.127 (colored)

Add fgetdummy/fputdummy: allocate and free dummy 'struct file' entries
to be used when traversing filehead.

Revision 1.168 / (download) - annotate - [select for diffs], Sat Jan 5 19:08:50 2008 UTC (16 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.167: +21 -21 lines
Diff to previous 1.167 (colored) to selected 1.127 (colored)

Use FILE_LOCK() and FILE_UNLOCK()

Revision 1.167 / (download) - annotate - [select for diffs], Wed Dec 26 16:01:35 2007 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.166: +58 -44 lines
Diff to previous 1.166 (colored) to selected 1.127 (colored)

Merge more changes from vmlocking2, mainly:

- Locking improvements.
- Use pool_cache for more items.

Revision 1.166 / (download) - annotate - [select for diffs], Thu Dec 20 23:03:07 2007 UTC (16 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.165: +26 -26 lines
Diff to previous 1.165 (colored) to selected 1.127 (colored)

Convert all the system call entry points from:
    int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.

Revision 1.165 / (download) - annotate - [select for diffs], Sat Dec 8 19:29:47 2007 UTC (16 years, 3 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, jmcneill-pm-base, cube-autoconf-base, cube-autoconf
Branch point for: bouyer-xeni386
Changes since 1.164: +3 -4 lines
Diff to previous 1.164 (colored) to selected 1.127 (colored)

Remove cn_lwp from struct componentname.  curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.

Revision 1.164 / (download) - annotate - [select for diffs], Thu Nov 29 18:17:47 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base
Branch point for: vmlocking2
Changes since 1.163: +4 -9 lines
Diff to previous 1.163 (colored) to selected 1.127 (colored)

Use atomics to adjust filedesc::fd_refcnt.

Revision 1.163 / (download) - annotate - [select for diffs], Thu Nov 29 18:15:14 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.162: +5 -10 lines
Diff to previous 1.162 (colored) to selected 1.127 (colored)

Use atomics to adjust cwdi_refcnt.

Revision 1.162 / (download) - annotate - [select for diffs], Wed Nov 7 00:23:20 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: bouyer-xenamd64-base2, bouyer-xenamd64-base
Changes since 1.161: +47 -23 lines
Diff to previous 1.161 (colored) to selected 1.127 (colored)

Merge from vmlocking:

- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.

Revision 1.161 / (download) - annotate - [select for diffs], Mon Oct 8 15:12:07 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, vmlocking-base, jmcneill-base
Branch point for: mjf-devfs, bouyer-xenamd64
Changes since 1.160: +108 -73 lines
Diff to previous 1.160 (colored) to selected 1.127 (colored)

Merge file descriptor locking, cwdi locking and cross-call changes
from the vmlocking branch.

Revision 1.160 / (download) - annotate - [select for diffs], Fri Sep 7 18:56:08 2007 UTC (16 years, 6 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-x86pmap-base2, yamt-x86pmap-base, nick-csl-alignment-base5
Branch point for: yamt-x86pmap
Changes since 1.159: +36 -2 lines
Diff to previous 1.159 (colored) to selected 1.127 (colored)

Implementation of POSIX message queues.

Reviewed by: <ad>, <tech-kern>

Revision 1.159 / (download) - annotate - [select for diffs], Mon Jul 9 21:10:51 2007 UTC (16 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: nick-csl-alignment-base, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: nick-csl-alignment, matt-armv6, jmcneill-pm
Changes since 1.158: +8 -7 lines
Diff to previous 1.158 (colored) to selected 1.127 (colored)

Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements

Revision 1.158 / (download) - annotate - [select for diffs], Sat May 12 23:02:50 2007 UTC (16 years, 10 months ago) by dsl
Branch: MAIN
CVS Tags: yamt-idlelwp-base8
Changes since 1.157: +92 -73 lines
Diff to previous 1.157 (colored) to selected 1.127 (colored)

Split the fcntl locking code out from its copyin/out.
Use to avoid all the stackgap stuff in compat code.

Revision 1.157 / (download) - annotate - [select for diffs], Sun Apr 22 18:41:49 2007 UTC (16 years, 11 months ago) by dsl
Branch: MAIN
Changes since 1.156: +5 -4 lines
Diff to previous 1.156 (colored) to selected 1.127 (colored)

I'm not sure why I decided that cwdinit() shouldn't copy cwd_edir.
Since this is called in fork() it does rather need to give the child
process the parent's emulation root.
This means that (for example) an emulated shell will, by default, run
programs from the emulation root.

Revision 1.156 / (download) - annotate - [select for diffs], Sun Apr 22 08:30:00 2007 UTC (16 years, 11 months ago) by dsl
Branch: MAIN
Changes since 1.155: +9 -2 lines
Diff to previous 1.155 (colored) to selected 1.127 (colored)

Change the way that emulations locate files within the emulation root to
  avoid having to allocate space in the 'stackgap'
  - which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
  the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
  during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
  search for absolute pathnames in the emulation root, if that fails it will
  retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
  of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
  relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
  inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
  the real root is returned instead (matching the behaviour of emul_lookup,
  but being a cheap comparison here) so that programs that scan "../.."
  looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
  CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
  TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.

Revision 1.155 / (download) - annotate - [select for diffs], Wed Mar 21 21:18:56 2007 UTC (17 years ago) by dsl
Branch: MAIN
CVS Tags: thorpej-atomic-base, thorpej-atomic
Changes since 1.154: +3 -4 lines
Diff to previous 1.154 (colored) to selected 1.127 (colored)

Somehow a single K&R function definition was lurking - nuke it.

Revision 1.154 / (download) - annotate - [select for diffs], Mon Mar 12 18:18:32 2007 UTC (17 years ago) by ad
Branch: MAIN
Branch point for: reinoud-bufcleanup, mjf-ufs-trans
Changes since 1.153: +5 -5 lines
Diff to previous 1.153 (colored) to selected 1.127 (colored)

Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.

Revision 1.153 / (download) - annotate - [select for diffs], Sat Mar 10 16:50:01 2007 UTC (17 years ago) by dsl
Branch: MAIN
Branch point for: vmlocking
Changes since 1.152: +26 -18 lines
Diff to previous 1.152 (colored) to selected 1.127 (colored)

Split the work for sys_stat, sys_lstat, sys_fstat and sys_fhstat out into
separate functions that don't do the copyout.
This allows all the compat_xxx versions to convert the 'struct stat' to
the correct format without using the 'stackgap'.
The stackgap isn't at all LWP friendly, and needs to be removed from
any compat functions that might involve threads (inc. clone()).
The code is still binary compatible with existing LKMs.

Revision 1.152 / (download) - annotate - [select for diffs], Fri Mar 9 14:11:24 2007 UTC (17 years ago) by ad
Branch: MAIN
Changes since 1.151: +4 -4 lines
Diff to previous 1.151 (colored) to selected 1.127 (colored)

- Make the proclist_lock a mutex. The write:read ratio is unfavourable,
  and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.

Revision 1.151 / (download) - annotate - [select for diffs], Sat Feb 17 22:31:42 2007 UTC (17 years, 1 month ago) by pavel
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.150: +5 -5 lines
Diff to previous 1.150 (colored) to selected 1.127 (colored)

Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.

Revision 1.150 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:30 2007 UTC (17 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: post-newlock2-merge
Branch point for: yamt-idlelwp
Changes since 1.149: +16 -6 lines
Diff to previous 1.149 (colored) to selected 1.127 (colored)

Merge newlock2 to head.

Revision 1.149 / (download) - annotate - [select for diffs], Wed Jan 31 16:00:43 2007 UTC (17 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: newlock2-nbase, newlock2-base
Changes since 1.148: +6 -3 lines
Diff to previous 1.148 (colored) to selected 1.127 (colored)

ffree(): don't call kauth_cred_free() with a held simplelock.

Revision 1.148 / (download) - annotate - [select for diffs], Wed Dec 6 10:02:22 2006 UTC (17 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3
Changes since 1.147: +3 -3 lines
Diff to previous 1.147 (colored) to selected 1.127 (colored)

use KSI_INIT rather than memset.  no functional changes.

Revision 1.147 / (download) - annotate - [select for diffs], Wed Nov 1 10:17:58 2006 UTC (17 years, 5 months ago) by yamt
Branch: MAIN
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm
Changes since 1.146: +15 -15 lines
Diff to previous 1.146 (colored) to selected 1.127 (colored)

remove some __unused from function parameters.

Revision 1.146 / (download) - annotate - [select for diffs], Thu Oct 12 01:32:14 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.145: +15 -12 lines
Diff to previous 1.145 (colored) to selected 1.127 (colored)

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.145 / (download) - annotate - [select for diffs], Sat Sep 2 06:22:45 2006 UTC (17 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.144: +3 -3 lines
Diff to previous 1.144 (colored) to selected 1.127 (colored)

add missing initializer

Revision 1.144 / (download) - annotate - [select for diffs], Sun Jul 23 22:06:11 2006 UTC (17 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.143: +8 -5 lines
Diff to previous 1.143 (colored) to selected 1.127 (colored)

Use the LWP cached credentials where sane.

Revision 1.143 / (download) - annotate - [select for diffs], Sun May 14 21:15:11 2006 UTC (17 years, 10 months ago) by elad
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, chap-midi
Changes since 1.142: +7 -6 lines
Diff to previous 1.142 (colored) to selected 1.127 (colored)

integrate kauth.

Revision 1.142 / (download) - annotate - [select for diffs], Sat Apr 15 04:50:08 2006 UTC (17 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: elad-kernelauth-base
Changes since 1.141: +3 -3 lines
Diff to previous 1.141 (colored) to selected 1.127 (colored)

Coverity CID 845: Make it clear that devnullfp != NULL.

Revision 1.141 / (download) - annotate - [select for diffs], Tue Mar 7 17:13:53 2006 UTC (18 years ago) by pooka
Branch: MAIN
CVS Tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, peter-altq-base
Branch point for: peter-altq, elad-kernelauth
Changes since 1.140: +2 -24 lines
Diff to previous 1.140 (colored) to selected 1.127 (colored)

remove the no longer useful fdavail(), as proposed and (thankfully) not
discussed on tech-kern

Revision 1.140 / (download) - annotate - [select for diffs], Tue Jan 31 14:02:10 2006 UTC (18 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.139: +4 -2 lines
Diff to previous 1.139 (colored) to selected 1.127 (colored)

falloc: grab fd_slock when calling fd_unused.

Revision 1.139 / (download) - annotate - [select for diffs], Sat Dec 24 19:12:23 2005 UTC (18 years, 3 months ago) by perry
Branch: MAIN
Branch point for: yamt-uio_vmspace
Changes since 1.138: +5 -5 lines
Diff to previous 1.138 (colored) to selected 1.127 (colored)

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.138 / (download) - annotate - [select for diffs], Sun Dec 11 12:24:29 2005 UTC (18 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.137: +79 -70 lines
Diff to previous 1.137 (colored) to selected 1.127 (colored)

merge ktrace-lwp.

Revision 1.137 / (download) - annotate - [select for diffs], Tue Nov 29 22:52:02 2005 UTC (18 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: ktrace-lwp-base
Changes since 1.136: +70 -2 lines
Diff to previous 1.136 (colored) to selected 1.127 (colored)

merge yamt-readahead branch.

Revision 1.136 / (download) - annotate - [select for diffs], Mon Oct 3 02:06:00 2005 UTC (18 years, 6 months ago) by mrg
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, thorpej-vnode-attr-base, thorpej-vnode-attr
Branch point for: yamt-readahead
Changes since 1.135: +4 -3 lines
Diff to previous 1.135 (colored) to selected 1.127 (colored)

fix a bug pointed out by der mouse on tech-kern: in F_GETOWN, use a
pointer to a temporary "int" variable to pass to fo_ioctl(TIOCGPGRP), not
a register_t pointer.  (how did F_GETOWN ever work on sparc64 before?)

Revision 1.135 / (download) - annotate - [select for diffs], Fri Aug 19 02:04:03 2005 UTC (18 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.134: +4 -4 lines
Diff to previous 1.134 (colored) to selected 1.127 (colored)

64 bit inode changes.

Revision 1.134 / (download) - annotate - [select for diffs], Thu Jun 23 23:15:12 2005 UTC (18 years, 9 months ago) by thorpej
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.133: +120 -129 lines
Diff to previous 1.133 (colored) to selected 1.127 (colored)

Use ANSI function decls.  Apply some static.

Revision 1.133 / (download) - annotate - [select for diffs], Sun May 29 22:24:15 2005 UTC (18 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.132: +25 -25 lines
Diff to previous 1.132 (colored) to selected 1.127 (colored)

- add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.

Revision 1.132 / (download) - annotate - [select for diffs], Fri May 20 16:13:00 2005 UTC (18 years, 10 months ago) by wrstuden
Branch: MAIN
Changes since 1.131: +3 -3 lines
Diff to previous 1.131 (colored) to selected 1.127 (colored)

The file being closed is (fdp->fd_lastfile - i), not i. So compare
(fdp->fd_lastfile - i) against fd_knlistsize. Otherwise we can
call knote_fdclose() on a file descriptor that doesn't have a knote.

This issue explains random panics I have had on process exit over the
past few years.

Revision 1.131 / (download) - annotate - [select for diffs], Sat Feb 26 21:34:55 2005 UTC (19 years, 1 month ago) by perry
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base, kent-audio2-base
Branch point for: netbsd-3
Changes since 1.130: +6 -6 lines
Diff to previous 1.130 (colored) to selected 1.127 (colored)

nuke trailing whitespace

Revision 1.130 / (download) - annotate - [select for diffs], Sat Feb 12 23:14:03 2005 UTC (19 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.129: +5 -5 lines
Diff to previous 1.129 (colored) to selected 1.127 (colored)

pass the flag to fdclone.

Revision 1.129 / (download) - annotate - [select for diffs], Fri Jan 14 00:25:12 2005 UTC (19 years, 2 months ago) by cube
Branch: MAIN
CVS Tags: yamt-km-base2, yamt-km-base
Branch point for: yamt-km, kent-audio2
Changes since 1.128: +3 -3 lines
Diff to previous 1.128 (colored) to selected 1.127 (colored)

As fd_lastfile might be negative, we can't use the (u_int) cast trick to
compare fd and fdp->fd_lastfile in fdrelease(), so change the test to a
more explicit one.  Spotted by Matt Thomas.

Should fix the panic reported by Matthias Scheler.

Revision 1.128 / (download) - annotate - [select for diffs], Wed Jan 12 20:41:45 2005 UTC (19 years, 2 months ago) by cube
Branch: MAIN
Changes since 1.127: +10 -5 lines
Diff to previous 1.127 (colored)

fd_lastfile should be -1 when there are no opened file descriptors.
Hence, make find_last_set return -1 in such situation, and initialize it
such.  Otherwise, with 0 meaning two things, it confused the F_CLOSEM
fcntl which could end up looping indifintely (PR#28929 by Brian Marcotte).

However, this change enlightens another bug in fdcopy(), where more entries
than needed were cleared in the new file descriptor table, so the memset()
call there is fixed too.

Analyzed with the help of Greg Oster.

Revision 1.127 / (download) - annotate - [selected], Tue Nov 30 04:25:43 2004 UTC (19 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Changes since 1.126: +56 -7 lines
Diff to previous 1.126 (colored)

Cloning cleanup:
1. make fileops const
2. add 2 new negative errno's to `officially' support the cloning hack:
    - EDUPFD (used to overload ENODEV)
    - EMOVEFD (used to overload ENXIO)
3. Created an fdclone() function to encapsulate the operations needed for
   EMOVEFD, and made all cloners use it.
4. Centralize the local noop/badop fileops functions to:
   fnullop_fcntl, fnullop_poll, fnullop_kqfilter, fbadop_stat

Revision 1.126 / (download) - annotate - [select for diffs], Mon May 31 15:30:55 2004 UTC (19 years, 10 months ago) by pk
Branch: MAIN
Changes since 1.125: +166 -78 lines
Diff to previous 1.125 (colored) to selected 1.127 (colored)

Implement mutexes for file descriptor and current working directory access.
Fix a potential race condition when reallocating storage for file descriptors
(even for non-SMP kernels).
Add missing locks for `struct file' ref count updates.

Revision 1.125 / (download) - annotate - [select for diffs], Sun Apr 25 16:42:41 2004 UTC (19 years, 11 months ago) by simonb
Branch: MAIN
Changes since 1.124: +8 -20 lines
Diff to previous 1.124 (colored) to selected 1.127 (colored)

Initialise (most) pools from a link set instead of explicit calls
to pool_init.  Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.

 Convert struct session, ucred and lockf to pools.

Revision 1.124 / (download) - annotate - [select for diffs], Mon Apr 5 10:10:29 2004 UTC (19 years, 11 months ago) by yamt
Branch: MAIN
Changes since 1.123: +17 -5 lines
Diff to previous 1.123 (colored) to selected 1.127 (colored)

add assertions related to file descriptor allocation.

Revision 1.123 / (download) - annotate - [select for diffs], Wed Jan 7 09:26:29 2004 UTC (20 years, 2 months ago) by jdolecek
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.122: +4 -3 lines
Diff to previous 1.122 (colored) to selected 1.127 (colored)

fix F_MAXFD fcntl - it returned the value as errno instead
of return value from the syscall
from mouss <usebsd at free dot fr>

Revision 1.122 / (download) - annotate - [select for diffs], Mon Jan 5 00:36:49 2004 UTC (20 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.121: +19 -3 lines
Diff to previous 1.121 (colored) to selected 1.127 (colored)

Ad F_CLOSEM, F_MAXFD from Matt Thomas.

Revision 1.121 / (download) - annotate - [select for diffs], Sun Nov 30 18:16:45 2003 UTC (20 years, 4 months ago) by provos
Branch: MAIN
Changes since 1.120: +3 -3 lines
Diff to previous 1.120 (colored) to selected 1.127 (colored)

fix off by one in find_last_set(); triggered for processes that have no
open file descriptors; found by tim robbins from freebsd

Revision 1.120 / (download) - annotate - [select for diffs], Wed Nov 26 12:42:28 2003 UTC (20 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.119: +4 -2 lines
Diff to previous 1.119 (colored) to selected 1.127 (colored)

fdcopy: copy inline bitmaps properly.
hopefully fixes PR/23469.

Revision 1.119 / (download) - annotate - [select for diffs], Sun Nov 9 07:57:15 2003 UTC (20 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.118: +4 -4 lines
Diff to previous 1.118 (colored) to selected 1.127 (colored)

fix typos in comments.

Revision 1.118 / (download) - annotate - [select for diffs], Sun Nov 9 07:55:38 2003 UTC (20 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.117: +15 -14 lines
Diff to previous 1.117 (colored) to selected 1.127 (colored)

- fix an use-after-free bug in /dev/fd/* handling.
  specifically, don't keep a stale pointer in fd_ofiles.
  it isn't needed anymore as fd allocation is now done using bitmaps.
- clean up dupfdopen() a little.
- don't call fd_used() unnecessarily.

Revision 1.117 / (download) - annotate - [select for diffs], Sun Nov 9 07:52:26 2003 UTC (20 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.116: +8 -8 lines
Diff to previous 1.116 (colored) to selected 1.127 (colored)

in the non-overwritten case of sys_dup2(),
call fd_used() by itsself rather than leaving it to finishdup().

Revision 1.116 / (download) - annotate - [select for diffs], Sat Nov 1 18:47:16 2003 UTC (20 years, 5 months ago) by provos
Branch: MAIN
Changes since 1.115: +4 -4 lines
Diff to previous 1.115 (colored) to selected 1.127 (colored)

use fdremove to remove kqueue file descriptor so that bitmap information
is maintained correctly; found by Juergen Hannken-Illjes

Revision 1.115 / (download) - annotate - [select for diffs], Thu Oct 30 07:27:02 2003 UTC (20 years, 5 months ago) by provos
Branch: MAIN
Changes since 1.114: +145 -15 lines
Diff to previous 1.114 (colored) to selected 1.127 (colored)

use a two-level bitmap as suggested by mogul and banga for fdalloc;
approved thorpej@

Revision 1.114 / (download) - annotate - [select for diffs], Mon Sep 22 12:59:55 2003 UTC (20 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.113: +4 -4 lines
Diff to previous 1.113 (colored) to selected 1.127 (colored)

- pass signo to fownsignal [ok by jd]
- make urg signal handling use fownsignal
- remove out of band detection in sowakeup

Revision 1.113 / (download) - annotate - [select for diffs], Sun Sep 21 19:17:03 2003 UTC (20 years, 6 months ago) by jdolecek
Branch: MAIN
Changes since 1.112: +74 -24 lines
Diff to previous 1.112 (colored) to selected 1.127 (colored)

cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
  the owner of descriptor, according to appropriate sematics
  of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
  these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
  properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
  in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
  pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@

Revision 1.112 / (download) - annotate - [select for diffs], Sat Sep 13 08:32:13 2003 UTC (20 years, 6 months ago) by jdolecek
Branch: MAIN
Changes since 1.111: +4 -4 lines
Diff to previous 1.111 (colored) to selected 1.127 (colored)

move dupfd from struct proc to struct lwp - it's per-LWP, not per-process; we
use curlwp where the lwp is not directly available, i.e. in device open
routines

briefly discussed on tech-kern

Revision 1.111 / (download) - annotate - [select for diffs], Thu Aug 7 16:31:43 2003 UTC (20 years, 7 months ago) by agc
Branch: MAIN
Changes since 1.110: +3 -7 lines
Diff to previous 1.110 (colored) to selected 1.127 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.

Revision 1.110 / (download) - annotate - [select for diffs], Sun Jun 29 22:31:18 2003 UTC (20 years, 9 months ago) by fvdl
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.109: +62 -73 lines
Diff to previous 1.109 (colored) to selected 1.127 (colored)

Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.

Revision 1.109 / (download) - annotate - [select for diffs], Sat Jun 28 14:21:53 2003 UTC (20 years, 9 months ago) by darrenr
Branch: MAIN
Changes since 1.108: +75 -64 lines
Diff to previous 1.108 (colored) to selected 1.127 (colored)

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

Revision 1.108 / (download) - annotate - [select for diffs], Fri May 16 14:40:41 2003 UTC (20 years, 10 months ago) by itojun
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored) to selected 1.127 (colored)

use strlcat

Revision 1.107 / (download) - annotate - [select for diffs], Sat Mar 22 10:39:47 2003 UTC (21 years ago) by dsl
Branch: MAIN
Changes since 1.106: +24 -14 lines
Diff to previous 1.106 (colored) to selected 1.127 (colored)

Correct rewinding if FIONBIO or FIOASYNC fail in F_SETFL
(code use to always turn off FIONBIO if FIOASYNC fails)
(approved by christos)

Revision 1.106 / (download) - annotate - [select for diffs], Sat Mar 22 10:35:01 2003 UTC (21 years ago) by dsl
Branch: MAIN
Changes since 1.105: +25 -31 lines
Diff to previous 1.105 (colored) to selected 1.127 (colored)

Change caddr_t to void *

Revision 1.105 / (download) - annotate - [select for diffs], Mon Mar 17 07:57:13 2003 UTC (21 years ago) by martin
Branch: MAIN
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored) to selected 1.127 (colored)

When being passed bogus file descriptors make close(2) return EBADF.
From Stephen Ma in PR kern/20762.

Revision 1.104 / (download) - annotate - [select for diffs], Sat Mar 1 09:19:53 2003 UTC (21 years, 1 month ago) by yamt
Branch: MAIN
Changes since 1.103: +5 -3 lines
Diff to previous 1.103 (colored) to selected 1.127 (colored)

make fdcheckstd f_slock friendly.

Revision 1.103 / (download) - annotate - [select for diffs], Sun Feb 23 14:37:33 2003 UTC (21 years, 1 month ago) by pk
Branch: MAIN
Changes since 1.102: +42 -8 lines
Diff to previous 1.102 (colored) to selected 1.127 (colored)

Make updating a file's reference and use count MP-safe.

Revision 1.102 / (download) - annotate - [select for diffs], Fri Feb 14 21:50:10 2003 UTC (21 years, 1 month ago) by pk
Branch: MAIN
Changes since 1.101: +13 -3 lines
Diff to previous 1.101 (colored) to selected 1.127 (colored)

Use a mutex to protect the global list of open files.

Revision 1.101 / (download) - annotate - [select for diffs], Sat Feb 1 06:23:42 2003 UTC (21 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.100: +6 -2 lines
Diff to previous 1.100 (colored) to selected 1.127 (colored)

Add extensible malloc types, adapted from FreeBSD.  This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Jan 19 22:54:47 2003 UTC (21 years, 2 months ago) by simonb
Branch: MAIN
Changes since 1.99: +3 -4 lines
Diff to previous 1.99 (colored) to selected 1.127 (colored)

Remove variable that is only assigned too but not referenced.

Revision 1.99 / (download) - annotate - [select for diffs], Sat Jan 18 10:06:24 2003 UTC (21 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.98: +24 -9 lines
Diff to previous 1.98 (colored) to selected 1.127 (colored)

Merge the nathanw_sa branch.

Revision 1.98 / (download) - annotate - [select for diffs], Mon Jan 6 13:19:53 2003 UTC (21 years, 2 months ago) by wiz
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base
Changes since 1.97: +3 -3 lines
Diff to previous 1.97 (colored) to selected 1.127 (colored)

descriptor, not decriptor.

Revision 1.97 / (download) - annotate - [select for diffs], Sun Nov 24 11:37:54 2002 UTC (21 years, 4 months ago) by scw
Branch: MAIN
CVS Tags: gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Changes since 1.96: +3 -3 lines
Diff to previous 1.96 (colored) to selected 1.127 (colored)

Quell uninitialised variable warnings.

Revision 1.96 / (download) - annotate - [select for diffs], Wed Oct 23 09:14:13 2002 UTC (21 years, 5 months ago) by jdolecek
Branch: MAIN
CVS Tags: kqueue-aftermerge
Changes since 1.95: +33 -3 lines
Diff to previous 1.95 (colored) to selected 1.127 (colored)

merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe

Revision 1.95 / (download) - annotate - [select for diffs], Mon Sep 23 04:19:16 2002 UTC (21 years, 6 months ago) by simonb
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base
Changes since 1.94: +2 -4 lines
Diff to previous 1.94 (colored) to selected 1.127 (colored)

fp->f_count is unsigned, don't check if it's less than zero.

Revision 1.94 / (download) - annotate - [select for diffs], Fri Sep 6 13:18:43 2002 UTC (21 years, 6 months ago) by gehenna
Branch: MAIN
Changes since 1.93: +9 -2 lines
Diff to previous 1.93 (colored) to selected 1.127 (colored)

Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.

Revision 1.93 / (download) - annotate - [select for diffs], Tue Jun 18 02:04:08 2002 UTC (21 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: gehenna-devsw-base
Changes since 1.92: +4 -3 lines
Diff to previous 1.92 (colored) to selected 1.127 (colored)

sys_fpathconf: Don't panic in the default case; just return EOPNOTSUPP.

Revision 1.92 / (download) - annotate - [select for diffs], Thu May 9 17:57:07 2002 UTC (21 years, 10 months ago) by atatat
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Branch point for: gehenna-devsw
Changes since 1.91: +18 -13 lines
Diff to previous 1.91 (colored) to selected 1.127 (colored)

Maintain a short list of the actual descriptors that were closed and
log that intead of being ambiguous about which of 0, 1, and/or 2 it
was that was closed.

Revision 1.91 / (download) - annotate - [select for diffs], Sun Apr 28 22:35:19 2002 UTC (21 years, 11 months ago) by enami
Branch: MAIN
Changes since 1.90: +9 -4 lines
Diff to previous 1.90 (colored) to selected 1.127 (colored)

Log who invoked the s[ug]id program.  Tested by mozilla.

Revision 1.90 / (download) - annotate - [select for diffs], Sat Apr 27 21:36:50 2002 UTC (21 years, 11 months ago) by enami
Branch: MAIN
Changes since 1.89: +18 -20 lines
Diff to previous 1.89 (colored) to selected 1.127 (colored)

A loop to expand file descriptor table and retry is move from fdalloc()
to caller.  So, no longer need to loop in fdalloc().

Revision 1.89 / (download) - annotate - [select for diffs], Sat Apr 27 21:31:41 2002 UTC (21 years, 11 months ago) by enami
Branch: MAIN
Changes since 1.88: +10 -10 lines
Diff to previous 1.88 (colored) to selected 1.127 (colored)

KNF.

Revision 1.88 / (download) - annotate - [select for diffs], Wed Apr 24 16:09:24 2002 UTC (21 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.87: +7 -2 lines
Diff to previous 1.87 (colored) to selected 1.127 (colored)

Avoid file use underflow; thanks to YAMAMOTO Takashi for noticing.

Revision 1.87 / (download) - annotate - [select for diffs], Tue Apr 23 17:20:58 2002 UTC (21 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.86: +6 -4 lines
Diff to previous 1.86 (colored) to selected 1.127 (colored)

Don't forget to set mature and unuse the file.

Revision 1.86 / (download) - annotate - [select for diffs], Tue Apr 23 15:11:25 2002 UTC (21 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.85: +63 -2 lines
Diff to previous 1.85 (colored) to selected 1.127 (colored)

From OpenBSD, via FreeBSD: If a set{u,g}id binary is invoked with fd < 3
closed, open those fds to /dev/null.

XXX: This needs to be fixed in a better way. The kernel should not need to
know about /dev/null or special case 0, 1, 2.

Revision 1.85 / (download) - annotate - [select for diffs], Fri Mar 8 20:48:40 2002 UTC (22 years ago) by thorpej
Branch: MAIN
CVS Tags: newlock-base, newlock, eeh-devprop-base, eeh-devprop
Changes since 1.84: +5 -5 lines
Diff to previous 1.84 (colored) to selected 1.127 (colored)

Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.

Revision 1.84 / (download) - annotate - [select for diffs], Thu Jan 31 22:17:33 2002 UTC (22 years, 2 months ago) by kleink
Branch: MAIN
CVS Tags: ifpoll-base
Changes since 1.83: +4 -4 lines
Diff to previous 1.83 (colored) to selected 1.127 (colored)

fcntl(..., F_GETOWN, ...): fix LP64-BE bug; raised by der Mouse
on tech-kern.

Revision 1.83 / (download) - annotate - [select for diffs], Fri Dec 7 07:09:29 2001 UTC (22 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.82: +5 -5 lines
Diff to previous 1.82 (colored) to selected 1.127 (colored)

Back off previous for now, Jason thinks it's not right. Will discuss
on tech-kern@

Revision 1.82 / (download) - annotate - [select for diffs], Thu Dec 6 22:34:24 2001 UTC (22 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.81: +5 -5 lines
Diff to previous 1.81 (colored) to selected 1.127 (colored)

replace FIF_WANTCLOSE/FIF_LARVAL with FWANTCLOSE/FLARVAL, which are set
in f_flag of struct file
for now, keep former f_iflags of struct file as _f_spare0, it will be g/c'ed
when struct file will be changed (this will happen soon)

Revision 1.81 / (download) - annotate - [select for diffs], Mon Nov 12 15:25:07 2001 UTC (22 years, 4 months ago) by lukem
Branch: MAIN
CVS Tags: thorpej-mips-cache-base
Changes since 1.80: +4 -1 lines
Diff to previous 1.80 (colored) to selected 1.127 (colored)

add RCSIDs

Revision 1.80 / (download) - annotate - [select for diffs], Wed Jul 18 05:34:37 2001 UTC (22 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-mips-cache, thorpej-devvp
Changes since 1.79: +4 -1 lines
Diff to previous 1.79 (colored) to selected 1.127 (colored)

Unshare the file descriptor table and `cwdinfo' when we exec.
From Matthew Orgass <darkstar@pgh.net>.

Revision 1.79 / (download) - annotate - [select for diffs], Sun Jul 1 18:12:00 2001 UTC (22 years, 9 months ago) by thorpej
Branch: MAIN
Branch point for: kqueue
Changes since 1.78: +5 -2 lines
Diff to previous 1.78 (colored) to selected 1.127 (colored)

Duh, use fd_getfile() in sys_close().

Revision 1.78 / (download) - annotate - [select for diffs], Sat Jun 16 08:28:39 2001 UTC (22 years, 9 months ago) by jdolecek
Branch: MAIN
Changes since 1.77: +2 -1 lines
Diff to previous 1.77 (colored) to selected 1.127 (colored)

Add DTYPE_PIPE (to be used by new pipe implementation) and handle
it accordingly.

Revision 1.77 / (download) - annotate - [select for diffs], Thu Jun 14 20:32:47 2001 UTC (22 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.76: +33 -24 lines
Diff to previous 1.76 (colored) to selected 1.127 (colored)

Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads.  What we do is stick descriptors in the table, but
mark them as "larval".  This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again.  When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.

Revision 1.76 / (download) - annotate - [select for diffs], Thu Jun 7 01:29:16 2001 UTC (22 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.75: +58 -39 lines
Diff to previous 1.75 (colored) to selected 1.127 (colored)

Rework fdalloc() even further: split fdalloc() into fdalloc() and
fdexpand().  The former will return ENOSPC if there is not space
in the current filedesc table.  The latter performs the expansion
of the filedesc table.  This means that fdalloc() won't ever block,
and it gives callers an opportunity to clean up before the
potentially-blocking fdexpand() call.

Update all fdalloc() callers to deal with the need-to-fdexpand() case.

Rewrite unp_externalize() to use fdalloc() and fdexpand() in a
safe way, using an algorithm suggested by Bill Sommerfeld:
- Use a temporary array of integers to hold the new filedesc table
  indexes.  This allows us to repeat the loop if necessary.
- Loop through the array of file *'s, assigning them to filedesc table
  slots.  If fdalloc() indicates expansion is necessary, undo the
  assignments we've done so far, expand, and retry the whole process.
- Once all file *'s have been assigned to slots, update the f_msgcount
  and unp_rights counters.
- Right before we return, copy the temporary integer array to the message
  buffer, and trim the length as before.
Note that once locking is added to the filedesc array, this entire
operation will be `atomic', in that the lock will be held while
file *'s are assigned to embryonic table slots, thus preventing anything
else from using them.

Revision 1.75 / (download) - annotate - [select for diffs], Wed Jun 6 17:00:00 2001 UTC (22 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.74: +46 -16 lines
Diff to previous 1.74 (colored) to selected 1.127 (colored)

Change fdalloc() to return ERESTART if we had to reallocate the
descriptor array, which may have blocked.  Change callers of
fdalloc() to restart whatever they\'re doing if this condition
happens.  (XXX unp_externalize() needs some work, but that will
be tackled later.)

Change finishdup() to close the descriptor in the `new\' slot if
one exists, and change sys_dup2() accordingly.

Closes a race condition when using kernel-assisted user threads.

While here, garbage-collect UF_MAPPED -- it is not used anywhere.

Revision 1.74 / (download) - annotate - [select for diffs], Mon Apr 9 10:22:02 2001 UTC (22 years, 11 months ago) by jdolecek
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Changes since 1.73: +2 -2 lines
Diff to previous 1.73 (colored) to selected 1.127 (colored)

Change the first arg to fileops fo_stat routine to struct file *, adjust
callers and appropriate routines to cope. This makes fo_stat more
consistent with rest of fileops routines and also makes the fo_stat
match FreeBSD as an added bonus.
Discussed with Luke Mewburn on tech-kern@.

Revision 1.73 / (download) - annotate - [select for diffs], Sat Apr 7 09:00:57 2001 UTC (22 years, 11 months ago) by jdolecek
Branch: MAIN
Changes since 1.72: +4 -16 lines
Diff to previous 1.72 (colored) to selected 1.127 (colored)

Add new 'stat' fileop and call the stat function via f_ops rather
than directly.
For compat syscalls, also add necessary FILE_USE()/FILE_UNUSE().
Now that soo_stat() gets a proc arg, pass it on to usrreq function.

Revision 1.72 / (download) - annotate - [select for diffs], Mon Feb 26 20:24:30 2001 UTC (23 years, 1 month ago) by lukem
Branch: MAIN
Branch point for: nathanw_sa
Changes since 1.71: +163 -200 lines
Diff to previous 1.71 (colored) to selected 1.127 (colored)

convert to ANSI KNF

Revision 1.71 / (download) - annotate - [select for diffs], Tue Aug 15 17:54:59 2000 UTC (23 years, 7 months ago) by fvdl
Branch: MAIN
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored) to selected 1.127 (colored)

Fix omission in previous.

Revision 1.70 / (download) - annotate - [select for diffs], Tue Aug 15 16:26:42 2000 UTC (23 years, 7 months ago) by eeh
Branch: MAIN
Changes since 1.69: +4 -4 lines
Diff to previous 1.69 (colored) to selected 1.127 (colored)

Fix LP64BE bug.

Revision 1.69 / (download) - annotate - [select for diffs], Tue Jul 4 15:33:31 2000 UTC (23 years, 9 months ago) by jdolecek
Branch: MAIN
Changes since 1.68: +2 -2 lines
Diff to previous 1.68 (colored) to selected 1.127 (colored)

change tablefull() to accept one more parameter - optional hint

use that to inform about way to raise current limit when we reach maximum
number of processes, descriptors or vnodes

XXX hopefully I catched all users of tablefull()

Revision 1.68 / (download) - annotate - [select for diffs], Tue Jun 27 17:41:16 2000 UTC (23 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.67: +1 -3 lines
Diff to previous 1.67 (colored) to selected 1.127 (colored)

remove include of <vm/vm.h>

Revision 1.67 / (download) - annotate - [select for diffs], Fri May 26 23:10:36 2000 UTC (23 years, 10 months ago) by sommerfeld
Branch: MAIN
CVS Tags: netbsd-1-5-base, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: netbsd-1-5
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (colored) to selected 1.127 (colored)

Eliminate incorrect use of "curproc" in a comment.

Revision 1.66 / (download) - annotate - [select for diffs], Thu Mar 30 09:27:11 2000 UTC (24 years ago) by augustss
Branch: MAIN
Changes since 1.65: +46 -46 lines
Diff to previous 1.65 (colored) to selected 1.127 (colored)

Get rid of register declarations.

Revision 1.65 / (download) - annotate - [select for diffs], Thu Mar 23 05:16:14 2000 UTC (24 years ago) by thorpej
Branch: MAIN
Changes since 1.64: +11 -1 lines
Diff to previous 1.64 (colored) to selected 1.127 (colored)

Implement fdremove() which is used in place of all the code that
did the "fdp->fd_ofiles[fd] = 0" assignment; fdremove() make sure
the fd_freefiles hints stay in sync.

From OpenBSD.

Revision 1.64 / (download) - annotate - [select for diffs], Wed Mar 22 17:42:57 2000 UTC (24 years ago) by thorpej
Branch: MAIN
Changes since 1.63: +11 -12 lines
Diff to previous 1.63 (colored) to selected 1.127 (colored)

Pool'ify filedesc0 allocation.

Revision 1.63 / (download) - annotate - [select for diffs], Mon Jan 24 17:57:34 2000 UTC (24 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.62: +3 -2 lines
Diff to previous 1.62 (colored) to selected 1.127 (colored)

In cwdinit(), if there isn't a cdir vnode yet, don't VREF() it.

Revision 1.62 / (download) - annotate - [select for diffs], Wed Dec 8 18:53:56 1999 UTC (24 years, 3 months ago) by sommerfeld
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored) to selected 1.127 (colored)

Fix bug observed by Perry and myself: when emacs was shut down
uncleanly due to a lost connection, it would hang in closef() waiting
for the usecount to go back to 1.

An audit of FILE_USE() vs FILE_UNUSE() usage led me to discover some
incorrect error-path code..

In sys_fcntl(), avoid leaking a file descriptor usecount in an error
case of F_SETFL; don't return, instead go to "out" to clean up.  I
suspect that the F_SETFL would fail because vop_fcntl is not
implemented in deadfs.

Revision 1.61 / (download) - annotate - [select for diffs], Tue Aug 3 20:19:16 1999 UTC (24 years, 8 months ago) by wrstuden
Branch: MAIN
CVS Tags: fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999
Branch point for: wrstuden-devbsize, thorpej_scsipi
Changes since 1.60: +86 -4 lines
Diff to previous 1.60 (colored) to selected 1.127 (colored)

Add support for fcntl(2) to generate VOP_FCNTL calls. Any fcntl
call with F_FSCTL set and F_SETFL calls generate calls to a new
fileop fo_fcntl. Add genfs_fcntl() and soo_fcntl() which return 0
for F_SETFL and EOPNOTSUPP otherwise. Have all leaf filesystems
use genfs_fcntl().

Reviewed by: thorpej
Tested by: wrstuden

Revision 1.60 / (download) - annotate - [select for diffs], Sun Jun 20 08:54:13 1999 UTC (24 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.59: +2 -3 lines
Diff to previous 1.59 (colored) to selected 1.127 (colored)

Fix umask inheritance problem introduced by the cwdi changes, whereby
children processes will not inherit the parent's umask but 022.

Revision 1.59 / (download) - annotate - [select for diffs], Wed May 5 20:01:08 1999 UTC (24 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.58: +260 -81 lines
Diff to previous 1.58 (colored) to selected 1.127 (colored)

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.

Revision 1.58 / (download) - annotate - [select for diffs], Fri Apr 30 18:42:59 1999 UTC (24 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.57: +78 -15 lines
Diff to previous 1.57 (colored) to selected 1.127 (colored)

Break cdir/rdir/cmask info out of struct filedesc, and put it in a new
substructure, `cwdinfo'.  Implement optional sharing of this substructure.

This is required for clone(2).

Revision 1.57 / (download) - annotate - [select for diffs], Wed Mar 24 05:51:22 1999 UTC (25 years ago) by mrg
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, kame_14_19990705, kame_14_19990628, kame_141_19991130, kame
Branch point for: chs-ubc2
Changes since 1.56: +1 -8 lines
Diff to previous 1.56 (colored) to selected 1.127 (colored)

completely remove Mach VM support.  all that is left is the all the
header files as UVM still uses (most of) these.

Revision 1.56 / (download) - annotate - [select for diffs], Mon Mar 22 17:39:44 1999 UTC (25 years ago) by sommerfe
Branch: MAIN
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored) to selected 1.127 (colored)

bug fix to fdavail: be consistent about taking per-process descriptor
limit into account when checking against the limit; fdp->fd_nfiles may
be greater than the current descriptor limit, and there may be space
in fdp->fd_ofiles beyond the limit.  If we say it's available,
unp_externalize will get confused and panic when fdalloc fails.

Revision 1.55 / (download) - annotate - [select for diffs], Mon Aug 31 23:55:37 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
CVS Tags: kenh-if-detach-base, kenh-if-detach, chs-ubc-base, chs-ubc
Changes since 1.54: +16 -3 lines
Diff to previous 1.54 (colored) to selected 1.127 (colored)

Use the pool allocator and "nointr" pool page allocator for file structures.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Aug 13 10:06:31 1998 UTC (25 years, 7 months ago) by kleink
Branch: MAIN
Changes since 1.53: +3 -3 lines
Diff to previous 1.53 (colored) to selected 1.127 (colored)

Per POSIX, fail with EINVAL if advisory locking is attempted on a file type
that doesn't support it, rather than using a homegrown EBADF or EOPNOTSUPP.

Revision 1.53 / (download) - annotate - [select for diffs], Tue Aug 4 04:03:11 1998 UTC (25 years, 8 months ago) by perry
Branch: MAIN
Changes since 1.52: +10 -10 lines
Diff to previous 1.52 (colored) to selected 1.127 (colored)

Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
  bcopy(x, y, z) ->  memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
   bcmp(x, y, z) ->  memcmp(x, y, z)
  bzero(x, y)    ->  memset(x, 0, y)

Revision 1.52 / (download) - annotate - [select for diffs], Fri Jul 31 22:50:49 1998 UTC (25 years, 8 months ago) by perry
Branch: MAIN
Changes since 1.51: +5 -5 lines
Diff to previous 1.51 (colored) to selected 1.127 (colored)

fix sizeofs so they comply with the KNF style guide. yes, it is pedantic.

Revision 1.51 / (download) - annotate - [select for diffs], Sun Mar 1 02:22:28 1998 UTC (26 years, 1 month ago) by fvdl
Branch: MAIN
CVS Tags: eeh-paddr_t-base
Branch point for: eeh-paddr_t
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored) to selected 1.127 (colored)

Merge with Lite2 + local changes

Revision 1.50 / (download) - annotate - [select for diffs], Tue Feb 10 14:09:25 1998 UTC (26 years, 1 month ago) by mrg
Branch: MAIN
Changes since 1.49: +3 -1 lines
Diff to previous 1.49 (colored) to selected 1.127 (colored)

- add defopt's for UVM, UVMHIST and PMAP_NEW.
- remove unnecessary UVMHIST_DECL's.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Feb 5 07:59:47 1998 UTC (26 years, 1 month ago) by mrg
Branch: MAIN
Changes since 1.48: +8 -1 lines
Diff to previous 1.48 (colored) to selected 1.127 (colored)

initial import of the new virtual memory system, UVM, into -current.

UVM was written by chuck cranor <chuck@maria.wustl.edu>, with some
minor portions derived from the old Mach code.  i provided some help
getting swap and paging working, and other bug fixes/ideas.  chuck
silvers <chuq@chuq.com> also provided some other fixes.

this is the rest of the MI portion changes.

this will be KNF'd shortly.  :-)

Revision 1.48 / (download) - annotate - [select for diffs], Mon Jan 5 04:51:16 1998 UTC (26 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.47: +86 -1 lines
Diff to previous 1.47 (colored) to selected 1.127 (colored)

Implement file descriptor table sharing.  Partially from FreeBSD.

Revision 1.47 / (download) - annotate - [select for diffs], Mon Oct 20 22:05:10 1997 UTC (26 years, 5 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored) to selected 1.127 (colored)

Fix the shared library versioning snafu caused by the recent changes
to the stat(2) family and msync(2).  This uses a primitive function
versioning scheme.

This reverts the libc shared library major version from 13 to 12, and
adds a few new interfaces to bring us to libc version 12.20.

From Frank van der Linden <fvdl@NetBSD.ORG>.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Oct 19 01:50:33 1997 UTC (26 years, 5 months ago) by mycroft
Branch: MAIN
Changes since 1.45: +2 -3 lines
Diff to previous 1.45 (colored) to selected 1.127 (colored)

Minor change; remove unnecessary casts.

Revision 1.45 / (download) - annotate - [select for diffs], Wed Oct 15 17:27:46 1997 UTC (26 years, 5 months ago) by mycroft
Branch: MAIN
Changes since 1.44: +4 -4 lines
Diff to previous 1.44 (colored) to selected 1.127 (colored)

Adjust u_int arguments of some system calls to int, to match user-level
prototypes.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Jul 17 17:54:40 1997 UTC (26 years, 8 months ago) by phil
Branch: MAIN
CVS Tags: thorpej-signal-base, thorpej-signal, marc-pcmcia-bp, marc-pcmcia-base, marc-pcmcia
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored) to selected 1.127 (colored)

In sys_flock, change EBADF to EINVAL because error was generated by
a bad argument, not a bad file descriptor. (Found in response to
PR 2602.)

Revision 1.43 / (download) - annotate - [select for diffs], Wed Apr 2 18:22:32 1997 UTC (27 years ago) by kleink
Branch: MAIN
CVS Tags: bouyer-scsipi
Changes since 1.42: +5 -2 lines
Diff to previous 1.42 (colored) to selected 1.127 (colored)

Like in F_SETLK, check if F_GETLK is actually called with a
valid lock type.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Mar 30 22:24:38 1996 UTC (28 years ago) by christos
Branch: MAIN
CVS Tags: thorpej-setroot, netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2, mrg-vm-swap, is-newarp-before-merge, is-newarp-base, is-newarp
Changes since 1.41: +2 -3 lines
Diff to previous 1.41 (colored) to selected 1.127 (colored)

Eliminate kern_conf.h

Revision 1.41 / (download) - annotate - [select for diffs], Fri Mar 29 00:25:30 1996 UTC (28 years ago) by cgd
Branch: MAIN
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored) to selected 1.127 (colored)

kill unnecessary (and sometimes dangerous) casts of ioctl commands to int

Revision 1.40 / (download) - annotate - [select for diffs], Thu Mar 14 19:01:10 1996 UTC (28 years ago) by christos
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored) to selected 1.127 (colored)

- fdopen -> filedescopen
- bring kgdb prototype in scope.

Revision 1.39 / (download) - annotate - [select for diffs], Fri Feb 9 18:59:26 1996 UTC (28 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.38: +1 -2 lines
Diff to previous 1.38 (colored) to selected 1.127 (colored)

More proto fixes

Revision 1.38 / (download) - annotate - [select for diffs], Sun Feb 4 02:15:17 1996 UTC (28 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.37: +31 -11 lines
Diff to previous 1.37 (colored) to selected 1.127 (colored)

First pass at prototyping

Revision 1.37 / (download) - annotate - [select for diffs], Sat Oct 7 06:28:09 1995 UTC (28 years, 5 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.36: +15 -15 lines
Diff to previous 1.36 (colored) to selected 1.127 (colored)

Prefix names of system call implementation functions with `sys_'.

Revision 1.36 / (download) - annotate - [select for diffs], Tue Sep 19 21:44:55 1995 UTC (28 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.35: +36 -29 lines
Diff to previous 1.35 (colored) to selected 1.127 (colored)

Make system calls conform to a standard prototype and bring those
prototypes into scope.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Jun 24 20:33:55 1995 UTC (28 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.34: +1 -60 lines
Diff to previous 1.34 (colored) to selected 1.127 (colored)

Extracted all of the compat_xxx routines, and created a library [libcompat]
for them. There are a few #ifdef COMPAT_XX remaining, but they are not easy
or worth eliminating (yet).

Revision 1.34 / (download) - annotate - [select for diffs], Mon Apr 10 18:28:04 1995 UTC (28 years, 11 months ago) by mycroft
Branch: MAIN
Changes since 1.33: +5 -5 lines
Diff to previous 1.33 (colored) to selected 1.127 (colored)

Change `fdclose' to `fdrelease', to avoid confusion with device interfaces.

Revision 1.33 / (download) - annotate - [select for diffs], Wed Mar 8 01:20:21 1995 UTC (29 years ago) by cgd
Branch: MAIN
Changes since 1.32: +3 -2 lines
Diff to previous 1.32 (colored) to selected 1.127 (colored)

need COMPAT_OSF1 for some things

Revision 1.32 / (download) - annotate - [select for diffs], Wed Feb 15 02:12:02 1995 UTC (29 years, 1 month ago) by mycroft
Branch: MAIN
Changes since 1.31: +10 -5 lines
Diff to previous 1.31 (colored) to selected 1.127 (colored)

NULL out file descriptors as they're closed, for the benefit of fstat(8).

Revision 1.31 / (download) - annotate - [select for diffs], Mon Jan 23 04:45:22 1995 UTC (29 years, 2 months ago) by cgd
Branch: MAIN
Changes since 1.30: +1 -5 lines
Diff to previous 1.30 (colored) to selected 1.127 (colored)

ooops.  forgot to emable fpathconf's use of VOP_PATHCONF!

Revision 1.30 / (download) - annotate - [select for diffs], Thu Jan 12 05:40:10 1995 UTC (29 years, 2 months ago) by cgd
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored) to selected 1.127 (colored)

cast pointer to long, not int

Revision 1.29 / (download) - annotate - [select for diffs], Wed Dec 14 19:38:48 1994 UTC (29 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.28: +1 -2 lines
Diff to previous 1.28 (colored) to selected 1.127 (colored)

Remove old declaration.

Revision 1.28 / (download) - annotate - [select for diffs], Wed Dec 14 18:42:27 1994 UTC (29 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.27: +67 -56 lines
Diff to previous 1.27 (colored) to selected 1.127 (colored)

Revert dup handling.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Dec 4 03:09:50 1994 UTC (29 years, 4 months ago) by mycroft
Branch: MAIN
Changes since 1.26: +177 -176 lines
Diff to previous 1.26 (colored) to selected 1.127 (colored)

Abstract out the code to maintain fd_lastfile.  Remove the old dup() compatibility
kluge.  Rearrange fdopen() handling.  Make a common function to handle closing
a particular file descriptor in a process.  Some other cleanup.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Oct 30 21:47:38 1994 UTC (29 years, 5 months ago) by cgd
Branch: MAIN
Changes since 1.25: +5 -5 lines
Diff to previous 1.25 (colored) to selected 1.127 (colored)

be more careful with types, also pull in headers where necessary.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Oct 20 04:22:41 1994 UTC (29 years, 5 months ago) by cgd
Branch: MAIN
Changes since 1.24: +94 -89 lines
Diff to previous 1.24 (colored) to selected 1.127 (colored)

update for new syscall args description mechanism

Revision 1.24 / (download) - annotate - [select for diffs], Tue Aug 30 03:05:32 1994 UTC (29 years, 7 months ago) by mycroft
Branch: MAIN
Changes since 1.23: +10 -18 lines
Diff to previous 1.23 (colored) to selected 1.127 (colored)

Convert process, file, and namei lists and hash tables to use queue.h.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Aug 15 22:08:55 1994 UTC (29 years, 7 months ago) by mycroft
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored) to selected 1.127 (colored)

Need ofstat() for iBCS2 syscall conversion.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jun 29 06:32:23 1994 UTC (29 years, 9 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-0-base
Branch point for: netbsd-1-0
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (colored) to selected 1.127 (colored)

New RCS ID's, take two.  they're more aesthecially pleasant, and use 'NetBSD'

Revision 1.21 / (download) - annotate - [select for diffs], Wed Jun 22 03:00:21 1994 UTC (29 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored) to selected 1.127 (colored)

Make ogetdtablesize if COMPAT_HPUX.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jun 16 05:07:32 1994 UTC (29 years, 9 months ago) by glass
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored) to selected 1.127 (colored)

compat_ultrix

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jun 14 10:52:20 1994 UTC (29 years, 9 months ago) by chopps
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored) to selected 1.127 (colored)

getdtabledsize used by sunos compat code.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jun 14 05:21:11 1994 UTC (29 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.17: +5 -2 lines
Diff to previous 1.17 (colored) to selected 1.127 (colored)

make getdtablesize COMPAT_43; should be COMPAT_44 or _09, but that has probs

Revision 1.17 / (download) - annotate - [select for diffs], Thu May 19 08:13:09 1994 UTC (29 years, 10 months ago) by cgd
Branch: MAIN
Changes since 1.16: +110 -103 lines
Diff to previous 1.16 (colored) to selected 1.127 (colored)

update to 4.4-Lite, with some local changes

Revision 1.16 / (download) - annotate - [select for diffs], Tue May 17 04:21:52 1994 UTC (29 years, 10 months ago) by cgd
Branch: MAIN
Changes since 1.15: +937 -1 lines
Diff to previous 1.15 (colored) to selected 1.127 (colored)

copyright foo

Revision 1.15 / (download) - annotate - [select for diffs], Sat May 7 00:58:57 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.14: +1 -1 lines
Diff to previous 1.14 (colored) to selected 1.127 (colored)

stub fpathconf

Revision 1.14 / (download) - annotate - [select for diffs], Wed May 4 03:41:49 1994 UTC (29 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.13: +1 -1 lines
Diff to previous 1.13 (colored) to selected 1.127 (colored)

Rename a lot of process flags.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Mar 27 09:08:30 1994 UTC (30 years ago) by cgd
Branch: MAIN
Changes since 1.12: +1 -1 lines
Diff to previous 1.12 (colored) to selected 1.127 (colored)

expand uid_t/gid_t/off_t

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jan 4 12:26:21 1994 UTC (30 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.11: +1 -1 lines
Diff to previous 1.11 (colored) to selected 1.127 (colored)

generalize dupfdopen() to allow dups and moves.  from jsp

Revision 1.11 / (download) - annotate - [select for diffs], Tue Dec 21 06:39:12 1993 UTC (30 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.10: +1 -1 lines
Diff to previous 1.10 (colored) to selected 1.127 (colored)

more of the same; gah!

Revision 1.10 / (download) - annotate - [select for diffs], Tue Dec 21 06:30:28 1993 UTC (30 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.9: +1 -1 lines
Diff to previous 1.9 (colored) to selected 1.127 (colored)

kill a billism

Revision 1.9 / (download) - annotate - [select for diffs], Sat Dec 18 04:20:26 1993 UTC (30 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.8: +1 -1 lines
Diff to previous 1.8 (colored) to selected 1.127 (colored)

Canonicalize all #includes.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Aug 23 16:04:10 1993 UTC (30 years, 7 months ago) by mycroft
Branch: MAIN
CVS Tags: magnum-base
Branch point for: magnum
Changes since 1.7: +1 -1 lines
Diff to previous 1.7 (colored) to selected 1.127 (colored)

RLIMIT_OFILE --> RLIMIT_NOFILE

Revision 1.7 / (download) - annotate - [select for diffs], Tue Jul 13 22:13:17 1993 UTC (30 years, 8 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-0-9-patch-001, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9
Changes since 1.6: +1 -1 lines
Diff to previous 1.6 (colored) to selected 1.127 (colored)

break args structs out, into syscallname_args structs, so gcc2 doesn't
whine so much.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jun 27 06:01:31 1993 UTC (30 years, 9 months ago) by andrew
Branch: MAIN
Changes since 1.5: +1 -1 lines
Diff to previous 1.5 (colored) to selected 1.127 (colored)

ANSIfications - removed all implicit function return types and argument
definitions.  Ensured that all files include "systm.h" to gain access to
general prototypes.  Casts where necessary.

Revision 1.5 / (download) - annotate - [select for diffs], Sat May 22 11:41:33 1993 UTC (30 years, 10 months ago) by cgd
Branch: MAIN
Changes since 1.4: +1 -1 lines
Diff to previous 1.4 (colored) to selected 1.127 (colored)

add include of select.h if necessary for protos, or delete if extraneous

Revision 1.4 / (download) - annotate - [select for diffs], Tue May 18 18:19:13 1993 UTC (30 years, 10 months ago) by cgd
Branch: MAIN
Changes since 1.3: +1 -1 lines
Diff to previous 1.3 (colored) to selected 1.127 (colored)

make kernel select interface be one-stop shopping & clean it all up.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Apr 4 04:32:14 1993 UTC (31 years ago) by cgd
Branch: MAIN
CVS Tags: netbsd-alpha-1, netbsd-0-8
Changes since 1.2: +1 -1 lines
Diff to previous 1.2 (colored) to selected 1.127 (colored)

now uses `maxfdescs' to bound `openfiles' resource limit.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Mar 23 23:56:07 1993 UTC (31 years ago) by cgd
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored) to selected 1.127 (colored)

modified files to support kernfs and fdesc fs

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (31 years ago) by cgd
Branch: MAIN
Diff to selected 1.127 (colored)

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>