dragonfly.git
14 years agoRemove unneeded .Pp before .Rs in various manual pages.
Sascha Wildner [Tue, 28 Apr 2009 13:02:19 +0000 (15:02 +0200)]
Remove unneeded .Pp before .Rs in various manual pages.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 28 Apr 2009 05:28:56 +0000 (22:28 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoFix type-o, the file $syscompatdcldf12 file was not being properly touched.
Matthew Dillon [Tue, 28 Apr 2009 03:44:04 +0000 (20:44 -0700)]
Fix type-o, the file $syscompatdcldf12 file was not being properly touched.

Submitted-by: Mohd Farid Kamarudin <mokamaru@gmail.com>
14 years agoSync zoneinfo database with tzdata2009g from elsie.
Sascha Wildner [Mon, 27 Apr 2009 18:19:43 +0000 (20:19 +0200)]
Sync zoneinfo database with tzdata2009g from elsie.

africa:         8.18 -> 8.19

Due to Ramadan shifting through the Gregorian calendar it will end before
the fourth Thursday in September in 2009 and the next couple of years, so
Egypt is expected to end DST on the last Thursday in September.

14 years agoifpoll: Unbreak UP LINT building
Sepherosa Ziehau [Mon, 27 Apr 2009 13:15:50 +0000 (21:15 +0800)]
ifpoll: Unbreak UP LINT building

14 years agoAdd IFPOLL_ENABLE to LINT
Sepherosa Ziehau [Mon, 27 Apr 2009 12:25:10 +0000 (20:25 +0800)]
Add IFPOLL_ENABLE to LINT

14 years agoemx(4): If error happens, we must hold all of the serializers instead
Sepherosa Ziehau [Mon, 27 Apr 2009 12:22:25 +0000 (20:22 +0800)]
emx(4): If error happens, we must hold all of the serializers instead
of trying to hold them, since the register content changes upon next
call.

14 years agoifpoll: Fix comment
Sepherosa Ziehau [Mon, 27 Apr 2009 12:15:42 +0000 (20:15 +0800)]
ifpoll: Fix comment

14 years agoifpoll: Reorganize TX/RX polling sysctl tree
Sepherosa Ziehau [Mon, 27 Apr 2009 11:08:01 +0000 (19:08 +0800)]
ifpoll: Reorganize TX/RX polling sysctl tree

14 years agoifpoll: Use rdtsc() whenever possible to calculate time related states.
Sepherosa Ziehau [Sun, 26 Apr 2009 12:05:13 +0000 (20:05 +0800)]
ifpoll: Use rdtsc() whenever possible to calculate time related states.

14 years agoifpoll: Expose kernel time fraction; currenly for debugging only.
Sepherosa Ziehau [Sun, 26 Apr 2009 11:05:31 +0000 (19:05 +0800)]
ifpoll: Expose kernel time fraction; currenly for debugging only.

14 years agoifpoll: Put pollmore under crit section
Sepherosa Ziehau [Sun, 26 Apr 2009 06:42:56 +0000 (14:42 +0800)]
ifpoll: Put pollmore under crit section

14 years agoifpoll: crit_{enter,exit}() -> crit_{enter,exit}_gd()
Sepherosa Ziehau [Sun, 26 Apr 2009 06:12:47 +0000 (14:12 +0800)]
ifpoll: crit_{enter,exit}() -> crit_{enter,exit}_gd()

14 years agoifpoll: Let callers of sched_* enter/exit crit section
Sepherosa Ziehau [Sun, 26 Apr 2009 06:01:56 +0000 (14:01 +0800)]
ifpoll: Let callers of sched_* enter/exit crit section

14 years agoifpoll: Put iteration of polling handlers under crit section.
Sepherosa Ziehau [Sun, 26 Apr 2009 05:13:28 +0000 (13:13 +0800)]
ifpoll: Put iteration of polling handlers under crit section.

14 years agoAdd ifpoll, which support hardware TX/RX queues based polling.
Sepherosa Ziehau [Sun, 26 Apr 2009 03:04:18 +0000 (11:04 +0800)]
Add ifpoll, which support hardware TX/RX queues based polling.
The implementation is mainly based on the polling(4) code.

Difference to the polling(4):
- Instead of registering one polling handler for both TX/RX and status,
  drivers could register multiple polling handlers for TX/RX polling
  handler on different CPU based on its own needs.  And drivers could
  register one status check handler, which is always polled on CPU0.
- TX could be polled at lower frequency than RX; normally we don't
  need high frequency polling for TX, but for RX, we may need relative
  higher polling frequency.
- Better serializer integration.

ifnet changes:
- ifnet.if_qpoll is added, which should be implemented by driver which
  supports ifpoll.
- IFF_NPOLLING is added to indicate that the driver is using ifpoll.

ifconfig(8):
- Add 'npolling' and '-npolling'; they are used to turn on/off ifpoll
  on the specified interface.

Drivers:
- emx(4) is converted to use the ifpoll.  Coexistance of ifpoll and
  polling(4) in one driver requires extra effort in driver itself;
  drop polling(4) support in emx(4) for now.

IFPOLL_ENABLE kernel option is added, which is not enabled by default.

14 years agoUse STDERR_FILENO for stderr messages.
Hasso Tepper [Mon, 27 Apr 2009 03:28:55 +0000 (06:28 +0300)]
Use STDERR_FILENO for stderr messages.

14 years agoFix recursive lock in detached close of /dev/tty.
Matthew Dillon [Sun, 26 Apr 2009 19:26:16 +0000 (12:26 -0700)]
Fix recursive lock in detached close of /dev/tty.

A recursive lock and vp-held-after-release issue when close()ing a /dev/tty
descriptor was resulting in a panic.

Reported-by: Hasso Tepper <hasso@estpak.ee>
14 years agoUse MAP_TRYFIXED instead of MAP_FIXED when mapping the red zone.
Matthew Dillon [Sat, 25 Apr 2009 18:43:15 +0000 (11:43 -0700)]
Use MAP_TRYFIXED instead of MAP_FIXED when mapping the red zone.

We want to fail if the user program already faulted through the zone,
though in reality the red zone init occurs before main() is even run so
there is no practical difference.

14 years agoAdd cpdup feature - allow uid/gid/flags changes to fail if running as user
Matthew Dillon [Sat, 25 Apr 2009 18:39:45 +0000 (11:39 -0700)]
Add cpdup feature - allow uid/gid/flags changes to fail if running as user

If running as a user instead of root uid, gid, and flags changes are allowed
to fail and also, if running as a user, no longer force a copy if they
differ but the mtime and size are the same.  Generate a single warning
instead.

Reorder the call to setutimes to occur after chown/chmod instead of before,
and to occur after a chflags call if IMMUTABLE is not set.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Sat, 25 Apr 2009 17:42:30 +0000 (10:42 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoFix an installworld failure due to kernel fixes and a libthread_xu issue.
Matthew Dillon [Sat, 25 Apr 2009 17:36:03 +0000 (10:36 -0700)]
Fix an installworld failure due to kernel fixes and a libthread_xu issue.

Build the bootstrap version of cpdup without threading to work around a
bug in libthread_xu.  Libthread_xu was trying to map the original user
stack's red zone without using MAP_FIXED or MAP_TRYFIXED or MAP_STACK,
a behavior which the kernel now prohibits.

This fixes running installworld after rebooting with a new kernel.

Sepherosa Ziehau <sepherosa@gmail.com>

14 years agopktgenctl: Update according to recent libc changes
Sepherosa Ziehau [Sat, 25 Apr 2009 11:40:24 +0000 (19:40 +0800)]
pktgenctl: Update according to recent libc changes

14 years agoAdd a dummy offset to the arrays generated by genassym to avoid ary[0]
Matthew Dillon [Sat, 25 Apr 2009 00:11:10 +0000 (17:11 -0700)]
Add a dummy offset to the arrays generated by genassym to avoid ary[0]

The dummy offset avoids the generation of dummy arrays of size zero.
This whole code path is a hack, but after a lot of messing around
Alex and I determined that it was easier to hack it then to try to
redo the code due to complications introduced by cross-compiled
environments.

Submitted-by: Alex Hornung <ahornung@gmail.com>
14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 24 Apr 2009 19:23:31 +0000 (12:23 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoFix the backslashes in a __asm line's interference with an #ifdef
Matthew Dillon [Fri, 24 Apr 2009 19:21:49 +0000 (12:21 -0700)]
Fix the backslashes in a __asm line's interference with an #ifdef

Reported-by: Hasso Tepper
14 years agoNo barriers and spinlocks.
Hasso Tepper [Fri, 24 Apr 2009 18:59:40 +0000 (21:59 +0300)]
No barriers and spinlocks.

14 years agoWe don't support barriers and spinlocks yet.
Hasso Tepper [Fri, 24 Apr 2009 18:30:36 +0000 (21:30 +0300)]
We don't support barriers and spinlocks yet.

Fixes a lot of problems with thirdparty software.

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

14 years agoFix various clang compile issues
Alex [Fri, 24 Apr 2009 12:54:22 +0000 (13:54 +0100)]
Fix various clang compile issues

1) remove uses of __label__, which is not supported by llvm/clang
2) remove uses of register type var __asm("ecx") and other variable
register-binding as it is not supported by llvm/clang and is superfluous
3) add an ugly hack, conditionalized on __clang__, to allow correct
compilation of atomic_intr_cond_try()

Submitted-by: Alex Hornung
Cherry-Picked-From: Alex Hornung's leaf repo

14 years agounvis(3) manual page: s/RFCxxxx/RFC xxxx/
Sascha Wildner [Fri, 24 Apr 2009 06:47:11 +0000 (08:47 +0200)]
unvis(3) manual page: s/RFCxxxx/RFC xxxx/

14 years agoypclient(3) manual page: .Pp not needed here.
Sascha Wildner [Fri, 24 Apr 2009 06:46:44 +0000 (08:46 +0200)]
ypclient(3) manual page: .Pp not needed here.

14 years agoDon't call vm_map_findspace() when MAP_TRYFIXED is specified.
Matthew Dillon [Thu, 23 Apr 2009 22:18:10 +0000 (15:18 -0700)]
Don't call vm_map_findspace() when MAP_TRYFIXED is specified.

MAP_TRYFIXED is intended to return the requested address or an error.

14 years agoFix logic when using the umtx_*_err() functions. With these functions
Matthew Dillon [Thu, 23 Apr 2009 22:16:51 +0000 (15:16 -0700)]
Fix logic when using the umtx_*_err() functions.  With these functions
a positive error value is returned, not -1.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 23 Apr 2009 21:46:18 +0000 (14:46 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoMake adjustments to how MAP_STACK works to prevent improper mmap()s.
Matthew Dillon [Thu, 23 Apr 2009 21:41:28 +0000 (14:41 -0700)]
Make adjustments to how MAP_STACK works to prevent improper mmap()s.

Record that a vm_map_entry is a stack mapping.  When locating free space
do not allow non-MAP_STACK mappings to use space reserved by MAP_STACK
mappings, unless MAP_FIXED is used of course.

Previously MAP_STACK mappings implied MAP_FIXED, which is not how they are
supposed to work.  Implement proper hinting without MAP_FIXED.

Do not allow a normal mmap() call to use space reserved by a MAP_STACK
mapping (unless MAP_FIXED is used of course).

The proper method of making a MAP_STACK mapping inside another MAP_STACK
mapping is to use MAP_STACK | MAP_TRYFIXED.  For now, though, we silently
imply MAP_TRYFIXED when MAP_STACK is specified and it will work without it.

Document MAP_TRYFIXED and make it also relax additional requirements imposed
by MAP_STACK mappings inside of MAP_STACK mappings.

Adjust libthread_xu to use MAP_STACK | MAP_TRYFIXED.

14 years agocxm(4): Fix a crash by warning if no firmware is compiled in.
Sascha Wildner [Thu, 23 Apr 2009 20:38:03 +0000 (22:38 +0200)]
cxm(4): Fix a crash by warning if no firmware is compiled in.

14 years agoFix libthread_xu's use of MAP_STACK. Guards were not being setup properly.
Matthew Dillon [Thu, 23 Apr 2009 20:05:24 +0000 (13:05 -0700)]
Fix libthread_xu's use of MAP_STACK.  Guards were not being setup properly.

MAP_STACK mappings do not immediately extend down to their base, so calling
mprotect() on the base is basically a NOP.  Instead of calling mprotect() we
call mmap() with MAP_FIXED to force the guard.

Properly use MAP_FIXED when setting up the primary guard on the original
user stack.  The address specified in the mmap() is only a hint when MAP_FIXED
is not used, and will not properly map the anonymous area.  Also, new kernels
do not allow non-MAP_STACK mappings to override MAP_STACK mappings and the
user stack area is a MAP_STACK mapping, so use of MAP_FIXED is mandatory here.

14 years agoAdd a definition for POSIX.1-2008 to mdoc.local (from FreeBSD).
Sascha Wildner [Thu, 23 Apr 2009 19:46:34 +0000 (21:46 +0200)]
Add a definition for POSIX.1-2008 to mdoc.local (from FreeBSD).

14 years agoAdd missing files from umtx errno fixes commit.
Matthew Dillon [Thu, 23 Apr 2009 19:14:30 +0000 (12:14 -0700)]
Add missing files from umtx errno fixes commit.

14 years agoFix VM panic. Add required overflow check for MAP_STACK and MAP_FIXED mmaps
Matthew Dillon [Thu, 23 Apr 2009 18:54:47 +0000 (11:54 -0700)]
Fix VM panic.  Add required overflow check for MAP_STACK and MAP_FIXED mmaps

Certain mmap() calls were not properly checking that (addr + size) does not
overflow, causing a kernel panic.

Reported-by: Alex Hornung <ahornung@gmail.com>
14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 23 Apr 2009 17:35:47 +0000 (10:35 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoFix an errno leak in libthread_xu's calls to umtx.
Matthew Dillon [Thu, 23 Apr 2009 17:34:34 +0000 (10:34 -0700)]
Fix an errno leak in libthread_xu's calls to umtx.

Add a syscall entry point that returns errno instead of loading the
errno variable and use it to make umtx calls deep in libthread_xu,
avoiding the whole errno issue and fixing the leak.

Submitted-by: Alex Hornung
14 years agoAdd fpsetsticky() documentation (from NetBSD).
Sascha Wildner [Thu, 23 Apr 2009 08:59:46 +0000 (10:59 +0200)]
Add fpsetsticky() documentation (from NetBSD).

14 years agoAdd xdr_int64_t()/xdr_u_int64_t() documentation (from OpenBSD).
Sascha Wildner [Thu, 23 Apr 2009 08:58:23 +0000 (10:58 +0200)]
Add xdr_int64_t()/xdr_u_int64_t() documentation (from OpenBSD).

14 years agoAdd strnlen()/wcsnlen() documentation (from FreeBSD).
Sascha Wildner [Thu, 23 Apr 2009 08:56:48 +0000 (10:56 +0200)]
Add strnlen()/wcsnlen() documentation (from FreeBSD).

14 years agoAdd wcstof()/wcstold() documentation (from NetBSD).
Sascha Wildner [Thu, 23 Apr 2009 08:55:46 +0000 (10:55 +0200)]
Add wcstof()/wcstold() documentation (from NetBSD).

14 years agoAdd strunvisx() documentation (from FreeBSD).
Sascha Wildner [Thu, 23 Apr 2009 08:54:34 +0000 (10:54 +0200)]
Add strunvisx() documentation (from FreeBSD).

14 years agoBring in ypclnt(3) manual page (from NetBSD).
Sascha Wildner [Thu, 23 Apr 2009 08:53:13 +0000 (10:53 +0200)]
Bring in ypclnt(3) manual page (from NetBSD).

14 years agoFreeBSD-SA-09:05.telnet - fix environment based code execution vulnerability
Matthew Dillon [Thu, 23 Apr 2009 00:57:21 +0000 (17:57 -0700)]
FreeBSD-SA-09:05.telnet - fix environment based code execution vulnerability

14 years agoApply FreeBSD-SA-09:07.libc - fix information leak in db(3)
Matthew Dillon [Wed, 22 Apr 2009 23:09:06 +0000 (16:09 -0700)]
Apply FreeBSD-SA-09:07.libc - fix information leak in db(3)

Obtained-from: FreeBSD

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

14 years agoIncrease the number of internal spinlocks available to libc from 20 to 128
Matthew Dillon [Wed, 22 Apr 2009 21:50:37 +0000 (14:50 -0700)]
Increase the number of internal spinlocks available to libc from 20 to 128

Fix an issue where the new malloc wants to use more internal spinlocks
then libthread_xu declares.

14 years agoFix a bug in krealloc(). Note that krealloc() is very rarely used.
Matthew Dillon [Wed, 22 Apr 2009 20:04:23 +0000 (13:04 -0700)]
Fix a bug in krealloc().  Note that krealloc() is very rarely used.

krealloc() was improperly calling zoneindex() when transitioning from
zone-controlled memory to non-zone-controlled (big) memory.

14 years agoFix vkernel issues - enable ithread preemption, races, and more.
Matthew Dillon [Wed, 22 Apr 2009 19:56:37 +0000 (12:56 -0700)]
Fix vkernel issues - enable ithread preemption, races, and more.

signalintr() was improperly entering a critical section, preventing
sched_ithd() from being able to preempt the current thread.  Adjust
so the code matches the pc32 code.

lwp0 was being assigned cpu_heavy_switch instead of cpu_lwkt_switch,
which works fine on pc32 but blows up the vkernel if process 0 gets
preempted, because vkernel LWKT processes are not assigned vmspaces.
Properly use cpu_lwkt_switch() to fix the problem.

We were not checking for pending reschedule requests when the
vmspace_ctl() call got interrupted by a signal.  NOTE:  There is
still a race after the check prior to re-entry into vmspace_ctl()
which needs to be closed.

Tracked-down-by: corecode, dillon
14 years agoReplace the old BSD malloc code with a port of our slab allocator.
Matthew Dillon [Wed, 22 Apr 2009 19:18:07 +0000 (12:18 -0700)]
Replace the old BSD malloc code with a port of our slab allocator.

This should give us a better base with which we can work up a
more thread-friendly user malloc.  Buildworld performance is about
the same (just slightly faster).  malloc performance is about twice as
fast as the original.

14 years agotcp/ip4 mapped address: Add tcp6_soport()
Sepherosa Ziehau [Wed, 22 Apr 2009 13:49:40 +0000 (21:49 +0800)]
tcp/ip4 mapped address: Add tcp6_soport()

For IPv6 v6 only address or inp's address family is not known yet,
e.g. before connect(2) is called on the INET6 socket, this function
acts exactly the same as cpu0_soport() (the soport function before
this commit).  If a INET6 socket is connected to IPv4 mapped address,
then this function simply falls back to tcp_soport().

14 years agotcp/ipv4 mapped address: Make sure that tcp_output is done on inpcb's owner CPU
Sepherosa Ziehau [Wed, 22 Apr 2009 12:54:12 +0000 (20:54 +0800)]
tcp/ipv4 mapped address: Make sure that tcp_output is done on inpcb's owner CPU

15 years agotcp_timer: Add assertion to make sure that tcp timers are only accessed
Sepherosa Ziehau [Tue, 21 Apr 2009 14:09:24 +0000 (22:09 +0800)]
tcp_timer: Add assertion to make sure that tcp timers are only accessed
on their pcb's owner CPU

15 years agotmpnam(3) manual page: Correct function name.
Sascha Wildner [Wed, 22 Apr 2009 03:46:46 +0000 (05:46 +0200)]
tmpnam(3) manual page: Correct function name.

15 years agovmstat(8): align columns when reporting stats with -m
Stathis Kamperis [Tue, 21 Apr 2009 16:31:18 +0000 (16:31 +0000)]
vmstat(8): align columns when reporting stats with -m

Reviewed-by: dillon@
15 years agoSync libc/stdio with FreeBSD:
Peter Avalos [Sun, 19 Apr 2009 05:26:39 +0000 (05:26 +0000)]
Sync libc/stdio with FreeBSD:

* Rewrite asprintf() as a wrapper around vasprintf().

* Add dprintf() and vdprintf() from POSIX.1-2008.

* Remove an obsolete comment from fclose.3 regarding the placement
of a FUNLOCKFILE() call.

* Remove useless variable 'nofile' in fdopen().

* Remove comment about clearerr() being the only method of clearing
the EOF indicator, fseek() may also be used for this.

* Add commentary explaining why we return EBADF upon attempts to fflush()
a read-only file.

* Fix a few style and whitespace nits.

* Suggest that fgets() be used instead of gets().

* Don't use __sgetc() to avoid overwriting fwide(3) orientation
(__srget() call by __sgetc() uses _SET_ORIENTATION macro).

* Fix a sign-compare issue in fgetwln().

* Use C99-style initializers.

* Correct some buffer sizes.

* Rework the floating point code in printf().  Significant changes:

 - We used to round long double arguments to double.  Now we print
 them properly.

 - Bugs involving '%F', corner cases of '#' and 'g' format
 specifiers, and the '.*' precision specifier have been fixed.

 - Added support for the "'" specifier to print thousands' grouping
 characters in a locale-dependent manner.

 - Implement the __vfprintf() side of hexadecimal floating point
 support.  All that is still needed is a routine to convert the
 mantissa to hex digits one nibble at a time in the style of ultoa().

* Add restrict qualifier.

* Add rewind() to the list of functions which may fail and set errno.

* Improve documentation for fgetpos() and fsetpos(), and discourage
users from assuming that fpos_t is an integral type.

* Describe the restrictions on seeking on wide character streams, and also
point out that fseek() clears the ungetwc() buffer.

* Save errno from getting clobbered where appropriate.

* Resulting fseek() offset must fit in long, required by POSIX,
so add LONG_MAX and final tests for it.

* Disallow negative seek as POSIX requires for fseek{o}.

* Catch few possible off_t overflows.

* Make fseek(... SEEK_CUR) fails if current file-position is unspecified.

* Move all stdio internal flags processing and setting out of __sread(),
__swrite() and __sseek() to higher level. According to funopen(3) they all
are just wrappers to something like standard read(2), write(2) and
lseek(2), i.e. must not touch stdio internals because they are replaceable
with any other functions knows nothing about stdio internals.

* Rename cantwrite() to prepwrite().  The latter is less confusing,
since the macro isn't really a predicate, and it has side-effects.
Also, don't set errno if prepwrite() fails, since this is done in
prepwrite() now.

* Fix a potential deadlock in _fwalk in a threaded environment.
A file flag (__SIGN) was added to stdio.h that, when set, tells
_fwalk to ignore it in its walk.  This seemed to be needed in
refill.c because each file needs to be locked when flushing.

* Call __sgetc() directly in getchar() instead of taking an expensive
detour through getc().

* Add getdelim() and getline().

* Document dependence of mktemp(3) on the non-reentrant arc4random(3).

* Fix a few bugs with the _gettemp() routine which implements mkstemp(),
mkstemps(), and mkdtemp().
 - Add proper range checking for the 'slen' parameter passed to mkstemps().
 - Try all possible permutations of a template if a collision is encountered.
 Previously, once a single template character reached 'z', it would not wrap
 around to '0' and keep going until it encountered the original starting
 letter.  In the edge case that the randomly generated starting name used
 all 'z' characters, only that single name would be tried before giving up.

* Use arc4random_uniform(3) since modulo size is not power of 2 in _gettemp.

* Write the message to stderr, not file descriptor 2, so that perror()
writes to the correct stream if stderr has been redirected with freopen().

* Use strerror_r() to format the error message so that strerror()'s static
buffer does not get clobbered in perror().

* Move the positional argument handling code for vfprintf() to a new file,
printf-pos.c, and move common definitions to printflocal.h.

* Remove advertising clause in the copyrights.

* In rewind.c:
 1) add missing __sinit() as in fseek() it pretends to be.
 2) use clearerr_unlocked() since we already lock stream before _fseeko()
 3) don't zero errno at the end, it explicitely required by POSIX as the
 only one method to test rewind() error condition.
 4) don't clearerr() if error happens in _fseeko()

* When __SOPT is cleared, clear __SOFF too.

* Save a few cycles and don't initialize the locking fields in FILE if
they aren't going to be used later.

* Add ENVIRONMENT section to tmpnam(3) and mention there that TMPDIR is
ignored when issetugid(3) is true.  Also add a SECURITY CONSIDERATIONS
section.

* Describe file-position behaviour from POSIX in ungetc(3).

* Remove duplicate check for EOF from ungetc(); __ungetc() already checks.

* In vasprintf, free the buffer when __vfprintf() fails and don't bother
trying to shrink the buffer with realloc() before returning it.

* Rework the floating point code in printf().  Significant changes:
 - We used to round long double arguments to double.  Now we print
 them properly.
 - Bugs involving '%F', corner cases of '#' and 'g' format
 specifiers, and the '.*' precision specifier have been fixed.
 - Added support for the "'" specifier to print thousands' grouping
 characters in a locale-dependent manner.
 - Implement the __vfprintf() side of hexadecimal floating point
 support.  All that is still needed is a routine to convert the
 mantissa to hex digits one nibble at a time in the style of ultoa().

* %e conversions with precision 0 should not cause a decimal point to
  be printed.

* Fix %f conversions where the number of significant digits is < expt.

* %E-like %g and %G conversions should remove trailing zeroes unless
the # flag is present.  Implement this behavior and add a comment
describing it.

* Implement __hdtoa() and __hldtoa() and enable printf() support for %a
and %A, which print floating-point numbers in hexadecimal.

* Add an extensible printf implementation compatible with GLIBC.

* Add support for multibyte decimal_point encodings, e.g., U+066B.

* Add support for multibyte thousands_sep encodings, e.g., U+066C.
The integer thousands' separator code is rewritten in order to
avoid having to preallocate a buffer for the largest possible
digit string with the most possible instances of the longest
possible multibyte thousands' separator. The new version inserts
thousands' separators for integers using the same code as floating point.

* Introduce a local variable and use it instead of passed in parameter
to get rid of restrict qualifier discarding in vswscanf().

* Set the error indicator on an attempt to write to a read-only stream
in wsetup.c.

* Move the format_arg() attribute handling to <sys/cdefs.h> where it
belongs.

Obtained-from:  FreeBSD & NetBSD

15 years agoAdd the wcsnlen() function.
Peter Avalos [Sun, 19 Apr 2009 02:24:40 +0000 (02:24 +0000)]
Add the wcsnlen() function.

Obtained-from: FreeBSD

15 years agoAdd wcstof() and wcstold() functions.
Peter Avalos [Sun, 19 Apr 2009 02:09:36 +0000 (02:09 +0000)]
Add wcstof() and wcstold() functions.

Obtained-from: NetBSD

15 years agoAdd the strnlen() function.
Peter Avalos [Sun, 19 Apr 2009 00:07:53 +0000 (00:07 +0000)]
Add the strnlen() function.

Obtained-from: FreeBSD

15 years agocxm(4): Silence compilation warning.
Sascha Wildner [Mon, 20 Apr 2009 02:34:40 +0000 (04:34 +0200)]
cxm(4): Silence compilation warning.

15 years agomake upgrade: Don't remove /usr/lib/crt[1in].o anymore.
Sascha Wildner [Mon, 20 Apr 2009 02:31:59 +0000 (04:31 +0200)]
make upgrade: Don't remove /usr/lib/crt[1in].o anymore.

15 years agocsu: adjust readme
Simon Schubert [Sun, 19 Apr 2009 23:09:54 +0000 (01:09 +0200)]
csu:  adjust readme

15 years agocsu: move crt files to /usr/lib
Simon Schubert [Sun, 19 Apr 2009 22:46:24 +0000 (00:46 +0200)]
csu:  move crt files to /usr/lib

Instead of installing our start files in gcc directories, install the
generic ones in /usr/lib.  This should make porting other compilers more
easy.

Requested-by: hasso@
15 years agogcc: add /usr/lib to the startfile search path
Simon Schubert [Sun, 19 Apr 2009 21:26:43 +0000 (23:26 +0200)]
gcc:  add /usr/lib to the startfile search path

This will allow us to place some files (crt1.o etc) into /usr/lib, and
use other startfiles (like crtbegin.o) from their own gcc directories.

15 years agocxm(4) manual page: Fix typos.
Sascha Wildner [Sun, 19 Apr 2009 02:09:40 +0000 (04:09 +0200)]
cxm(4) manual page: Fix typos.

15 years agocxm(4): Oops, remove #include opt_cxm.h for now.
Sascha Wildner [Sun, 19 Apr 2009 01:03:12 +0000 (03:03 +0200)]
cxm(4): Oops, remove #include opt_cxm.h for now.

15 years agometeor(4) manual page: Add bktr(4) and cxm(4) references.
Sascha Wildner [Sun, 19 Apr 2009 00:52:49 +0000 (02:52 +0200)]
meteor(4) manual page: Add bktr(4) and cxm(4) references.

15 years agobktr(4) manual page: Add cxm(4) reference.
Sascha Wildner [Sun, 19 Apr 2009 00:52:27 +0000 (02:52 +0200)]
bktr(4) manual page: Add cxm(4) reference.

15 years agoAdd cxm(4), a driver for Hauppauge PVR-250/350 video capture cards.
Sascha Wildner [Sun, 19 Apr 2009 00:49:17 +0000 (02:49 +0200)]
Add cxm(4), a driver for Hauppauge PVR-250/350 video capture cards.

Before the driver can be used, two firmware files have to be extracted
from the Windows driver which cannot be redistributed with DragonFly.
For further information see the manual page.

It was tested on a PVR-250 which was kindly donated by Hasso Tepper
(many thanks for this!).

Ported-from: FreeBSD (ports/multimedia/pvr250), with modifications

15 years agopcidevs: Regenerate pcidevs.h and pcidevs_data.h
Sascha Wildner [Sun, 19 Apr 2009 00:35:08 +0000 (02:35 +0200)]
pcidevs: Regenerate pcidevs.h and pcidevs_data.h

15 years agopcidevs: Add iTVC16
Sascha Wildner [Sun, 19 Apr 2009 00:33:21 +0000 (02:33 +0200)]
pcidevs: Add iTVC16

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

15 years agoCPDUP - Fix lack of error reporting if created target directory cannot stat.
Matthew Dillon [Fri, 17 Apr 2009 21:08:31 +0000 (14:08 -0700)]
CPDUP - Fix lack of error reporting if created target directory cannot stat.

Fix a lack of error reporting if a just-created target directory cannot
be stat()'ed or chown()'d.

15 years agodevelopment(7): Add some documentation links.
Sascha Wildner [Fri, 17 Apr 2009 11:43:42 +0000 (13:43 +0200)]
development(7): Add some documentation links.

15 years agoFix printf(3) and friends when printing a float with precision 0.
Sascha Wildner [Fri, 17 Apr 2009 11:08:00 +0000 (13:08 +0200)]
Fix printf(3) and friends when printing a float with precision 0.

The decimal point shall be supressed in this case.

Reported-by: y0netan1
Patch-by: pavalos
15 years agolibc: malloc: minor code cleanup (no operational changes)
Matthew Dillon [Thu, 16 Apr 2009 23:30:45 +0000 (16:30 -0700)]
libc: malloc: minor code cleanup (no operational changes)

15 years agonewfs_hammer(8): Mention the nightly 'hammer cleanup' in the info message.
Sascha Wildner [Thu, 16 Apr 2009 01:20:36 +0000 (03:20 +0200)]
newfs_hammer(8): Mention the nightly 'hammer cleanup' in the info message.

15 years agocrontab(8)/mtrace(8): Remove CVS ID handling.
Sascha Wildner [Wed, 15 Apr 2009 23:29:36 +0000 (01:29 +0200)]
crontab(8)/mtrace(8): Remove CVS ID handling.

15 years agoFix the way <sys/ioccom.h> is included throughout our tree.
Sascha Wildner [Wed, 15 Apr 2009 12:21:52 +0000 (14:21 +0200)]
Fix the way <sys/ioccom.h> is included throughout our tree.

The original intention was to include it only in header files which
define ioctl codes and not in .c or .h files which include headers
that define ioctl codes.

Adjust the tree to follow this idea.

Pointed-out-by: Guy Harris <guy@alum.mit.edu>
Dragonfly-bug:  <http://bugs.dragonflybsd.org/issue1334>

15 years agolib/libpthread/Makefile: Oops, add missing '\'.
Sascha Wildner [Wed, 15 Apr 2009 12:23:34 +0000 (14:23 +0200)]
lib/libpthread/Makefile: Oops, add missing '\'.

15 years agopthread(3): Move pthread(3) manual page to lib/libpthread too.
Sascha Wildner [Wed, 15 Apr 2009 11:37:59 +0000 (13:37 +0200)]
pthread(3): Move pthread(3) manual page to lib/libpthread too.

It does need some further adjustment.

15 years agoRemove libc_r from list of Lb values and adjust libpthread manpages' Lb.
Sascha Wildner [Wed, 15 Apr 2009 11:28:04 +0000 (13:28 +0200)]
Remove libc_r from list of Lb values and adjust libpthread manpages' Lb.

15 years agoMove pthread* manpages to lib/libpthread as they are not libc_r specific.
Sascha Wildner [Wed, 15 Apr 2009 11:07:13 +0000 (13:07 +0200)]
Move pthread* manpages to lib/libpthread as they are not libc_r specific.

15 years agomagic(3): Fix program name extraction from core dumps.
Sascha Wildner [Tue, 14 Apr 2009 22:44:25 +0000 (00:44 +0200)]
magic(3): Fix program name extraction from core dumps.

Remove trailing whitespace only instead of unconditionally removing the
last character from the program name (see comments).

Reported-by: hasso
Located-by: Eric J. Christeson
Taken-from:  FreeBSD's libmagic

15 years agoposix_spawn_file_actions_init(3) manual page: Fix wrong usage of .Fn
Sascha Wildner [Tue, 14 Apr 2009 03:47:15 +0000 (05:47 +0200)]
posix_spawn_file_actions_init(3) manual page: Fix wrong usage of .Fn

15 years agoSync zoneinfo database with tzdata2009f from elsie.
Sascha Wildner [Mon, 13 Apr 2009 13:40:16 +0000 (15:40 +0200)]
Sync zoneinfo database with tzdata2009f from elsie.

asia:           8.29 -> 8.30

Pakistan will observe DST from April 15, 2009 instead of May 1 like
previously planned.

15 years agoAdd some new DLTs found in libpcap-1.0.0
Sepherosa Ziehau [Mon, 13 Apr 2009 12:35:30 +0000 (20:35 +0800)]
Add some new DLTs found in libpcap-1.0.0

15 years agoAllow users to turn off certain arp logging.
Sepherosa Ziehau [Mon, 13 Apr 2009 11:37:07 +0000 (19:37 +0800)]
Allow users to turn off certain arp logging.

Obtained-from: FreeBSD

15 years agoAdd description about sysctl nodes under net.link.ether.inet
Sepherosa Ziehau [Mon, 13 Apr 2009 11:19:34 +0000 (19:19 +0800)]
Add description about sysctl nodes under net.link.ether.inet

Obtained-from: FreeBSD

15 years agopciconf(8): Raise WARNS to 6 and fix warning.
Sascha Wildner [Sun, 12 Apr 2009 19:41:51 +0000 (21:41 +0200)]
pciconf(8): Raise WARNS to 6 and fix warning.

15 years agorpc.lockd(8): Raise WARNS to 3 and fix warnings.
Sascha Wildner [Sun, 12 Apr 2009 18:22:23 +0000 (20:22 +0200)]
rpc.lockd(8): Raise WARNS to 3 and fix warnings.

15 years agodhclient.conf(5) manual page: Use better mdoc (taken from FreeBSD).
Sascha Wildner [Sun, 12 Apr 2009 17:26:01 +0000 (19:26 +0200)]
dhclient.conf(5) manual page: Use better mdoc (taken from FreeBSD).

15 years agorcmd(3) manual page: Add missing .El
Sascha Wildner [Sun, 12 Apr 2009 17:25:23 +0000 (19:25 +0200)]
rcmd(3) manual page: Add missing .El

15 years agoi4b(4): Reorder includes slightly to silence some compilation warnings.
Sascha Wildner [Sun, 12 Apr 2009 16:22:27 +0000 (18:22 +0200)]
i4b(4): Reorder includes slightly to silence some compilation warnings.