dragonfly.git
3 years agokernel - make POLLHUP conform better to OpenGroup
Matthew Dillon [Fri, 13 Aug 2010 22:06:12 +0000 (15:06 -0700)]
kernel - make POLLHUP conform better to OpenGroup

* The poll() backend now only evaluates EV_EOF for EVFILT_WRITE, and
  generates a POLLHUP which is properly mutually exclusive with
  POLLWRNORM and POLLOUT.

  We do this even for a half-closed (write-side-closed) socket.

* We no longer set POLLHUP for POLLRD* or POLLIN, instead relying on
  the userland doing the read() and checking the 0 result (which
  userland has always done historically).

  EV_EOF for EVFILT_READ cannot be used to set POLLHUP for POLLRD* or
  POLLIN because it could indicate a half-closed connection
  (read-side-closed) where writing is still allowed, which is a more
  common situation on sockets.

  We would have to add another EV_ flag to set POLLHUP for POLLRD* or
  POLLIN to detect the fully disconnected state.  The OpenGroup standard
  does allow POLLHUP to be mixed with POLLRD* or POLLIN but for now we
  just don't set it at all in that case.

  Only a POLLOUT/POLLWRNORM flag request can cause POLLHUP to be set
  for now.

3 years agokernel - More kqueue work
Matthew Dillon [Fri, 13 Aug 2010 21:05:45 +0000 (14:05 -0700)]
kernel - More kqueue work

* Only set EV_EOF in the read filter after all pending data has
  been exhausted.

* This also fixes a bug where the read filter was not setting data
  ready on EOF when data was pending in the buffer.

* Fix bugs in the poll copyout handler.  An EOF condition does not
  prevent other flags from getting set.

3 years agokernel - Some minor swap allocator / blist work
Matthew Dillon [Fri, 13 Aug 2010 21:00:06 +0000 (14:00 -0700)]
kernel - Some minor swap allocator / blist work

* Fix a bug in the 'r' option for the userland compile of the blist code

* Finish converting daddr_t's to swblk_t's in the swap code.

* Move SWAPBLK_* out of vm/vm_page.h (taken from FreeBSD) to reduce
  the number of #includes needed.  Move them to sys/blist.h

Reported-by: Ilya Dryomov <idryomov@gmail.com>
3 years agostress2 - Use statvfs to fix calculations for large filesystems
Matthew Dillon [Fri, 13 Aug 2010 15:50:03 +0000 (08:50 -0700)]
stress2 - Use statvfs to fix calculations for large filesystems

* Use statvfs to avoid available space overflow in calculation.

3 years agolibdevattr - Minimal error checking in devattr_test
Antonio Huete Jimenez [Fri, 13 Aug 2010 11:49:45 +0000 (13:49 +0200)]
libdevattr - Minimal error checking in devattr_test

3 years agolibevent - Remove from tree
Samuel J. Greear [Thu, 12 Aug 2010 15:09:37 +0000 (15:09 +0000)]
libevent - Remove from tree

* There are no longer any in-tree consumers

* Maintenance burden is moved to pkgsrc

3 years agoftp-proxy - Port from libevent to kqueue(2)/kevent(2)
Samuel J. Greear [Fri, 13 Aug 2010 01:06:38 +0000 (01:06 +0000)]
ftp-proxy - Port from libevent to kqueue(2)/kevent(2)

* Was using libevent's bufferevent* API, we let the socket buffers do
  most of the work.

3 years agobthcid - Port from libevent to kqueue(2)/kevent(2)
Samuel J. Greear [Thu, 12 Aug 2010 14:48:31 +0000 (14:48 +0000)]
bthcid - Port from libevent to kqueue(2)/kevent(2)

3 years agokernel - Fix reboot races
Matthew Dillon [Fri, 13 Aug 2010 05:45:25 +0000 (22:45 -0700)]
kernel - Fix reboot races

* Fix a pty revoke race null pointer indirection during reboot

* Fix a deadlock with devfs (introduced by a recent commit) by
  not having devfs_config() do anything if it is called from
  the message core itself.

3 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 13 Aug 2010 04:50:49 +0000 (21:50 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

3 years agokernel - devfs - Fix deadlocks
Matthew Dillon [Fri, 13 Aug 2010 04:49:03 +0000 (21:49 -0700)]
kernel - devfs - Fix deadlocks

* Fix a deadlocks when the core thread attempts to free a node.  The
  devfs lock must be released when obtaining the vnode lock.  Fixes
  issues with ls -la /dev/pts when running stress2{pts}.

* Adjust devfs_config() to not attempt to message the devfs core thread
  if the core thread has terminated (fixes issues with reboot).

3 years agokernel - Add sysref assertions
Matthew Dillon [Fri, 13 Aug 2010 04:48:45 +0000 (21:48 -0700)]
kernel - Add sysref assertions

* Add more checks in the sysref code to detect use-after-free situations.

3 years agoAdjust the docs for the renaming of devfs_clone_bitmap_rst() to _put().
Sascha Wildner [Fri, 13 Aug 2010 04:33:02 +0000 (06:33 +0200)]
Adjust the docs for the renaming of devfs_clone_bitmap_rst() to _put().

3 years agokernel - Add sysref assertions
Matthew Dillon [Fri, 13 Aug 2010 04:11:20 +0000 (21:11 -0700)]
kernel - Add sysref assertions

* Add checks in the sysref code to detect use-after-free situations.

3 years agokernel - More tty and devfs race fixes
Matthew Dillon [Fri, 13 Aug 2010 04:09:13 +0000 (21:09 -0700)]
kernel - More tty and devfs race fixes

* Refactor the unix98 pty code to consolidate termination handling and
  add flags to deal with close() races.

* Rename devfs_clone_bitmap_rst() to devfs_clone_bitmap_put()

* devfs_clone_bitmap_put() now syncs devfs messages before clearing
  the bitmap bit, to ensure that related destroy_dev()s complete
  before the unit number becomes available for a new allocation
  again.

Reported-by: swildner
3 years agoHAMMER VFS - Adjust signedness of a media field for future de-dup
Matthew Dillon [Fri, 13 Aug 2010 02:02:34 +0000 (19:02 -0700)]
HAMMER VFS - Adjust signedness of a media field for future de-dup

* Make bytes_free in hammer_blockmap_layer2 a signed field and remove
  KKASSERT() that disallowed a negative value.

  This field can go negative in a future data de-dup implementation.

3 years agokernel - Fix pty registration, memory leak
Matthew Dillon [Fri, 13 Aug 2010 01:55:20 +0000 (18:55 -0700)]
kernel - Fix pty registration, memory leak

* Properly unregister the pt_ioctl before freeing it.

* Free the pt_ioctl structure after destroying the device, fixing
  a memory leak.

* Fix races in the sysctl_proc which iterates the tty list by using
  a marker.

3 years agokernel - Fix pty clone vnode leak
Matthew Dillon [Fri, 13 Aug 2010 01:20:41 +0000 (18:20 -0700)]
kernel - Fix pty clone vnode leak

* Any cloned devfs device (vn, tap, ptmx primarily) was leaving an extra
  vref on the related vnode, preventing the vnode from being recycled.

  This was due to devfs called vop_stdopen() but forgetting that
  vop_stdopen() will load the file pointer (fp), which devfs was also
  loading.  All devfs really needs to do is to replace fp->f_ops.

Reported-by: swildner
3 years agoAdd DSCHED_FQ to GENERIC.
Venkatesh Srinivas [Fri, 13 Aug 2010 00:12:49 +0000 (17:12 -0700)]
Add DSCHED_FQ to GENERIC.

3 years agokernel - Adjust krate infrastructure
Matthew Dillon [Wed, 11 Aug 2010 20:59:36 +0000 (13:59 -0700)]
kernel - Adjust krate infrastructure

* Move struct krate from sys/time.h to sys/resourcevar.h

* Remove krate from struct uidinfo, it created too much breakage
  in the buildworld.  Declare it as a static instead.

3 years agobuildworld - Fix breakage
Matthew Dillon [Wed, 11 Aug 2010 20:07:29 +0000 (13:07 -0700)]
buildworld - Fix breakage

* More cases where sys/user.h is not included early enough.

Reported-by: swildner
3 years agobuildworld - Fix breakage
Matthew Dillon [Wed, 11 Aug 2010 20:00:29 +0000 (13:00 -0700)]
buildworld - Fix breakage

* Fix some _KERNEL_STRUCTURES breakage.  This isn't a fantastic solution
  but it works.

Reported-by: swildner
3 years agoobjcache.9: Oops, .Vt actually.
Sascha Wildner [Wed, 11 Aug 2010 19:56:01 +0000 (21:56 +0200)]
objcache.9: Oops, .Vt actually.

3 years agoobjcache.9: Use .Ft for a type.
Sascha Wildner [Wed, 11 Aug 2010 19:50:49 +0000 (21:50 +0200)]
objcache.9: Use .Ft for a type.

3 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 10 Aug 2010 23:35:00 +0000 (16:35 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

3 years agokernel - Add per-user file descriptor limit
Matthew Dillon [Tue, 10 Aug 2010 23:27:27 +0000 (16:27 -0700)]
kernel - Add per-user file descriptor limit

* Add kern.maxfilesperuser and kern.minfilesperproc to complement the
  kern.maxfilesperproc which already exists.  Print a warning on the
  console if a user hits the limit (rate limited).

* Track per-user files via the uidinfo structure.  Each file pointer counts
  as one file.  dup()'d and fork()'d file descriptors do not count.

* Adjust the default user limits to approximately 1/4 the system maximums
  instead of 9/10 the system maximums.  This reduces the maximum descriptors
  per process and the maximum processes per uid.  They can be raised again
  via sysctl.

* Set minfilesperproc to 8 by default.  This is a safety which guarantees
  that a process can always have at least that many open descriptors
  without tripping over kern.maxfilesperuser.

Reported-by: swildner
3 years agolibthread_xu: Convert 0 to NULL for pointer assignment.
Venkatesh Srinivas [Tue, 10 Aug 2010 22:01:01 +0000 (15:01 -0700)]
libthread_xu: Convert 0 to NULL for pointer assignment.

3 years agokernel - Fix lockf panic
Matthew Dillon [Tue, 10 Aug 2010 20:09:10 +0000 (13:09 -0700)]
kernel - Fix lockf panic

* Fix a case where the F_UNLCK call made by closef()/fdrop() could fail
  on a resource limit, preventing the locks from being properly cleared.
  This resulted in an assertion panic at exit1().

* Minor cleanups.

Reported-by: swildner
3 years agoSome cleanup in the pf manual pages.
Sascha Wildner [Tue, 10 Aug 2010 19:22:05 +0000 (21:22 +0200)]
Some cleanup in the pf manual pages.

3 years agokqueue - Fix junk kfree() in doselect()
Matthew Dillon [Tue, 10 Aug 2010 16:58:39 +0000 (09:58 -0700)]
kqueue - Fix junk kfree() in doselect()

* Fix uninitialized fields which could cause kfree() to be called on
  junk data when a copyin error occurs.

* Minor cleanups.

Reported-by: swildner
3 years agoRemove old ftp-proxy per 'make upgrade'.
Sascha Wildner [Tue, 10 Aug 2010 10:12:52 +0000 (12:12 +0200)]
Remove old ftp-proxy per 'make upgrade'.

3 years agopf(4): Remove a ', 1' that had no effect (OpenBSD dev too tired, I guess).
Sascha Wildner [Tue, 10 Aug 2010 03:20:49 +0000 (05:20 +0200)]
pf(4): Remove a ', 1' that had no effect (OpenBSD dev too tired, I guess).

3 years agoaicasm: Correct logic bug in the undefined register bit access detection code.
Sascha Wildner [Tue, 10 Aug 2010 01:45:18 +0000 (03:45 +0200)]
aicasm: Correct logic bug in the undefined register bit access detection code.

Quoting FreeBSD's commit msg:

The code in question verifies that all register write operations only change
bits that are defined (in the register definition file) for that effected
register.  The bug effectively disabled this checking.

o Fix the check by testing the opcode against all supported read ("and" based)
  operands.

o Add missing bit definitions to the aic7xxx and aic79xx register definition
  files so that the warning (treated as a fatal error) does not spuriously
  fire.

Taken-from: FreeBSD

[While I'm here, also add a missing free() and raise WARNS to 6.]

3 years agoEliminate XIG server workaround in fp_mmap; just an artifact of copying from kern_mmap.
Venkatesh Srinivas [Tue, 10 Aug 2010 00:47:49 +0000 (17:47 -0700)]
Eliminate XIG server workaround in fp_mmap; just an artifact of copying from kern_mmap.

3 years agoDocument sysctls vm.fast_fault, vm.dreadful_invltlb, lwkt.preempt_hit/_miss,
Venkatesh Srinivas [Tue, 10 Aug 2010 00:12:05 +0000 (17:12 -0700)]
Document sysctls vm.fast_fault, vm.dreadful_invltlb, lwkt.preempt_hit/_miss,
vm.swap_idle_threshold1/2.

3 years agoVM - Enable idlezero by default.
Venkatesh Srinivas [Mon, 9 Aug 2010 23:55:01 +0000 (16:55 -0700)]
VM - Enable idlezero by default.

3 years agopf.conf.5: Minor adjustments
Thomas Nikolajsen [Mon, 9 Aug 2010 22:58:03 +0000 (00:58 +0200)]
pf.conf.5: Minor adjustments

 * delete duplicate/extra lines
 * interface group not supperted on our ifconfig(8)
 * syntax adjustments

3 years agoUndo part of the last change until I understand why it broke buildkernel.
Sascha Wildner [Mon, 9 Aug 2010 20:38:39 +0000 (22:38 +0200)]
Undo part of the last change until I understand why it broke buildkernel.

3 years agoFix some mis-usage of && and || in the kernel.
Sascha Wildner [Mon, 9 Aug 2010 20:28:26 +0000 (22:28 +0200)]
Fix some mis-usage of && and || in the kernel.

3 years agosound(4): Fix typos: illeagal -> illegal
Sascha Wildner [Mon, 9 Aug 2010 20:22:45 +0000 (22:22 +0200)]
sound(4): Fix typos: illeagal -> illegal

3 years agowlan(4): Replace GNU old-style field designators with proper C.
Sascha Wildner [Mon, 9 Aug 2010 18:58:11 +0000 (20:58 +0200)]
wlan(4): Replace GNU old-style field designators with proper C.

This GCC extension has been considered obsolete since 1993.

3 years agokernel - Move KNOTE() out of interrupt path
Samuel J. Greear [Mon, 9 Aug 2010 18:00:33 +0000 (18:00 +0000)]
kernel - Move KNOTE() out of interrupt path

3 years agopf: Fix if_pfsync to compile
Jan Lentfer [Mon, 9 Aug 2010 14:02:09 +0000 (16:02 +0200)]
pf: Fix if_pfsync to compile

if_pfsync has to be enabled in the
kernel config file.
It passed the last update unattended.
This patch let's it compile, but function
is untested, also tdb functioniality
has been removed.

3 years agopf(4): Add missing file to sys/conf/files for building pf into the kernel.
Sascha Wildner [Mon, 9 Aug 2010 08:04:48 +0000 (10:04 +0200)]
pf(4): Add missing file to sys/conf/files for building pf into the kernel.

3 years agopfctl(8): Fix some little printf() issues on x86_64 (fixes buildworld).
Sascha Wildner [Sun, 8 Aug 2010 21:24:30 +0000 (23:24 +0200)]
pfctl(8): Fix some little printf() issues on x86_64 (fixes buildworld).

3 years ago.gitignore: Add *.bak, *.core, *.old and .depend.
Sascha Wildner [Sun, 8 Aug 2010 20:39:12 +0000 (22:39 +0200)]
.gitignore: Add *.bak, *.core, *.old and .depend.

3 years ago.gitignore: Sort alphabetically.
Sascha Wildner [Sun, 8 Aug 2010 20:38:18 +0000 (22:38 +0200)]
.gitignore: Sort alphabetically.

3 years agoftp-proxy(8): Remove leftover .depend.
Sascha Wildner [Sun, 8 Aug 2010 20:29:36 +0000 (22:29 +0200)]
ftp-proxy(8): Remove leftover .depend.

3 years agoftp-proxy: Update to OpenBSD 4.1
Jan Lentfer [Sun, 8 Aug 2010 16:47:04 +0000 (18:47 +0200)]
ftp-proxy: Update to OpenBSD 4.1

ftp-proxy has been moved from libexec/ to usr.sbin/

3 years agopflogd: Update to OpenBSD 4.1
Jan Lentfer [Sun, 8 Aug 2010 16:43:17 +0000 (18:43 +0200)]
pflogd: Update to OpenBSD 4.1

3 years agokernel - Fix kqueue panic on signal event knote
Matthew Dillon [Sun, 8 Aug 2010 19:43:04 +0000 (12:43 -0700)]
kernel - Fix kqueue panic on signal event knote

* sig_filtops filters on a process, not a file descriptor.  Remove
  the FILTEROP_ISFD flag.

  This should fix a panic when the kqueue is closed while the signal
  event is still active.

Reported-by: Jan Lentfer <Jan.Lentfer@web.de>
3 years agoMerge branch 'master' of git://island.quantumachine.net/dragonfly
Jan Lentfer [Sun, 8 Aug 2010 19:28:24 +0000 (21:28 +0200)]
Merge branch 'master' of git://island.quantumachine.net/dragonfly

3 years agoFix a panic in the varsym_get(2) syscall.
Sascha Wildner [Sun, 8 Aug 2010 18:13:07 +0000 (20:13 +0200)]
Fix a panic in the varsym_get(2) syscall.

In varsymfind(), release the lock only if vss != NULL. This could be
the case if garbage was passed in the mask.

3 years agoloader - Use PTOV() to convert physical addresses to virtual addresses.
Antonio Huete Jimenez [Sat, 7 Aug 2010 19:37:37 +0000 (21:37 +0200)]
loader - Use PTOV() to convert physical addresses to virtual addresses.

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1683>
Submitted-by: Sascha Wildner <swildner@>
Obtained-from: FreeBSD

3 years agoFix a panic in the __getcwd(2) syscall.
Sascha Wildner [Sun, 8 Aug 2010 09:19:09 +0000 (11:19 +0200)]
Fix a panic in the __getcwd(2) syscall.

buflen has to be unsigned so that large values do not become negative
and sneak past the MAXPATHLEN check.

3 years agoFix panics in two syscalls, caps_sys_get(2) and caps_sys_wait(2).
Sascha Wildner [Sun, 8 Aug 2010 08:43:08 +0000 (10:43 +0200)]
Fix panics in two syscalls, caps_sys_get(2) and caps_sys_wait(2).

Only call caps_drop() if caps != NULL.

3 years agopf: Update packet filter to the version that comes with OpenBSD 4.1
Jan Lentfer [Sun, 8 Aug 2010 07:44:38 +0000 (09:44 +0200)]
pf: Update packet filter to the version that comes with OpenBSD 4.1

    The original OpenBSD 4.1 defaults to "keep state flags S/SA" for
    all pass rules. In contrast to that we default to "no state". As
    in earlier verions of pf in DragonFly the default keep-state
    policy can still be set with the keep-policy option (e.g. "set
    keep-policy keep state (pickups)").

    DragonFly additions to pf have been kept: fairq support,
    pickups.

Detailed Info on changes/additions:
* ALTQ: Fix altq to work with pf_mtag
Patch by Matthew Dillon
* libkern: Revert commit e104539
strchr was added to libkern.h together with strrch
* net/if.h: add interface groups
Imported from FreeBSD.
* netinet6/in6.h: add macros
IN6_IS_ADDR_MC_INTFACELOCAL
IN6_IS_SCOPE_EMBED
PV6_ADDR_SCOPE_INTFACELOCAL
* sys/libkern.h: Add strchr and strrchr as inline functions
Brought in from FreeBSD
* sys/net/if_var.h: Import interface groups
Import interface groups and event handlers from FreeBSD
* sys/net/if_var.h: add if_pf_kif, if_groups to struct ifnet
obtained from: Open/FreeBSD
* net/if_types.h: add IFT_ENC to non-IATA-assignments
obtained from Open/FreeBSD
* net/bpf.c: add bpf_mtap_hdr from OpenBSD
Con up a minimal dummy header to pacify bpf.  Allocate
(only) a struct m_hdr on the stack.

3 years agore(4): fix re_setmulti(): PCIe mcast hash registers were swapped
Thomas Nikolajsen [Sun, 8 Aug 2010 07:41:05 +0000 (09:41 +0200)]
re(4): fix re_setmulti(): PCIe mcast hash registers were swapped

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1799>
Submitted-by: "Mitja Horvat <pinkfluid@>"
Obtained-from: FreeBSD

3 years agodaemon(8): add missing break
Thomas Nikolajsen [Sun, 8 Aug 2010 06:45:56 +0000 (08:45 +0200)]
daemon(8): add missing break

DragonFly-bug: <http://bugs.dragonflybsd.org/issue1800>
Submitted-by: "Mitja Horvat <pinkfluid@>"
3 years agoiwn.4: Miscellaneous adjustments.
Sascha Wildner [Sat, 7 Aug 2010 03:14:29 +0000 (05:14 +0200)]
iwn.4: Miscellaneous adjustments.

* Add some words about iwn6050fw.

* Comment out information about building the firmwares separately into
  the kernel. We don't support that (yet).

3 years agoiwn(4): Add Makefile for building iwn6050fw.ko.
Sascha Wildner [Sat, 7 Aug 2010 03:12:38 +0000 (05:12 +0200)]
iwn(4): Add Makefile for building iwn6050fw.ko.

3 years agoAdd iwn(4) and iwnfw(4) to LINT.
Sascha Wildner [Sat, 7 Aug 2010 03:11:48 +0000 (05:11 +0200)]
Add iwn(4) and iwnfw(4) to LINT.

3 years agoconfig - Fix typo in iwn6050 clean target.
Joe Talbott [Sat, 7 Aug 2010 02:21:23 +0000 (22:21 -0400)]
config - Fix typo in iwn6050 clean target.

3 years agoUnbreak buildworld.
Sascha Wildner [Fri, 6 Aug 2010 23:26:40 +0000 (01:26 +0200)]
Unbreak buildworld.

wlan_token shall be visible to the kernel only.

3 years agoiwn - Fix warning related to token work.
Joe Talbott [Sun, 25 Jul 2010 22:50:05 +0000 (18:50 -0400)]
iwn - Fix warning related to token work.

3 years agoiwn - Cleanup sysctl tree on detach.
Joe Talbott [Sun, 25 Jul 2010 22:49:35 +0000 (18:49 -0400)]
iwn - Cleanup sysctl tree on detach.

3 years agoiwn - Clean up memory freeing.
Joe Talbott [Sun, 25 Jul 2010 22:27:29 +0000 (18:27 -0400)]
iwn - Clean up memory freeing.

* Mark variables with NULL after freeing.
* Properly free dma memory.

3 years agoiwn - Convert to use the new wlan layer's global token.
Joe Talbott [Sun, 25 Jul 2010 20:09:21 +0000 (16:09 -0400)]
iwn - Convert to use the new wlan layer's global token.

3 years agowlan - Convert lockmgr locking to a global token.
Joe Talbott [Sun, 25 Jul 2010 20:08:19 +0000 (16:08 -0400)]
wlan - Convert lockmgr locking to a global token.

Use the lwkt_token API to synchronize the wlan layer entry points.

Discussed-With: dillon

3 years agoiwn - Bring in recent changes from FreeBSD.
Joe Talbott [Sun, 25 Jul 2010 19:29:52 +0000 (15:29 -0400)]
iwn - Bring in recent changes from FreeBSD.

Taken-From: FreeBSD

3 years agoiwn - Lock callout iwn_timer_timeout().
Joe Talbott [Sat, 24 Jul 2010 14:48:09 +0000 (10:48 -0400)]
iwn - Lock callout iwn_timer_timeout().

3 years agoiwn - Update firmware for 6000 chipset.
Joe Talbott [Tue, 20 Jul 2010 13:38:30 +0000 (09:38 -0400)]
iwn - Update firmware for 6000 chipset.

3 years agoiwnfw - Update 6000 firmware and add 6050 firmware
Joe Talbott [Tue, 20 Jul 2010 12:43:36 +0000 (08:43 -0400)]
iwnfw - Update 6000 firmware and add 6050 firmware

3 years agoAdd some more *at() system calls.
Sascha Wildner [Fri, 6 Aug 2010 14:44:50 +0000 (16:44 +0200)]
Add some more *at() system calls.

mkdirat(2), mkfifoat(2), mknodat(2), readlinkat(2), symlinkat(2)

Missing still (at least): linkat(2)

Documentation-changes-from: FreeBSD

3 years agoRemove <sys/selinfo.h> per 'make upgrade'.
Sascha Wildner [Fri, 6 Aug 2010 14:01:55 +0000 (16:01 +0200)]
Remove <sys/selinfo.h> per 'make upgrade'.

3 years agokernel - Clean up pipe filters (fixes last)
Samuel J. Greear [Fri, 6 Aug 2010 12:29:24 +0000 (12:29 +0000)]
kernel - Clean up pipe filters (fixes last)

* Remove extra pipe space calculation

* Move disconnected pipe check before token acquisition

3 years agokern - Clean up pipe filters
Samuel J. Greear [Fri, 6 Aug 2010 12:16:22 +0000 (12:16 +0000)]
kern - Clean up pipe filters

* Do not check ki_note, just issue the KNOTE and let kq sort it out.

* Remove an unmatched rel_mplock().

* Take the r and w tokens for the pipe in question before poking around for
  states and sizes.

* Reverse the pipe end that the write filter assumes it will receive, this
  matches the semantics of the previous .fo_poll implementation.

3 years agokernel - Silently swallow EOPNOTSUPP filter errors for select(2) in all cases
Samuel J. Greear [Fri, 6 Aug 2010 09:19:38 +0000 (09:19 +0000)]
kernel - Silently swallow EOPNOTSUPP filter errors for select(2) in all cases

* This fixes hald

Reported-by: Rumko
3 years agokernel - make poll return only explicitly asked for events
Samuel J. Greear [Fri, 6 Aug 2010 09:15:15 +0000 (09:15 +0000)]
kernel - make poll return only explicitly asked for events

* Previously we were returning all events that were analogous to each other,
  now we return only what was explicitly asked for.

* This fixes pulseaudio

Reported-by: Rumko
3 years agoFix some typos in various places.
Sascha Wildner [Thu, 5 Aug 2010 16:49:49 +0000 (18:49 +0200)]
Fix some typos in various places.

3 years agoFix LINT build.
Sascha Wildner [Thu, 5 Aug 2010 08:09:33 +0000 (10:09 +0200)]
Fix LINT build.

3 years agoBring in FreeBSD's stress2 stress testing suite.
Sascha Wildner [Wed, 4 Aug 2010 23:36:53 +0000 (01:36 +0200)]
Bring in FreeBSD's stress2 stress testing suite.

Great for crashing the system.

See test/stress/stress2/README for instructions.

Thanks to Peter Holm <pho@FreeBSD.org> for writing it.

Thanks to Damian Lubosch <dl@xiqit.de> for helping with testing
on DragonFly.

This might need further adjustment in the future.

3 years agobuildworld - Fix header file
Matthew Dillon [Wed, 4 Aug 2010 05:34:35 +0000 (22:34 -0700)]
buildworld - Fix header file

* struct kqinfo must be exposed for _KERNEL_STRUCTURES too.
  Fixes buildworld.

* Attempt to limit the inclusion of sys/queue.h to builds
  with _KERNEL or _KERNEL_STRUCTURES.

Reported-by: swildner
3 years agokernel - Add ALTQ to GENERIC and X86_64_GENERIC
Matthew Dillon [Wed, 4 Aug 2010 02:34:15 +0000 (19:34 -0700)]
kernel - Add ALTQ to GENERIC and X86_64_GENERIC

* Add ALTQ to these guys, as no altq module is currently
  available.

3 years agokernel - Make filters able to be marked MPSAFE
Samuel J. Greear [Tue, 3 Aug 2010 15:11:21 +0000 (15:11 +0000)]
kernel - Make filters able to be marked MPSAFE

* Change struct filterops f_isfd field to f_flags, taking FILTEROP_ISFD and/or
  FILTEROP_MPSAFE.

* Convert all existing filter definitions to use new flags.

* Create filter_attach/detach/event wrapper functions for calling through the
  struct filterops vector that grab the MPLOCK as necessary.

* kern_event() uses kq->kq_count to determine whether or not to sleep,
  kqueue_scan() removes events from the TAILQ and can possibly sleep, releasing
  the global kq token, before updating kq->kq_count.

3 years agokernel - Remove kevent subsystem from under mplock
Samuel J. Greear [Thu, 29 Jul 2010 12:06:13 +0000 (12:06 +0000)]
kernel - Remove kevent subsystem from under mplock

* Create a global token for the kevent subsystem to operate under

* Push klist insertion and removal into knote_insert()/knote_remove()

* Rename struct selinfo to struct kqinfo

3 years agoiwn{,fw}.4: Remove trailing whitespace and an unneeded .Pp
Sascha Wildner [Tue, 3 Aug 2010 14:06:51 +0000 (16:06 +0200)]
iwn{,fw}.4: Remove trailing whitespace and an unneeded .Pp

3 years agotwa(4): Sync with FreeBSD's current code.
Sascha Wildner [Tue, 3 Aug 2010 12:20:56 +0000 (14:20 +0200)]
twa(4): Sync with FreeBSD's current code.

This adds support for more and newer cards (see the hardware list in
the manual page).

Big thanks to Damian Lubosch <dl@xiqit.de> for testing it on a 9650SE.

3 years agokernel - Silently swallow EOPNOTSUPP filter errors for poll(2) in all cases
Samuel J. Greear [Tue, 3 Aug 2010 06:06:27 +0000 (06:06 +0000)]
kernel - Silently swallow EOPNOTSUPP filter errors for poll(2) in all cases

* This fixes firefox/gconfd/others

Reported-by: tuxillo
3 years agoFix buildkernel with 'options CPU_GEODE' but without 'device gpio'.
Sascha Wildner [Tue, 3 Aug 2010 00:49:13 +0000 (02:49 +0200)]
Fix buildkernel with 'options CPU_GEODE' but without 'device gpio'.

3 years agoFix x86_64 build by casting some {u,}intmax_t's for printing.
Sascha Wildner [Mon, 2 Aug 2010 21:03:18 +0000 (23:03 +0200)]
Fix x86_64 build by casting some {u,}intmax_t's for printing.

3 years ago{fetch,store}.9: Move casuword() from fetch(9) to store(9).
Sascha Wildner [Mon, 2 Aug 2010 09:08:32 +0000 (11:08 +0200)]
{fetch,store}.9: Move casuword() from fetch(9) to store(9).

3 years agokernel - Filter out unknown errors for select(2) and poll(2)
Samuel J. Greear [Mon, 2 Aug 2010 13:10:05 +0000 (13:10 +0000)]
kernel - Filter out unknown errors for select(2) and poll(2)

* select/poll have very limited error management, silently ignore anything they
  cannot handle (this brings us closer in line with the previous
  implementation).

* Add a couple of kern.nseldebug kprintf's

* Increment the kqueue serial by the number of descriptors for both select
  and poll.

3 years agokernel - Unset TS_ZOMBIE when pty is re-opened
Samuel J. Greear [Mon, 2 Aug 2010 13:09:27 +0000 (13:09 +0000)]
kernel - Unset TS_ZOMBIE when pty is re-opened

Reported-by: tuxillo
3 years agoFix the VKERNEL build with KLD_DEBUG set.
Sascha Wildner [Mon, 2 Aug 2010 13:00:58 +0000 (15:00 +0200)]
Fix the VKERNEL build with KLD_DEBUG set.

Reported-by: lentferj
3 years agobce(4): Remove some carriage returns.
Sascha Wildner [Mon, 2 Aug 2010 12:22:53 +0000 (14:22 +0200)]
bce(4): Remove some carriage returns.

4 years agoiwn(4): Hook the manual pages into the build as well.
Sascha Wildner [Sun, 1 Aug 2010 17:49:30 +0000 (19:49 +0200)]
iwn(4): Hook the manual pages into the build as well.

4 years agodsched - minor fixes, cleanup
Alex Hornung [Sun, 1 Aug 2010 12:04:32 +0000 (13:04 +0100)]
dsched - minor fixes, cleanup

* Clean up old dsched dev stuff, since dschedctl was the only consumer
  of it.

* Add a sysctl to change the default dsched policy
  (dsched.policy.default).

Suggested-by: Sascha Wildner
4 years agoMark the *at(2) system calls' prototypes as being new in IEEE 1003.1-2008.
Sascha Wildner [Sun, 1 Aug 2010 09:02:12 +0000 (11:02 +0200)]
Mark the *at(2) system calls' prototypes as being new in IEEE 1003.1-2008.

This is to prevent them from being exposed if an earlier version is
explicitly requested.

Mark them with __BSD_VISIBLE too so they are still exposed in our default
programming environment.

4 years agokernel - Make pt's throw EOF on disconnect.
Samuel J. Greear [Sun, 1 Aug 2010 08:54:29 +0000 (08:54 +0000)]
kernel - Make pt's throw EOF on disconnect.

* Set TS_ZOMBIE when pts is closed (already set for ptc).

* Add TS_ZOMBIE filter checks which throw EOF.

* This fixes a problem with screen introduced with screen commit 33b7c9ca

Reported-by: YONETANI Tomokazu