Commit Graph

7270 Commits

Author SHA1 Message Date
Peter Wemm
77ac203091 Sync up with kern/subr_prf.c. This adds %ll, %j, %q, %z, etc. 2003-04-06 05:25:48 +00:00
David Schultz
ebbad5ec5c 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().

Reviewed by:	silence on standards@
2003-04-05 22:11:42 +00:00
David Schultz
92b93b37c0 Add __ldtoa(), a wrapper around gdtoa() to make it look like dtoa().
In support of this, add some MD macros to assist in converting long
doubles to the format expected by gdtoa().

Reviewed by:	silence on standards@
2003-04-05 22:10:13 +00:00
David Schultz
b936664e72 Add missing #include to unbreak previous commit. 2003-04-05 22:08:53 +00:00
David Schultz
38cac8f88b Correct some buffer sizes.
- __vfprintf()'s 'buf' has never been used for floating point, so
  don't define it in terms of (incorrect) constants describing
  floating point numbers.  The actual size needed depends on
  sizeof(uintmax_t) and locale details, so I slightly overestimated.

- We don't need a 308-character buffer to store the string "308".
  With long doubles and %a we need more than three characters, though.
2003-04-05 22:03:43 +00:00
Warner Losh
30aaff1192 Migrate to a new way of dealing with building from old revisions of
FreeBSD.  This method attempts to centralize all the necessary hacks
or work arounds in one of two places in the tree (src/Makefile.inc1
and src/tools/build).  We build a small compatibility library
(libbuild.a) as well as selectively installing necessary include
files.  We then include this directory when building host binaries.

This removes all the past release compatibilty hacks from various
places in the tree.  We still build on tip of stable and current.  I
will work with those that want to support more, although I anticipate
it will just work.

Many thanks to ru@, obrien@ and jhb@ for providing valuable input at
various stage of implementation, as well as for working together to
positively effect a change for the better.
2003-04-05 20:30:30 +00:00
Tim J. Robbins
63e6ca586e MFp4: Link strtof.3 and strtold.3 to strtod.3. 2003-04-05 07:33:46 +00:00
Mike Makonnen
f23f149866 Zero out the struct tm supplied by the caller. Otherwise,
strange things might happen when garbage values in the struct
get passed in to localtime_r() and family.

Noticed by:	marcus
Approved by:	markm (mentor)(implicit)
2003-04-05 05:46:43 +00:00
Tim J. Robbins
799d93559b MFp4: Pentium/Athlon-optimised implementation of wcschr(). 2003-04-05 04:17:05 +00:00
Poul-Henning Kamp
a12b1b124a Use sized cast matching the sized pointer. 2003-04-04 16:59:39 +00:00
Poul-Henning Kamp
197e5e73ef Libdisk does not need to include <sys/diskslice.h> any more.
Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h>

Move i386/pc98 specific bits from <sys/reboot.h> to
<i386/include/bootinfo.h> as well.

Adjust includes in sys/boot accordingly.
2003-04-04 16:35:16 +00:00
David Schultz
6d3bd9530d Fix braino in definition of isfinite().
Noticed by:	marcus
Pointy hat to:	das
2003-04-04 13:27:47 +00:00
Warner Losh
33c2c9a3fa No need to have ifdef < FreeBSD 4.0-current in here. Remove it to
avoid false positive while searching for __FreeBSD_version abuse.
2003-04-04 04:16:06 +00:00
Jake Burkholder
55ad402a8f - Pass a ucontext_t to _set_curthread. If non-NULL the new thread is set
as curthread in the new context, so that it will be set automatically when
  the thread is switched to.  This fixes a race where we'd run for a little
  while with curthread unset in _thread_start.

Reviewed by:	jeff
2003-04-03 03:34:50 +00:00
Jeff Roberson
996a395d37 - Don't overrun the ldt buffer.
Submitted by:	gordan@freebsd.org
2003-04-02 22:53:52 +00:00
Jake Burkholder
68c724b96f Implement _get_curthread and _set_curthread. This is especially easy. 2003-04-02 08:15:07 +00:00
Jeff Roberson
26f52e2f8b - Define curthread as _get_curthread() and remove all direct calls to
_get_curthread().  This is similar to the kernel's curthread.  Doing
   this saves stack overhead and is more convenient to the programmer.
 - Pass the pointer to the newly created thread to _thread_init().
 - Remove _get_curthread_slow().
2003-04-02 03:05:39 +00:00
Jake Burkholder
dd3dd8724d Add MD makefile. 2003-04-01 23:52:24 +00:00
Jake Burkholder
9f5a511863 Implement makecontext. 2003-04-01 23:28:50 +00:00
Jeff Roberson
00c301540e - Don't drop and reacquire giant in thread_suspend(). Change callers to do
this manually.  This will facilitate the unrolling of giant.
 - Don't allow giant to recurse anymore.  This should never happen.
2003-04-01 22:41:41 +00:00
Jeff Roberson
901d86ae8a - Reenable setschedparam and the prioceiling code now that the mutex code
has been restored.
2003-04-01 22:40:29 +00:00
Jeff Roberson
360a519459 - Restore old mutex code from libc_r. It is more standards compliant.
This was changed because originally we were blocking on the umtx and
   allowing the kernel to do the queueing.  It was decided that the
   lib should queue and start the threads in the order it decides and the
   umtx code would just be used like spinlocks.
2003-04-01 22:39:31 +00:00
Ceri Davies
d5882f3f58 [1] - Document EHOSTUNREACH as a possible error
[2]	- Remove a contraction

PR:		docs/50401
Submitted by:	[1] Slaven Rezic <slaven@rezic.de>
MFC after:	1 week
2003-04-01 20:25:46 +00:00
Jeff Roberson
7a57e9abdd - Adjust the makefiles so we have a per architecture makefile. 2003-04-01 07:07:38 +00:00
Jeff Roberson
42d3ad7144 - Spell SIGSETOR correctly. 2003-04-01 04:49:12 +00:00
Jeff Roberson
70d5093a8b - Commit the forgotten libthr/sys bits. 2003-04-01 03:51:08 +00:00
Jeff Roberson
bb535300dd - Add libthr but don't hook it up to the regular build yet. This is an
adaptation of libc_r for the thr system call interface.  This is beta
   quality code.
2003-04-01 03:46:29 +00:00
Jeff Roberson
31a9779e5d - Catch up with kernel signal changes. 2003-03-31 22:57:55 +00:00
Wes Peters
f4cf2141f6 Add a facility allowing processes to inform the VM subsystem they are
critical and should not be killed when pageout is looking for more
memory pages in all the wrong places.

Reviewed by:	arch@
Sponsored by:	St. Bernard Software
2003-03-31 21:09:57 +00:00
Dag-Erling Smørgrav
eac956b2d1 Experimental pam_chroot module (not connected to the build) 2003-03-30 22:58:23 +00:00
Juli Mallett
5b3a32e4a8 MFp4: Fix copy&paste English error. 2003-03-30 18:00:24 +00:00
Max Khon
839e119ec8 BDE'ify 2003-03-29 21:56:59 +00:00
Max Khon
057e4034dd fix truncation check and buffer overflow check 2003-03-29 21:34:13 +00:00
Daniel Eischen
67aba1c6a4 Align signal frame placed on stack to 16 bytes so that SSE FPU register
restores can work.  Also correct allocation for signal frame size.

Reviewed by:	mini
2003-03-29 16:38:15 +00:00
Dag-Erling Smørgrav
762892c047 Don't dereference flags if NULL (see http.c rev 1.87) 2003-03-29 15:15:38 +00:00
Mike Makonnen
764628c056 Fill in the rest of the fields in the resulting struct tm
from strptime(3). Previously, they would get filled only
for the %s specifier and as a side effect of using the
the %Z specifier with a GMT time zone.

PR:		misc/48993
Approved by:	markm (mentor)
Silence on:	-standards
2003-03-29 11:55:37 +00:00
Max Khon
be6a158e0f - MAXPATHLEN -> PATH_MAX (pass correct buffer size to readlink as well)
Requested by:		bde
2003-03-28 12:05:45 +00:00
Juli Mallett
7a51271b68 Close the disk file descriptor that is RO before trying to open the
new one, and do not fall back to the RO fd.  There was a bug here
in that the RO fd was never closed, if the RDRW open succeeded, but
this code is bogus anyway, and it breaks newfs of floppies, at least
for me, due to "Device busy."  Anything that wants to fall back is
doing something significantly odd that it should have some more complex
code on its end.
2003-03-28 01:50:11 +00:00
Max Khon
226a0f0f8b Make realpath() thread-safe. New implementation does not use chdir(2) at all.
Submitted by:	Constantin S. Svintsoff <kostik (at) iclub.nsu.ru>
2003-03-27 20:48:53 +00:00
Poul-Henning Kamp
63728c47e8 Run a revision on the OAM api.
Use prefix gctl_ systematically.
Add flag with access perms for each argument.
Add ro/rw versions of argument building functions.
General cleanup.
2003-03-27 14:35:00 +00:00
Jeff Roberson
cc3521d660 - Define a _spinunlock() function so that threading implementations may do
more complicated things than just setting the lock to 0.
 - Implement stubs for this function in libc and the two threading libraries
   that are currently in the tree.
2003-03-26 04:02:24 +00:00
Matthew N. Dodd
7db77bf0c1 Back off WARNS until I've had a chance to deal with the problems on
sparc64/alpha.
2003-03-25 17:40:00 +00:00
Matthew N. Dodd
619531d847 Fix warnings. 2003-03-25 04:29:26 +00:00
Philippe Charnier
b43dc21149 The .Fn function
The ... 2 system call
2003-03-24 16:07:19 +00:00
Philippe Charnier
9d09157a0f The .Fn function. Use .Xr where appropriate. 2003-03-24 16:05:24 +00:00
Philippe Charnier
0552350ecc The .Fn function 2003-03-24 16:02:05 +00:00
Philippe Charnier
592bb5e477 The .Nm library 2003-03-24 16:01:01 +00:00
Philippe Charnier
4cacb61823 The .Fn function
The .Fa argument
2003-03-24 15:58:53 +00:00
Philippe Charnier
0dc90c7a0d The .Fn function
The .Nm library
2003-03-24 15:56:36 +00:00
Poul-Henning Kamp
4b8938c1d5 Add marshalling functions for OAM api. 2003-03-23 10:15:02 +00:00