Commit Graph

9316 Commits

Author SHA1 Message Date
Joseph Koshy
6febaa3aff Mutually cross-reference sysexits(3) and err(3). Add text to err(3)
recommending that the standard exit codes in sysexits(3) be used.

Reviewed by:    ru
2004-10-04 14:04:37 +00:00
Stefan Farfeleder
5a9e72a72b Don't add integers to void pointers. 2004-10-03 15:58:20 +00:00
Stefan Farfeleder
4c86f66f52 Don't add integers to void pointers. 2004-10-03 15:48:32 +00:00
Stefan Farfeleder
4e8c80e977 Directly include <runetype.h> for _CurrentRuneLocale, <_ctype.h> doesn't
include it in all cases.
2004-10-03 15:42:59 +00:00
David E. O'Brien
c79b3b412b Finish the de-orbital burn of our previous FreeBSD version compat libs
living in usr/src.  We need to use them from ports to record dependencies.

Discussed with:	re(scottl)
2004-10-02 05:48:09 +00:00
Scott Long
a4a358733d Enable the new compat4x libs. 2004-10-02 01:47:56 +00:00
Scott Long
50053f5d05 Update libc, libc_r, and libperl and add libhistory, libm, libopie, libpcap,
and libreadline from 4.10.
2004-10-02 01:46:20 +00:00
Ken Smith
1c98894f63 Prepare for 5.3 release by updating libraries that had changed in
4.10 and adding libraries whose version got bumped recently.
Updated libraries: libc, libc_r, and libperl.  Added: libhistory,
libm, libopie, libpcap, and libreadline.
2004-10-01 20:33:26 +00:00
Ken Smith
85a8b887df Bump the library version numbers for the following libraries:
/lib/{libm,libreadline}
	/usr/lib/{libhistory,libopie,libpcap}

in preparation for doing the same thing to RELENG_5.  HUGE amounts of
help for determining what to bump provided by kris.

Discussed on:	freebsd-current
Approved by:	re (not required for commit but something like this should be)
2004-10-01 15:38:07 +00:00
Maxim Konovalov
796a03f172 Reflect the fact addr2ascii(3) and ascii2addr(3) need sys/socket.h
for AF_* constants.

Submitted by:	Matthew George
MFC after:	2 weeks
2004-09-29 17:54:30 +00:00
Pawel Jakub Dawidek
69560edc13 Backout manual page updates.
Requested by:	ru
2004-09-26 12:08:31 +00:00
Daniel Eischen
862e463a75 Add a wrapper for execve(). The exec'd process must be started with
the signal mask and pending signals of the calling thread.  These
are stored in userland in libpthread.

There is a small race condition in this patch which could cause
problems if a signal arrives after setting the (kernel) signal
mask and before exec'ing.  The thread's set of pending signals
also are not yet installed in the exec'd process.  Both of these
will be corrected with the addition of a special syscall.

Reported & Tested by:	Joost Bekkers <joost at jodocus dot org>
Reviewed by:	julian, davidxu
2004-09-26 06:50:15 +00:00
Doug Barton
bd64f29b37 Fix up the man file installation for the new BIND 9 sources:
1. Install man files and links for the lwres library.

2. Fix the path in various files to say /etc/namedb/ instead of just /etc.

3. Correctly install the conf file man pages for named and rndc.
2004-09-26 06:36:11 +00:00
Pawel Jakub Dawidek
bd52c9ac59 Take the lastest fixes from NetBSD.
Obtained from:	NetBSD
2004-09-25 14:11:34 +00:00
Tom Rhodes
5f892a7ff0 Fix build in the !NOATM case by using the begemot library in place of
using libisc which was a part of BIND8.

Discussed with:	des, re, dougb
Submitted by:	harti (one part)
Reviewed by:	harti (previous version)
2004-09-24 22:10:34 +00:00
Doug Barton
0279b4a104 Ruslan has educated me both on the wisdom of why this approach is
better than mine, and why to wait for review.

Submitted by:	ru
2004-09-24 21:30:54 +00:00
Doug Barton
a2af6bc259 Fix the WANT_BIND_LIBS knob by correctly spelling it as WITH_BIND_LIBS
to match how similar syntax is used in the ports system. Thanks to kris
for pointing out my mistake here.

Install the lwres library unless the user defines NO_BIND, or the new
knob, NO_BIND_LIBS_LWRES. There is at least one potential customer
for this library in the wings. Thanks to nectar for the reminder.
2004-09-24 18:42:05 +00:00
Ruslan Ermilov
56216f685b Don't expose BIND libraries and their headers to the public by default,
but have a knob (WANT_BIND_LIBS) to build and install them in /usr/lib
and /usr/include.  Rumors are that this may be useful at a later point,
let's see.

What this really means is that all BIND libraries are now internal to
buildworld (by default, unless WANT_BIND_LIBS is defined), and linked
statically into various BIND executables.

While here, removed redundant -I's from CFLAGS in lib/bind makefiles.

Sponsored by:	des
OK'ed by:	dougb
2004-09-24 13:42:00 +00:00
Olivier Houchard
99feca3bae _tcb_ctor takes two args. 2004-09-24 13:02:30 +00:00
Suleiman Souhlal
eea4bca56b Make sure we don't call _thr_start_sig_daemon() when SYSTEM_SCOPE_ONLY is defined. This makes libpthread usable on powerpc.
Approved by:	grehan (mentor), deischen
2004-09-24 06:36:31 +00:00
David Schultz
48c8620ae4 Remove __isnanl() to avoid conflicting with the same function in libm.
__isnan() and __isnanf() must remain in libc for hysterical raisins.
On the other hand, __isnanl() must live in libm because libm uses it
internally and can't depend on older versions of libc to provide it.
Fortunately, we don't need __isnanl() in both libraries.

Prodded by:	ale
PR:		71698
MT5 candidate
2004-09-24 06:33:22 +00:00
Olivier Houchard
9e3a79d517 Arbitraly choose the Variant II for arm. 2004-09-23 23:14:09 +00:00
Olivier Houchard
3d90a3cd91 Make setjmp()/longjmp() use sigprocmask. 2004-09-23 23:13:46 +00:00
Olivier Houchard
05a07e2bda Add a dummy set_tp(). 2004-09-23 23:12:57 +00:00
Olivier Houchard
04823f257b Always use bx for returning on Xscale.
Obtained from:	NetBSD
2004-09-23 23:11:32 +00:00
Olivier Houchard
3e3aced335 Fix the align-to-32-bits code.
Obtained from:	NetBSD
2004-09-23 23:10:56 +00:00
Olivier Houchard
eed605e0fe Implement .init and .fini. 2004-09-23 23:00:51 +00:00
Dag-Erling Smørgrav
b67acf67b2 Instead of hardcoding the BIND version, deduce it from ${BIND_DIR}/version. 2004-09-23 07:52:51 +00:00
Dag-Erling Smørgrav
fcb61d9f95 libpthread is always libpthread, even when it's libc_r.
Reminded by:	ru@
2004-09-23 07:37:19 +00:00
Dag-Erling Smørgrav
73b3230180 Bump version number after vendor import of 9.3.0. 2004-09-23 07:21:02 +00:00
Doug Barton
8c3d51e1dc LOCALSTATEDIR should be /var, since the BIND 9 source appends
things like "run/named.pid" to it.
2004-09-23 04:46:56 +00:00
Marcel Moolenaar
0c32530bb7 Redefine a PTE as a 64-bit integral type instead of a struct of
bit-fields. Unify the PTE defines accordingly and update all
uses.
2004-09-23 00:05:20 +00:00
Marcel Moolenaar
6d77d031fd The offset argument to mmap(2) is not a pointer. Use 0 instead of NULL. 2004-09-22 20:26:33 +00:00
Mike Makonnen
2d79470f8a Remove vestiges of libthr's signal mangling past. This fixes that last
known problem with mysql on libthr: not being able to kill mysqld.
2004-09-22 18:51:16 +00:00
Stefan Farfeleder
e60b9f5130 Prefer C99's __func__ over GCC's __FUNCTION__. 2004-09-22 16:56:49 +00:00
Mike Makonnen
ff9af45a01 The SUSv3 function say that the affected functions MAY FAIL, if the
specified mutex is invalid. In spec parlance 'MAY FAIL' means it's
up to the implementor. So, remove the check for NULL pointers for two
reasons:
	1. A mutex may be invalid without necessarily being NULL.
	2. If the pointer to the mutex is NULL core-dumping in the
	   vicinity of the problem is much much much better than failing
	   in some other part of the code (especially when the application
	   doesn't check the return value of the function that you oh so
	   helpfully set to EINVAL).
2004-09-22 16:53:23 +00:00
Dag-Erling Smørgrav
abb3768b5c Always link with -lpthread, not -lc_r, because platforms that don't have
full KSE support still have -lpthread as an alias for -lc_r.  The only
thing that's different is the name of the knob that turns it off.

Pointed out by:	ru@
2004-09-22 14:36:12 +00:00
Dag-Erling Smørgrav
11d9d041cf Clean up and comment config.mk. Centralize more stuff. Bitch if
POSIX threads libraries are not available.  Add crypto support if
the crypto libraries are available.  Build dnssec-{keygen,signzone}
if crypto is available.

Submitted by:	(in part) dougb@
2004-09-22 12:13:58 +00:00
Dag-Erling Smørgrav
cd3ee173f9 Switch from BIND 8 to BIND 9.
Submitted by:	(in part) dougb@, trhodes@
Reviewed by:	dougb@, trhodes@, re@
MFC after:	5 days
2004-09-21 19:01:48 +00:00
Dag-Erling Smørgrav
2cbbf9dac9 Update copyright years. 2004-09-21 18:35:21 +00:00
David Schultz
d622ef6993 Further refine some #ifs:
- Simplify the logic by using __GNUC_PREREQ__.
  Suggested by stefanf.
- Make math.h compile with old (pre-8.0) versions of icc.
  Submitted by sf [sic].
2004-09-17 05:15:33 +00:00
Tim Kientzle
d6970563b6 Fix two ugly errors:
1. The correct cutoff for large uid/gid handling is 1<<18, not 1<<20.
2. Limit the uid/gid in the 'x' extension header (where numeric extensions
are not permitted) to 1<<18, but use the correct value in the regular
header (where numeric extensions are permitted).
Thanks to: Dan Nelson
MFC after: 3 days
2004-09-17 04:39:07 +00:00
Pawel Jakub Dawidek
8914c29937 There is no such manual page in FreeBSD. 2004-09-16 18:32:58 +00:00
Mike Makonnen
737afa3cec Implement cancellation points in libc interfaces, as specified by POSIX. 2004-09-16 13:55:46 +00:00
Jun Kuriyama
0c1691334a Fix a condition where the hole would be inserted in the wrong
place during a split.

Obtained from:	NetBSD
2004-09-13 22:07:24 +00:00
Pawel Jakub Dawidek
08aa5a1ddb We have now so many GEOM classes that it is better to just skip unknown
classes than exiting.

Reviewed by:	le
OK'ed by:	phk
2004-09-13 16:06:14 +00:00
Lukas Ertl
6ce35ad043 Ignore geom_stripe providers.
MFC in: one week
2004-09-13 11:28:54 +00:00
Jun Kuriyama
a5906b6cd2 I found "portsdb -u" dumps core with recent INDEX file, and this is
caused by refering broken (uninitialized?) pointer which is retrieved
from __bt_new() (and from mpool_new()).

I don't know why this linp[0] is read before stored because this
should be controlled by .lower and .upper member of PAGE structure
which are correctly initialized.

But this workaround fixes the problem on my environment and this
module has #ifdef PURIFY option which initializes new and reused
memory from mpool by memset(p, 0xff, size) like as I did.

Please feel free to fix the real bug instead of my workaround.
2004-09-10 14:45:00 +00:00
Jun Kuriyama
312f18518e Fix format strings to unbreak with -DDEBUG option. 2004-09-10 05:44:17 +00:00
Yaroslav Tykhiy
23b5c802b8 Use the recently introduced RES_DFLRETRY parameter instead of a well-hidden
constant for the default number of retries.
2004-09-09 17:42:18 +00:00
Alfred Perlstein
29a6af9b14 bump .Dd
requested by: ru
2004-09-09 10:54:08 +00:00
Alfred Perlstein
dc45e5b846 Add/document autoreq_getxid(3), which gets the autofs request
transaction id from the request, this is useful for debugging.

Fix the autoh_freeall(3) function to properly free the array of
auto handles.  Before it was freeing individual members of the list
OK, however it was then advancing the pointer and freeing the wrong
data for the whole list.
2004-09-09 01:23:27 +00:00
Alfred Perlstein
334be0c9c3 Remove debug output. 2004-09-08 20:08:18 +00:00
Alfred Perlstein
864ad288d7 Fix a .Fn that should be an .Fa.
Clear up the spelling and language when describing how to select/poll for
an autofs event.
2004-09-08 19:47:29 +00:00
Alfred Perlstein
7a3b8aefbf sync with private code:
fix a 5.x'ism that 4.x needs protection from.
make this code compile standalone.
2004-09-08 08:44:14 +00:00
Tim J. Robbins
33176f1755 Fix two problems with REG_ICASE that were introduced with the addition of
multibyte character support:
- In CHadd(), avoid writing past the end of the character set bitmap when
  the opposite-case counterpart of wide characters with values less than
  NC have values greater than or equal to NC.
- In CHaddtype(), fix a braino that caused alphabetic characters to be
  added to all character classes! (but only with REG_ICASE)

PR:		71367
2004-09-05 08:30:42 +00:00
Julian Elischer
ed062c8d66 Refactor a bunch of scheduler code to give basically the same behaviour
but with slightly cleaned up interfaces.

The KSE structure has become the same as the "per thread scheduler
private data" structure. In order to not make the diffs too great
one is #defined as the other at this time.

The KSE (or td_sched) structure is  now allocated per thread and has no
allocation code of its own.

Concurrency for a KSEGRP is now kept track of via a simple pair of counters
rather than using KSE structures as tokens.

Since the KSE structure is different in each scheduler, kern_switch.c
is now included at the end of each scheduler. Nothing outside the
scheduler knows the contents of the KSE (aka td_sched) structure.

The fields in the ksegrp structure that are to do with the scheduler's
queueing mechanisms are now moved to the kg_sched structure.
(per ksegrp scheduler private data structure). In other words how the
scheduler queues and keeps track of threads is no-one's business except
the scheduler's. This should allow people to write experimental
schedulers with completely different internal structuring.

A scheduler call sched_set_concurrency(kg, N) has been added that
notifies teh scheduler that no more than N threads from that ksegrp
should be allowed to be on concurrently scheduled. This is also
used to enforce 'fainess' at this time so that a ksegrp with
10000 threads can not swamp a the run queue and force out a process
with 1 thread, since the current code will not set the concurrency above
NCPU, and both schedulers will not allow more than that many
onto the system run queue at a time. Each scheduler should eventualy develop
their own methods to do this now that they are effectively separated.

Rejig libthr's kernel interface to follow the same code paths as
linkse for scope system threads. This has slightly hurt libthr's performance
but I will work to recover as much of it as I can.

Thread exit code has been cleaned up greatly.
exit and exec code now transitions a process back to
'standard non-threaded mode' before taking the next step.
Reviewed by:	scottl, peter
MFC after:	1 week
2004-09-05 02:09:54 +00:00
Tim Kientzle
8a95c5cb6e Some old tar archives rely on "regular-file-plus-trailing-slash" to
denote a directory.  Unfortunately, in the presence of GNU or POSIX
extensions, this code was checking the truncated filename stored in the
regular header rather than the full filename stored in the extended
attribute.  As a result, long filenames with '/' in just the right
position would trigger this check and be erroneously marked as
directories.  Move the check so it only considers the full filename.
Note: the check can't simply be disabled for archives that contain
these extensions because there are some very broken archivers out
there.

Thanks to: Will Froning
MFC after: 3 days
2004-09-04 21:49:42 +00:00
Ian Dowse
e3cce87239 Reset the seek pointer to 0 when a file is successfully opened,
since otherwise the initial seek offset will contain the directory
offset of the filesystem block that contained its directory entry.
This bug was mostly harmless because typically the directory is
less than one filesystem block in size so the offset would be zero.
It did however generally break loading a kernel from the (large)
kernel compile directory.

Also reset the seek pointer when a new inode is opened in read_inode(),
though this is not actually necessary now because all callers set
it afterwards.
2004-09-04 14:54:01 +00:00
Marcel Moolenaar
ef0cd312df Unbreak memmove(). Return the dst argument. While here, fix the END
macro to actually reference memmove, not memcpy.
2004-09-04 00:23:15 +00:00
Marcel Moolenaar
4c36bcaa87 Unbreak memcpy(). memcpy() is defined to return the dst argument.
By using r8 instead of r14 to do the swap, we put the dst argument
in the return register. Since bcopy() doesn't clobber r8, we don't
have to do anything else. This fixes ports/textproc/aspell.
2004-09-04 00:04:58 +00:00
Alfred Perlstein
682f9306a4 Normalize the makefile.
submitted by: ru
2004-09-03 18:01:34 +00:00
Alfred Perlstein
345c5f4a23 Hook libautofs to the build. 2004-09-03 17:39:00 +00:00
Peter Pentchev
2f67164732 Add a BUGS section and copy the wording from mmap(2)'s MAP_NOSYNC,
documenting the obsoleteness of the msync(2) syscall and its single
remaining purpose.

PR:		70916
Submitted by:	Radim Kolar <hsn@netmag.cz>
MFC after:	3 days
2004-09-03 06:24:25 +00:00
Alfred Perlstein
0793d4d1e4 Hook autofs to the build. 2004-09-02 20:44:56 +00:00
Tim J. Robbins
b37ff7a592 Septepber -> September
Noticed by:	ru
2004-09-01 23:28:27 +00:00
Tim J. Robbins
e6e1974ba5 Back out the previous change. glob() still does use strcmp() to order
pathnames.
2004-09-01 11:02:55 +00:00
Tim Kientzle
00ccc351f8 Per Ruslan, bsd.lib.mk already has support for dynamically-generated
.h files.  This simplifies the Makefile here a bit and makes it behave
better in a couple of situations.  While I'm here, clean up some comments
and try to improve the organization a bit.

Thanks to: Ruslan Ermilov (The Marvelous Makefile Guru)
2004-09-01 05:06:42 +00:00
Alfred Perlstein
acc387c393 Enter the autofs. 2004-08-31 16:26:01 +00:00
David E. O'Brien
c6d8b958f1 Start the de-orbital burn of our previous FreeBSD version compat libs
living in usr/src.  We need to use them from ports to record dependencies.

Discussed with:	re(scottl)
2004-08-29 18:27:00 +00:00
Tim J. Robbins
1fd0f50a3a Add cross-reference to ftw(3). 2004-08-29 06:39:58 +00:00
Peter Pentchev
882bc79a39 Remove the misleading description of the 'key' argument to
mpool_open(3) - it is *not* really used for synchronization; in fact,
it is not used at all.

PR:		70929
Submitted by:	Martin Kammerhofer <dada@sbox.tugraz.at>
MFC after:	3 days
2004-08-27 14:51:21 +00:00
Tim Kientzle
db9e0127da Cache uid-from-uname and gid-from-gname lookups during extraction.
This should provide a big performance boost for folks using NIS or LDAP.

MFC after: 3 days
Thanks to: Jun Kuriyama (for reminding me that this was still on my TODO list)
2004-08-27 03:40:48 +00:00
Jacques Vidrine
521adbdfc7 Correct a denial-of-service vulnerability in zlib.
For reference, this bug was first reported at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=252253

Submitted by:	"Dmitry V. Levin" <ldv@altlinux.org>
2004-08-26 19:37:06 +00:00
Dag-Erling Smørgrav
096ad1042a Don't forget to va_end() the va_list we get from va_copy().
Submitted by:	Sean McNeil <sean@mcneil.com>
MFC after:	3 days
2004-08-26 06:25:28 +00:00
Tim Kientzle
2522fe6764 Don't edit permissions of pre-existing directories during extract.
This closes a security hole.  Otherwise, libarchive will happily
extract into directories to which it lacks write permissions by
resetting the permissions during the extract.

Thanks to: Kris Kennaway
2004-08-26 03:53:43 +00:00
Tim Kientzle
c85db499ac It is not legal to re-use a va_list variable. This caused
a crash on amd64, in particular.

Thanks to: Sean McNeil
2004-08-26 03:33:53 +00:00
David Xu
1db81dc074 Add missing brackets. It was committed from wrong tree. 2004-08-26 02:41:01 +00:00
David Xu
28f5d1b766 gcc -O2 cleanup. tested for a long time.
Reviewed by: deischen
2004-08-25 23:42:40 +00:00
Marcel Moolenaar
f0556e70bb Make profiling actually work. The gcc compiler emits a call to the
_mcount() stub when profiling is enabled. Emit this code sequence
for assembly routines as welli (MCOUNT definition in <machine/asm.h>.
We do not pass the GOT entry however as the 4th argument, because it's
not used. The _mcount() stub calls __mcount(), which does the actual
work. Define _MCOUNT_DECL to define __mcount. We do not have an
implementation of mcount(), so we define MCOUNT as empty, but have a
weak alias to _mcount() in _mcount.S.
Note that the _mcount() stub in the kernel is slightly different from
the stub in userland. This is because we do not have to worry about
nested routines in the kernel.
2004-08-25 07:42:34 +00:00
Alfred Perlstein
3b28ee84a6 note that it is the caller's responsibility to free any buffer passed
to setvbuf(3) and friends.
2004-08-24 21:48:21 +00:00
Tim J. Robbins
e1bcce4f46 Replace the current implementations of ftw() and nftw() with the OpenBSD
implementations written by Todd C. Miller. These are cleaner, less buggy
and actively maintained.
2004-08-24 13:00:55 +00:00
Peter Wemm
ee4dc2a402 struct tm.tm_year is listed as 'years since 1900', and is signed. On
64 bit systems, years roughly -2^31 through 2^31 can be represented in
time_t without any trouble.  32 bit time_t systems only range from
roughly 1902 through 2038.  As a consequence, none of the date munging
code for all the various calendar tweaks before then is present.  There
are other problems including the fact that there was no 'year zero' and
so on.  So rather than get excited about trying to figure out when the
calendar jumped by two weeks etc, simply disallow negative (ie: prior to
1900) years.

This happens to have an important side effect.  If you bzero a 'struct
tm', it corresponds to 'Jan 0, 1900, 00:00 GMT'.  This happens to be
representable (after canonification) in 64 bit time_t space.  Zero tm
structs are generally an error and mktime normally returns -1 for them.
Interestingly, it tries to canonify the 'jan 0' to 'dec 31, 1899', ie:
year -1.  This conveniently trips the negative year test above, which
means we can trivially detect the null 'tm' struct.

This actually tripped up code at work. :-/  (Don't ask)
2004-08-24 00:15:37 +00:00
Doug Rabson
bd41e9ea59 Make sure we allocate at least enough space for the TCB for variant I TLS.
MFC after: 3 days
2004-08-23 15:30:05 +00:00
Tim J. Robbins
9777e82e42 Update documentation to match reality: glob() sorts its result according
to the current LC_COLLATE setting, not in "ASCII order".

PR:		54391
MFC after:	1 week
2004-08-23 12:10:44 +00:00
David Xu
0dabb2c8a0 Pull debug symbols in for statically linked binary.
Reviewed by: desichen
2004-08-21 11:49:19 +00:00
Doug Rabson
4a5a97e625 Back out the call to _init_tls() - something is broken there and it
prevents all static binaries from running.
2004-08-21 08:22:00 +00:00
Tim J. Robbins
8d2a49a247 Re-word warning about the UTF2 encoding, taking care to use the word
"obsolete" instead of "deprecated".
2004-08-21 08:08:29 +00:00
Tim J. Robbins
4740653c84 Bump document date for previous. 2004-08-21 08:03:18 +00:00
Tim J. Robbins
6a4d3d68c7 Re-word warning about the rune interface, taking care to use the word
"obsolete" instead of "deprecated".
2004-08-21 08:00:31 +00:00
Tim J. Robbins
5a52f3c22c Change "deprecated" in link-time warnings about various rune functions
to "obsolete".
2004-08-21 07:48:06 +00:00
Tim J. Robbins
b9b90a1312 Re-word compatibility section, taking care to use the word "obsolete" to
describe the 4.4BSD extension of accepting characters (runes) outside of
the range of unsigned char.
2004-08-21 07:37:08 +00:00
David E. O'Brien
b35b4dcba7 Document when this function came into FreeBSD. 2004-08-21 03:31:17 +00:00
David Xu
aea0abf3e3 build libthr on amd64. 2004-08-19 23:51:42 +00:00
David Xu
9027ac471c Adjust code to support AMD64, on AMD64, thread needs to set fsbase by
itself before it can execute any other code, so new thread should be
created with all signals are masked until after fsbase is set.
2004-08-19 23:49:04 +00:00
David Xu
f5eb80a9d3 Add AMD64 support code. 2004-08-19 23:41:12 +00:00
Alfred Perlstein
65da79c4be Reword recent addition about memory moving.
Requested by: keramida

Bump .Dd

Requested by: ru
2004-08-19 16:34:31 +00:00
Marcel Moolenaar
e8e41d4cf8 Bring ia64 back from the dead. After a call one needs to restore the
GP register, because it's clobbered for calls across load modules. The
previous commit inserted the call to _init_tls() between the call to
atexit() and the restoration of the GP register clobbered by it. Fix:
restore GP before we call _init_tls().

Pointy hat: dfr@
2004-08-18 23:06:47 +00:00
Alfred Perlstein
09a12d75cf Clarify that realloc and reallocf may move the memory allocation. 2004-08-18 21:13:15 +00:00
Doug Rabson
0e7e4e5fd6 Always allocate a TLS area even if its empty - libpthread relies on
having a valid %gs when it initialises.

MFC after: 2 days
2004-08-18 10:18:58 +00:00
Tom Rhodes
1bdc6fddbf /me kicks cvs update
Revert previous commit, tjr already fixed it and I was too stupid to
notice this fact.

Approved by:	re (to avoid failing cvs ci)
2004-08-17 04:56:03 +00:00
Tom Rhodes
daa790840c Fix incorrect code in an example. The previous example would produce
19 column positions wide in the first line and 20 in the rest of the lines.
This fixes the example to provide the correct output.

PR:		53454
Noticed by:	Kuang-che Wu <kcwu@kcwu.homeip.net>
Submitted by:	Marc Silver <marcs@draenor.org>
Approved by:	re (scottl)
2004-08-17 04:45:52 +00:00
David Xu
f914e34db6 Fix compile, s/tp_dtv/tp_tdv/g. 2004-08-16 14:07:38 +00:00
Doug Rabson
e9abf2d6e2 Fix alpha build and add __FBSDID.
PR: 70518
2004-08-16 08:12:29 +00:00
Peter Grehan
391d4a3856 Bring PPC up to date with latest TLS changes. 2004-08-16 05:41:39 +00:00
David Xu
2eb43a641f Plug a memory leak in error case. 2004-08-16 05:20:12 +00:00
David Xu
cd980d46c2 1. Use libpthread's exported symbols to calcuate offset in data structure
2. Enable TLS debugger support.
2004-08-16 03:30:16 +00:00
David Xu
a002d437ea 1. Add macro DTV_OFFSET to calculate dtv offset in tcb.
2. Export symbols needed by debugger.
2004-08-16 03:27:29 +00:00
David Xu
497c17e0ae Add a file to collection all symbols will be needed by debugger. 2004-08-16 03:25:07 +00:00
Doug Rabson
e6f19330ce Add rtld-elf to the include path for the rtld to pthread TLS interface. 2004-08-15 21:51:18 +00:00
Doug Rabson
99c8d0836d Add TLS support for i386 and amd64. 2004-08-15 16:28:05 +00:00
Doug Rabson
adbadf41a9 Add TLS support for libthr on i386. 2004-08-15 16:21:30 +00:00
Doug Rabson
ccd13c49b5 Add support for TLS in statically linked programs. 2004-08-15 16:18:52 +00:00
Stefan Farfeleder
4eae39bfdf Avoid using void pointers in additive expressions.
PR:		56653
2004-08-14 17:46:10 +00:00
Poul-Henning Kamp
e7581f0fc2 Fix outgoing ICMP on global instance. 2004-08-14 14:21:09 +00:00
Tim Kientzle
57b665990a Eliminate reliance on non-portable <err.h> by implementing a very
simple errx() function.
Improve behavior when bzlib/zlib are missing by detecting and
issuing an error message on attempts to read gzip/bzip2 compressed
archives.
2004-08-14 03:45:45 +00:00
Tim Kientzle
6a0724a89e We don't need <paths.h>, so don't bother including it. 2004-08-14 03:43:35 +00:00
Stefan Farfeleder
361de173a5 Avoid using void pointers in additive expressions.
PR:		56653 (libc/rpc bits)
Approved by:	alfred
2004-08-13 23:22:38 +00:00
Peter Pentchev
9f4c0e5c8f Document the MNT_SNAPSHOT mount flag with a cross-reference
to mksnap_ffs(8).

PR:		70402
Submitted by:	James Raftery <james@now.ie>
2004-08-13 14:33:03 +00:00
David Xu
d4ee712657 1. Add missing functions: libthr_dbresume,libthr_dbsuspend.
2. Implement functions: libthr_db_thr_setfpregs, libthr_db_thr_setregs,
   libthr_db_ta_map_id2thr.
3. simplify libthr_db_thr_getfpregs, libthr_db_thr_getgregs.
2004-08-13 06:47:33 +00:00
Tim J. Robbins
5349fd7f49 Fix example. 2004-08-12 12:32:14 +00:00
Tim J. Robbins
de6c9c9d5b Implement wcwidth() as an inline function. 2004-08-12 12:19:11 +00:00
Daniel Eischen
b9de27c005 As long as we have a knob to force system scope threads, why not have
a knob to force process scope threads.  If the environment variable
LIBPTHREAD_PROCESS_SCOPE is set, force all threads to be process
scope threads regardless of how the application creates them.  If
LIBPTHREAD_SYSTEM_SCOPE is set (forcing system scope threads), it
overrides LIBPTHREAD_PROCESS_SCOPE.

        $ # To force system scope threads
        $ LIBPTHREAD_SYSTEM_SCOPE=anything threaded_app
        $ # To force process scope threads
        $ LIBPTHREAD_PROCESS_SCOPE=anything threaded_app
2004-08-12 12:12:12 +00:00
Hartmut Brandt
0d5467be9e Link to the build again. The problem was that we need a new
gensnmptree for the .def file to parse. This was fixed in
Makefile.inc1.
2004-08-11 16:47:12 +00:00
Hartmut Brandt
6c6e198147 Again something bad is happening so comment out the ATM module. 2004-08-11 16:01:46 +00:00
Hartmut Brandt
d6024e35bf Now, after the import of NgATM-1.1, re-enable the atm module. 2004-08-11 12:27:31 +00:00
Brian Feldman
ea84c8dc30 Update "documentation date" fields. 2004-08-10 16:38:19 +00:00
Brian Feldman
831bc6f574 Update mlock(2) manpage to cross-reference m{,un}lockall(2), remove
a case where ENOMEM could be returned by munlock(2), and add possible
system deadlock to the BUGS section.
2004-08-10 14:52:42 +00:00
Scott Long
ddb75b6fab Disable the snmp_atm module until the source gets fixed. This will unbreak
this portion of the build.
2004-08-10 04:56:39 +00:00
Hartmut Brandt
c33ca5aaa0 Link the snmp_atm module to the build unless NOATM is defined. 2004-08-09 16:40:39 +00:00
Hartmut Brandt
a566bd48a8 Now that gensnmptree can read and merge more than one tree make
the rule so that the tree .c and .h files can be produced from several
trees.
2004-08-09 16:37:25 +00:00
Hartmut Brandt
9856b0ba40 A module for bsnmpd(1) that exports a MIB that contains information about
the local ATM interfaces and allows to change some parameters via SNMP.
2004-08-09 16:36:04 +00:00
David E. O'Brien
8f7ffe585a Turn on the magic. 2004-08-09 11:30:36 +00:00
David E. O'Brien
7866c62aa6 Don't try to programatically support running file(1) w/in /usr/obj or other
non-standard install path.

Agreed with:	ru
2004-08-09 11:05:09 +00:00
David E. O'Brien
3dcb1ab12d Uncomment the real paths and remove the local debugging paths.
Noticed by:	ru (who's faster than 'make world' on my stock src test machine)
2004-08-09 10:32:16 +00:00
David E. O'Brien
20164649ea Bmake the library containing and processing the magic. 2004-08-09 08:48:28 +00:00
David Xu
78f687539a Check debugger suspending flag for system scope thread.
Reviewed by: deischen
2004-08-08 22:42:11 +00:00
David Xu
3e93cc3ae3 1.Use new way to check if a thread is in critical region, defer suspending
if it is true.
2.Add thread_db api td_thr_tls_get_addr to get tls address, the real code
  is commented out util tls patch is committed.

Reviewed by: deischen
2004-08-08 22:37:53 +00:00
Tim Kientzle
7acae2155e Add archive_entry_set_mtime() 2004-08-08 07:39:19 +00:00
Tim Kientzle
0a36c0e86b Oops. Use "unsigned long" instead of "int" for the intermediate variables
in wide-character conversions, since it's guaranteed to be large enough.
Thanks to: Andrey Chernov
2004-08-08 02:22:48 +00:00
Tim Kientzle
61913b5f21 Use 'int' for certain wide-character conversions instead of wchar_t.
That quiets some compiler warnings on platforms with 16-bit wchar_t.
With this change, libarchive now compiles cleanly on Win32/cygwin.
2004-08-08 01:21:10 +00:00
Tim Kientzle
e33730c3c3 The configure-built Makefile wasn't installing archive.h 2004-08-08 00:48:39 +00:00
Tim Kientzle
e8ec6e32d2 If you don't need a header, don't bother including it. 2004-08-08 00:43:21 +00:00
Stefan Farfeleder
bef5493789 Add man pages for the cimag(), conj() and creal() functions. 2004-08-07 23:03:36 +00:00
Dag-Erling Smørgrav
264a4c03fc Don't forget to allocate space for the terminating NUL when converting to
base 64.

PR:		misc/70022
Submitted by:	Herve Masson <herve-bsdbt@mindstep.com>
MFC after:	3 days
2004-08-07 20:23:50 +00:00
Tim Kientzle
91ce8f27d8 Split archive_{read,write}_finish into separate "close" (finish the archive
and close it) and "finish" (destroy the object) functions.   For backwards
compat and simplicity, have "finish" invoke "close" transparently if needed.
This allows clients to close the archive and check end-of-operation
statistics before destroying the object.
2004-08-07 19:22:50 +00:00
Tim Kientzle
0cc230af33 Don't forget to count the end-of-file padding as part of the finished
file size.
2004-08-07 19:21:18 +00:00
Tim Kientzle
b2d9ea9fd3 Having implemented read support for it, I now know how to document the
GNU sparse file extension.
2004-08-07 17:24:50 +00:00
Tim Kientzle
659c68935c Correct an mdoc error; add a sentence about tar's ancestors "tp" and "tap." 2004-08-07 17:15:33 +00:00
Daniel Eischen
00be1d3d12 Add a way to force 1:1 mode for libpthread. To do this, define
LIBPTHREAD_SYSTEM_SCOPE in the environment.

You can still force libpthread to be built in strictly 1:1 by
adding -DSYSTEM_SCOPE_ONLY to CFLAGS.  This is kept for archs
that don't yet support M:N mode.

Requested by:   rwatson
Reviewed by:    davidxu
2004-08-07 15:15:38 +00:00
Tim Kientzle
1e28302160 Fix the calculation of the most negative int64_t value, which
is used on systems that lack C99 headers (such as FreeBSD 4).
2004-08-07 06:38:40 +00:00
Tim Kientzle
bfe891b141 libarchive now has two complete build systems. The usual "Makefile"
is present for FreeBSD.  If you "make distfile" on FreeBSD, you will
soon have a tar.gz file suitable for deploying to other systems
(complete with the expected "configure" script, etc).  This latter
relies (at least for now) on the GNU auto??? tools.  (I like autoconf
okay, but someday I hope to write a custom Makefile.in and dispense
with automake, which is somewhat odious.)

As part of this, I've cleaned up some of the conditional
compilation options, added make-foo to construct archive.h dynamically
(it now contains some version constants), and added some useful
informational files.
2004-08-07 03:09:28 +00:00
Tim Kientzle
501fe26500 Pass the pointy hat, please: Don't blow away the high-order
mode bits when setting permissions from ACL data.
Thanks to: David Gilbert for first reporting this and
    Jimmy Olgeni for noticing that it only occurred on
    ACL-enabled filesystems.
2004-08-07 02:50:05 +00:00
Tim Kientzle
af062c24e6 Beef up the "cannot archive this" error message with the
actual mode that failed, to help track down a bug.
2004-08-07 02:24:20 +00:00
Tim J. Robbins
91f18ef928 Fix an off-by-one bug that caused the first character of the buffer to
be uninitialized.
2004-08-06 17:00:09 +00:00
Peter Pentchev
16d9177176 Bump the document date, since the content changed today.
Discussed with:	ru
2004-08-06 15:29:54 +00:00
Peter Pentchev
9a3daf494b Fix a case of _SC_CLK_TCK being misspelled as _SC_CLOCK_TCK.
PR:		69428
Submitted by:	Sascha Schneider <suntsu@suntsu.org>
MFC after:	2 weeks
2004-08-06 14:49:11 +00:00
Hartmut Brandt
2216298b64 Add the right CFLAGS to show that we have err.h, getaddrinfo and strlcpy.
Add support.c to the list of source files.
2004-08-06 13:43:29 +00:00
Peter Pentchev
b047cf9879 Spell FTP correctly - in this case, it is used as the name of the protocol,
not the program.  Also, bump the document date.

Reminded by:	our resident mdoc guard (ru)
2004-08-06 12:56:39 +00:00
Peter Pentchev
808712c91c Cross-reference getnameinfo(3), getaddrinfo(3), getipnodebyname(3) and
getipnodebyaddr(3).

PR:		54229
Submitted by:	Samuel Tardieu <sam@inf.enst.fr>
MFC after:	2 weeks
2004-08-06 12:02:07 +00:00
Peter Pentchev
a222db0461 Fix a printf("%b", ..) example.
PR:		68849
Submitted by:	Michel Lavondes <fox@vader.aacc.cc.md.us>
MFC after:	1 week
2004-08-06 11:24:37 +00:00
Peter Pentchev
1575f75dc9 Add Giorgos's description of the ftp-chroot login.conf option.
Reported by:	Bill Moran <wmoran@potentialtech.com>
Submitted by:	keramida
MFC after:	2 weeks
2004-08-06 10:43:24 +00:00
Colin Percival
d37df47d31 Join the 21st century: Cryptography is no longer an optional component
of releases.  The -DNOCRYPT build option still exists for anyone who
really wants to build non-cryptographic binaries, but the "crypto"
release distribution is now part of "base", and anyone installing from a
release will get cryptographic binaries.

Approved by:	re (scottl), markm
Discussed on:	freebsd-current, in late April 2004
2004-08-06 07:27:08 +00:00
Marcel Moolenaar
7bf298bcad Don't use type unknown for partitions that we don't care about because
the chunk will never be added to the list in that case. Use type mbr
for GPT nested MBRs and use type part for any partition we don't know
or care about. Since the subtype is 0, this should not cause confusion.
2004-08-05 17:44:07 +00:00
Olivier Houchard
60b22cf1c2 Only use rfs and wfs if ARM_HARD_FLOAT is defined, and use stubs if it is not,
in order to unbreak arm make world. The right way to do it with soft floats
will be figured out later.
Discussed with:	das
2004-08-05 14:07:24 +00:00
David Schultz
2208ce0a06 Replace s_isnan.c and s_isnanf.c with the more compact s_isnan.c from
libc.  The externally-visible effect of this is to add __isnanl() to
libm, which means that libm.so.2 can once again link against libc.so.4
when LD_BIND_NOW is set.  This was broken by the addition of fdiml(),
which calls __isnanl().
2004-08-05 01:46:11 +00:00
David Schultz
8dc56b6821 Use isnormal() instead of fpclassify() to avoid dependency on libc.so.5. 2004-08-05 01:44:55 +00:00
Joe Marcus Clarke
5c7e7e80cc Fix Skinny and PPTP NAT'ing after the introduction of the {ip,tcp,udp}_next
functions.  Basically, the ip_next() function was used to get the PPTP and
Skinny headers when tcp_next() should have been used instead.  Symptoms of
this included a segfault in natd when trying to process a PPTP or Skinny
packet.

Approved by:	des
2004-08-04 15:17:08 +00:00
Hartmut Brandt
caf55ed6b5 Move libbsnmp.so to /lib so that it is available to atmconfig.
At the moment the only dependency on this library is bsnmpd.

Approved by:	silence on re@
2004-08-04 06:46:02 +00:00
Tim Kientzle
16918868d3 Correct the names and descriptions of the man pages. 2004-08-04 06:19:31 +00:00
Doug Rabson
0e1c7d0f08 Add stubs for TLS functions. These will be replaced at runtime by the
functional versions in rtld.
2004-08-03 08:54:01 +00:00
David Xu
4513fb36aa s/TMDF_DONOTRUNUSER/TMDF_SUSPEND/g
Dicussed with: deischen
2004-08-03 02:23:06 +00:00
Lukas Ertl
31359ff400 Typo in comment. 2004-08-02 19:57:37 +00:00
Lukas Ertl
3231ba13da Ignore geom_vinum providers. 2004-08-02 19:14:58 +00:00
Stefan Farfeleder
3103c94843 Remove an implicit int parameter by using prototypes. 2004-08-02 08:46:23 +00:00
Stefan Farfeleder
44a35598ff Don't pass function pointers via a void * parameter. 2004-08-02 08:18:43 +00:00
Tim Kientzle
da40bbb79e For the "portable" distribution, the configure script will overwrite
"Makefile," so I'm moving all the FreeBSD build machinery to
"Makefile.freebsd", with the default "Makefile" containing a single
include.
2004-08-01 19:30:56 +00:00
Tim Kientzle
b5fda35ca3 C standard does not permit empty initializer list.
Thanks to: Stefan Farfeleder
2004-08-01 19:02:49 +00:00
David Xu
447d36ec16 Add missing thread suspension/resumption code, fix a bug in pt_thr_sstep,
don't overwrite other debug flags.
2004-08-01 04:57:04 +00:00
David Xu
6cc695d3b2 Add code to implement register structure converter. 2004-08-01 02:08:39 +00:00
Gregory Neil Shapiro
f673db9f69 Reflect changes in sendmail 8.13 source tree 2004-08-01 01:16:59 +00:00
Warner Losh
9e749cc9c5 Expand the license referenced indirectly inline. 2004-07-31 18:49:53 +00:00
David Xu
aa087e0e12 Save context in kernel fashion, so it can be restored by
kse_switchin syscall.
2004-07-31 14:18:26 +00:00
David Xu
5f0d8cc327 Remove unused field. 2004-07-31 14:14:55 +00:00
David Xu
df6978352a Macro optimize, this increases context switch speed about 2% on my
athlon64 machine.
2004-07-31 01:53:21 +00:00
David Xu
d3c6a920f1 1. Use correct alignment mask, -15 != ~15
2. Make end of frames
2004-07-31 01:41:41 +00:00
Warner Losh
d68c1e59a8 Use #include <unistd.h> rather than the explicit externs in the
example.  The externs haven't been needed in about 10 years, so
there's no reason to have them other than for hysterical raisins.  And
the California Rasins haven't been around for a long time...
2004-07-31 01:00:50 +00:00
Mike Makonnen
0feabab576 o Assertions to catch that stuff that shouldn't happen is not happening.
o In the rwlock code: move a duplicated check inside an if..else to after
  the if...else clause.
o When initializing a static rwlock move the initialization check
  inside the lock.
o In thr_setschedparam.c: When breaking out of the trylock...retry if busy
  loop make sure to reset the mtx pointer to null if the mutex is nolonger
  in a queue.
2004-07-30 17:13:00 +00:00
Tim Kientzle
769756525d Conditionalize the bzip2/gzip compression/decompression
code on the existence of the relevant libraries (actually,
the existence of the include files).

This will allow the library to be easily ported to systems
that don't have these libraries.  (Of course, it also means
that clients using the library on such systems will not be
able to take advantage of the automatic compression format
detection.)
2004-07-30 04:14:47 +00:00
Tim J. Robbins
0db74aa4a9 Re-word the COMPATIBILITY section, taking care to use the word "deprecated"
to describe the 4.4BSD extension of accepting arguments outside the range
of unsigned char. This gives us freedom to remove this extension when we
remove the <rune.h> interface in FreeBSD 6.
2004-07-29 23:32:41 +00:00
Alexander Kabaev
132cc0756e Use newly added __used attribute to keep static function symbols from being
eliminated by compiler optimizer.
2004-07-29 18:07:08 +00:00
Scott Long
c893420ff0 Change a couple of comments so that GCC doesn't think that they contain
tri-graphs.
2004-07-29 15:35:45 +00:00
Tim J. Robbins
a351559479 Remove unnecessary #include directives. 2004-07-29 06:18:40 +00:00
Tim J. Robbins
a0998ce663 Prefer <runetype.h> to <rune.h>, since the latter is going away soon. 2004-07-29 06:16:19 +00:00
Tim J. Robbins
e214931fbf Remove useless checks for characters longer than INT_MAX bytes. 2004-07-29 06:08:31 +00:00
Tim J. Robbins
e9346e012d Add support for multibyte characters. 2004-07-29 03:48:52 +00:00
Tim J. Robbins
9a9aa3ffa1 Add a paragraph break in the STANDARDS section to improve readability. 2004-07-29 03:41:24 +00:00
Tim J. Robbins
9d88e27007 Add support for multibyte characters. 2004-07-29 03:13:10 +00:00
Tim J. Robbins
f825dd29c2 Document incorrect handling of multibyte characters due to limitations
of sh(1).
2004-07-28 15:43:33 +00:00
David Xu
0187c8ff4e Set fpu context flags to known values, zero is illegal. 2004-07-28 13:08:24 +00:00
Dag-Erling Smørgrav
7688459683 ANSIfy and constify; this now builds with GCC 3.4. 2004-07-28 11:56:03 +00:00
Alexander Kabaev
dd86691ec8 Work around known GCC 3.4.x problem and use ANSI prototype for dremf(). 2004-07-28 05:53:18 +00:00
Alexander Kabaev
2d18d113c7 Downgrade WARNS level for GCC 3.4.2. 2004-07-28 05:49:15 +00:00
Alexander Kabaev
511938318c Avoid casts as lvalues. 2004-07-28 05:44:52 +00:00
Alexander Kabaev
c2cc554bbe Downgrage WARNS level for GCC 3.4.x. 2004-07-28 05:44:07 +00:00
Alexander Kabaev
e1f91dbd18 Remove stale code protected by #ifdef sparc. GCC 3.4.x adds sparc to
predefined symbols on all SPARC platforms and FreeBSD follows the crowd.
2004-07-28 05:43:08 +00:00
Alexander Kabaev
698784bef7 s/round/fpround/ to avoid naming clash with GCC builtin function. 2004-07-28 05:41:05 +00:00
Tim J. Robbins
ea9a9a377b Add UTF-8-specific implementations of mbsnrtowcs() and wcsnrtombs().
These convert plain ASCII characters in-line, making them only slightly
slower than the single-byte ("NONE" encoding) version when processing
ASCII strings.
2004-07-27 06:29:48 +00:00
Philippe Charnier
30857323e0 Enclose .Fa fn with ``The ... function'' at the beginning of sentences. 2004-07-26 19:35:20 +00:00
Tim Kientzle
e791a7a913 When writing "pax" format, readers are supposed to ignore fields
in the regular ustar header that are overridden by the pax
extended attributes.  As a result, it makes perfect sense to
use numeric extensions in the regular ustar header so that readers
that don't understand pax extensions but do understand some other
extensions can still get useful information out of it.

This is especially important for filesizes, as the failure to
read a file size correctly can get the reader out of sync.

This commit introduces a "non-strict" option into the internal
function to format a ustar header.  In non-strict mode, the formatter
will use longer octal values (overwriting terminators) or binary
("base-256") values as needed to ensure that large file sizes,
negative mtimes, etc, have the correct values stored in the regular
ustar header.
2004-07-26 02:54:42 +00:00
Tim Kientzle
e5cdebc19e Allow "posix" as a synonym for "pax". (The gtar folks chose "posix",
which is really, really dumb and just going to cause confusion among
people who understand that "ustar" is also a POSIX standard tar format.)
2004-07-25 23:10:38 +00:00
Tim Kientzle
3dd77a04e5 We were forcing a pax extension header for files >= 1G. Set that
cutoff to >= 8G, as it should be.
2004-07-25 18:50:24 +00:00
Tim J. Robbins
16018100a7 Add an nftw(3) link. 2004-07-25 11:17:54 +00:00
Tim Kientzle
f5589ef9f4 Minor style nits. 2004-07-24 22:30:35 +00:00
Tim Kientzle
e6787adf79 Rework the feature-detection logic in archive_platform.h so that
it will work cleanly with autoconf.
2004-07-24 20:47:11 +00:00
Tim Kientzle
c02f123ff1 Define the PACKAGE_NAME and PACKAGE_VERSION macros. 2004-07-24 20:45:04 +00:00
Tim Kientzle
c91b82e3e5 Suppress a minor compiler warning if the platform doesn't support hi-res
timestamps.
2004-07-24 20:43:22 +00:00
Tim Kientzle
c48a83413a Add some functions to query basic facts about the library:
archive_version: Returns a text string, e.g., "libarchive 1.00.000"
   archive_api_version: Returns the SHLIB major version
   archive_api_feature: Returns a feature number useful for answering
     questions such as "Is this recent enough to do XXX?"

The last two also have macros defined in archive.h, so you can compare
the compile-time and run-time environments.  (In particular, you can
compare ARCHIVE_API_VERSION to archive_api_version() to detect library
version mismatches.)

With these in hand, it will soon be time to turn on the
shared-library version of libarchive...  stay tuned.
2004-07-24 20:08:26 +00:00
Tim Kientzle
73c891fe79 Use "linux" instead of "LINUX" to control Linux-specific code.
Thanks to: David O'Brien for pointing this out.

Also, add in a few additional portability tweaks and make a few
more things conditional on features (HAVE_XXXX macros) rather
than platform.
2004-07-24 17:50:05 +00:00
Tim Kientzle
45e13f191f Fix the handling of signed values when parsing base-256 header values.
In particular, this means we can now correctly read gtar archives that
contain timestamps prior to the start of the Epoch.

Also, make the code in this area more portable.  ANSI C99 headers are
not yet ubiquitous (for example, FreeBSD 4 still lacks them), so be
prepared for systems that don't have the INT64_MAX, INT64_MIN, and
UINT64_MAX macros.  This version still requires int64_t and uint64_t be
defined (which can be done in archive_platform.h if necessary), but
doesn't require them to be exactly 64 bits.
2004-07-24 17:46:45 +00:00
David Schultz
9b5f005228 Remove unused variable.
Noticed by:	Todd Miller <Todd.Miller@courtesan.com>
2004-07-23 06:01:00 +00:00
Tim J. Robbins
6740cd8374 Return the correct value when dst == NULL and conversion has stopped after
nwc dropping to zero.
2004-07-22 02:57:29 +00:00
Hajimu UMEMOTO
0def575fd7 now e.f.f.3.ip6.arpa is delegated, we no longer need to query ip6.int
Obtained from:	KAME
2004-07-21 17:26:40 +00:00
Tim J. Robbins
7d7287dc7d Read directly from the stdio buffer using the new __mbsnrtowcs() interface
instead of making repeated calls to __fgetwc().
2004-07-21 12:12:48 +00:00
Tim J. Robbins
1949a3470f Implement the GNU extensions of mbsnrtowcs() and wcsnrtombs(). These are
convenient when the source string isn't null-terminated.

Implement the other conversion functions (mbstowcs(), mbsrtowcs(), wcstombs(),
wcsrtombs()) in terms of these new functions.
2004-07-21 10:54:57 +00:00
Tim J. Robbins
2f2c1839f8 Use __wcsrtombs() and __sfvwrite() to convert and write the wide character
string instead of multiple calls to __fputwc().
2004-07-21 08:35:18 +00:00
Christian S.J. Peron
ef6dea1404 Back out previous commit. Even though statfs(2) can take a regular
file as an argument, it may still fail for the same reasons that
open(2) can.

Pointed out by:	Jilles Tjoelker
Apporived by:	bmilekic (mentor)
2004-07-20 19:30:57 +00:00
Christian S.J. Peron
5b154abc54 Remove reference to ENOTDIR in the documented errors
for statfs(2). This is false, if the pathname specified
is a regular file, then the information for the file
system that the file lives on will be returned.

Approved by:	bmilekic (mentor)
2004-07-20 18:35:33 +00:00
Tim J. Robbins
f9ceea9bf1 Call __mbrtowc() and __wcrtomb() directly instead of taking detours
through mbrtowc() and wcrtomb().
2004-07-20 08:27:27 +00:00
Andrew Gallatin
df11547f5d Fix printing of long doubles to match the size that
gcc is using.  This fixes devstat consumers (like vmstat, iostat,
systat) so they don't print crazy zillion digit numbers for
disk transfers and bandwidth.

According to gcc, long doubles are 64-bits, rather than 128 bits
like the SVR4 ABI spec wants them to be..  Note that MacOSX also treats
long doubles as 64-bits, and not 128 bits, so we are in good company.

Reviewed by: das
Approved by: grehan
2004-07-19 23:56:07 +00:00
Marcel Moolenaar
c465e9a1f0 prgregset_t changed type from being a typedef of struct reg to an
array of one element of type struct reg. Change the argument to
libc_r_md_getgregs() accordingly.
2004-07-19 16:54:52 +00:00
Peter Grehan
98707ef546 Enable libpthread build for powerpc 2004-07-19 12:20:10 +00:00
Peter Grehan
0f47890401 PPC MD bits for KSE. Runs test cases OK. Crippled to 1:1 mode for
the time being.
2004-07-19 12:19:04 +00:00
Peter Grehan
cc73b0f03d Add signalcontext, required by KSE. 2004-07-19 12:08:03 +00:00
Peter Grehan
44d1098779 The new program counter should go into the trapframe's srr0 and
not the link register, which was lucky enough to work.
2004-07-19 12:05:07 +00:00
Tim J. Robbins
2ff3ba336e Update paths to reg*.c and regex2.h. Add a target to build regex.h. 2004-07-19 08:48:17 +00:00
Tim J. Robbins
405033831e Update for removal of cclass.h. Trim some useless targets. Invoke mkh
with "sh mkh" so it works if the script is not executable.
2004-07-19 08:41:11 +00:00
Tim J. Robbins
ec8b0411f1 Update for recent changes to struct re_guts. Disable printing the contents
of OANYOF sets for the moment.
2004-07-19 08:28:53 +00:00
Tim J. Robbins
f420a25887 Remove unused files. 2004-07-19 08:24:21 +00:00
David Schultz
479f8d2214 Make FLT_ROUNDS correctly reflect the dynamic rounding mode. 2004-07-19 08:17:25 +00:00
David Schultz
ec79bc0da9 Fix two bugs in the signbit() macro, which was implemented last year:
- It was added to libc instead of libm.  Hopefully no programs rely
  on this mistake.

- It didn't work properly on large long doubles because its argument
  was converted to type double, resulting in undefined behavior.
2004-07-19 08:16:10 +00:00
David Schultz
39bcea8689 Replace seven nominally MD implementations of frexp() that are broken
for subnormals with one implementation that works.
2004-07-18 21:23:39 +00:00
Marcel Moolenaar
3475d7748a This library is not WARNS=2 clean for -O2 builds, because we include
headers from libpthread that are not WARNS=2 clean for -O2 builds.
Lower the WARNS level to 1. This is the highest level possible for
now.
2004-07-18 19:33:56 +00:00
Marcel Moolenaar
a7092d3091 Correct the mess I made by committing from the wrong tree. Most
notably, this restores some of the contents in thread_db.h as well
as David Xu's copyright notice. This also fixes the includes in
the MD libpthread files which Scott tried to provide a quick fix
for.

Pointy hat: marcel
2004-07-18 19:29:38 +00:00
Scott Long
7a76c247bd Try to fix ia64 and alpha compiles. I don't have either equipment fired
up now, but it appears to be the same problem and solution as sparc64.
2004-07-18 15:24:37 +00:00
Scott Long
4bfe920594 Add missing #includes so that this can compile. Obtained from the i386 version. 2004-07-18 15:20:03 +00:00
Tim J. Robbins
ad3d799334 Remove claim of conformance to IEEE Std. 1003.2. Replace it with a list
of features required by the standard that the current implementation
does not support.

PR:	57911 (related)
2004-07-18 10:11:27 +00:00
Tim J. Robbins
613e383e81 Remove claim of conformance to IEEE Std. 1003.2. Replace it with a list
of features required by the standard that the current implementation
does not support.

PR:	57911
2004-07-18 06:56:40 +00:00
Marcel Moolenaar
14d2874c32 Hook libthread_db into the build, except for arm and powerpc.
Porting libthread_db to arm and/or powerpc is easy enough, but
we don't build gdb on those platforms yet.
2004-07-18 04:36:22 +00:00
Marcel Moolenaar
7ea419c0cf Define _libthr_debug for use by libthread_db. 2004-07-18 04:23:30 +00:00
Marcel Moolenaar
3271031518 Don't include lock.h and pthread_md.h when we're being included by
libthread_db. Both headers are included seperately.
2004-07-18 04:22:01 +00:00
Marcel Moolenaar
3c1e38ea6e Add rudimentary support and stubs for libthr and libc_r on alpha, amd64,
i386, ia64 and sparc64. Add stubs for alpha, amd64, ia64 and sparc64 for
libpthread.

Restructure the source files to avoid unnecessary use of subdirectories
that also force us to use non-portable compilation flags to deal with
the uncommon compilation requirements (building archive libraries for
linkage into a shared library).

The libpthread support has been copied from the original local and
cleaned-up to make them WARNS=2 clean.
that also force us to use non-portable compilation flags to deal with
the uncommon compilation requirements (building archive libraries for
linkage into a shared library).

The libpthread support has been copied from the original local and
cleaned-up to make them WARNS=2 clean.

Tested on: amd64, i386, ia64
2004-07-18 04:17:15 +00:00
Marcel Moolenaar
27123635dd Add the const qualifier to the prgregset_t argument for the *setregs*
functions.
2004-07-17 17:09:12 +00:00
Stefan Farfeleder
9979bae3e7 Fix minor namespace pollution: The prototypes for f{dim,max,min}(),
nearbyint(), round() and trunc() shouldn't be visible when compiling with
-D_XOPEN_SOURCE=500.
2004-07-17 15:03:52 +00:00
Tim J. Robbins
ad19b09bec Fix typo: carat -> caret. 2004-07-17 12:27:25 +00:00
Hartmut Brandt
b711f5ddea Document the MSG_DONTWAIT flag. 2004-07-16 17:15:37 +00:00
David Schultz
205d3300b8 Tweak the conditions under which certain gcc builtins are used:
- Unlike the builtin relational operators, builtin floating-point
  constants were not available until gcc 3.3, so account for this.[1]

- Apparently some versions of the Intel C Compiler fallaciously define
  __GNUC__ without actually being compatible with the claimed gcc
  version.  Account for this, too.[2]

[1] Noticed by:		Christian Hiris <4711@chello.at>
[2] Submitted by:	Alexander Leidinger <Alexander@Leidinger.net>
2004-07-16 06:21:56 +00:00
Tim J. Robbins
2508f480c2 Add a cross reference to fgetwln(3). 2004-07-16 06:07:12 +00:00
Tim J. Robbins
9531ef0fc1 Add fgetwln(), a wide character version of fgetln(). 2004-07-16 06:06:09 +00:00
Tim J. Robbins
66d56cb7b8 Rename slbexpand() to __slbexpand() and make it available outside
of fgetln.c (non-static).
2004-07-16 05:52:51 +00:00
Alfred Perlstein
85e8765b7e Clarify getfsstat(2) usage.
The getfsstat(2) function expects a buffer and a count, and returns a count.

The confusing part is that the count it takes is a byte count, while the
return value is a count of the number of structures it has filled out.

Spell this out.
2004-07-16 01:18:13 +00:00
David Xu
a31a256002 Add my initial work of libthread_db. The library is used by gdb to debug
threaded process. Current, only libpthread is supported, but macrel will
work on it to support libthr and libc_r.
2004-07-15 03:36:35 +00:00
Tim Kientzle
6a1d1828e7 Style: rename 'mkdirpath' so it's clearer exactly what it does.
(To be precise, it creates the parent dir of the provided path.)
2004-07-15 03:13:27 +00:00
David Xu
dd094c943d Copy lwp id to thread mailbox. 2004-07-14 00:58:53 +00:00
David Xu
e378b41cb4 Call kse_switchin to switch context when being debugged. 2004-07-13 22:54:23 +00:00
David Xu
63db3fb215 Remove unused symbols. 2004-07-13 22:53:56 +00:00
David Xu
5c1a1421fe Export necessary symbols to debugger. 2004-07-13 22:52:53 +00:00
David Xu
c7f5b2dbc5 Let debugger check signal, make SIGINFO works. 2004-07-13 22:52:11 +00:00
David Xu
099e4630c1 If _libkse_debug is not zero, activate thread mode. 2004-07-13 22:51:03 +00:00
David Xu
566382df0a Add code to support thread debugging.
1. Add global varible _libkse_debug, debugger uses the varible to identify
   libpthread. when the varible is written to non-zero by debugger, libpthread
   will take some special action at context switch time, it will check
   TMDF_DOTRUNUSER flags, if a thread has the flags set by debugger, it won't
   be scheduled, when a thread leaves KSE critical region, thread checks
   the flag, if it was set, the thread relinquish CPU.

2. Add pq_first_debug to select a thread allowd to run by debugger.

3. Some names prefixed with _thr are renamed to _thread prefix.

which is allowed to run by debugger.
2004-07-13 22:49:58 +00:00
Tim J. Robbins
ee5d8a1b0a Remove an entry from the BUGS section: we have multibyte character
support now.
2004-07-12 11:03:42 +00:00
David Xu
a5dc4a8255 kse_switchin ABI was changed in kernel. 2004-07-12 07:41:01 +00:00
Tim J. Robbins
e5996857ad Make regular expression matching aware of multibyte characters. The general
idea is that we perform multibyte->wide character conversion while parsing
and compiling, then convert byte sequences to wide characters when they're
needed for comparison and stepping through the string during execution.

As with tr(1), the main complication is to efficiently represent sets of
characters in bracket expressions. The old bitmap representation is replaced
by a bitmap for the first 256 characters combined with a vector of individual
wide characters, a vector of character ranges (for [A-Z] etc.), and a vector
of character classes (for [[:alpha:]] etc.).

One other point of interest is that although the Boyer-Moore algorithm had
to be disabled in the general multibyte case, it is still enabled for UTF-8
because of its self-synchronizing nature. This greatly speeds up matching
by reducing the number of multibyte conversions that need to be done.
2004-07-12 07:35:59 +00:00
Tim J. Robbins
67aff1896c Add a new error code, REG_ILLSEQ, to indicate that a regular expression
contains an illegal multibyte character sequence.
2004-07-12 06:07:26 +00:00
Marcel Moolenaar
b41e0f0f56 Document the new PT_LWPINFO request. In fact, the request is so new
it hasn't even been implemented yet. I just wanted to be the first
to try a new approach to development ;-)
2004-07-12 04:43:58 +00:00
Tim Kientzle
47aa50e155 Update the README notes to include the current list of supported
formats and remove some outdated comments about library limitations.
2004-07-12 01:54:37 +00:00
Tim J. Robbins
80f363668e Remove incomplete support for multi-character collating elements. Remove
unused character category calculations.
2004-07-11 05:58:31 +00:00
Tim Kientzle
320adc42ea Correct a brain-o in extract_dir: mkdirpath() and mkdir(2) are
not interchangable.
2004-07-10 18:10:20 +00:00
Marcel Moolenaar
f5eda2f1cb Unbreak alpha: On alpha a long double is the same as a double and
consequently the exponent is only 11 bits. Testing whether the
exponent equals 32767 in that case only effects to compiler warnings
and thus build breakage.
2004-07-10 15:52:26 +00:00
Tim J. Robbins
550473de5b Add fast paths for conversion of plain ASCII characters. 2004-07-09 15:46:06 +00:00
Tim J. Robbins
fcc5191787 Slightly reorganize and simplify. 2004-07-09 15:12:10 +00:00
David Schultz
9fc5c45bad Remove the declaration of isnan() from this file. It is no longer
needed as of math.h v1.40, and its prototype is incorrect here.
2004-07-09 10:01:10 +00:00
David Schultz
ad93428d7a Bump document date for recent changes.
Prodded by:	ru
2004-07-09 06:37:44 +00:00
David Schultz
3bdf026534 Document these functions as being in libm, not libc. Some of them
*are* in libc for historical reasons, but programmers should not rely
on that fact.

Also remove a BUGS section that is not relevant here.
2004-07-09 03:33:00 +00:00
David Schultz
240dbabfa8 Implement the classification macros isfinite(), isinf(), isnan(), and
isnormal() the hard way, rather than relying on fpclassify().  This is
a lose in the sense that we need a total of 12 functions, but it is
necessary for binary compatibility because we have never bumped libm's
major version number.  In particular, isinf(), isnan(), and isnanf()
were BSD libc functions before they were C99 macros, so we can't
reimplement them in terms of fpclassify() without adding a dependency
on libc.so.5.  I have tried to arrange things so that programs that
could be compiled in FreeBSD 4.X will generate the same external
references when compiled in 5.X.  At the same time, the new macros
should remain C99-compliant.

The isinf() and isnan() functions remain in libc for historical
reasons; however, I have moved the functions that implement the macros
isfinite() and isnormal() to libm where they belong.  Moreover,
half a dozen MD versions of isinf() and isnan() have been replaced
with MI versions that work equally well.

Prodded by:	kris
2004-07-09 03:32:40 +00:00
David Schultz
b2d5d0b376 Define the following macros in terms of [gi]cc builtins when the
builtins are available: HUGE_VAL, HUGE_VALF, HUGE_VALL, INFINITY,
and NAN.  These macros now expand to floating-point constant
expressions rather than external references, as required by C99.
Other compilers will retain the historical behavior.  Note that
it is not possible say, e.g.
#define	HUGE_VAL	1.0e9999
because the above may result in diagnostics at translation time
and spurious exceptions at runtime.  Hence the need for compiler
support for these features.

Also use builtins to implement the macros isgreater(),
isgreaterequal(), isless(), islessequal(), islessgreater(),
and isunordered() when such builtins are available.
Although the old macros are correct, the builtin versions
are much faster, and they avoid double-expansion problems.
2004-07-09 03:31:09 +00:00
Garrett Wollman
5b1eaa7bb6 Eliminate some magic numbers and correct description of _PC_NO_TRUNC.
Slight emendation to _PC_CHOWN_RESTRICTED, which is in a very similar
boat.
2004-07-08 20:27:38 +00:00
Hartmut Brandt
aed56f6cad Add the new call control layer to the library and install the man page
for the service access point (SAP) stuff now that it is really available.
2004-07-08 17:09:55 +00:00
Tim J. Robbins
ee446de0b1 Add a function to iterate over all characters in a particular character
class. This is necessary in order to implement tr(1) efficiently in
multibyte locales, since the brute force method of finding all characters
in a class is infeasible with a 32-bit (or wider) wchar_t.
2004-07-08 06:43:37 +00:00
Tim Kientzle
cbf4203db5 I think this is my fourth complete rewrite of the dir-creation
code. <whew!> This version handles all of the following edge cases:
  * Restoring explicit dirs with 000 permissions (star fails this test)
  * Restore of implicit or explicit dirs when umask=777
    (gtar and star both fail this test)
  * Restoring dir paths containing "." and ".." components
This version initially creates all dirs with permission 700 (ignoring
umask), then does a post-extract "fixup" pass to set the correct
permissions (which may or may not depend on umask, depending on the
restore flags and whether it's an explicit or implicit dir).
Permissions are restored depth-first so that permissions within
non-writable dirs can be correctly restored. (The depth-sorting does
correctly account for dirs with ".." components.)
2004-07-08 05:24:48 +00:00
Maksim Yevmenkin
23d1e148af Make bluetooth compile on all platforms
Reviewed by:	imp, ru
2004-07-07 22:48:30 +00:00
Alfred Perlstein
83f46f9e33 there's no such define as KERN_NAME_MAX, change to _POSIX_NAME_MAX. 2004-07-07 20:47:42 +00:00
Ruslan Ermilov
fd13236829 Markup fixes. 2004-07-07 20:25:54 +00:00
Ruslan Ermilov
5792ef0983 Markup nits. 2004-07-07 20:15:31 +00:00
Ruslan Ermilov
1c5f1e7afd Fixed markup. 2004-07-07 20:11:35 +00:00
Ruslan Ermilov
2410103c1d mdoc(7) fixes. 2004-07-07 19:57:16 +00:00
Hiten Pandya
af73aa7cce Move the return value information about the getenv(3) library function
under the RETURN VALUES section so it is consistent with others.

Cleanup the return value text for getenv(3) a little while I am here.

PR:     	docs/58033
MFC after:	3 days
2004-07-06 23:21:36 +00:00
Andrey A. Chernov
42aeacc4d4 Keep it sync with OpenBSD:
An optional argument cannot start with '-', even if permutation is
disabled.

Obtained from: OpenBSD getopt_long.c v1.17
2004-07-06 13:58:45 +00:00
Dag-Erling Smørgrav
de47739e71 Push WARNS back up to 6, but define NO_WERROR; I want the warts out in the
open where people can see them and hopefully fix them.
2004-07-06 12:15:24 +00:00
Dag-Erling Smørgrav
9fa0fd2682 Introduce inline {ip,udp,tcp}_next() functions which take a pointer to an
{ip,udp,tcp} header and return a void * pointing to the payload (i.e. the
first byte past the end of the header and any required padding).  Use them
consistently throughout libalias to a) reduce code duplication, b) improve
code legibility, c) get rid of a bunch of alignment warnings.
2004-07-06 12:13:28 +00:00