10 years agoSync fnmatch(3) with FreeBSD.
Peter Avalos [Thu, 26 Feb 2009 08:21:07 +0000 (03:21 -0500)]
Sync fnmatch(3) with FreeBSD.

* Define FNM_NOSYS iaw SUS.

* Document the missing portions of IEEE Std. 1003.2.

* Add support for multibyte characters.

10 years agoSync fmtcheck(3) with FreeBSD, teaching it some new flags and args.
Peter Avalos [Thu, 26 Feb 2009 07:32:43 +0000 (02:32 -0500)]
Sync fmtcheck(3) with FreeBSD, teaching it some new flags and args.

10 years agoAdd posix_spawn() and posix_spawnp().
Peter Avalos [Sun, 15 Feb 2009 20:46:03 +0000 (15:46 -0500)]
Add posix_spawn() and posix_spawnp().

Also add execvP() which takes the search path as an argument.

Obtained-from: FreeBSD

10 years agoAdd a few new errnos and improve documentation.
Peter Avalos [Sat, 14 Feb 2009 23:11:36 +0000 (18:11 -0500)]
Add a few new errnos and improve documentation.

Some of these aren't used, but are required by POSIX.

Obtained-from: FreeBSD

10 years agoFix a few namespace issues in err.c.
Peter Avalos [Sat, 14 Feb 2009 19:48:33 +0000 (14:48 -0500)]
Fix a few namespace issues in err.c.

While I'm here, use sysexits in examples in the manual page.

Obtained-from: FreeBSD

10 years agoSync daemon(3) with FreeBSD:
Peter Avalos [Fri, 13 Feb 2009 22:37:49 +0000 (17:37 -0500)]
Sync daemon(3) with FreeBSD:

* Prevent abnormal termination of a child daemon process when created
by a parent that is a session leader (e.g., login shell) by ignoring
SIGHUP in before calling fork(2) and then restoring SIGHUP's action
after setsid(3).

* Merge some updates and markup fixes from OpenBSD for the manual page.

10 years agoSync confstr(3) with FreeBSD:
Peter Avalos [Fri, 13 Feb 2009 21:40:06 +0000 (16:40 -0500)]
Sync confstr(3) with FreeBSD:

* Support SUS "programming environment".
* confstr() returns compile-time constants.  Don't use sysctl to get
  the value of _PATD_STDPATH when we can just get it directly.

10 years agoSync assert with FreeBSD:
Peter Avalos [Fri, 13 Feb 2009 18:43:06 +0000 (13:43 -0500)]
Sync assert with FreeBSD:

* Change __assert() function to print failing function name.

* Make the output from assert() look more like the example in the C99

10 years agoSync arc4random with FreeBSD:
Peter Avalos [Fri, 13 Feb 2009 06:15:48 +0000 (01:15 -0500)]
Sync arc4random with FreeBSD:

* Add locking.

* Automatically re-stir

* Implement _buf() and _uniform() functions.

* Eliminate the arc4_stream arg since there's only 1 that's possible.

10 years agoFix format strings and a spelling errors.
Peter Avalos [Sun, 8 Feb 2009 16:45:31 +0000 (11:45 -0500)]
Fix format strings and a spelling errors.

Obtained-from: FreeBSD

10 years agoUse pread/pwrite instead of lseek followed by read/write.
Peter Avalos [Sun, 8 Feb 2009 16:41:07 +0000 (11:41 -0500)]
Use pread/pwrite instead of lseek followed by read/write.

Obtained-from: FreeBSD

10 years agoFix a sizeof error in __bt_put.
Peter Avalos [Sun, 8 Feb 2009 16:38:00 +0000 (11:38 -0500)]
Fix a sizeof error in __bt_put.

memmove() was used on pointers to size_ts, but only
sizeof(u_int32_t) bytes where copied.

Obtained-from: FreeBSD

10 years agoWhitespace cleanup.
Peter Avalos [Sun, 8 Feb 2009 16:32:21 +0000 (11:32 -0500)]
Whitespace cleanup.

10 years agoAdd a __printflike.
Peter Avalos [Sun, 8 Feb 2009 16:29:01 +0000 (11:29 -0500)]
Add a __printflike.

Obtained-from: FreeBSD

10 years agoDon't clobber CFLAGS.
Peter Avalos [Sun, 8 Feb 2009 16:27:03 +0000 (11:27 -0500)]
Don't clobber CFLAGS.

Obtained-from: FreeBSD

10 years agoSync libc/gmon with FreeBSD:
Peter Avalos [Tue, 3 Feb 2009 14:20:30 +0000 (09:20 -0500)]
Sync libc/gmon with FreeBSD:

* asm -> __asm
* Change warnx(foo, strerror()) to warn().
* Fix some format strings.
* Mark some statements that should probably use atomic ops.

10 years agoSync lib/net with FreeBSD:
Peter Avalos [Mon, 2 Feb 2009 07:19:33 +0000 (02:19 -0500)]
Sync lib/net with FreeBSD:

* Add a byteorder.9 manual page.
* Remove the addr2ascii and ascii2addr functions.  They aren't used in
  the tree, and there's other functions that are more generic and
* Fix a few style issues.
* Add and document ether_ntoa_r() and ether_aton_r() functions, which
  accept passed storage buffers rather than using static storage.
  Reimplement ether_ntoa() and ether_aton() in terms of these functions.
  These variants are thread-safe.
* Document that AI_ALL and AI_V4MAPPED flags are currently not supported.
* Add a SIOCGIFINDEX ioctl, which returns the index of a named interface.
  Use this ioctl in if_nametoindex(3) to use network aliases.
* Add restrict qualifier where needed.
* Add inet_ntoa_r() - a re-entrant function of inet_ntoa.
* Note that inet6_option_space.3 and inet6_rthdr_space.3 functions are
  deprecated in favor of inet6_opt_init.3 and inet6_rth_space.3.
* Remove NS and ISO stuff.
* Sync map_v4v6.c with BIND9.
* Instead of re-implementing hton[ls] and friends for each arch, add a
  new MI file, net/ntoh.c, which just implement them using the inline
  functions from <sys/endian.h>.
* Fix some namespace issues in <netdb.h>.

10 years agoSync libc/quad with FreeBSD:
Peter Avalos [Tue, 27 Jan 2009 20:51:36 +0000 (15:51 -0500)]
Sync libc/quad with FreeBSD:

-Remove advertising clause from copyright.

-Remove gcc 1 stuff.

-Add some prototypes in quad.h.

And, while I'm here:

-ANSI function declarations.

10 years agoSync libc/regex with FreeBSD:
Peter Avalos [Tue, 27 Jan 2009 14:17:46 +0000 (09:17 -0500)]
Sync libc/regex with FreeBSD:

-Make regular expression matching aware of multibyte characters.

-Some WARNS cleanup.

-Only stop evaluation of a back reference if the match length is
zero and the recursion level is too deep.

-Add restrict type-qualifier.

10 years agoReplace our strtod with the gdtoa package.
Peter Avalos [Mon, 19 Jan 2009 19:48:45 +0000 (14:48 -0500)]
Replace our strtod with the gdtoa package.

Obtained-from: FreeBSD

10 years agoConfigure gdtoa for DragonFly:
Peter Avalos [Mon, 19 Jan 2009 18:39:20 +0000 (13:39 -0500)]
Configure gdtoa for DragonFly:

-Protect exported symbols with leading underscores.

-Enable locale support.

-Add some missing prototypes.

-Correctly round floating-point numbers when they are printed in
non-default rounding modes.

-On platforms where long is 64 bits, make sure gdtoa doesn't use a
long when it really wants an int.

Obtained-from: FreeBSD

10 years agoAdd a <fenv.h> implementation.
Peter Avalos [Mon, 19 Jan 2009 23:44:52 +0000 (18:44 -0500)]
Add a <fenv.h> implementation.

This is slightly changed from FreeBSD's version since we aren't worried
about backward compatibility with FreeBSD 5.

Obtained-from: FreeBSD
amd64 fixes: dillon

10 years agoSync libc/stdlib with FreeBSD (ignoring jemalloc, pts, and gdtoa):
Peter Avalos [Mon, 19 Jan 2009 02:51:47 +0000 (21:51 -0500)]
Sync libc/stdlib with FreeBSD (ignoring jemalloc, pts, and gdtoa):

-Add a64l(), l64a(), and l64a_r() XSI extentions.  These functions
convert between a 32-bit integer and a radix-64 ASCII string.

-Replace some syscalls with libc version.

-Remove advertising clause.

-alloca() cannot check if the allocation is valid; mention the

-Include some verbage about not calling exit() from functions registered
by atexit().

-Use pthread mutexes where possible instead of libc spinlocks.

-Significantly reduce the memory leak as noted in the BUGS section of
setenv(3) by tracking the size of the memory allocated instead of using
strlen() on the current value.

-Prefer setenv() instead of putenv().

-Convert *env() calls to POSIX:
-unsetenv returns an int.
-putenv takes a char * instead of const char *.
-putenv no longer makes a copy of the input string.
-errno is set appropriately.  Exceptions involve bad environ
variable and internal initialization code.  These both set errno

-Make getopt_long() more GNU compatible and sync up with OpenBSD's

-POSIX clearly states that getsubopt() should be declared in <stdlib.h>
not in <unistd.h>

-Use size_t to avoid overflow when sorting arrays larger than 2 GB in
heapsort() and qsort().

-Add new implementations of insque() and remque() which conform to
IEEE Std 1003.1-2001.

-Add qsort_r() for functions that need to be reentrant.

-Improve radixsort()'s preformance when sorting strings with common

-Use 'uint32_t' instead of 'long' when a 32-bit integer is intended in

-Rearrange <stdlib.h> in a more logical order based on visibility.

-Move getsubopt()'s prototype to <stdlib.h> (standards).

-Make an internal _getprogname() that is used only inside
libc. For libc, getprogname(3) is a weak symbol in case a
function of the same name is defined in userland.

10 years agoReduce lock contention for simple cases in stdtime.
Peter Avalos [Sat, 17 Jan 2009 03:37:59 +0000 (22:37 -0500)]
Reduce lock contention for simple cases in stdtime.

Normally, we are often reading local time rather than setting time zone,
replace mutex with rwlock, this should eliminate lock contention in
most cases.

Obtained-from: FreeBSD

10 years agoRemove unused source files.
Peter Avalos [Sat, 17 Jan 2009 02:46:08 +0000 (21:46 -0500)]
Remove unused source files.

10 years agoAdd the restrict qualifier to strftime(3) and strptime(3).
Peter Avalos [Sat, 17 Jan 2009 02:22:40 +0000 (21:22 -0500)]
Add the restrict qualifier to strftime(3) and strptime(3).

10 years agoAdd routines to convert time_t to/from fixed-bit fields.
Peter Avalos [Sat, 17 Jan 2009 01:55:46 +0000 (20:55 -0500)]
Add routines to convert time_t to/from fixed-bit fields.

Obtained-from: FreeBSD

10 years agoSync strptime with NetBSD:
Peter Avalos [Fri, 16 Jan 2009 23:45:43 +0000 (18:45 -0500)]
Sync strptime with NetBSD:

-A few code optimiztions.

-%y failed to subtract 1900 from tm_year

-%p (am/pm) only worked at the end of the string

-%E% was treated as %% (ie match a % character)

-Add support for %Z.

-Add %F the ISO 8601 date format which is equivalent to %Y-%m-%d.

-Add gnu extensions: %z, %g, %G, %u.

-Bring in NetBSD's strptime(3) manual page.

10 years agoRemove the timezone() function.
Peter Avalos [Fri, 16 Jan 2009 15:52:59 +0000 (10:52 -0500)]
Remove the timezone() function.

It conflicts with an XSI extension where timezone and daylight are
variables representing:

timezone:  the difference, in seconds, between Coordinated Universal
Time (UTC) and local standard time.

daylight:  set to 0 if Daylight Savings Time conversions should never be
applied for the timezone in use; otherwise, non-zero.

10 years agoUse snprintf instead of sprintf.
Peter Avalos [Fri, 16 Jan 2009 00:40:23 +0000 (19:40 -0500)]
Use snprintf instead of sprintf.

Obtained-from: NetBSD

10 years agoMake sure that %r honors the LC_TIME t_fmt_ampm.
Peter Avalos [Fri, 16 Jan 2009 00:37:18 +0000 (19:37 -0500)]
Make sure that %r honors the LC_TIME t_fmt_ampm.

Obtained-from: NetBSD

10 years agoDon't depend on lcl_mutex being a recursive mutex.
Peter Avalos [Thu, 15 Jan 2009 15:48:06 +0000 (10:48 -0500)]
Don't depend on lcl_mutex being a recursive mutex.

10 years agoSync lib/libc/string with FreeBSD:
Peter Avalos [Wed, 14 Jan 2009 21:01:28 +0000 (16:01 -0500)]
Sync lib/libc/string with FreeBSD:

-Move legacy functions to strings.h.

-A few WARNS and style cleanup.

-Add ffsl(), fls(), flsl(), ffsll(), flsll().

-Merge index.3 and rindex.3 since they are so similar.  Do the same for

-Add memrchr().

-Remove advertising clause from copyrights.

-Add memmem() which is basically the same as strstr().

-Add stpcpy().

-Add a SECURITY CONSIDERATIONS section to remind people about buffer
overflows, etc.

-Add restrict keyword where required.

-Add strndup().

-Correctly document the return value of strerror() and strerror_r() and
the contents of the returned buffer for unknown error codes.

-Add NLS catalogs support to strerror(), strerror_r() and strsignal().
Controlled by NLS define.

-For strl* files, use a less restrictive copyright (original author
changed it).

-strmode.3: strmode does not return 0.

-Move swab()'s prototype to unistd.h IAW SUS.

-Simplify by removing unneeded local variables and explicit
null termination is wcs* functions.

-Move wcscoll() and wcsxfrm() to string/ and do locale-sensitive
collation for single-byte locales.

-Add wcsdup().

-Remove unneeded includes.

-Reimplement wcsrchr(3) more efficiently, using a single forward scan
(like strrchr(3)) instead of scanning forwards to find the end of the
string then scanning backwards to find the character.

-Slightly optimize wcswidth().

-Tell contrib srcs that we have strndup now since some of them provide
their own static definition which will blow up a buildworld.

10 years agoImport the uuid_enc_le(), uuid_dec_le(), uuid_enc_be() and uuid_dec_be() functions...
Peter Avalos [Fri, 2 Jan 2009 02:27:24 +0000 (21:27 -0500)]
Import the uuid_enc_le(), uuid_dec_le(), uuid_enc_be() and uuid_dec_be() functions. These routines are not part of the DCE RPC API. They are provided for convenience.

Obtained-from: FreeBSD

10 years agoSync libc/yp with FreeBSD:
Peter Avalos [Fri, 2 Jan 2009 01:28:07 +0000 (20:28 -0500)]
Sync libc/yp with FreeBSD:

-Set timeout for all NIS RPC requests to 1 second.  This should reduce
the risk of NIS timing out due to packet loss.
-Protect calls with a mutex lock.

10 years agoMerge commit 'chlamydia/master'
Thomas Nikolajsen [Mon, 6 Apr 2009 21:52:47 +0000 (23:52 +0200)]
Merge commit 'chlamydia/master'

10 years agobattd update: fix some errors and improve battd.8
Thomas Nikolajsen [Mon, 6 Apr 2009 21:13:03 +0000 (23:13 +0200)]
battd update: fix some errors and improve battd.8

 - Execute once (-E) didn't work
 - Default time (-T) didn't work
 - Default percentage couldn't be turned off, now -p0 does this
 - battd couldn't start when system on AC
 - battd.8 updated: markup improved
 -  line break at end of sentence
 -  -T better documented
 -  EXAMPLE udated

10 years agoSync zoneinfo database with tzdata2009e from elsie.
Sascha Wildner [Mon, 6 Apr 2009 13:43:12 +0000 (15:43 +0200)]
Sync zoneinfo database with tzdata2009e from elsie.

asia:           8.26 -> 8.29

* Jordan has been going to DST on the last Friday in March since 2002
  and not on the last Thursday.

* Palestine started DST midnight, March 26 and will end midnight,
  September 27.

10 years agoether_input(): Remove unapplied comment
Sepherosa Ziehau [Sun, 5 Apr 2009 04:28:31 +0000 (12:28 +0800)]
ether_input(): Remove unapplied comment

10 years agovlan(4): Support IFF_PROMISC and IFF_ALLMULTI
Sepherosa Ziehau [Sun, 5 Apr 2009 04:26:58 +0000 (12:26 +0800)]
vlan(4): Support IFF_PROMISC and IFF_ALLMULTI

Obtained-from: FreeBSD

10 years agoether_input: Defer promiscous packet discarding until vlan is processed
Sepherosa Ziehau [Sun, 5 Apr 2009 03:38:23 +0000 (11:38 +0800)]
ether_input: Defer promiscous packet discarding until vlan is processed

This is the one of the precondition to make vlan/bridge work: preventing
packets from being dropped prematurely by vlan's parent interface.

10 years agoUse ETHER_IS_MULTICAST, which is more expressive.
Sepherosa Ziehau [Sun, 5 Apr 2009 02:57:27 +0000 (10:57 +0800)]
Use ETHER_IS_MULTICAST, which is more expressive.

10 years agoserializer manpage: Remove IS_SERIALIZED(), which is available only if
Sepherosa Ziehau [Sun, 5 Apr 2009 02:03:26 +0000 (10:03 +0800)]
serializer manpage: Remove IS_SERIALIZED(), which is available only if
INVARIANTS is defined and probably should not be used in any places
other than the serializer implementation itself.

10 years agombuf: Don't discount the objcache limits required by non-pkthdr mbuf
Sepherosa Ziehau [Sun, 5 Apr 2009 02:00:04 +0000 (10:00 +0800)]
mbuf: Don't discount the objcache limits required by non-pkthdr mbuf

10 years agoaltq: ifq needs protection here; not ifnet
Sepherosa Ziehau [Sat, 4 Apr 2009 08:51:40 +0000 (16:51 +0800)]
altq: ifq needs protection here; not ifnet

10 years agoumount(8): Raise WARNS to 6 and fix all warnings.
Sascha Wildner [Sat, 4 Apr 2009 20:50:59 +0000 (22:50 +0200)]
umount(8): Raise WARNS to 6 and fix all warnings.

10 years agosh(1): Fix warnings when compiling with -DNO_HISTORY.
Sascha Wildner [Sat, 4 Apr 2009 20:38:31 +0000 (22:38 +0200)]
sh(1): Fix warnings when compiling with -DNO_HISTORY.

10 years agovkernel: Comment out unused variable.
Sascha Wildner [Sat, 4 Apr 2009 20:31:06 +0000 (22:31 +0200)]
vkernel: Comment out unused variable.

10 years agoRename some log() -> dolog() to not conflict with built-in log().
Sascha Wildner [Sat, 4 Apr 2009 20:26:27 +0000 (22:26 +0200)]
Rename some log() -> dolog() to not conflict with built-in log().

While here, remove trailing whitespace.

10 years agosystat(1): Correct TCP statistics reporting
Sepherosa Ziehau [Sat, 4 Apr 2009 02:43:27 +0000 (10:43 +0800)]
systat(1): Correct TCP statistics reporting

Reported-by: ruse39 on EFnet #dragonflybsd
10 years agobridge(4): if_snd.ifq_maxlen does not need explicit setting
Sepherosa Ziehau [Sat, 4 Apr 2009 02:33:04 +0000 (10:33 +0800)]
bridge(4): if_snd.ifq_maxlen does not need explicit setting

10 years agoHAMMER - Fix extra TAILQ_REMOVE in HAMMER shutdown code.
Matthew Dillon [Sat, 4 Apr 2009 01:35:07 +0000 (18:35 -0700)]
HAMMER - Fix extra TAILQ_REMOVE in HAMMER shutdown code.

Caught-by: New assertions in sys/queue.h imported by pavalos.
10 years agoAMD64 Test Environment - add SDL support to the qemu build
Matthew Dillon [Sat, 4 Apr 2009 01:12:12 +0000 (18:12 -0700)]
AMD64 Test Environment - add SDL support to the qemu build

Qemu may now be built with SDL (X support) using the make directive
WITHSDL=YES.  A new target 'xrun' runs qemu in X mode vs curses mode.

Submitted-by: Antonio Huete
10 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 3 Apr 2009 22:12:02 +0000 (15:12 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

10 years agoAMD64 - Enhance help target for src/test/amd64 build
Matthew Dillon [Fri, 3 Apr 2009 22:10:56 +0000 (15:10 -0700)]
AMD64 - Enhance help target for src/test/amd64 build

Document all targets.  Also add a new target 'sysloader' which will
install the native 32 bit system loader in root.img in case the
64 bit one doesn't work.

10 years agoUse .Va for tunables in manual pages.
Sascha Wildner [Fri, 3 Apr 2009 18:13:15 +0000 (20:13 +0200)]
Use .Va for tunables in manual pages.

10 years agoRedo last commit. Do not require that SRCDIR be specified. Set it
Matthew Dillon [Fri, 3 Apr 2009 18:00:39 +0000 (11:00 -0700)]
Redo last commit.  Do not require that SRCDIR be specified.  Set it
to ${.CURDIR}/../.. by default (originally it was hardwired to /usr/src).

10 years agoRequire that SRCDIR be specified or exist in the environment instead of
Matthew Dillon [Fri, 3 Apr 2009 17:56:41 +0000 (10:56 -0700)]
Require that SRCDIR be specified or exist in the environment instead of
defaulting it to /usr/src.

10 years agoRevoke reimplementation - primary commit part 2/2.
Matthew Dillon [Fri, 3 Apr 2009 16:46:57 +0000 (09:46 -0700)]
Revoke reimplementation - primary commit part 2/2.

This finishes out the primary revoke changes.  Adjust the revoke code
to do a primary pass on the file pointer table and mark fps with FREVOKED,
then do a pass on the process descriptor tables to clean them out.

Add checks to dup() to silently use a dummy fp when the source fp has
been revoked.  This removes revoke/dup races.

Add unix domain in-transit tests.  If a revoked fp is in-transit then
unix-domain sockets are scanned and revoked file pointers replaced with
dummy file pointers.

10 years agoAdd programs to test revocation of open files in the presence of
Matthew Dillon [Fri, 3 Apr 2009 16:24:13 +0000 (09:24 -0700)]
Add programs to test revocation of open files in the presence of
unix domain sockets with in-transit descriptors.

10 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 3 Apr 2009 06:48:28 +0000 (23:48 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

10 years agoRevoke reimplementation - primary commit part 1/2.
Matthew Dillon [Fri, 3 Apr 2009 06:38:31 +0000 (23:38 -0700)]
Revoke reimplementation - primary commit part 1/2.

Rip out and replace the old revoke code.  The old code basically ripped
vnodes out from under the related VFSs, faked close operations, hacked
up ref counts, and generally wreaked havoc on the system.

The new code is not as efficient, but plays a lot nicer with the kernel.
It locates and closes matching file descriptors (replacing the descriptor
with a dummy that just returns an error).  No ref count hacks are needed
and vnodes are no longer unceremoniously canned.

The new revoke code is also capable of revoking any vnode in the system,
device or file.  root, jail root, and chrooted directories cannot be

This also fixes an issue with HAMMER getting confused when one of its
vnodes got ripped out from under it by the old revoke.

10 years agousched_dummy: Silence warning
Sascha Wildner [Fri, 3 Apr 2009 06:34:24 +0000 (08:34 +0200)]
usched_dummy: Silence warning

10 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 2 Apr 2009 20:03:06 +0000 (13:03 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

10 years agoAMD64 - Fixes to make dynamic binaries run
Matthew Dillon [Thu, 2 Apr 2009 19:59:29 +0000 (12:59 -0700)]
AMD64 - Fixes to make dynamic binaries run

Fix the Elf64_Auxargs structure.

Misc stuff - Supply the original stack pointer as arg3 to rtld_bind().
Set addr = 0 if no interpreter (static binary).  Enable KTRACE.
Remove unused COPY_SIGCODE.

Taken-from: Loosely taken from FreeBSD, with help from Jordan Gordeev

10 years agovnconfig(8): remove code with no effect
Stathis Kamperis [Thu, 2 Apr 2009 17:37:57 +0000 (17:37 +0000)]
vnconfig(8): remove code with no effect

There is no point in calling anything after an err() call,
since err() itself exits and never fails.

Reviewed-by: dillon@
10 years agopppstats(8): Convert manual page to mdoc.
Sascha Wildner [Thu, 2 Apr 2009 09:17:11 +0000 (11:17 +0200)]
pppstats(8): Convert manual page to mdoc.

10 years agoAMD64 - More signal handler work. Signals now appear to work.
Matthew Dillon [Thu, 2 Apr 2009 06:23:50 +0000 (23:23 -0700)]
AMD64 - More signal handler work.  Signals now appear to work.

Finish implementing signal handler argument construction.  For AMD64 the
arguments are passed in registers rather than on the stack.

Align the stack to 16 bytes.

Misc cleanup, comments, and enable PROCFS in kernel config JG64.

Taken-from: FreeBSD code used as a loose template.

10 years agoFix permissions check for utimes() - owner can call even if u-w.
Matt Dillon [Thu, 2 Apr 2009 03:56:49 +0000 (03:56 +0000)]
Fix permissions check for utimes() - owner can call even if u-w.

The owner of a file can call utimes() to modify the file's access and
modified times even if the file is not user-writable.  Add a VOWN test
for VOP_ACCESS() / naccess() which performs this check.

As far as I know only kern_utimes() needs to use this particular type
of test.

This also fixes issues with cp -p and a few other programs.

Reported-by: Johannes Hofmann <johannes.hofmann@gmx.de>
10 years agoAMD64 - Remove some debugging.
Matthew Dillon [Thu, 2 Apr 2009 01:07:11 +0000 (18:07 -0700)]
AMD64 - Remove some debugging.

10 years agoAMD64 - Make signals operational, fix reg mappings, fix %fs management, trace
Matthew Dillon [Thu, 2 Apr 2009 00:57:01 +0000 (17:57 -0700)]
AMD64 - Make signals operational, fix reg mappings, fix %fs management, trace

Adjust sigframe, trapframe, mcontext, ucontext, and regs.  Add tf_xflags
too all structures.  Reorder struct regs to match the register layout
in the other structures.

Implement the commented out signaling code.  Signals now work, or at least
do not crash programs.  Theoretically the FP state is also saved and restored.

The exec() code failed to adjust gd_user_fs and gd_user_gs when setting
the msr registers for the user %fs and %gs, causing %fs to unexpectedly
change in running user programs.

Implement trace/debug support functions to set %rip and to single-step.

Define the missing vkernel flag FP_SOFTFP.

10 years agoAMD64 - Minor rtld syncs from FreeBSD
Matthew Dillon [Thu, 2 Apr 2009 00:52:31 +0000 (17:52 -0700)]
AMD64 - Minor rtld syncs from FreeBSD

Mainly change Elf_Word to Elf_Size in _rtld_bind(), plus some other
minor updates.

Taken-from: FreeBSD

10 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 1 Apr 2009 21:29:40 +0000 (14:29 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

10 years agoCorrect elf hash element types for 64 bit ELF.
Matthew Dillon [Wed, 1 Apr 2009 21:27:01 +0000 (14:27 -0700)]
Correct elf hash element types for 64 bit ELF.

Suggested-by: smtms
Taken-from: FreeBSD

10 years agoFix quickworld for crossbuilding - use ln -hsf to replace 'cpu' softlink
Matthew Dillon [Wed, 1 Apr 2009 20:07:07 +0000 (13:07 -0700)]
Fix quickworld for crossbuilding - use ln -hsf to replace 'cpu' softlink

10 years agoamd64 test builds - add additional targets
Matthew Dillon [Wed, 1 Apr 2009 20:04:21 +0000 (13:04 -0700)]
amd64 test builds - add additional targets

Add numerous additional targets including an incremental buildworld
feature and gdb64 build to examine 64 bit binaries on 32 bit platforms.

10 years agoRemove CVS ID from the loader help file.
Sascha Wildner [Wed, 1 Apr 2009 13:08:03 +0000 (15:08 +0200)]
Remove CVS ID from the loader help file.

10 years agousched_dummy: just proceed if the current thread is trying to acquire curproc
Simon Schubert [Wed, 1 Apr 2009 09:26:51 +0000 (11:26 +0200)]
usched_dummy:  just proceed if the current thread is trying to acquire curproc

If the current thread is exiting to userland and there is no
rescheduling required, uschedcp will be lp, not NULL, so accept this
situation as well.

10 years agoSimplify the radeon microcode loading.
Hasso Tepper [Wed, 1 Apr 2009 05:50:56 +0000 (08:50 +0300)]
Simplify the radeon microcode loading.

Obtained-from: FreeBSD

10 years agoAdd a comment for reminder about nocache.
Hasso Tepper [Tue, 31 Mar 2009 17:07:06 +0000 (20:07 +0300)]
Add a comment for reminder about nocache.

10 years agoLoad the right microcode for RS780.
Hasso Tepper [Tue, 31 Mar 2009 17:03:03 +0000 (20:03 +0300)]
Load the right microcode for RS780.

Obtained-from: FreeBSD

10 years agoFix typo in cpdup.1.
Peter Avalos [Wed, 1 Apr 2009 03:55:41 +0000 (03:55 +0000)]
Fix typo in cpdup.1.

10 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 1 Apr 2009 03:34:54 +0000 (20:34 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

10 years agovkernel: Fix startup race with I/O cothread support.
Matthew Dillon [Wed, 1 Apr 2009 03:32:22 +0000 (20:32 -0700)]
vkernel: Fix startup race with I/O cothread support.

The cothread interlocks using pthread calls but there is a small window
of opportunity where a cpu thread can signal the cothread before the
cothread has managed to interlock its first wait.  Moving the wait from the
top of the loop to the bottom fixes the problem.

Reported-by: Joe Talbott <josepht@cstone.net>
10 years agocpdup: '#' in cpignore files is no longer interpreted as a comment.
Matthew Dillon [Wed, 1 Apr 2009 00:16:31 +0000 (17:16 -0700)]
cpdup: '#' in cpignore files is no longer interpreted as a comment.

A '#' as the first character on a line in a cpignore file used to be
interpreted as a comment.  It is no just considered another valid
character in a filename.  Comments may no longer be represented in
cpignore files.

10 years agoUse atomic_fetchadd_int() in fdrop() instead of the spin-lock.
Matthew Dillon [Tue, 31 Mar 2009 23:56:14 +0000 (16:56 -0700)]
Use atomic_fetchadd_int() in fdrop() instead of the spin-lock.

10 years agoAdjust vfinddev() to return a referenced vnode in *vpp.
Matthew Dillon [Tue, 31 Mar 2009 22:17:33 +0000 (15:17 -0700)]
Adjust vfinddev() to return a referenced vnode in *vpp.

Fix a small race condition in sys_linux_ustat() related to accessing
a vnode which can get ripped out from under the procedure.

10 years agoMarkup fixes in several manual pages.
Sascha Wildner [Tue, 31 Mar 2009 22:14:12 +0000 (00:14 +0200)]
Markup fixes in several manual pages.

10 years agovnconfig(8): document -S default size modifier
Stathis Kamperis [Tue, 31 Mar 2009 07:26:17 +0000 (07:26 +0000)]
vnconfig(8): document -S default size modifier

10 years agoSort SEE ALSO in some manual pages.
Sascha Wildner [Mon, 30 Mar 2009 10:50:26 +0000 (12:50 +0200)]
Sort SEE ALSO in some manual pages.

10 years agovnconfig: remove unnecessary casts
Stathis Kamperis [Mon, 30 Mar 2009 09:57:36 +0000 (09:57 +0000)]
vnconfig: remove unnecessary casts

Approved-by: corecode@
10 years agovnconfig -l: print an error if supplied vn is unknown
Stathis Kamperis [Mon, 30 Mar 2009 07:48:36 +0000 (07:48 +0000)]
vnconfig -l: print an error if supplied vn is unknown

The code as it is has no effect, because `tmp' is never NULL.
Make it behave as initially intended. Also, since we are here
replace the printf() call with errx().

Approved-by: corecode@
10 years agorpc.rstatd(8): Silence warnings.
Sascha Wildner [Sun, 29 Mar 2009 16:00:23 +0000 (18:00 +0200)]
rpc.rstatd(8): Silence warnings.

10 years ago<sys/tree.h>: Add __unused (fixes warning in undo(1)).
Sascha Wildner [Sun, 29 Mar 2009 16:04:26 +0000 (18:04 +0200)]
<sys/tree.h>: Add __unused (fixes warning in undo(1)).

10 years agorpc.rusersd(8): Silence warnings.
Sascha Wildner [Sun, 29 Mar 2009 16:08:10 +0000 (18:08 +0200)]
rpc.rusersd(8): Silence warnings.

10 years agorpc.rwalld(8): Silence warnings.
Sascha Wildner [Sun, 29 Mar 2009 16:16:45 +0000 (18:16 +0200)]
rpc.rwalld(8): Silence warnings.

10 years agorpc.sprayd(8): Silence warnings.
Sascha Wildner [Sun, 29 Mar 2009 16:18:36 +0000 (18:18 +0200)]
rpc.sprayd(8): Silence warnings.

10 years agorpc.lockd(8): Silence warnings.
Sascha Wildner [Sun, 29 Mar 2009 17:52:21 +0000 (19:52 +0200)]
rpc.lockd(8): Silence warnings.

10 years agorpc.statd(8): Silence warnings.
Sascha Wildner [Sun, 29 Mar 2009 17:56:50 +0000 (19:56 +0200)]
rpc.statd(8): Silence warnings.

10 years agorpc.ypxfrd(8): Silence warnings.
Sascha Wildner [Sun, 29 Mar 2009 17:58:31 +0000 (19:58 +0200)]
rpc.ypxfrd(8): Silence warnings.