Commit Graph

8699 Commits

Author SHA1 Message Date
Stefan Farfeleder
14e4372584 Remove a couple of casts added for an ancient Sun compiler.
Approved by:	das (mentor)
2004-06-08 12:20:40 +00:00
Stefan Farfeleder
cf6fc3417a The third operand of the conditional operator should have type void too.
Approved by:	das (mentor)
2004-06-08 12:03:48 +00:00
David Schultz
1e03bff7f2 In fts_build(), if we try to chdir and fail (e.g. due to lack of search
permission), try to continue in FTS_DONTCHDIR mode.  Of course this
won't work for long paths, but we can't descend more than one pathname
component beyond the directory anyway if we lack search permission.

Here is a transcript demonstrating the change, where oldls is ls(1)
linked with the old fts(3):

	das@VARK:~> mkdir t && touch t/{a,b,c} && chmod u-x t
	das@VARK:~> oldls t
	a       b       c
	das@VARK:~> oldls -l t
	das@VARK:~> \ls t
	a       b       c
	das@VARK:~> \ls -l t
	ls: a: Permission denied
	ls: b: Permission denied
	ls: c: Permission denied

I had forgotten about this patch until bde reminded me.  He reports
using it without problems for over a year.

PR:	45723
2004-06-08 06:23:23 +00:00
David Schultz
92a5b2ee71 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.
2004-06-08 05:45:48 +00:00
David Schultz
52183d4654 Rename cantwrite() to prepwrite(). The latter is less confusing,
since the macro isn't really a predicate, and it has side-effects.
2004-06-08 05:45:32 +00:00
David Schultz
325d97d0d1 Set errno to EBADF on attempts to write to a stream that is not
writable.  Affected callers include fwrite(), put?(), and *printf().
The issue of whether this is the right errno for funopened streams is
unresolved, but that's an obscure case, and some errno is better than
no errno.

Discussed with:	bde, jkh
2004-06-08 05:44:52 +00:00
Tim Kientzle
071a23c2d6 Correct some spelling errors. 2004-06-08 00:23:27 +00:00
Yaroslav Tykhiy
e7aa25d3fb Use ".In" to mark up C include file names. 2004-06-07 21:52:20 +00:00
Yaroslav Tykhiy
cacc8e6c5d Each sentence should begin on a new line. 2004-06-07 21:48:02 +00:00
Yaroslav Tykhiy
431c0866bb Extend and improve the mdoc(7) markup of this page.
Reviewed by:	ru
2004-06-07 21:43:14 +00:00
Tim J. Robbins
bf1d6a62b0 Avoid clobbering the red zone when running on the new context's stack in
_amd64_restore_context().
2004-06-07 21:25:16 +00:00
Tim Kientzle
ce7fa714ab Linux (at least Debian) requires sys/types.h to get off_t. 2004-06-07 18:42:50 +00:00
Yaroslav Tykhiy
35641ec00f Finally document the option to avoid zombie creation
through ignoring SIGCHLD.
2004-06-07 11:01:39 +00:00
David Schultz
d0f1363370 Add round(3) and roundf(3) and the associated documentation.
PR:		59797
Submitted by:	"Steven G. Kargl" <kargl@troutmask.apl.washington.edu>
Reviewed by:	bde (earlier version, last year)
2004-06-07 08:05:36 +00:00
Tim Kientzle
33e546958b History: A few very, very old tar programs used the filename to
distinguish files from dirs (trailing '/' indicated a dir).  Since
POSIX.1-1987, this convention is no longer necessary.  However, there
are current tar programs that pretend to write POSIX-compliant
archives, yet store directories as "regular files", relying on this
old filename convention to save them.  <sigh> So, move the check for
this old convention so it applies to all tar archives, not just those
identified as "old."

Pointed out by: Broken distfile for audio/faad port
2004-06-07 06:34:51 +00:00
Tim Kientzle
7d9005ce33 Tar bidder should just return a zero bid ("not me!") if
it sees a truncated input the first time it gets called.
(In particular, files shorter than 512 bytes cannot be tar archives.)
This allows the top-level archive_read_next_header code to
generate a proper error message for unrecognized file types.

Pointed out by: numerous ports that expect tar to extract non-tar files ;-(
Thanks to: Kris Kennaway
2004-06-07 04:32:10 +00:00
David Schultz
54dd6976a8 Add fenv.h, fenv.c, and the associated documentation to the libm
build.  To facilitate this, add ${.CURDIR}/${ARCH} to make's search
path unconditionally.

Reviewed by:	standards@
2004-06-06 10:06:57 +00:00
David Schultz
07235cc8f7 Add documentation for:
- fenv(3)
- feclearexcept(3), fegetexceptflag(3), feraiseexcept(3),
  fesetexceptflag(3), fetestexcept(3)
- fegetround(3), fesetround(3)
- fegetenv(3), feholdexcept(3), fesetenv(3), feupdateenv(3)

Reviewed by:	standards@
2004-06-06 10:06:26 +00:00
David Schultz
7ab6d2aa74 Add an fenv.h implementation for the sparc64 port.
Reviewed by:	standards@
2004-06-06 10:05:57 +00:00
David Schultz
122e138072 Add an fenv.h implementation for the powerpc port.
Reviewed by:	standards@
2004-06-06 10:05:10 +00:00
David Schultz
50c4f20324 Add an fenv.h implementation for the ia64 port.
Reviewed by:	standards@
2004-06-06 10:04:43 +00:00
David Schultz
0b71a226d1 Add an fenv.h implementation for the i386 port.
Reviewed by:	standards@
2004-06-06 10:04:17 +00:00
David Schultz
19220bc13f Add an fenv.h implementation for the arm port.
It does not appear to be possible to cross-build arm from i386 at the
moment, and I have no ARM hardware anyway.  Thus, I'm sure there are
bugs.  I will gladly fix these when the arm port is more mature.

Reviewed by:	standards@
2004-06-06 10:03:59 +00:00
David Schultz
fc27daefcd Add an fenv.h implementation for the amd64 port.
Reviewed by:	standards@
2004-06-06 10:03:25 +00:00
David Schultz
7993050251 Add an fenv.h implementation for the alpha port. All of the standard
features appear to work, subject to the caveat that you tell gcc you
want standard rather than recklessly fast behavior
(-mieee-with-inexact -mfp-rounding-mode=d).

The non-standard feature of delivering a SIGFPE when an application
raises an unmasked exception does not work, presumably due to a kernel
bug.  This isn't so bad given that floating-point exceptions on the
Alpha architecture are not precise, so making them useful in userland
requires a significant amount of wizardry.

Reviewed by:	standards@
2004-06-06 09:58:55 +00:00
Tim Kientzle
16847cbdc4 Pointy hat: We can't avoid a chown() call without checking both UID
and GID.  Suppress a premature attempt at optimization.
2004-06-05 06:08:40 +00:00
Tim Kientzle
25354e55bf YAPHtM: Yet Another Pointy Hat to Me.
After calculating new dir permissions that allow creating files,
don't be stupid and use the original permissions.  <sigh>
2004-06-05 05:34:45 +00:00
Tim Kientzle
2474b73276 Recognize when we've accidentally created "foo/."
and don't complain about it.
2004-06-05 05:30:41 +00:00
Tim Kientzle
2b68caa0f2 Correctly reset archive_read_data state everytime a header is read. 2004-06-04 23:25:20 +00:00
Tim Kientzle
7a4f3ab2c4 Correct the layering violation in read_body_to_string. The previous
version called the higher-level archive_read_data and
archive_read_data_skip functions, which screwed up state management of
those functions.  This bit of mis-design has existed for a long time,
but became a serious issue with the recent changes to the
archive_read_data APIs, which added more internal state to the
high-level archive_read_data function.  Most common symptom was a
failure to correctly read 'L' entries (long filename) from GNU-style
archives, causing the message ": Can't open: No such file or
directory" with an empty filename.

Pointed out by:  Numerous port build failures
Thanks to: Kris Kennaway
2004-06-04 23:24:21 +00:00
Brian Somers
5661d9de75 Handle read_block() failures by ignoring the disk rather than
dumping core.
2004-06-04 11:49:11 +00:00
Tim Kientzle
456db9b6db When we go to read the next tar header, if we get zero bytes, accept
that as end-of-archive.  Otherwise, a short read at this point
generates an error.  This accomodates broken tar writers (such as the
one apparently in use at AT&T Labs) that don't even write a single
end-of-archive block.

Note that both star and pdtar behave this way as well.
In contrast, gtar doesn't complain in either case, and as a
result, will generate no warning for a lot of trashed archives.

Pointed out by: shells/ksh93 port  (Thanks to Kris Kennaway)
2004-06-04 10:27:23 +00:00
Tim Kientzle
1a74b99db7 Be more careful about the initial read (used for "tasting" the compression):
* Check for and return input errors
  * Treat empty file (zero-length read) as a fatal error
2004-06-04 01:36:10 +00:00
Tim Kientzle
a8659f8468 Refactor the extraction code somewhat. In particular,
push extract data down into archive_read_extract.c and out
of the library-global archive_private.h; push dir-specific
mode/time fixup down into dir restore function; now that the
fixup list is file-local, I can use somewhat more natural
naming.

Oh, yeah, update a bunch of comments to match current reality.
2004-06-03 23:29:47 +00:00
Dag-Erling Smørgrav
e404f75180 Add __BEGIN_DECLS / __END_DECLS so this can be used in C++ code.
MFC after:	1 week
2004-06-03 15:04:24 +00:00
Peter Pentchev
c56864a7a7 Fix the ordering in the description of the dlsym() lookup procedure to
reflect src/libexec/rtld-elf/rtld.c rev. 1.68 - the globally-loaded
objects (RTLD_GLOBAL) are searched before the local object's DAG's.

PR:		62770
Submitted by:	Kimura Fuyuki <fuyuki@nigredo.org>
2004-06-03 10:13:26 +00:00
Bruce Evans
4f8f819975 Fixed lots of 1 ULP errors caused by a broken approximation for pi/2.
We approximate pi with more than float precision using pi_hi+pi_lo in
the usual way (pi_hi is actually spelled pi in the source code), and
expect (float)0.5*pi_lo to give the low part of the corresponding
approximation for pi/2.  However, the high part for pi/2 (pi_o_2) is
rounded to nearest, which happens to round up, while the high part for
pi was rounded down.  Thus pi_o_2+(float)0.5*pi (in infinite precision)
was a very bad approximation for pi/2 -- the low term has the wrong
sign and increases the error drom less than half an ULP to a full ULP.

This fix rounds up instead of down for pi_hi.  Consistently rounding
down instead of up should work, and is the method used in e_acosf.c
and e_asinf.c.  The reason for the difference is that we sometimes
want to return precisely pi/2 in e_atan2f.c, so it is convenient to
have a correctly rounded (to nearest) value for pi/2 in a variable.
a_acosf.c and e_asinf.c also differ in directly approximating pi/2
instead pi; they multiply by 2.0 instead of dividing by 0.5 to convert
the approximation.

These complications are not directly visible in the double precision
versions because rounding to nearest happens to round down.
2004-06-02 17:09:05 +00:00
Tim Kientzle
94dffc977c Add MLINKS for new API functions. 2004-06-02 08:16:21 +00:00
Tim Kientzle
e250dd4fad Refactor read_data:
* New read_data_block is both sparse-file aware and uses zero-copy semantics
 * Push read_data_block down into specific formats (opens door to
   various encoded entry bodies, such as zip or gtar -S)
 * Reimplement read_data, read_data_skip, read_data_into_fd in terms
   of new read_data_block.
 * Update documentation
It's unfortunate that I couldn't just call the new interface
archive_read_data, but didn't want to upset the API that much.
2004-06-02 08:14:43 +00:00
Hajimu UMEMOTO
146cd1bc0a use source address as a hint to determine destination address
by getipnodebyname().
2004-06-02 06:49:36 +00:00
David Schultz
73fbb89dd6 Port a bugfix from FDLIBM 5.3. The bug really only applies to tan()
and not tanf() because float type can't represent numbers large enough
to trigger the problem.  However, there seems to be a precedent that
the float versions of the fdlibm routines should mirror their double
counterparts.

Also update to the FDLIBM 5.3 license.

Obtained from:	FDLIBM
Reviewed by:	exhaustive comparison
2004-06-02 04:39:44 +00:00
David Schultz
21d39caaee Merge a bugfix from FDLIBM 5.3 to ensure that the error in tan()
is always less than 1 ulp.  Also update to the 5.3 license.

Obtained from:	FDLIBM
2004-06-02 04:39:29 +00:00
Boris Popov
33e1041767 Distinguish cases when ncp module not loaded and when module have old
interface.
2004-06-02 03:41:10 +00:00
Bruce Evans
f88a48cc43 Merged from double precision case (e_pow.c 1.10: sign fixes). 2004-06-01 19:33:30 +00:00
Brooks Davis
cf7549084d Add Aerospace Corporation copyrights to EUI64 support files.
Suggested by:	marcel, imp
2004-06-01 19:30:13 +00:00
Bruce Evans
f083533b68 Fixed the sign of the result in some overflow and underflow cases (ones
where the exponent is an odd integer and the base is negative).

Obtained from:	fdlibm-5.3

Sun finally released a new version of fdlibm just a coupe of weeks
ago.  It only fixes 3 bugs (this one, another one in pow() that we
already have (rev.1.9), and one in tan().  I've learned too much about
powf() lately, so this fix was easy to merge.  The patch is not verbatim,
because our base version has many differences for portability and I
didn't like global renaming of an unrelated variable to keep it separate
from the sign variable.  This patch uses a new variable named sn for
the sign.
2004-06-01 19:28:38 +00:00
Bruce Evans
5f20e5ce7f Fixed another precision bug in powf(). This one is in the computation
[t=p_l+p_h High].  We multiply t by lg2_h, and want the result to be
exact.  For the bogus float case of the high-low decomposition trick,
we normally discard the lowest 12 bits of the fraction for the high
part, keeping 12 bits of precision.  That was used for t here, but it
doesnt't work because for some reason we only discard the lowest 9
bits in the fraction for lg2_h.  Discard another 3 bits of the fraction
for t to compensate.

This bug gave wrong results like:

      powf(0.9999999, -2.9999995) = 1.0000002 (should be 1.0000001)
        hex values: 3F7FFFFF C03FFFFE 3F800002 3F800001

As explained in the log for the previous commit, the bug is normally
masked by doing float calculations in extra precision on i386's, but
is easily detected by ucbtest on systems that don't have accidental
extra precision.

This completes fixing all the bugs in powf() that were routinely found
by ucbtest.
2004-06-01 19:03:31 +00:00
Bruce Evans
12be4e0d5a Fixed 2 bugs in the computation /* t_h=ax+bp[k] High */.
(1) The bit for the 1.0 part of bp[k] was right shifted by 4.  This seems
    to have been caused by a typo in converting e_pow.c to e_powf.c.
(2) The lower 12 bits of ax+bp[k] were not discarded, so t_h was actually
    plain ax+bp[k].  This seems to have been caused by a logic error in
    the conversion.

These bugs gave wrong results like:

    powf(-1.1, 101.0) = -15158.703 (should be -15158.707)
      hex values: BF8CCCCD 42CA0000 C66CDAD0 C66CDAD4

Fixing (1) gives a result wrong in the opposite direction (hex C66CDAD8),
and fixing (2) gives the correct result.

ucbtest has been reporting this particular wrong result on i386 systems
with unpatched libraries for 9 years.  I finally figured out the extent
of the bugs.  On i386's they are normally hidden by extra precision.
We use the trick of representing floats as a sum of 2 floats (one much
smaller) to get extra precision in intermediate calculations without
explicitly using more than float precision.  This trick is just a
pessimization when extra precision is available naturally (as it always
is when dealing with IEEE single precision, so the float precision part
of the library is mostly misimplemented).  (1) and (2) break the trick
in different ways, except on i386's it turns out that the intermediate
calculations are done in enough precision to mask both the bugs and
the limited precision of the float variables (as far as ucbtest can
check).

ucbtest detects the bugs because it forces float precision, but this
is not a normal mode of operation so the bug normally has little effect
on i386's.

On systems that do float arithmetic in float precision, e.g., amd64's,
there is no accidental extra precision and the bugs just give wrong
results.
2004-06-01 18:08:39 +00:00
Tim J. Robbins
95a535af6d Change the signature of ftok from (const char *, char) to (const char *, int)
Obtained from:	NetBSD (christos)
2004-06-01 06:53:07 +00:00
Gregory Neil Shapiro
0c56527f65 Honor NOINET6 and disable IPv6 support in libmilter and sendmail if it
is set.

MFC after:	4 days
2004-06-01 01:29:42 +00:00
Hajimu UMEMOTO
251b48a1bb Treat IPv4 private address as global scope rather than site scope.
Though it breaks RFC 3484, without this change, dest addr selection
doesn't work well under NAT environment.
2004-05-31 21:09:14 +00:00
Hajimu UMEMOTO
4d489f472b use source address as a hint to determine destination address.
Obtained from:	KAME
2004-05-31 19:27:54 +00:00
Stefan Farfeleder
8b5cd5a662 Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are
needed for cases where GCC's builtin functions cannot be used and for
compilers that don't know about them.

Approved by:	das (mentor)
2004-05-30 09:21:56 +00:00
Tim Kientzle
14a60ae9a2 Connect libarchive decompress support to the build.
Also, add it to archive_read_support_compression_all()
so that typical clients get it pulled in by default.
2004-05-27 23:57:45 +00:00
Tim Kientzle
30230b4fd0 'gnutar' is now handled by the 'tar' reader, so
there's no need to enable support for it separately
from 'tar.'  (The call to enable gnutar support is
now just an alias for the tar support, left in to
avoid API breakage.)
2004-05-27 21:27:42 +00:00
Tim J. Robbins
c05bd9ae25 Buffer partial wide characters more efficiently: instead of storing the
multibyte representation in conversion state objects, store the
accumulated wide character, set number and number of bytes remaining
to avoid having to derive them every time mbrtowc() is called.
2004-05-27 10:54:34 +00:00
Tim Kientzle
da725414f3 Previously, restoring an archive with hardlinked files that had
certain flags set (e.g., schg or uappend) would fail because the flags
were restored before the hardlink was created.

To address this, I've generalized the existing machinery for deferring
directory timestamp/mode restoration and used it to defer the
restoration of highly-restrictive flags to the end of the extraction,
after any links have been created.

Pointed out by: Pawel Jakub Dawidek (pjd@)
2004-05-27 05:02:35 +00:00
Tim Kientzle
2023cfd41b Document support for reading .Z compressed archives.
Correct a few other minor nits.
2004-05-27 04:21:52 +00:00
Tim Kientzle
5d425e1c12 GC some no-longer-used constants. 2004-05-27 04:01:58 +00:00
Tim Kientzle
ddf99967cc Add prototypes for .Z compression support. 2004-05-27 04:00:25 +00:00
Tim Kientzle
72271236bb Add read-only support for .Z compressed archives. 2004-05-27 03:58:55 +00:00
Brooks Davis
7387768ef4 Add support for an /etc/eui64 file modeled on /etc/ethers. The API is
modeled on ethers(3) except that all functions are thread-safe.

Reviewed by:	simokawa
2004-05-26 22:58:06 +00:00
Pawel Jakub Dawidek
e27d191348 Humanize_number(3) is a part of libutil. 2004-05-25 20:11:50 +00:00
Tom Rhodes
d268591bf7 You want to include libutil.h, not util.h.
Some minor sentence tweaking.
2004-05-25 18:53:54 +00:00
Tim J. Robbins
18b2031298 Scan the source string for invalid wide characters in wcsrtombs()
in the dst == NULL case.
2004-05-25 10:45:24 +00:00
Tim J. Robbins
e7e4715db2 Provide trivial macro implementations of getwc(), getwchar(), putwc() and
putwchar() to reduce function call overhead.
2004-05-25 10:42:52 +00:00
Pawel Jakub Dawidek
23d1a17825 Add humanize_number(3) to libutil for formating numbers into a human
readable form.

Obtained from:	NetBSD
2004-05-24 22:19:27 +00:00
Stefan Farfeleder
da2e20777e Don't declare spectHex() inside a function, use a real prototype.
Approved by:	das (mentor)
2004-05-24 16:48:53 +00:00
Stefan Farfeleder
cb62151102 Include <stdlib.h> for exit() and add a prototype for yyparse().
Approved by:	das (mentor)
2004-05-24 09:50:57 +00:00
Tim J. Robbins
675e7ddbee Grab all the information we need about a character with one call to
__maskrune() instead of one direct call and one through iswprint().
2004-05-23 13:20:09 +00:00
Tim J. Robbins
d6ed810a67 Perform conversions straight from the stream buffer instead of scanning
through byte by byte with mbrtowc(). In the usual case (buffer is big
enough to contain the multibyte character, character does not straddle
buffer boundary) this results in only one call to mbrtowc() for each
wide character read.
2004-05-22 15:41:03 +00:00
Tim J. Robbins
87275e436a Associate a multibyte conversion state object with each stream. Reset it
to the initial state when a stream is opened or seeked upon. Use the
stream's conversion state object instead of a freshly-zeroed one in
fgetwc(), fputwc() and ungetwc().

This is only a performance improvement for now, but it would also be
required in order to support state-dependent encodings.
2004-05-22 15:19:41 +00:00
Tim Kientzle
b3fd17797d Correct parsing of Solaris default ACLs. 2004-05-21 09:01:13 +00:00
Alan Cox
db9081ab70 Update the document date.
Reminded by:	ru@
2004-05-20 18:47:15 +00:00
Mike Makonnen
4cd18a22d5 Make libthr async-signal-safe without costly signal masking. The guidlines I
followed are: Only 3 functions (pthread_cancel, pthread_setcancelstate,
pthread_setcanceltype) are required to be async-signal-safe by POSIX. None of
the rest of the pthread api is required to be async-signal-safe. This means
that only the three mentioned functions are safe to use from inside
signal handlers.
However, there are certain system/libc calls that are
cancellation points that a caller may call from within a signal handler,
and since they are cancellation points calls have to be made into libthr
to test for cancellation and exit the thread if necessary. So, the
cancellation test and thread exit code paths must be async-signal-safe
as well. A summary of the changes follows:

o Almost all of the code paths that masked signals, as well as locking the
  pthread structure now lock only the pthread structure.
o Signals are masked (and left that way) as soon as a thread enters
  pthread_exit().
o The active and dead threads locks now explicitly require that signals
  are masked.
o Access to the isdead field of the pthread structure is protected by both
  the active and dead list locks for writing. Either one is sufficient for
  reading.
o The thread state and type fields have been combined into one three-state
  switch to make it easier to read without requiring a lock. It doesn't need
  a lock for writing (and therefore for reading either) because only the
  current thread can write to it and it is an integer value.
o The thread state field of the pthread structure has been eliminated. It
  was an unnecessary field that mostly duplicated the flags field, but
  required additional locking that would make a lot more code paths require
  signal masking. Any truly unique values (such as PS_DEAD) have been
  reborn as separate members of the pthread structure.
o Since the mutex and condvar pthread functions are not async-signal-safe
  there is no need to muck about with the wait queues when handling
  a signal ...
o ... which also removes the need for wrapping signal handlers and sigaction(2).
o The condvar and mutex async-cancellation code had to be revised as a result
  of some of these changes, which resulted in semi-unrelated changes which
  would have been difficult to work on as a separate commit, so they are
  included as well.

The only part of the changes I am worried about is related to locking for
the pthread joining fields. But, I will take a closer look at them once this
mega-patch is committed.
2004-05-20 12:06:16 +00:00
Mike Makonnen
7295f69667 q§ 2004-05-20 11:55:04 +00:00
Tim Kientzle
5aedc78012 Nits fixed.
Pointed out by: Daniel Harris
2004-05-20 06:22:42 +00:00
Tim Kientzle
9e9662ef5b More research, more shuffling and clarification. 2004-05-20 04:12:47 +00:00
Peter Wemm
f2b2912599 Implement crashdump decoding for AMD64 as well, now that I have finally
got a sample to test against.
2004-05-19 18:24:13 +00:00
Tim Kientzle
22a2730797 When combining ustar prefix and name fields, check before adding a '/'
character, as some tar implementations incorrectly include a '/' with
the prefix.

Thanks to: Divacky Roman for the UnixWare 7 tarfile that
demonstrated this issue.
2004-05-19 17:09:24 +00:00
Tim Kientzle
ecad688385 I've recently been looking at the Seventh Edition source
code available at tuhs.org, and found out that my chronology
is a bit off.  In particular, Seventh Edition already used
the "linkflag" and "linkname" fields.  Also, it appears that
there was no tar in Sixth Edition, contrary to what an earlier
tar.1 manpage claimed.

A few mdoc fixes also crept in here.
2004-05-19 06:38:38 +00:00
Tim Kientzle
44c46f7978 Refine the heuristic used to determine whether or not to obey
the size field for a hardlink entry.  Specifically, ensure that
we do obey the size field for archives that we know are pax interchange
format archives, as required by POSIX.

Also, clarify the comment explaining why this is necessary and explain
the (very unusual) conditions under which it might fail.
2004-05-19 06:35:47 +00:00
Alan Cox
5ae2d19711 Remove a long obsolete paragraph from the BUGS section. 2004-05-19 03:25:17 +00:00
Peter Wemm
b320e7fae7 For amd64, explicitly compile mcount.po, rather than copying mcount.o. We
need to compile it with -fno-omit-frame-pointers since the mcount code
depends on that, and by default it omits them without -pg.
2004-05-18 22:49:15 +00:00
Tim Kientzle
6c1a87e738 Be smarter about hardlink sizes: some tar programs write
a non-zero size but no body, some write a non-zero size and include
a body.  To distinguish these cases, look for a valid tar header immediately
following a hardlink header with non-zero size.
2004-05-18 18:16:30 +00:00
Stefan Farfeleder
ec18ee18ad Don't depend on NULL's expansion being a pointer, cast it before it is passed
to variadic functions.

Approved by:	das (mentor)
2004-05-18 15:53:58 +00:00
Tim Kientzle
f62681112e Clarify an error message. 2004-05-18 00:13:06 +00:00
Yaroslav Tykhiy
d0080709e7 Clarify and extend paragraphs on interoperation
of fcntl(2), flock(2), and lockf(3) advisory locks.
Add such a paragraph to the flock(2) manpage for the
sake of consistency.

Reviewed by:	Cyrille Lefevre and Kirk McKusick on -arch
MFC after:	2 weeks
2004-05-17 23:09:10 +00:00
Tim Kientzle
9b8f137b2d getgrent() and friends should set errno if there is an error.
Also, clarify the manpage description of when errno is set and
explain that clients should set errno=0 first if they want useful
error information.
2004-05-17 22:15:49 +00:00
Tim Kientzle
5edb850fbe POSIX prohibits any library function from setting errno to 0.
Correct my previous commit and add a comment to the manpage
indicating that the user must set errno to 0 if they wish to
distinguish "no such user" from "error".

Pointed out by: Jacques Vidrine (nectar@)
2004-05-17 18:27:05 +00:00
Tim J. Robbins
5e44d7ebe1 Use conversion state objects to store the accumulated wide character,
low bound, and the number of bytes remaining instead of storing the
raw byte sequence and deriving them every time mbrtowc() is called.
This is much faster -- about twice as fast in some crude benchmarks.
2004-05-17 12:32:40 +00:00
Tim J. Robbins
6107476759 Use a simpler and faster buffering scheme for partial multibyte characters. 2004-05-17 11:16:14 +00:00
Tim Kientzle
b4cc8687ad If getpwent/getpwuid/getpwnam return NULL, they must also set errno. 2004-05-17 06:17:59 +00:00
David Schultz
6955d806c0 Remove some kludges designed to ensure that the compiler didn't round
constants the wrong way on the VAX.  Instead, use C99 hexadecimal
floating-point constants, which are guaranteed to be exact on binary
IEEE machines.  (The correct hexadecimal values were already provided
in the source, but not used.)  Also, convert the constants to
lowercase to work around a gcc bug that wasn't fixed until gcc 3.4.0.

Prompted by:	stefanf
2004-05-17 01:04:37 +00:00
Stefan Farfeleder
a752604477 Remove spurious semicolons. Outside of functions they are actually errors but
GCC doesn't warn about them without -pedantic.

Approved by:	das (mentor)
PR:		56649
Reviewed by:	md5
2004-05-16 22:08:17 +00:00
Bruce Evans
3c23d036cc Style fixes:
Main ones: mostly use conditional expressions in ifdefs instead of a
mixture of conditional expressions and nested ifdefs.
Nearby ones:
- don't do less than echo the code in the comment about libc_r
- fixed some internal insertion sort errors and indentation errors.
2004-05-14 19:52:35 +00:00
Bruce Evans
f3e5ff4080 Fixed some insertion sort errors (external ones only). 2004-05-14 19:31:20 +00:00
Tim J. Robbins
b666b593eb Use a simpler, faster buffering scheme for partial characters in mbrtowc(). 2004-05-14 15:40:47 +00:00
Olivier Houchard
cc5735a32d Do not attempt to build libdisk, libthr and libc_r for arm. 2004-05-14 13:45:56 +00:00
Olivier Houchard
027e3e1b0d Define iaddr_t and saddr_t for arm. 2004-05-14 13:32:13 +00:00