Commit Graph

12164 Commits

Author SHA1 Message Date
kib
f1194ec0c5 Remove doubtful structure definition with variable array members.
I believe this is not a valid C99 construct.  Use directly calculated
offsets into the supplied buffer, using specified members length,
to fill appropriate structure.

Either use sysctl, or copy the value of the UNAME_x environment
variable, instead of unconditionally doing sysctl, and then
overriding a returned value with user-specified one.

Noted and tested by:	rdivacky
2008-10-22 19:55:12 +00:00
des
d9ae813ea1 Move va_end() up 2008-10-21 12:10:30 +00:00
kientzle
24084253f7 If we don't know the file size, leave the file size unset.
If it's not a regular file, don't return any data, even if the size is unknown.

Update the Zip test with a hand-tweaked Zip archive that has a
directory (with length-at-end set), a regular file without
length-at-end set, and a regular file with length-at-end set and a bad
CRC.  Update the test code to verify that the file size is unset
for the regular file with length-at-end.

MFC after:	7 days
2008-10-21 05:08:35 +00:00
des
526ffc2acc Diff reduction against Varnish, including one important fix: use a shared
lock if the file is opened with O_RDONLY.
2008-10-20 18:11:30 +00:00
des
fd059e9b04 Reimplement flopen(3) using fcntl(2) locks instead of flock(2) locks. 2008-10-20 18:02:16 +00:00
des
9a22db9431 pidfile(3) uses flopen(3) - don't make any assumptions about how the
latter is implemented.
2008-10-20 18:00:11 +00:00
des
fef0e9dfaf There is no point in releasing a lock on a file which we've unlinked and
are about to close, so don't.  As a bonus, pidfile_remove(3) will now
work with an fcntl(2)-based flopen(3).
2008-10-20 17:41:08 +00:00
des
a7d94abf21 Since in_lt() and in_lts() are not static, assume that they are intended to
be part of the public API.  Accordingly, add prototypes and document them.
2008-10-20 17:17:58 +00:00
des
afd6f1dcd0 Additional style and whitespace fixes. 2008-10-20 17:09:50 +00:00
des
9dcafcf0a3 Style and whitespace 2008-10-20 17:07:50 +00:00
des
214f29e32b Unbreak 2008-10-20 17:04:57 +00:00
des
767e2b5352 Since setclasscpumask() is not static, assume that it is intended to be
part of the public API.  Accordingly, add a prototype and document it.
2008-10-20 17:03:05 +00:00
des
70afe705b8 Style and whitespace. 2008-10-20 16:54:53 +00:00
des
ab560b6812 Parenthesize return values. 2008-10-20 16:51:43 +00:00
des
acbcfa5fb2 include and whitespace cleanup. 2008-10-20 16:48:18 +00:00
delphij
4360de0fd4 - License change to a less restrictive one;
- ANSIfy;
 - Convert do {} while loop -> while {} for clarity;
 - Sync RCS ID with OpenBSD;

Obtained from:	OpenBSD
2008-10-19 10:11:35 +00:00
delphij
84a6bd24ee Further simplify the code.
Submitted by:	Christoph Mallon <christoph.mallon gmx.de>
2008-10-19 09:10:44 +00:00
kientzle
88da8906fe Add test to verify ACL restores on FreeBSD, verify kern/128203 (mtime
restore fails if ACL provided), apply patch from kern/128203, and verify fix.

PR:		kern/128203
Submitted by:	Udo Schweigert
MFC after:	3 days
2008-10-19 00:18:44 +00:00
kientzle
e2204b1f39 Style: Mark private data 'static', correct an old comment.
MFC after:	3 days
2008-10-19 00:13:57 +00:00
delphij
cae7e20d60 Use strlcpy() in !localized case to avoid the -1's. 2008-10-17 21:29:05 +00:00
delphij
767e2acdc7 Use strlcpy() when we mean it. 2008-10-17 21:21:14 +00:00
delphij
d3b188efba Reduce code duplication: use calloc() intead of malloc()
and memset afterward.
2008-10-17 20:11:28 +00:00
delphij
0c0113fdef _kvm_malloc allocates memory through calloc() which
returns zeroed memory, so don't redo the initialization.
2008-10-17 20:09:00 +00:00
netchild
34697cecc7 MTC r183949:
Allow to define MALLOC_PRODUCTION with a make variable instead of polluting
 the global CFLAGS.

Reviewed by:	jasone
2008-10-17 08:30:20 +00:00
raj
556a646598 Let libstand(3) build on ARM.
This is a pre-requisite for loader(8) + U-Boot support library on this arch.
2008-10-14 09:53:47 +00:00
jkoshy
62245b8648 - Sparsely number enumerations 'pmc_cputype' and 'pmc_event' in order to
reduce ABI disruptions when new cpu types and new PMC events are added
  in the future.
- Support alternate spellings for PMC events.  Derive the canonical
  spelling of an event name from its enumeration name in 'enum pmc_event'.
- Provide a way for users to disambiguate between identically named events
  supported by multiple classes of PMCs in a CPU.
- Change libpmc's machine-dependent event specifier parsing code to
  better support CPUs containing two or more classes of PMC resources.
2008-10-09 14:55:45 +00:00
jkoshy
b964421dc9 Correct a typo. 2008-10-06 10:34:44 +00:00
jkoshy
aa0d582606 - Add cross-references.
- Tweak -mdoc use.
2008-10-04 12:54:25 +00:00
jkoshy
61dadf8c5e Add cross-references. 2008-10-04 12:53:08 +00:00
jkoshy
8382297f14 Cross-reference new manual pages. 2008-10-04 12:44:05 +00:00
jkoshy
8bf9e82033 - Cross-reference new manual pages.
- Spell new PMC class names correctly.
2008-10-04 12:35:02 +00:00
jkoshy
d53aeb488c Add manual pages for performance measurement counters present in
Intel Atom(tm), Core(tm) and Core2(tm) CPUs.
2008-10-04 12:27:49 +00:00
ed
7ccb72cce6 Small cleanups to openpty().
- Pass O_NOCTTY to posix_openpt(2). This makes the implementation work
  consistently on implementations that make the PTY the controlling TTY
  by default.

- Call unlockpt() before opening the slave device. POSIX mentions that
  de slave device should only be opened after grantpt() and unlockpt()
  have been called.

- Replace some redundant code by a label.

In theory we could remove a lot of code from openpty() on FreeBSD
-CURRENT, because grantpt(), unlockpt() and revoke() are not needed in
our implementation. We'd better keep them there. This makes the code
still work with older FreeBSD releases and even makes it work on other
non-BSD operating systems.

I've compiled openpty() on Linux. You only need to remove the revoke()
call, because revoke() on Linux always returns -1. Apart from that, it
seems to work like it should.

Reviewed by:	jhb
2008-10-03 09:42:50 +00:00
jkoshy
e753484473 - Document event numbers associated with event names.
- Document an event that was missed out earlier.
- Sort event names alphabetically.
2008-10-02 08:53:06 +00:00
jkoshy
e775ff8588 - Document event numbers.
- Sort event names.
2008-10-02 06:37:33 +00:00
jkoshy
4ab86caef8 -mdoc tweaks. 2008-10-02 06:21:07 +00:00
jkoshy
ea821fb99b - Document event numbers.
- Correct misspellings of two event names.
2008-10-02 06:15:40 +00:00
jkoshy
7db8ef2245 Document event numbers alongside event names.
Requested by:		Arun Sharma <arun at sharma-home dot net>
2008-10-02 04:46:00 +00:00
kib
c725244bd2 Add unistd.h to the getosreldate(3) manpage.
Update referenced example to include unistd.h per manpage.
Update example to be more style(9)-ish, silence warnings and add
FreeBSD id to the source file.
2008-09-30 11:25:55 +00:00
kientzle
18256ca193 Verify high-res birthtime support on FreeBSD.
MFC after:	30 days
2008-09-30 04:13:21 +00:00
kientzle
1f6b640a75 MfP4: restore birth time data to disk + more thorough tests for
time restore to disk.

MFC after:	30 days
2008-09-30 04:02:36 +00:00
kientzle
c7ce068f95 MfP4: Store/read birthtime data in pax format.
Submitted by:	Pedro Giffuni
MFC after:	30 days
2008-09-30 03:57:07 +00:00
kientzle
6902e811f6 MfP4: Support for storing birthtime in archive_entry objects.
Submitted by:	Pedro Giffuni
MFC after:	30 days
2008-09-30 03:53:03 +00:00
jhb
5ccde8cd26 Support for CPU sets is going to appear in 7.1 before 8.0.
MFC after:	3 days
2008-09-29 15:44:48 +00:00
nwhitehorn
1a71eb5c50 Fix some ifdef logic in the libc syncicache() bit that I somehow missed in the
last commit. Now it really can use a runtime-set cacheline size.
2008-09-24 01:06:11 +00:00
nwhitehorn
2a5e536b9e Allow the cacheline size on PowerPC to be set at runtime. This is essential for
supporting 64-bit CPUs, which often have 128-byte cache lines instead of the
standard 32.
2008-09-24 00:28:46 +00:00
jkoshy
0d9d822db0 Document changes in behaviour due to sparse CPU numbering support. 2008-09-22 14:31:24 +00:00
sam
9c3d2ffcdf add new build knobs and jigger some existing controls to improve
control over the result of buildworld and installworld; this especially
helps packaging systems such as nanobsd

Reviewed by:	various (posted to arch)
MFC after:	1 month
2008-09-21 22:02:26 +00:00
rodrigc
fb5e3c1343 <osreldate.h> does not have a forward declration of getosreldate(), so
remove it from this man page.

MFC after:	3 days
2008-09-20 21:12:54 +00:00
emax
3776c76ac8 Move uuid_enc_le, uuid_dec_le, uuid_enc_be and uuid_dec_be symbols
into FBSD_1.1 section where they should be.

Pointed out by:	kib, deischen
MFC after:	3 days
2008-09-19 15:52:56 +00:00
jkoshy
2fad7e6a9b Keep symbols in sorted order. 2008-09-19 13:21:23 +00:00
jkoshy
27963af43f Improve grammar. 2008-09-18 10:20:35 +00:00
jkoshy
2eb96d23a7 Document new PMC classes, capabilities and CPU kinds.
Improve typography.
2008-09-18 10:16:54 +00:00
kientzle
46af6c4ecf MfP4: Generalize int64_t in the public headers to support compilers
which have a 64-bit integer type but don't provide standard C99 definitions.
2008-09-18 04:19:06 +00:00
kientzle
97219c55ce Trying to distinguish different "versions" of mtree files was a silly idea.
Submitted by:	Joerg Sonnenberger
2008-09-18 04:13:36 +00:00
jkoshy
8dda766e41 Whitespace fixes. 2008-09-17 04:13:14 +00:00
jkoshy
5dfb9467b3 Add event name aliases for Pentium PMCs. 2008-09-17 03:53:37 +00:00
jkoshy
1895a00fef Replace PMC-dependent content with references to
the appropriate manual pages.
2008-09-16 16:58:24 +00:00
jkoshy
8d1b22f6ed Build and install PMC-dependent manual pages. 2008-09-16 16:57:14 +00:00
jkoshy
deffb81337 Fix a typo. 2008-09-16 16:53:25 +00:00
jkoshy
9ec48f3bd4 Move PMC documentation to separate manual pages, one per PMC class. 2008-09-16 16:34:55 +00:00
jkoshy
253d17b642 Move TSC specific PMC information to its own manual page. 2008-09-16 16:29:41 +00:00
jkoshy
f145085b0d Correct an event name alias: event "k7-dc-misses" does not support
a unitmask.
2008-09-16 14:13:03 +00:00
emax
220bf33ae2 Add uuid_enc,dec_le,be() functions to Symbol.map
Pointy hat goes to me.

MFC after:	3 days
2008-09-15 23:54:55 +00:00
dfr
992112e8aa Fix async mode (required for ypbind in manycast mode). 2008-09-15 14:02:49 +00:00
marcel
ead754945e Allow psaddr_t to be widened by using thr_pread_{int,long,ptr},
where critical. Some places still use ps_pread/ps_pwrite directly,
but only need changed when byte-order comes into the picture.
Also, change th_p in td_event_msg_t from a pointer type to
psaddr_t, so that events also work when psaddr_t is widened.
2008-09-14 16:07:21 +00:00
kientzle
c575680569 Choose a flag-handling strategy based on platform capabilities
rather than on platform.
2008-09-14 05:51:25 +00:00
kientzle
f86ac1c574 Portability: Don't use symbolic constants when the values are more
standard than the names are.  Remove some trailing whitespace.
2008-09-12 05:33:00 +00:00
kientzle
ccdf5b420c Portability: Not everyone is lucky enough to have ftruncate() 2008-09-12 04:08:11 +00:00
kientzle
96223dee11 Portability: Support platforms that lack (struct stat).st_blksize or SSIZE_MAX
Of course, FreeBSD has both.
2008-09-12 04:03:34 +00:00
kientzle
93721eec26 Windows compatibility: The stub replacement for compression_program
(which always returns an error when invoked) needs its prototype.
2008-09-12 03:53:54 +00:00
jasone
f4190c00f8 Use PAGE_{SIZE,MASK,SHIFT} from machine/param.h rather than hard-coding
page size and using sysconf(3).

Suggested by:	marcel
2008-09-10 14:27:34 +00:00
jasone
c30fff5419 Move call to _malloc_thread_cleanup() so that if this is the last thread,
the call never happens.  This is necessary because malloc may be used
during exit handler processing.

Submitted by:	davidxu
2008-09-09 17:14:32 +00:00
dfr
73a287b491 Initialise the SVCAUTH field for new transport structures when they are
allocated instead of waiting for the first request. This fixes an issue with
rpcbind's support for PMAPPROC_CALLIT.

Reviewed by:	markm
2008-09-09 14:15:55 +00:00
ache
c6428874f2 Return two fixes from previous backout which does not require
review by secteam@ for the reasons mentioned below.

1) Rename /dev/urandom to /dev/random since urandom marked as
XXX Deprecated
alias in /sys/dev/random/randomdev.c
(this is our naming convention and no review by secteam@ required)

2) Set rs_stired flag after forced initialization to prevent
double stearing.
(this is already in OpenBSD, i.e. they don't have double stearing.
It means that this change matches their code path and no additional
secteam@ review required)

Submitted by:   Thorsten Glaser <tg@mirbsd.de> (2)
2008-09-09 09:46:36 +00:00
lulf
7646af6a7d - Update the libgeom manpage with a description of g_device_path and
g_providername utility functions.

Approved by:	kib (mentor)
2008-09-08 06:27:00 +00:00
kientzle
97fcc0ce31 Fix a type-aliasing problem in the libarchive test suite,
restore WARNS=6.
2008-09-08 00:58:12 +00:00
kientzle
76f6bbac93 Correct a leaking archive_entry in the test suite. 2008-09-07 23:59:27 +00:00
lulf
8c52b542c0 - Add a new ioctl for getting the provider name of a geom provider.
- Add a routine for looking up a device and checking if it is a valid geom
  provider given a partial or full path to its device node.

Reviewed by:	phk
Approved by:	pjd (mentor)
2008-09-07 13:54:57 +00:00
kientzle
f900007096 Correct the comments here.
PR:		bin/126849
MFC after:	3 days
2008-09-07 06:15:45 +00:00
kientzle
02ce672bbc When restoring a directory, allow symlinks to be followed. The full
logic here gets a little complex, but the net effect is that the
SECURE_SYMLINKS flag will prevent us from ever following a symlink.
Without it, we'll only follow symlinks to dirs.  bsdtar specifies
SECURE_SYMLINKS by default, suppresses it for -P.

I've also beefed up the write_disk_secure test to verify this
behavior.

PR:		bin/126849
2008-09-07 05:22:33 +00:00
marcel
af87cdf28e Unbreak ia64: pges are 8KB. 2008-09-06 05:26:31 +00:00
keramida
8ba042b0de Add two example regexps: (1) one for matching all the characters
that belong in a character class, and (2) one for matching all
the characters *not* in a character class.

Submitted by:	Mark B, mkbucc at gmail.com
MFC after:	3 days
2008-09-05 17:41:20 +00:00
kientzle
ae483162bf The link resolver now unsets the size to mark a hardlink
with no body instead of setting it to zero.
2008-09-05 06:15:25 +00:00
kientzle
5290cd20ad MfP4: Handle entries with unset size properly: Regular files with
unspecified size are "unlimited" (required by Zip reader, which
sometimes does not know the uncompressed size of an entry until it
gets to the end).  Also, hardlinks with unspecified (or zero) size do
not overwrite the data on disk nor do they set metadata.  This is
compatible with GNU tar and NetBSD pax behavior.
2008-09-05 06:13:11 +00:00
kientzle
88514167fd MfP4: Use the set/unset tracking to determine when mtime or atime
is unavailable.  Use start_time as a substitute when one is missing;
if both are missing, skip the call to {f,l,}utime{s,}() entirely.
2008-09-05 05:55:49 +00:00
dfr
ae590ad889 Fix an off-by-one error in the replay detection logic. 2008-09-04 14:54:22 +00:00
raj
62315f0783 Eliminate __alpha__ leftover from libstand. 2008-09-04 10:05:44 +00:00
kientzle
5cd175eaac Markup fix.
MFC after:	3 days
2008-09-04 05:22:00 +00:00
dougb
595c959724 Update for version 9.4.2-P2 2008-09-01 22:55:23 +00:00
kientzle
da7b4a0824 Style: Use ARCHIVE_VERSION_NUMBER to conditionalize tests on
the particular libarchive version being tested instead of the
deprecated ARCHIVE_API_VERSION and ARCHIVE_VERSION_STAMP macros.
2008-09-01 05:38:33 +00:00
kientzle
3b54160eff MfP4: set/unset tracking for atime, ctime, mtime, and size fields.
This generalizes the existing set/unset tracking for hardlink/symlink
fields and extends it to cover non-string fields.  Eventually, this
will be further extended to cover most fields.

In particular, this is needed to correctly detect when time fields
are missing (for example, reading ustar archives doesn't set atime or
ctime) for proper time restore and is helpful when trying to determine
whether to overwrite data when restoring hardlinks.

This commit updates the tests but not the docs.
2008-09-01 04:54:29 +00:00
kientzle
12d7b9e21b Sort the list of format names. 2008-09-01 02:50:53 +00:00
kientzle
7711ed1cf5 Use the "start_time" (time at which the restore process began)
to fill in a missing atime instead of substituting mtime.

PR:		bin/124915
2008-09-01 02:50:24 +00:00
kientzle
fe3cf0e14f New mtree writer, thanks to Joerg Sonnenberger.
Obtained from:	Joerg Sonnenberger
2008-08-31 07:21:46 +00:00
kientzle
ede0c9fe5c Joerg Sonnenberger's improvements to the shar writer.
Significant performance improvements, better quoting of file names, etc.
2008-08-31 07:10:40 +00:00
kientzle
a3fa470b0f Make libarchive_test a little smarter about trying to find
its reference files when you don't specify -r.  It now checks
a couple of likely nearby directories to see if any of them
have a particular known file.
2008-08-31 07:06:02 +00:00
kientzle
558a49e6d8 When atime wasn't specified, it should get set == mtime.
This is much stronger than just asserting that it's not zero.
2008-08-30 05:31:23 +00:00
obrien
30759f2655 Add the needed libpthread_md.c for MIPS.
Obtained from:	Juniper Networks
2008-08-28 15:41:12 +00:00
pjd
fb7f3b6363 Add links to all libpcap functions. 2008-08-28 11:48:49 +00:00
kientzle
76addb3012 If no atime was specified (for example, when extracting from ustar
archives), set atime == mtime.  Before this, atime would get restored
to 0.
2008-08-28 06:40:22 +00:00
obrien
49dcd989d3 Add the needed _setjmp.S for MIPS.
Obtained from:	Juniper Networks
2008-08-27 17:58:51 +00:00
jasone
a734052e9c Add thread-specific caching for small size classes, based on magazines.
This caching allows for completely lock-free allocation/deallocation in the
steady state, at the expense of likely increased memory use and
fragmentation.

Reduce the default number of arenas to 2*ncpus, since thread-specific
caching typically reduces arena contention.

Modify size class spacing to include ranges of 2^n-spaced, quantum-spaced,
cacheline-spaced, and subpage-spaced size classes.  The advantages are:
fewer size classes, reduced false cacheline sharing, and reduced internal
fragmentation for allocations that are slightly over 512, 1024, etc.

Increase RUN_MAX_SMALL, in order to limit fragmentation for the
subpage-spaced size classes.

Add a size-->bin lookup table for small sizes to simplify translating sizes
to size classes.  Include a hard-coded constant table that is used unless
custom size class spacing is specified at run time.

Add the ability to disable tiny size classes at compile time via
MALLOC_TINY.
2008-08-27 02:00:53 +00:00
kib
05dac85e4b Implement WNOWAIT flag for wait4(2). It specifies that process whose status
is returned shall be kept in the waitable state.
Add WSTOPPED as an alias for WUNTRACED.

Submitted by:	Jukka Ukkonen <jau at iki fi>
PR:	standards/116221
MFC after:	2 weeks
2008-08-26 12:37:16 +00:00
kib
2d990eae05 When calculating arguments to the interpreter for the shebang script
executed by fexecve(2), imgp->args->fname is NULL. Moreover, there is
no way to recover the path to the script being executed.
Do what some other U*ixes do unconditionally, namely supply /dev/fd/n
as the script path when called from fexecve(). Document requirement of
having fdescfs mounted as caveat.
2008-08-26 10:53:32 +00:00
kientzle
f8ec8301f6 Alphabetize the list of tests. 2008-08-25 06:08:22 +00:00
kientzle
0563028aef Update the total archive byte counters when writing entries to disk using
archive_write_disk.
Update cpio to use this to emit block counts in -p mode.
Update cpio tests to verify these block counts.
2008-08-24 06:21:00 +00:00
kientzle
5f09367fca Remove the stillborn attempt to cleanup tests as well as the build dir. 2008-08-24 05:54:28 +00:00
kientzle
1f8b9faf14 Fail copying path/.. only if SECURE_NODOTDOT was specified.
Since we already warn for any '..' elements in that case,
the extra "lastdotdot" tracking turns out to be unnecessary.

PR:		bin/124924
2008-08-24 05:42:22 +00:00
kientzle
ad89b2721b Fix the cpio bug tested for by r182092 of usr.bin/cpio/test.
Since various 'find' incantations can emit container directories
in various orders, we cannot refuse to update a dir because it's
apparently the same age.

MFC after:	3 days
2008-08-24 05:01:01 +00:00
kib
958ba94773 Add -fno-omit-frame-pointer to CFLAGS used to compile crt1.c on amd64.
For gcc' __builtin_frame_address() to work, all call frames need to save
frame pointer. In particular, this is important for the upper frame that
should terminate the chain.

No objections from:	jhb
PR:	amd64/126543
MFC after:	1 week
2008-08-22 09:23:39 +00:00
jhb
50652bcc22 Add a "CACHING" section regarding the internal caching of kernel variables
and the ability to clear that cache.
2008-08-21 19:22:13 +00:00
ed
f827c5e9cb Remove grantpt.c, which should have been deleted in the MPSAFE TTY commit.
The routines in grantpt.c have been moved to ptsname.c in the MPSAFE TTY
layer, because grantpt() is now effectively a no-op. I forgot to remove
the corresponding source file from libc.
2008-08-20 09:43:46 +00:00
ed
cc3116a938 Integrate the new MPSAFE TTY layer to the FreeBSD operating system.
The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:

- Improved driver model:

  The old TTY layer has a driver model that is not abstract enough to
  make it friendly to use. A good example is the output path, where the
  device drivers directly access the output buffers. This means that an
  in-kernel PPP implementation must always convert network buffers into
  TTY buffers.

  If a PPP implementation would be built on top of the new TTY layer
  (still needs a hooks layer, though), it would allow the PPP
  implementation to directly hand the data to the TTY driver.

- Improved hotplugging:

  With the old TTY layer, it isn't entirely safe to destroy TTY's from
  the system. This implementation has a two-step destructing design,
  where the driver first abandons the TTY. After all threads have left
  the TTY, the TTY layer calls a routine in the driver, which can be
  used to free resources (unit numbers, etc).

  The pts(4) driver also implements this feature, which means
  posix_openpt() will now return PTY's that are created on the fly.

- Improved performance:

  One of the major improvements is the per-TTY mutex, which is expected
  to improve scalability when compared to the old Giant locking.
  Another change is the unbuffered copying to userspace, which is both
  used on TTY device nodes and PTY masters.

Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.

Obtained from:		//depot/projects/mpsafetty/...
Approved by:		philip (ex-mentor)
Discussed:		on the lists, at BSDCan, at the DevSummit
Sponsored by:		Snow B.V., the Netherlands
dcons(4) fixed by:	kan
2008-08-20 08:31:58 +00:00
jhb
67b02c52de Add a new routine kvm_getcptime(3) for fetching the equivalent of
'kern.cp_time'.  For a live kernel it uses the sysctl.  For a crashdump,
it first checks to see if the kernel has a 'cp_time' global symbol.  If
it does, it uses that.  If that doesn't work, when it uses the recently
added kvm_getmaxcpu(3) and kvm_getpcpu(3) routines to walk all the CPUs
and sum up their counters.

MFC after:	1 week
2008-08-19 21:30:36 +00:00
jhb
78678aa46b Add two new routines to libkvm for working with per-CPU data:
kvm_getmaxcpu() and kvm_getpcpu().

MFC after:	1 week
2008-08-19 19:55:33 +00:00
kmacy
925bfa4378 atomic_fetchadd_int works on unsigned quantities - change
sigev_generation to be unsigned

MFC after:	1 month
2008-08-15 21:08:48 +00:00
emax
35aef144ac Import the uuid_enc_le(), uuid_dec_le(), uuid_enc_be() and
uuid_dec_be() functions. These routines are not part of the
DCE RPC API. They are provided for convenience.

Reviewed by:	marcel
Obtained from:	NetBSD
MFC after:	1 week
2008-08-14 22:23:16 +00:00
jasone
463ec8e02d Move CPU_SPINWAIT into the innermost spin loop, in order to allow faster
preemption while busy-waiting.

Submitted by:	Mike Schuster <schuster@adobe.com>
2008-08-14 17:31:42 +00:00
jasone
db987f53e4 Re-order the terms of an expression in arena_run_reg_dalloc() to correctly
detect whether the integer division table is large enough to handle the
divisor.  Before this change, the last two table elements were never used,
thus causing the slow path to be used for those divisors.
2008-08-14 17:03:29 +00:00
emax
4474d60a02 Import handy shorthand Bluetooth address (BD_ADDR) utility functions
from NetBSD and document them.

Obtained from:	NetBSD
MFC after:	1 week
2008-08-13 19:35:31 +00:00
ed
c392c35035 Change bpf(4) to use the cdevpriv API.
Right now the bpf(4) driver uses the cloning API to generate /dev/bpf%u.
When an application such as tcpdump needs a BPF, it opens /dev/bpf0,
/dev/bpf1, etc. until it opens the first available device node. We used
this approach, because our devfs implementation didn't allow
per-descriptor data.

Now that we can, make it use devfs_get_cdevpriv() to obtain the private
data. To remain compatible with the existing implementation, add a
symlink from /dev/bpf0 to /dev/bpf. I've already changed libpcap to
compile with HAVE_CLONING_BPF, which makes it use /dev/bpf. There may be
other applications in the base system (dhclient) that use the loop to
obtain a valid bpf.

Discussed on:	src-committers
Approved by:	csjp
2008-08-13 15:41:21 +00:00
marcel
54448b6186 Change the type of ti_traceme from a char to an int as its
address is passed to ps_pread for reading sizeof(int) bytes.
2008-08-13 00:03:35 +00:00
kientzle
0e0fb66ac7 Fix up test suite so it works again with the libarchive 1.x API.
In particular, FreeBSD 6 still uses the libarchive 1.x API and
this correction will permit MFCing new libarchive features back
to FreeBSD 6.
2008-08-11 01:19:36 +00:00
kientzle
aa6984275e Correct test_tar_large so it works correctly with the libarchive 1.x API. 2008-08-10 21:14:26 +00:00
kientzle
55e9379b97 Explain why two apparently-identical archive_read_data() calls
really should have different return values.
2008-08-10 03:13:42 +00:00
kientzle
58af11b815 MfP4: Joerg Sonnenberger's fixes to make 'ar' and 'pax' writers
robust against multiple calls to their destroy() functions.
2008-08-10 02:06:28 +00:00
des
c2c1c946ae Add sbuf_new_auto as a shortcut for the very common case of creating a
completely dynamic sbuf.

Obtained from:	Varnish
MFC after:	2 weeks
2008-08-09 11:14:05 +00:00
delphij
67cdccd740 Add prototype defination for setfib(2) to sys/socket.h. 2008-08-08 22:40:04 +00:00
cperciva
0b041e8f96 Remove variables which are assigned values and never used thereafter.
Found by:	LLVM/Clang Static Checker
Approved by:	jasone
2008-08-08 20:42:42 +00:00
das
9bb760c809 Remove some unused variables.
Reported by:	Intel C Compiler
2008-08-08 00:21:27 +00:00
das
ff948bbd69 In the line
#pragma STDC CX_LIMITED_RANGE   ON
the "ON" needs to be in caps. gcc doesn't understand this pragma
anyway and assumes it is always on in any case, but icc supports
it and cares about the case.
2008-08-08 00:15:16 +00:00
das
ec47be13ee Implement cproj{,f,l}(). 2008-08-07 15:07:48 +00:00
das
1a05561e34 Use cpack() and the gcc extension __imag__ to implement cimag() and
conj() instead of using expressions like z * I. The latter is bad for
several reasons:

1. It is implemented using arithmetic, which is unnecessary, and can
   generate floating point exceptions, contrary to the requirements on
   these functions.

2. gcc implements complex multiplication using a formula that breaks
   down for infinities, e.g., it gives INFINITY * I == nan + inf I.
2008-08-07 14:39:56 +00:00
dfr
e3e7adc95f Fix ia64 build. 2008-08-06 17:11:12 +00:00
dfr
eff18f23e9 Fix 64bt build. 2008-08-06 15:33:00 +00:00
dfr
ea3d7030c0 Add an implementation of the RPCSEC_GSS authentication protocol for RPC. This
is based on an old implementation from the University of Michigan with lots of
changes and fixes by me and the addition of a Solaris-compatible API.

Sponsored by:	Isilon Systems
Reviewed by:	alfred
2008-08-06 14:02:05 +00:00
marcel
57f1d21802 Cleanup for WARNS 6. 2008-08-06 03:14:18 +00:00
trhodes
4f7a011af7 Add EPERM to the ERRORS section.
PR:		125746
2008-08-04 22:22:17 +00:00
cperciva
5b18df3c73 Initialize "nconv" to a reasonable value in all code paths. Prior to
this commit, sprintf("%s", "") could fail depending on what happened
to be on the stack.

Found by:	LLVM/Clang Static Checker
2008-08-04 06:55:42 +00:00
cperciva
f33a169622 Set "max" to a reasonable value if BLOCKSIZE has a bogus unit. Prior
to this commit, "env BLOCKSIZE=4X df" prints not only "4X: unknown
blocksize" as expected, but sometimes also "maximum blocksize is 1G"
and "minimum blocksize is 512" depending on what happened to be on
the stack.

Found by:	LLVM/Clang Static Checker
2008-08-04 06:53:13 +00:00
cperciva
45f0d08992 Mark functions as __dead2 in order to help the LLVM static checker
understand which code paths aren't possible.

This commit eliminates 117 false positive bug reports of the form
"allocate memory; error out if pointer is NULL; use pointer".
2008-08-04 01:25:48 +00:00
scf
d2bab1788d Restructure and use different variables in the tests that involve
environ[0] to be more obvious that environ is not NULL before environ[0]
is tested.  Although I believe the previous code worked, this change
improves code maintainability.

Reviewed by:	ache
MFC after:	3 days
2008-08-03 22:47:23 +00:00
trhodes
79ec5bdbfe Add EAGAIN to the ERRORS list, as found in kern_jail.c.
PR:		125253
Submitted by:	Mateusz Guzik <mjguzik@gmail.com> (original version)
2008-08-03 21:56:58 +00:00
ache
3fa9cc2a95 Restored from previous backing out (because that is OpenBSD way, so
assumed to be reviewd by them):
Stir directly from the kernel PRNG, without taking less random pid & time
bytes too (when it is possible).

The difference with OpenBSD code is that they have KERN_ARND sysctl for
that task, while we need to read /dev/random
2008-08-03 20:15:22 +00:00
das
d95c118b83 Fix some style bogosity from fdlibm. 2008-08-03 17:49:05 +00:00
das
e570127faf Minor improvements:
- Improve the order of some tests.
- Fix style.

Submitted by:	bde
2008-08-03 17:39:54 +00:00
das
9df7b1ac5c A few minor corrections, including some from bde:
- When y/x is huge, it's faster and more accurate to return pi/2
  instead of pi - pi/2.
- There's no need for 3 lines of bit fiddling to compute -z.
- Fix a comment.
2008-08-02 19:17:00 +00:00
remko
dd6ada0389 remove whitespace bug (8 spaces into one tab)
Submitted by:	ed
2008-08-02 13:49:12 +00:00
das
70fb465112 Teach fmtcheck() about wint_t, intmax_t, char *, intmax_t *, and
wide string arguments.

Also simplify the code that handles length modifiers and make it
more conservative. For instance, be explicit about the modifiers
allowed for %d, rather than assuming that anything other than L,
q, t, or z implies an int argument.
2008-08-02 06:02:42 +00:00