20 months agoUPDATING: Add some words about the ISA only drivers I removed recently.
Sascha Wildner [Mon, 12 Sep 2011 11:53:09 +0000]
UPDATING: Add some words about the ISA only drivers I removed recently.

20 months agolibc: Initial implementation of open_memstream.
Venkatesh Srinivas [Mon, 12 Sep 2011 05:12:47 +0000]
libc: Initial implementation of open_memstream.

open_memstream allows wrapping a buffer via the FILE * interface; the
buffer is dynamically allocated and automatically expanding. The interface
appeared in POSIX 2008.

This implementation doesn't validate seek offsets and doesn't currently
handle SEEK_END.

20 months agokernel: mmap -- Return EINVAL for len = 0 mmap.
Venkatesh Srinivas [Mon, 12 Sep 2011 03:46:07 +0000]
kernel: mmap -- Return EINVAL for len = 0 mmap.

Closes bug: 2131

20 months agoUpdate fmemopen from NetBSD.
Venkatesh Srinivas [Mon, 12 Sep 2011 02:33:22 +0000]
Update fmemopen from NetBSD.

NetBSD's version of fmemopen() was more correct than our own wrt error
handling and handling seeks at the tail of buffers. We now pass the ATF
fmemopen test set, with the exception of test08; that problem is related to
malloc return for SIZE_MAX requests.

Changes:
* Modified NetBSD's fmemopen to work with our libc's private FILE struct
* Modified fmemopen_read() to use bcopy() rather than a byte-at-a-time loop

20 months agoSome cleanup in the ndis manpages.
Sascha Wildner [Sat, 10 Sep 2011 18:13:00 +0000]
Some cleanup in the ndis manpages.

20 months agondis(4): Remove comment that doesn't apply to us.
Sascha Wildner [Sat, 10 Sep 2011 18:12:24 +0000]
ndis(4): Remove comment that doesn't apply to us.

20 months agokernel: Fix UP remove the "race averted" msg in callout_terminate().
Sascha Wildner [Fri, 9 Sep 2011 16:42:16 +0000]
kernel: Fix UP remove the "race averted" msg in callout_terminate().

20 months agoFix the VKERNEL/VKERNEL64 build.
Sascha Wildner [Thu, 8 Sep 2011 17:16:42 +0000]
Fix the VKERNEL/VKERNEL64 build.

Stuff dt_lock into <machine/segments.h>.

20 months agokernel - Add missing prototype for last commit
Matthew Dillon [Wed, 7 Sep 2011 22:54:54 +0000]
kernel - Add missing prototype for last commit

* Add missing prototype for last commit

20 months agokernel - Fix panic related to kqueue-based timers
Matthew Dillon [Wed, 7 Sep 2011 22:48:07 +0000]
kernel - Fix panic related to kqueue-based timers

* Fix a panic related to kqueue-based timers.  When a knote is destroyed it
  is possible for the callout_stop() to race a callout on another cpu that
  is blocked on a lock.

* Introduce callout_terminate() which stops a callout and ensures that no
  function calls for the callout is still in progress before returning.
  The kevent code now uses this function instead of callout_stop().

* We can't have this assurance for the normal callout_stop() function because
  it can deadlock a backend stuck waiting for a lock when a frontend holding
  that lock calls callout_stop().

Reported-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>

20 months agoSync ndis(4) and tools with FreeBSD and hook it all back into the build.
Sascha Wildner [Wed, 7 Sep 2011 20:28:06 +0000]
Sync ndis(4) and tools with FreeBSD and hook it all back into the build.

It supports NDIS 5.x drivers, that means Windows XP and Server 2003.
The latter is an educated guess by me. No testing has actually been
done using Windows Server 2003 drivers.

It is tested on i386 with the following PCI adapters:

* D-Link DWL-G520+ (Texas Instruments ACX111 chip), aka acx(4).

* Linksys WMP600N (Ralink RT2860 chip).

* Planex GW-DS54GR (Realtek RTL8185 chip) which was kindly donated by
  sephe.

Thanks to Max Herrgard <herrgard@gmail.com> for testing it on x86_64
with a CNet CWP-854 (Ralink RT2561T chip), aka ral(4).

Note that this port has the following caveats:

* PCI adapters need hw.ioapic_enable=0 in /boot/loader.conf but worked
  great then. Without it, the box will completely freeze after a while.
  This has been observed on both my own testing box as well as on a
  different box by Max Herrgard. The cause is yet unknown. :-(

* PC Card adapters are untested (they might just work).

* USB adapters are not yet stable at all. Panics might ensue.

Taken-from: FreeBSD

20 months agokernel: Add dt_lock (for GDT and LDT).
Sascha Wildner [Wed, 7 Sep 2011 20:10:53 +0000]
kernel: Add dt_lock (for GDT and LDT).

20 months agokernel: Add m_extadd().
Sascha Wildner [Thu, 30 Dec 2010 08:16:56 +0000]
kernel: Add m_extadd().

20 months agoFix some typos: in to -> into.
Sascha Wildner [Wed, 7 Sep 2011 14:11:08 +0000]
Fix some typos: in to -> into.

20 months agoetc/rc.d/wpa_supplicant: Fix broken check for ndis(4) interfaces.
Sascha Wildner [Wed, 7 Sep 2011 13:26:53 +0000]
etc/rc.d/wpa_supplicant: Fix broken check for ndis(4) interfaces.

With the new wlan stack, we need to check a sysctl to determine if it
is an ndis(4) interface because it is now wlanX that gets passed to
the script.

Depending on this, wpa_supplicant(8) will be started with either
"-D bsd" or "-D ndis".

Reported-by: Max Herrgard <herrgard@gmail.com>
Taken-from:  FreeBSD

20 months agoinstall.1: One more markup fix.
Sascha Wildner [Wed, 7 Sep 2011 09:00:53 +0000]
install.1: One more markup fix.

20 months agoinstall.1: A little cleanup.
Sascha Wildner [Wed, 7 Sep 2011 08:53:18 +0000]
install.1: A little cleanup.

20 months agoAdd a -D option to install(1)
François Tigeot [Wed, 7 Sep 2011 07:37:22 +0000]
Add a -D option to install(1)

This option is implemented for compatibility with the NetBSD version of
install(1). Even though its code is fully operating, it is only useful
when used in combination with the non-implemented -M NetBSD flag.

Thus, it is effectively a dummy as of the present commit.

20 months agokernel: Add linker_file_foreach() (taken from FreeBSD).
Sascha Wildner [Wed, 29 Dec 2010 16:39:38 +0000]
kernel: Add linker_file_foreach() (taken from FreeBSD).

20 months ago<net/ethernet.h>: Add ETHER_MAX_FRAME (taken from FreeBSD).
Sascha Wildner [Wed, 29 Dec 2010 15:55:59 +0000]
<net/ethernet.h>: Add ETHER_MAX_FRAME (taken from FreeBSD).

20 months agomachintr.h: Add header guardian
Sepherosa Ziehau [Mon, 5 Sep 2011 11:52:13 +0000]
machintr.h: Add header guardian

20 months agoMachIntrABI: Remove unused setvar/getvar interfaces
Sepherosa Ziehau [Mon, 5 Sep 2011 11:42:41 +0000]
MachIntrABI: Remove unused setvar/getvar interfaces

20 months agomachintr.h: Remove unnecessary inclusion
Sepherosa Ziehau [Mon, 5 Sep 2011 11:21:24 +0000]
machintr.h: Remove unnecessary inclusion

20 months agobfq.4: Fix and improve a bit.
Sascha Wildner [Sat, 3 Sep 2011 18:18:32 +0000]
bfq.4: Fix and improve a bit.

20 months agodsched.4: Add a reference to bfq(4).
Sascha Wildner [Sat, 3 Sep 2011 18:17:13 +0000]
dsched.4: Add a reference to bfq(4).

20 months agopsm.4: Use %O for URLs. We don't have %U yet.
Sascha Wildner [Sat, 3 Sep 2011 18:16:25 +0000]
psm.4: Use %O for URLs. We don't have %U yet.

20 months agousb.4: Add a reference to lgue(4).
Sascha Wildner [Fri, 2 Sep 2011 20:12:30 +0000]
usb.4: Add a reference to lgue(4).

20 months agokernel: Use NULL for DRIVER_MODULE()'s evh & arg (which are pointers).
Sascha Wildner [Fri, 2 Sep 2011 20:07:03 +0000]
kernel: Use NULL for DRIVER_MODULE()'s evh & arg (which are pointers).

20 months agonetif/e1000: Add a missing include file to the Makefile.
Sascha Wildner [Fri, 2 Sep 2011 18:41:12 +0000]
netif/e1000: Add a missing include file to the Makefile.

Reported-by: Miro Svetlik <miro@svetlik.be>

20 months agoacpi/pcib: Use DEFINE_CLASS_1 to define acpi_pcib driver
Sepherosa Ziehau [Fri, 2 Sep 2011 11:48:11 +0000]
acpi/pcib: Use DEFINE_CLASS_1 to define acpi_pcib driver

This avoids code duplication and maintenance headache

20 months agopci: Declare pcib_driver
Sepherosa Ziehau [Fri, 2 Sep 2011 11:47:56 +0000]
pci: Declare pcib_driver

20 months agoThird parameter of VFS_STATFS is no longer struct proc *
François Tigeot [Thu, 1 Sep 2011 21:48:59 +0000]
Third parameter of VFS_STATFS is no longer struct proc *

20 months agogdb: Remove previous local modification
John Marino [Thu, 1 Sep 2011 18:17:20 +0000]
gdb: Remove previous local modification

Due to a previous effort that saw binutils support DragonFly, the
config.bfd file no longer needs to be modified.  Unfortunately the
official binutils version wasn't modified the same way as it was in
base, so the auto-merge didn't catch that there were two versions of
each DragonFly entry.  Luckily the good version came first, so this
is simply a cleanup.

Also the README.DRAGONFLY file was updated to include a new set of
local modifications introduced with the FAKE_PROCESS_ID changes.

20 months agokgdb: Tweak to avoid extra inferior
John Marino [Tue, 12 Jul 2011 22:57:53 +0000]
kgdb: Tweak to avoid extra inferior

Since one inferior exists when kgdb launches, the code was changed to
update the pid of the first inferior rather than to add it outright.

20 months agogdb: Improve concept of FAKE_PROCESS_ID to fix JIT crash
John Marino [Tue, 12 Jul 2011 22:06:43 +0000]
gdb: Improve concept of FAKE_PROCESS_ID to fix JIT crash

The fix for 7.2 seems to break on gdb 7.3 with addition of JIT
initialization which assumes at least one inferior defined.  The problem
is that this inferior isn't defined before the JIT routine is run.

Changing the fake process ID from zero has a lot of risk (miss some,
accidently change zero's that need to remain zero, etc), but it seems to
be the only way to fix it cleanly.

20 months agogdb: Adjust makefiles for gdb 7.3
John Marino [Tue, 12 Jul 2011 18:42:26 +0000]
gdb: Adjust makefiles for gdb 7.3

20 months agoMerge branch 'vendor/GDB'
John Marino [Thu, 1 Sep 2011 17:50:06 +0000]
Merge branch 'vendor/GDB'

Conflicts:
contrib/gdb-7/gdb/charset.c

20 months agoImport gdb 7.3 into vendor branch
John Marino [Wed, 31 Aug 2011 21:22:16 +0000]
Import gdb 7.3 into vendor branch

20 months agompt(4): Properly lock mpt_timeout().
Sascha Wildner [Wed, 31 Aug 2011 16:24:44 +0000]
mpt(4): Properly lock mpt_timeout().

I had removed it with an assertion (like in FreeBSD) as part of the
last sync I did, but I had overlooked that FreeBSD initializes their
callout with callout_init_mtx().

For now, just put back locking like it was.

Reported-by:   G.Isenmann
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2127>

20 months agomfi(4): Remove another debug message.
Sascha Wildner [Wed, 31 Aug 2011 09:49:44 +0000]
mfi(4): Remove another debug message.

20 months agoioapic/x86_64: Rearrange pin information for ioapic low level intrhandler
Sepherosa Ziehau [Wed, 31 Aug 2011 09:09:06 +0000]
ioapic/x86_64: Rearrange pin information for ioapic low level intrhandler

- Remove unused field, thus reduce the information size from 32 bytes
  to 16bytes.
- Struct, field and macro renaming

20 months agointr/x86_64: Define ISA_IRQ_CNT; use it consistently instead of magic number
Sepherosa Ziehau [Wed, 31 Aug 2011 08:37:22 +0000]
intr/x86_64: Define ISA_IRQ_CNT; use it consistently instead of magic number

20 months agointr/x86_64: Define IDT_HWI_VECTORS
Sepherosa Ziehau [Wed, 31 Aug 2011 08:11:35 +0000]
intr/x86_64: Define IDT_HWI_VECTORS

This macro defines how many IDT vectors that could be setup as hardware
interrupts.  Use this macro instead of MAX_HARDINTS and APIC_INTMAPSIZE.

20 months agoicu/x86_64: Remove unnecessary header inclusion
Sepherosa Ziehau [Wed, 31 Aug 2011 06:58:02 +0000]
icu/x86_64: Remove unnecessary header inclusion

20 months agomfi(4): Remove some debug messages.
Sascha Wildner [Wed, 31 Aug 2011 06:53:31 +0000]
mfi(4): Remove some debug messages.

20 months agomkdir(1): Don't reference memory beyond the end of the path
Sepherosa Ziehau [Wed, 31 Aug 2011 06:24:05 +0000]
mkdir(1): Don't reference memory beyond the end of the path

20 months agoLINT/LINT64: Add SAFE_NO_RNG.
Sascha Wildner [Tue, 30 Aug 2011 19:51:31 +0000]
LINT/LINT64: Add SAFE_NO_RNG.

20 months agoioapic/i386: Rearrange pin information for ioapic low level intrhandler
Sepherosa Ziehau [Mon, 29 Aug 2011 11:54:51 +0000]
ioapic/i386: Rearrange pin information for ioapic low level intrhandler

- Remove unused field, thus reduce the information size from 32 bytes
  to 16bytes.
- Struct, field and macro renaming

20 months agointr/i386: Define ISA_IRQ_CNT; use it consistently instead of magic number
Sepherosa Ziehau [Sun, 28 Aug 2011 08:18:41 +0000]
intr/i386: Define ISA_IRQ_CNT; use it consistently instead of magic number

20 months agoSync zoneinfo database with tzdata2011i from elsie.nci.nih.gov
Sascha Wildner [Mon, 29 Aug 2011 11:08:07 +0000]
Sync zoneinfo database with tzdata2011i from elsie.nci.nih.gov

africa:         8.31 -> 8.32
australasia:    8.23 -> 8.25
europe:         8.33 -> 8.34
iso3166.tab:    8.9  -> 8.11
northamerica:   8.42 -> 8.48
zone.tab:       8.45 -> 8.47

* africa: Add Africa/Juba (South Sudan) zone.

* australasia: Samoa moves from east to west of the international date line
    (changes from UTC-11 to UTC+13). It will skip December 30, 2011.
    Thanks to David Zuelke and Mark Sim-Smith.

* europe: Use KALT as abbreviation for Europe/Kalinigrad from spring 2011
    forward (thanks to Yoshito Umaoka).

* iso3166.tab: Add SS (South Sudan) entry.

* northamerica:
    - Newfoundland changes time of day for DST start and end to 2:00 a.m.
      starting fall 2011 and forward (thanks to Michael Pelley).
    - Change America/Resolute use of EST to 2006-2007 only (thanks to
      Chris Walton).
    - Assume Metlakatla abandoned use of daylight saving as a result of
      its 1983 vote.
    - Avoid unnecessary use of US rule in America/Honolulu; fix two
      typos in America/Honolulu comments.
    - Adjust America/Goose_Bay as well as America/St_Johns from fall 2011
      forward (thanks to Chris Walton).

* zone.tab:
    - Change America/Resolute entry to Central Standard Time.
      (thanks to Chris Walton).
    - Add SS (South Sudan, Africa/Juba) entry.

20 months agobce(4): Flush BCE_PCICFG_INT_ACK_CMD in interrupt handler
Sepherosa Ziehau [Mon, 29 Aug 2011 09:37:36 +0000]
bce(4): Flush BCE_PCICFG_INT_ACK_CMD in interrupt handler

This could avoid possible spurious interrupts due to the PCI write
to BCE_PCICFG_INT_ACK_CMD is still pending after we leave interrupt
handler.

Obtained-from: Linux bnx2

20 months agoatkbd/x86_64: Do the same AT controller check on x86_64 as on i386
Sepherosa Ziehau [Mon, 29 Aug 2011 07:18:16 +0000]
atkbd/x86_64: Do the same AT controller check on x86_64 as on i386

DragonFly-bug:
    http://bugs.dragonflybsd.org/issue2052
    http://bugs.dragonflybsd.org/issue2065

20 months agomfi(4): Fix a bug in the disk initialization code.
Sascha Wildner [Mon, 29 Aug 2011 03:19:54 +0000]
mfi(4): Fix a bug in the disk initialization code.

This ultimately caused a panic when kldunloading.

Reported-by: Tomi Juvonen <tomi.juvonen@kenou.biz>

20 months agokernel: Bring in safe(4), for SafeNet crypto accelerators.
Sascha Wildner [Sun, 28 Aug 2011 22:39:54 +0000]
kernel: Bring in safe(4), for SafeNet crypto accelerators.

Yet untested.

Taken-from: FreeBSD

20 months agodsched - increase max size of diskctx
Alex Hornung [Sun, 28 Aug 2011 21:57:45 +0000]
dsched - increase max size of diskctx

20 months agoadd missing DSCHED_BFQ option
Alex Hornung [Sun, 28 Aug 2011 21:51:26 +0000]
add missing DSCHED_BFQ option

 * fixes LINT build

Reported-by: Sascha Wildner

20 months agodm - Add device type for future raid1
Alex Hornung [Sun, 28 Aug 2011 08:45:12 +0000]
dm - Add device type for future raid1

Submitted-by: Adam Hoka
Sponsored-by: Google Summer of Code

20 months agodm - Move the target unbusy to the dm_table_destroy function
Adam Hoka [Tue, 21 Jun 2011 01:23:21 +0000]
dm - Move the target unbusy to the dm_table_destroy function

Sponsored-by: Google Summer of Code

20 months agodm - Add method to get inactive table size
Adam Hoka [Sun, 28 Aug 2011 08:37:19 +0000]
dm - Add method to get inactive table size

Sponsored-by: Google Summer of Code

20 months agosystat: Change the way ifstats are displayed.
Peter Avalos [Sun, 28 Aug 2011 04:00:29 +0000]
systat:  Change the way ifstats are displayed.

-Default to displaying bits/s for the rate, and bytes for the totals.
-kilo, mega, giga, tera are all powers of 1000, not 1024.
-Add two new commands: autobyte and autobit which will automatically
change the scale factor in bytes or bits, respectively.  auto defaults
to displaying bits.

20 months agosystat: Sync ifstat code with FreeBSD.
Peter Avalos [Sun, 28 Aug 2011 01:53:25 +0000]
systat:  Sync ifstat code with FreeBSD.

-Add a tera factor.
-Change factors from binary (1024) to SI (1000).
-Allow for larger scale factors.
-Drop useless initializers and includes.
-Use C99 initializers and enums.
-Remove trailing whitespace.

Obtained-from:   FreeBSD

20 months agodsched_bfq - Add documentation
Brills Peng [Sun, 28 Aug 2011 01:06:24 +0000]
dsched_bfq - Add documentation

Sponsored-by: Google Summer of Code

20 months agodsched_bfq - A budget fair-queuing dsched policy
Brills Peng [Sat, 27 Aug 2011 18:19:49 +0000]
dsched_bfq - A budget fair-queuing dsched policy

 * dsched_bfq is a budget fair queuing scheduling policy for the dsched
   framework.

 * NOTE: this scheduler is still highly experimental and
   work-in-progress, it's not recommended for widespread use (yet).
   There are several well-known issues, such as a possible deadlock on
   unloading the module.

Sponsored-by: Google Summer of Code

20 months agodsched_as - A simple & experimental AS
Brills Peng [Sat, 27 Aug 2011 17:27:04 +0000]
dsched_as - A simple & experimental AS

 * dsched_as is a purely experimental anticipatory scheduler. It serves
   no real-life purpose other than testing and experimenting.

 * Don't use this scheduling policy for anything other than
   experimentation!!!

Sponsored-By: Google Summer of Code

20 months agosystat: Don't revert to bits if >1024GB.
Peter Avalos [Sat, 27 Aug 2011 21:08:04 +0000]
systat:  Don't revert to bits if >1024GB.

20 months agokernel - Fix ptrace signal races between child and parent
Matthew Dillon [Sat, 27 Aug 2011 19:57:53 +0000]
kernel - Fix ptrace signal races between child and parent

* Fix several ptrace signal races which could cause the parent's wait()
  function to block forever (or until the parent is killed).  Generally
  speaking we have to use the process token to interlock the wakeup()/tsleep()
  sequence used by the ptrace code.

* Fix a MP race in the wait code, we must hold the child process's token
  when manipulating its p_flag field.

Reported-by: corecode, tuxillo

20 months agodsched - Bump maximum tdio size to 384 bytes
Brills Peng [Sat, 27 Aug 2011 11:42:08 +0000]
dsched - Bump maximum tdio size to 384 bytes

Sponsored-by: Google Summer of Code

20 months agodsched - Add request polling wrapper
Brills Peng [Sat, 27 Aug 2011 11:24:35 +0000]
dsched - Add request polling wrapper

 * Add a request polling emulation layer to dsched. This emulated
   request polling as if a disk driver would poll for requests instead
   of requests being actively pushed down.

 * The policy->polling_func() callback is called whenever a BIO
   completes.

 * A field in the diskctx that shows the current tag queue depth and the
   maximum tag queue depth (currently fixed value of 32) are used in the
   policies using request polling directly and is not enforced in the
   dsched layer. That is, a policy using request polling emulation
   should take care of not having (many) more BIOs in flight than
   max_tag_queue_depth.

Sponsored-by: Google Summer of Code

20 months agodsched - Add debugging & fix rare problem conditions
Alex Hornung [Sat, 27 Aug 2011 10:51:24 +0000]
dsched - Add debugging & fix rare problem conditions

 * Add a bunch of debugging to see whether a particular tdio was
   initialized and to which policy it belongs.

 * Reorder some locking to ensure the whole switch of policy is
   protected as expected.

 * Make sure the tdio from the newest policy is used when there
   are tdios for several scheduling policies in the tdctx->tdio_list.

Reported-by: Brills Peng

20 months agofq - fix a (possible) deadlock
Alex Hornung [Fri, 26 Aug 2011 00:29:17 +0000]
fq - fix a (possible) deadlock

 * A deadlock can occur if a lock is held around the strategy call when
   the completion is synchronous and ends up in the destruction of a
   tdio, as both will acquire the same diskctx lock.

 * Refactor the code around strategy calls so that the bios are first
   prepared, under the protection of the lock, and inserted into a local
   array. Once that is ready and the bios are ready and taken out of
   their respective queues, the locks are dropped and the strategy call
   occurs locklessly.

Reported-by: Antonio Huete (tuxillo@)

21 months agohammer(8): Adjust status message (Dedup-real -> Dedup).
Sascha Wildner [Thu, 25 Aug 2011 16:59:38 +0000]
hammer(8): Adjust status message (Dedup-real -> Dedup).

21 months agosh.1: Nuke unneeded .Pp
Sascha Wildner [Thu, 25 Aug 2011 16:31:57 +0000]
sh.1: Nuke unneeded .Pp

21 months agomfi(4): Add forgotten brace.
Sascha Wildner [Wed, 24 Aug 2011 15:13:09 +0000]
mfi(4): Add forgotten brace.

21 months agomfi(4): Add a panic to catch future mistakes.
Sascha Wildner [Wed, 24 Aug 2011 06:26:30 +0000]
mfi(4): Add a panic to catch future mistakes.

It is not reached with the current code but will prevent future
mistakes in case the mfi_identifiers[] array is not set up
properly.

21 months agomfi(4): Style fix.
Sascha Wildner [Wed, 24 Aug 2011 03:48:38 +0000]
mfi(4): Style fix.

21 months agoFrom NetBSD revision 1.11:
Justin C. Sherrill [Wed, 24 Aug 2011 01:48:15 +0000]
From NetBSD revision 1.11:

"Do proper input validation without penalizing performance."

Suggested-by: Joerg Sonnenberger <joerg@britannica.bec.de>

21 months agoFrom NetBSD revision 1.10:
Justin C. Sherrill [Wed, 24 Aug 2011 01:40:40 +0000]
From NetBSD revision 1.10:

"set errno on overflow return."

Suggested-by: Joerg Sonnenberger <joerg@britannica.bec.de>

21 months agoFrom NetBSD revision 1.9:
Justin C. Sherrill [Wed, 24 Aug 2011 01:37:29 +0000]
From NetBSD revision 1.9:

"provisional fix for CVS-2011-2895, buffer overflow when uncompressing"

Suggested-by: Joerg Sonnenberger <joerg@britannica.bec.de>

21 months agomly(4): Fix comment indentation.
Sascha Wildner [Mon, 22 Aug 2011 20:29:06 +0000]
mly(4): Fix comment indentation.

21 months agocam(4): Add a quirk to turn off SYNC CACHE for mly(4).
Sascha Wildner [Mon, 22 Aug 2011 20:22:41 +0000]
cam(4): Add a quirk to turn off SYNC CACHE for mly(4).

This fixes mounting a HAMMER file system from an mly(4) disk on
the AcceleRAID 160 I tried this with.

I think it will also fix the following issue that was reported
for the AcceleRAID 170 on FreeBSD:

http://lists.freebsd.org/pipermail/freebsd-hardware/2008-December/005676.html

The problem with fixing this was that the mly(4) driver modifies
the SCSI inquiry data and uses it for its own purposes (to show
the disk type and status). So I had to make these fields a bit
more recognizable to the quirks code because the previous strings
were too generic for my taste.

21 months agomly(4): Reduce diffs with FreeBSD and update CVS IDs.
Sascha Wildner [Mon, 22 Aug 2011 16:38:26 +0000]
mly(4): Reduce diffs with FreeBSD and update CVS IDs.

21 months agoLINT: Sort descriptions better than I did in the last commit.
Sascha Wildner [Mon, 22 Aug 2011 12:14:24 +0000]
LINT: Sort descriptions better than I did in the last commit.

21 months agolongrun(4): Remove from Makefile, it is not a module.
Sascha Wildner [Mon, 22 Aug 2011 11:37:04 +0000]
longrun(4): Remove from Makefile, it is not a module.

21 months agokernel: Bring back longrun(4) which was lost in 90e8a35b.
Sascha Wildner [Mon, 22 Aug 2011 11:31:42 +0000]
kernel: Bring back longrun(4) which was lost in 90e8a35b.

FreeBSD had moved it to its own file (from identcpu.c) but that wasn't
brought in.

21 months agomly(4): Perform some minor cleanup.
Sascha Wildner [Mon, 22 Aug 2011 07:17:49 +0000]
mly(4): Perform some minor cleanup.

* Add dependencies for pci and cam.

* Fix a typo (MHZ -> MHz)

* Cleanup debug printf.

* Remove unused define from the Makefile and add MLY_DEBUG.

21 months agosh(1): Extend documentation about subshells.
Peter Avalos [Sun, 21 Aug 2011 22:12:11 +0000]
sh(1): Extend documentation about subshells.

Because sh executes commands in subshell environments without forking in
more and more cases, it makes sense to describe subshell environments
more precisely using ideas from POSIX, together with some
DragonFly-specific items.

In particular, the hash and times builtins may not behave as if their
state is copied for a subshell environment while leaving the parent
shell environment unchanged.

Obtained-from:   FreeBSD 223909

21 months agosh: include <limits.h> instead of non-standard <sys/limits.h>
Peter Avalos [Sun, 21 Aug 2011 22:10:34 +0000]
sh:  include <limits.h> instead of non-standard <sys/limits.h>

Obtained-from:   FreeBSD 223580

21 months agosh(1): Improve documentation of shell patterns:
Peter Avalos [Sun, 21 Aug 2011 22:07:23 +0000]
sh(1): Improve documentation of shell patterns:

* Shell patterns are also for ${var#pat} and the like.
* An '!' by itself will not trigger pathname generation so do not call
  it a meta-character, even though it has a special meaning directly
  after an '['.
* Character ranges are locale-dependent.
* A '^' will complement a character class like '!' but is non-standard.

Obtained-from:   FreeBSD 223522

21 months agosh(1): Document the case command better.
Peter Avalos [Sun, 21 Aug 2011 22:02:29 +0000]
sh(1): Document the case command better.

Obtained-from:  FreeBSD 223517

21 months agosh: Remove unneeded include file.
Peter Avalos [Sun, 21 Aug 2011 22:00:54 +0000]
sh:  Remove unneeded include file.

Obtained-from:   FreeBSD 223494

21 months agosh: Remove special support for background simple commands.
Peter Avalos [Sun, 21 Aug 2011 21:55:15 +0000]
sh: Remove special support for background simple commands.

It expands the arguments in the parent shell process, which is
incorrect.

Obtained-from:   FreeBSD 223282

21 months agosh: Add do-nothing -h option.
Peter Avalos [Sun, 21 Aug 2011 21:52:20 +0000]
sh: Add do-nothing -h option.

POSIX requires a -h option to sh and set, to locate and remember
utilities invoked by functions as they are defined. Given that this
locate-and-remember process is optional elsewhere, it seems safe enough
to make this option do nothing.

POSIX does not specify a long name for this option. Follow ksh in
calling it "trackall".

Obtained-from:   FreeBSD 223281

21 months agosh: Add case statement fallthrough (with ';&' instead of ';;').
Peter Avalos [Sun, 21 Aug 2011 21:45:13 +0000]
sh: Add case statement fallthrough (with ';&' instead of ';;').

Replacing ;; with the new control operator ;& will cause the next list
to be executed as well without checking its pattern, continuing until
a list ends with ;; or until the end of the case statement. This is
like omitting "break" in a C "switch" statement.

The sequence ;& was formerly invalid.

This feature is proposed for the next POSIX issue in Austin Group
issue #449.

Obtained-from:   FreeBSD 223186

21 months agosh: Skip vars with invalid names in "set", "export -p", "readonly -p".
Peter Avalos [Sun, 21 Aug 2011 21:39:50 +0000]
sh: Skip vars with invalid names in "set", "export -p", "readonly -p".

This ensures the output of these commands is valid shell input.

Obtained-from:   FreeBSD 223183

21 months agosh: Reduce unnecessary forks with eval.
Peter Avalos [Sun, 21 Aug 2011 21:36:38 +0000]
sh: Reduce unnecessary forks with eval.

The eval special builtin now runs the code with EV_EXIT if it was run
with EV_EXIT itself.

In particular, this eliminates one fork when a command substitution
contains an eval command that ends with an external program or a
subshell.

Obtained-from:   FreeBSD 223163

21 months agosh: Add support for named character classes in bracket expressions.
Peter Avalos [Sun, 21 Aug 2011 21:33:45 +0000]
sh: Add support for named character classes in bracket expressions.

Example:
  case x in [[:alpha:]]) echo yes ;; esac

Obtained-from:   FreeBSD 223120

21 months agosh: Fix duplicate prototypes for builtins.
Peter Avalos [Sun, 21 Aug 2011 21:21:56 +0000]
sh: Fix duplicate prototypes for builtins.

Have mkbuiltins write the prototypes for the *cmd functions to
builtins.h instead of builtins.c and include builtins.h in more
.c files instead of duplicating prototypes for *cmd functions in
other headers.

Obtained-from:   FreeBSD 223060

21 months agosh: Save/restore changed variables in optimized command substitution.
Peter Avalos [Sun, 21 Aug 2011 20:54:19 +0000]
sh: Save/restore changed variables in optimized command substitution.

In optimized command substitution, save and restore any variables
changed by expansions (${var=value} and $((var=assigned))), instead of
trying to determine if an expansion may cause such changes.

If $! is referenced in optimized command substitution, do not cause jobs
to be remembered longer.

This fixes $(jobs $!) again, simplifies the man page and shortens the
code.

Obtained-from:   FreeBSD 223024

21 months agosh: Read .profile from the home directory (or / if HOME is not set).
Peter Avalos [Sun, 21 Aug 2011 20:42:26 +0000]
sh: Read .profile from the home directory (or / if HOME is not set).

In most cases, login shells are started from the home directory, but not
in all, such as xterm -ls.

Obtained-from:   FreeBSD 223005

21 months agosh: Do parameter expansion on ENV before using it.
Peter Avalos [Sun, 21 Aug 2011 20:38:33 +0000]
sh: Do parameter expansion on ENV before using it.

This is required by POSIX, and allows things like ENV=\$HOME/.shrc.

Obtained-from:   FreeBSD 222957