Commit Graph

8437 Commits

Author SHA1 Message Date
tjr
dab1ed1529 Re-add description of putc() macro (back out rev. 1.13.) 2004-03-17 12:46:17 +00:00
tjr
430cbeb954 Re-add text that says getc() is a macro (back out rev. 1.16.) 2004-03-17 12:37:28 +00:00
davidxu
12db4373da Fix a POSIX conformance bug. POSIX says sigwait should return error number
in return value not in errno.
2004-03-17 02:12:19 +00:00
tjr
b4d98c6855 Re-add macro versions of getc(), getchar(), putc(), putchar(), feof(),
ferror(), fileno() and clearerr(), using the value of __isthreaded to
decide between the fast inline single-threaded code and the more
general function equivalent. This gives most of the performance
benefits of the old unsafe macros while preserving thread safety.
2004-03-17 01:43:08 +00:00
des
3cb81148d8 Run through indent(1) so I can read the code without getting a headache.
The result isn't quite knf, but it's knfer than the original, and far
more consistent.
2004-03-16 21:30:41 +00:00
des
ce346529a3 Use unions to avoid violating C99 strict aliasing rules. 2004-03-16 20:42:02 +00:00
jhb
b7e56e9eea Change libdisk and sysinstall to use d_addr_t rather than u_long for disk
addresses.  For arch's with 64-bit longs, this is a nop, but for i386 this
allows sysinstall to properly handle disks and filesystems > 1 TB.

Changes from the original patch include:
- Use d_addr_t rather than inventing a blkcnt type based on int64_t.
- Use strtoimax() rather than strtoull() to parse d_addr_t's from config
  files.
- Use intmax_t casts and %jd rather than %llu to printf d_addr_t values.

Tested on:	i386
Tested by:	kuriyama
Submitted by:	julian
MFC after:	1 month
2004-03-16 17:07:06 +00:00
tjr
feae82b01a Refer to "wide characters" instead of "wide-characters". 2004-03-16 13:30:11 +00:00
tjr
d28b18f4b5 Sort MLINKS.
Noticed by:	ru
2004-03-16 11:06:31 +00:00
tjr
48661b2fa3 Add fairly minimal documentation for the nmount() syscall. 2004-03-16 09:45:38 +00:00
des
a52d3498dd Don't try to pass off a struct sockaddr as a struct sockaddr_in when it
may in fact very well be a struct sockaddr_in6.  Just use plain struct
sockaddr.

This brings us yet another step closer to a clean -O2 build.
2004-03-15 17:08:28 +00:00
des
950b98f1f7 Add -DDEBUG to DEBUG_FLAGS if PAM_DEBUG is defined. 2004-03-15 13:23:20 +00:00
truckman
8cf9e392b9 Document additional reasons that sysctl(3) can return ENOMEM (due to
vslock() failure).
2004-03-15 10:32:37 +00:00
des
2d02e7d4d4 Make this compile with -O2. A proper fix would use a struct to represent
vectors, instead of requiring the caller to keep track of element size
and count and pass them in by reference.
2004-03-15 08:14:35 +00:00
des
243c5ae2b1 Whitespace nits. 2004-03-15 08:03:10 +00:00
bde
1e78a65d3a Fixed a misspelling of 0 as NULL. 2004-03-14 05:27:26 +00:00
bde
76b946302c Fixed a misspelling of 0 as NULL. Removed a spelling of NULL as 0. 2004-03-14 05:19:38 +00:00
bde
84f037f29f Fixed misspellings of '\0' as NULL. 2004-03-14 05:14:00 +00:00
bde
5c7ee701c7 Initial support for C99's (or is it POSIX.1-2001's?) MATH_ERRNO,
MATH_ERREXCEPTION and math_errhandling, so that C99 applications at
least have the possibility of determining that errno is not set for
math functions.  Set math_errhandling to the non-standard-conforming
value of 0 for now to indicate that we don't support either method
of reporting errors.  We intentionally don't support MATH_ERRNO
because errno is a mistake, and we are missing support for
MATH_ERREXCEPTION (<fenv.h>, compiler support for <fenv.h>, and
actually setting the exception flags correctly).
2004-03-12 12:02:03 +00:00
bde
4a50f50816 Fixed misspellings of 0 as NULL. 2004-03-11 09:56:04 +00:00
tjr
00bce96751 Set stream orientation in ungetc() instead of __ungetc(). This avoids
setting it redundantly when called from ungetwc(), vfscanf() etc.,
which already set the orientation.
2004-03-10 12:41:11 +00:00
tjr
76708e58aa Remove duplicate check for EOF from ungetc(); __ungetc() already checks. 2004-03-10 11:13:23 +00:00
tjr
26739bcc23 Call __sputc() directly in fputc() instead of taking an expensive
detour through putc().
2004-03-10 10:49:45 +00:00
tjr
d856ced836 Call __sgetc() directly in getchar() instead of taking an expensive
detour through getc().
2004-03-10 10:24:15 +00:00
tjr
c1542ae485 Set the stream orientation explicitly in fgetln() instead of relying on
__srefill() to do it.
2004-03-10 09:28:38 +00:00
tjr
d27994efb7 Set stream orientation in puts(). 2004-03-10 09:15:38 +00:00
phk
4de4b53ade Put libypclnt behind NO_YP_LIBC 2004-03-10 08:58:06 +00:00
jhb
01eed200f9 Make libgeom usable by C++ programs:
- Add DECL wrappers to libgeom.h.
- Rename structure members in libgeom.h to use a lg_ prefix for member
  names.  This is required because a few structures had members named
  'class' which made g++ very unhappy.
- Catch gstat(8) and gconcat(8) up to these API changes.

Reviewed by:	phk
2004-03-09 21:14:18 +00:00
kientzle
90072dfae0 Many fixes.
Portability: Thanks to Juergen Lock, libarchive now compiles cleanly
on Linux.  Along the way, I cleaned up a lot of error return codes and
reorganized some code to simplify conditional compilation of certain
sections.

Bug fixes:
  * pax format now actually stores filenames that are 101-154
    characters long.
  * pax format now allows newline characters in extended attributes
    (this fixes a long-standing bug in ACL handling)
  * mtime/atime are now restored for directories
  * directory list is now sorted prior to fix-up to permit
    correct restore of non-writable dir heirarchies
2004-03-09 19:50:41 +00:00
jb
c50fc65e96 Backout the previous revision due to objections. 2004-03-09 04:51:58 +00:00
jb
e9062915d3 On 4.X it was possible for an application to initialise a local FILE
structure and call stdio functions. In 5.X this was broken when FILE
locking was introduced into libc.

This change makes most (relevant) stdio functions work again when the
_extra file in FILE isn't initialised (and can't be without a libc
function to do it since the __sFILEX structure is private to libc).
2004-03-09 02:44:59 +00:00
phk
ceb3b7463e String the consumers into the list of the provider they are attached to.
Noticed by:	jhb
2004-03-08 16:37:08 +00:00
phk
a545780c51 Rearrange (centralize) initialization of mallocs internals to always be
done before the first call, even if this is a malloc(0) call.

PR:	62859
2004-03-07 20:41:27 +00:00
phk
ea1893785c Add manpages for the gctl API.
Submitted by:	le
Tweaks by:	phk
2004-03-07 16:07:57 +00:00
kientzle
76c408916b Recognize hardlinks when reading cpio files.
This doesn't yet address the issue of selective restore
of hardlinked files.  With cpio format, it's possible to correctly
restore any linked file; the API doesn't yet fully support this.
(There's no way for the library to inform a client whether or not
there's a file body associated with this entry.  The assumption
right now is that "hardlink" entries have no file body.)
2004-03-07 00:57:43 +00:00
ache
ce8bd08be4 Merge some fixes from NetBSD's getopt.3 v1.31:
cleanup, add more sections, better explanation, declaration
2004-03-06 17:09:10 +00:00
ache
892e165566 Merge some fixes from NetBSD's getopt.c v1.26:
cleanups, handling 'ls -l-', handling '--*'

Note this is in the same time back out of our v1.3
"Don't print an error message if the bad option is '?'"
because it directly violates POSIX.
2004-03-06 17:05:45 +00:00
ache
5993cc3bce Fix typo, was 'W'; instead of `W;' 2004-03-06 14:47:49 +00:00
ache
c94e5bebf5 Make GNU-compatible following case:
single '-' in command line and '-' (non-first) in options
2004-03-06 14:24:10 +00:00
kientzle
f7afdba4b3 Minor API tweak: The format-specific write_header function now sets
the size in the archive_entry object to zero if that format doesn't
store a body for that file type.  This allows the client to determine
whether or not it should feed the file body to the archive.  In
particular, cpio stores the file body for hardlinks, tar and shar
don't.  With this change, bsdtar now correctly archives hardlinks in all
supported formats.

While I'm here, make shar output be more aggressive about creating directories.
Before this, commands such as:
    bsdtar -cv -F shar  some/explicit/path/to/a/file
wouldn't create the directory.  Some simple logic to remember the last
directory creation helps reduce unnecessary mkdirs here.

At this point, I think the only flaw in libarchive's cpio support is
the failure to recognize hardlinks when reading.
2004-03-06 05:44:13 +00:00
kientzle
b2042c11e8 Remove last evidence of a long-dead function. 2004-03-06 01:06:49 +00:00
kientzle
a96c560b59 Add ARCHIVE_EXTRACT_UNLINK option to permit clients to
control how archive_extract handles pre-existing files.
(Not implemented yet, but documented.)
2004-03-06 01:05:32 +00:00
kientzle
eec560a7c3 Correctly read symlinks from cpio files.
While I'm here, fix a bug in reading filenames from
cpio files.  (Copy should count the length of the name,
not the number of bytes available for input.)
2004-03-06 00:59:08 +00:00
markm
0b0ae8e16e Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT
C++" (implying C).

There are places where (void *) pointers are not valid, such as for
function pointers, but in the special case of (void *)0, agreement
settles on it being OK.

Most of the fixes were NULL where an integer zero was needed; many
of the fixes were NULL where ascii <nul> ('\0') was needed, and a
few were just "other".

Tested on: i386 sparc64
2004-03-05 08:10:19 +00:00
kientzle
57d3b7d165 Correctly read SCHILY.nlink from pax-format archives.
In particular, -tv output for pax-format archives now
lists everything that ls -l does.
2004-03-05 00:09:53 +00:00
dds
91b0d17289 Document missing EFAULT errno value.
MFC after:	2 weeks
2004-03-03 14:51:11 +00:00
ache
6ec2ddd536 Make return code in noarg case GNU-compatible 2004-03-03 08:29:00 +00:00
ache
248096d10f Be more GNU-compatible in diagnostics 2004-03-03 03:05:21 +00:00
jkh
5a199c908b If handed a file pointer we can't write to, set errno properly to EBADF
in order to get SUSv2 conformant behavior in higher level calls like
fputs() and puts().

Reviewed by:	bde
2004-03-02 19:43:51 +00:00
grehan
bfc8874821 Hook libthr to the build for PowerPC 2004-03-02 06:26:37 +00:00