Commit Graph

13934 Commits

Author SHA1 Message Date
Martin Matuska
38abb26b5a - Update libarchive to 2.8.4
- Add support for extracting xar and rpm archives
- Add libarchive_fe subdir (common code for tar and cpio)

Approved by:	kientzle
MFC after:	2 weeks
2011-07-17 21:27:38 +00:00
Dimitry Andric
17a519f92f Upgrade our copy of llvm/clang to r135360, from upstream's trunk. 2011-07-17 19:51:40 +00:00
Dimitry Andric
180abc3db9 Vendor import of clang trunk r135360:
http://llvm.org/svn/llvm-project/cfe/trunk@135360
2011-07-17 15:40:56 +00:00
Dimitry Andric
411bd29eea Vendor import of llvm trunk r135360:
http://llvm.org/svn/llvm-project/llvm/trunk@135360
2011-07-17 15:36:56 +00:00
Doug Barton
023343ae9a Fixes to make the WITH_BIND_LIBS option functional with BIND 9.8.x 2011-07-17 12:07:22 +00:00
Doug Barton
25630ba729 bmake and other updates necessary for the BIND 9.8.x upgrade.
This includes a structural change regarding atomic ops. Previously they
were enabled on all platforms unless we had knowledge that they did not
work. However both work performed by marius@ on sparc64 and the fact that
the 9.8.x branch is fussier in this area has demonstrated that this is
not a safe approach. So I've modified a patch provided by marius to
enable them for i386, amd64, and ia64 only.
2011-07-16 11:20:54 +00:00
Doug Barton
473038528a Vendor import of BIND 9.8.0-P4 2011-07-16 10:49:33 +00:00
Hans Petter Selasky
4eb5923d1a - Add two missing functions to the LibUSB v0.1 API.
- Clamp the string length to 255 bytes when getting
  the interface description.
- Clamp data request length to 65535 bytes when doing
  control requests.

MFC after:	3 days
2011-07-16 08:29:12 +00:00
Doug Barton
8e75ad45e6 Handle the MK_BIND_XML option more intelligently 2011-07-16 07:12:02 +00:00
Konstantin Belousov
134e789b67 Document RFTSIGZMB. Fix spelling of SIGCHLD. Note that signals are
delivered, not returned.

MFC after:	1 week
2011-07-12 20:38:42 +00:00
Sergey Kandaurov
813f118c6e Mention myself in the AUTHORS section.
Requested by:	stas
2011-07-12 19:48:21 +00:00
Sergey Kandaurov
c66ca7723b Provide a simple manual page for libprocstat(3).
Reviewed by:	jilles, gjb
2011-07-12 13:46:13 +00:00
Martin Matuska
e24134bc0e Update xz to git snapshot of v5.0 branch as of 20110711 (post-5.0.3)
For architectures with __NO_STRICT_ALIGNMENT
define TUKLIB_FAST_UNALIGNED_ACCESS

MFC after:	2 weeks
2011-07-11 14:15:27 +00:00
Jilles Tjoelker
9ea47cacda posix_spawn: If an error is detected in the child process, reap the zombie.
Formerly, in this case an error was returned but the pid was also returned
to the application, requiring the application to use unspecified behaviour
(the returned pid in error situations) to avoid zombies.

Now, reap the zombie and do not return the pid.

MFC after:	2 weeks
2011-07-10 14:20:11 +00:00
Tai-hwa Liang
f497fbf5e4 - Removing some unneeded definitions of NULL(cruft related to 1970's C).
In C90, NULL is guaranteed to be declared in <stddef.h> and also in
  <string.h>.  Though the correct way to define NULL in FreeBSD is to
  include <sys/_null.h>, other parts of libstand still require <string.h>
  to build; therefore, we keep <string.h> in stand.h and add a note about
  this;
- Removing no longer used 'Prototype' definition.  Quote from bde@:

	'Cruft related to getting incomplete struct declarations within
	prototypes forward-declared before the structs.  It doesn't mean
	"prototype" but only part of a prototype-related hack.  No longer
	used.'

- Replacing iaddr_t with uintptr_t;
- Removing use of long double to determine alignment.  Use a fixed 16 byte
  alignment instead;

Reviewed by:	bde
Obtained from:	DragonFlyBSD (partially)
MFC after:	1 month
2011-07-10 07:25:34 +00:00
Kevin Lo
5f099d0a7d style(9) cleanup 2011-07-10 07:14:32 +00:00
Kevin Lo
5c6d2a0100 Add a HISTORY section
Requested by:	arundel
2011-07-10 06:57:00 +00:00
Edward Tomasz Napierala
55f0bfbadc Add missing "swapuse" resource limit. 2011-07-09 08:42:23 +00:00
Kevin Lo
d98b6d6edd - Add xdr_sizeof(3) to libc
- Document xdr_sizeof(3); from NetBSD

Discussed with:	kib
2011-07-09 07:43:56 +00:00
Tai-hwa Liang
728fc2d633 Fixing building bustage on 32 bits platforms when WARNS >= 2. Note that
this fix only applies to zalloc.c, the other part of libstand such like
qdivrem.c still gives compilation warnings on sparc64 tinderbox builds;
therefore, WARNS level isn't changed for now.

Submitted by:	Garrett Cooper <yanegomi@gmail.com>
Reviewed by:	bde
2011-07-08 01:35:33 +00:00
Doug Barton
8579a19211 Vendor import of BIND 9.6-ESV-R4-P3 2011-07-05 19:37:48 +00:00
Attilio Rao
a2f4e284b0 Completely remove now unused pc_other_cpus, pc_cpumask.
Tested by:	pluknet
2011-07-04 10:45:54 +00:00
Attilio Rao
40a034576b MFC 2011-06-28 14:40:17 +00:00
Nathan Whitehorn
68a108e626 Build Scrt.o on powerpc64. Its introduction on other platforms got lost
during the period of time the powerpc64 port was on a project branch.
2011-06-27 16:24:36 +00:00
Colin Percival
02d98cd4da Rewrite HISTORY: The SHA256 code first appeared in 6.0, and the SHA512
code in 9.0; neither existed in FreeBSD 4.0.
2011-06-27 02:10:10 +00:00
Ed Schouten
1d9a9b79d0 Fix whitespace inconsistencies in libc in files copyrighted by me. 2011-06-26 18:27:17 +00:00
Sergey Kandaurov
76341556c9 Add missing libkvm and libutil dependencies.
Now libprocstat takes care of its own dependencies and does not
require applications to specify them.

Reviewed by:	stas, jilles
2011-06-25 11:21:23 +00:00
Hans Petter Selasky
2485d8a793 - Add two new API's to libusb20 which can be used to retrive information
about the parent USB device:
  - libusb20_dev_get_parent_address
  - libusb20_dev_get_parent_port

- Rename libusb20_compat01.c into libusb01.c

MFC after:	3 days
2011-06-24 11:14:09 +00:00
Craig Rodrigues
23a5bce73f Fixes to newer tftp code in libstand:
(1) Coding style changes.
 (2) If the server does not acknowledge any blocksize option,
     revert to the default blocksize of 512 bytes.
 (3) Send ACK if the first packet happens to be the last packet.
 (4) Do not accept blocksize greater than what was requested.
 (5) Drop any unwanted OACK received if a tftp transfer is already
     in progress.
 (6) Terminate incomplete transfers with a special no-error ERROR packet.
     Otherwise we rely on the tftp server to time out, which it does
     eventually, after re-sending the last packet several times and spamming
     the system log about it every time.  This idea is borrowed from the
     PXE client, which does exactly that.

Submitted by:  Alexander Kabaev <kan@FreeBSD.org>
Reviewed and Tested by: Santhanakrishnan Balraj <sbalraj at juniper dot net>
2011-06-24 03:50:54 +00:00
Marius Strobl
1e01d8915a Change sparc64 to use the initial exec TLS model, too. This avoids random
assertion failures in _malloc_thread_cleanup().
2011-06-21 19:15:23 +00:00
Steve Kargl
edfca01f71 In the libm access macros for the double type, z can sometimes
be used uninitialized.  This can lead to spurious exceptions
and bit clobbering.

Submitted by:	bde
Approved by:	das (mentor)
2011-06-19 17:07:58 +00:00
Alexander Kabaev
472d2173ba Put a quick bandaid on internal citrus locking.
The code is not quite right still, but it programs from deadlocking
on themselves if one enables new citrus code by mistake.
2011-06-19 13:35:46 +00:00
Alexander Kabaev
a805bbe21a Do not set thread name to less than informative 'initial thread'. 2011-06-19 13:35:36 +00:00
Jilles Tjoelker
279a233d0c libprocstat: For MAP_PRIVATE, do not consider the file open for writing.
If a file is mapped with with MAP_PRIVATE, no write permission is required
and changes do not end up in the file. Therefore, tools like fuser and fstat
should not show the file as open for writing.

The protection as displayed by procstat -v still includes write in this
case, and shows 'C' for copy-on-write.
2011-06-18 23:01:26 +00:00
Jilles Tjoelker
80905c3568 libprocstat: Fix typo in error messages. 2011-06-18 22:16:55 +00:00
Jilles Tjoelker
b0766d1fc5 libprocstat: Remove spaces between function name and open parenthesis. 2011-06-18 21:46:11 +00:00
Jilles Tjoelker
6586921454 libprocstat: Correct format for size_t (should be %zu, not %zd). 2011-06-18 21:29:25 +00:00
Ben Laurie
5f301949ef Fix clang warnings.
Approved by:	philip (mentor)
2011-06-18 13:56:33 +00:00
Marius Strobl
6ce2f878d3 Merge from r161730:
o  Set TP using inline assembly to avoid dead code elimination.
o  Eliminate _tcb.

Merge from r161840:
Stylize: avoid using a global register variable.

Merge from r157461:
Simplify _get_curthread() and _tcb_ctor because libc and rtld now
already allocate thread pointer space in tls block for initial thread.

Merge from r177853:
Replace function _umtx_op with _umtx_op_err, the later function directly
returns errno, because errno can be mucked by user's signal handler and
most of pthread api heavily depends on errno to be correct, this change
should improve stability of the thread library.

MFC after:	1 week
2011-06-18 11:07:09 +00:00
Michael Tuexen
bb3c45bf86 Document the latest changes to sctp_opt_info() in the code.
This makes sctp_opt_info() compiliant with the latest version
of the socket API ID.
2011-06-18 10:36:05 +00:00
David E. O'Brien
a57971c679 Note how wait(3) is implemented. 2011-06-18 00:53:51 +00:00
Xin LI
488d6e0c3d Sync with OpenBSD, primarily make the code easier to read, and a license
change to standard OpenBSD ISC license.

Obtained from:	OpenBSD
MFC after:	2 weeks
2011-06-18 00:33:34 +00:00
Xin LI
8e27b6e60f Sync with OpenBSD (zap rcsid).
MFC after:	2 weeks
2011-06-18 00:29:10 +00:00
Xin LI
25879947d6 The flags argument of mpool_get() is meaningful, document it.
MFC after:	2 weeks
2011-06-18 00:10:21 +00:00
Jilles Tjoelker
876b6796f3 posix_spawn(3): Document r222511 (trying to close already closed fd).
MFC after:	1 week
2011-06-17 21:16:27 +00:00
Michael Tuexen
bb2c20c1a8 Add SCTP_MAX_BURST support to sctp_opt_info().
This only applies to 9.0 and higher, since the type
of the values has changed since we introduced it.
So it can't be MFCed.
2011-06-17 07:06:42 +00:00
Michael Tuexen
13aae0bf1d Update the list of supported socket options for sctp_opt_info().
MFC after: 1 month.
2011-06-17 07:03:42 +00:00
Warner Losh
d996b98bea Setting warnings without make universe considered harmful. Revert to WARNS=0
until such time that the warnings at =2 are fixed for all platforms.
2011-06-16 18:00:27 +00:00
Michael Tuexen
c67a03f99a Fix two typos and remove redundant code.
MFC after: 1 month.
2011-06-16 17:30:50 +00:00
Michael Tuexen
0b064106dd * Fix the handling of addresses in sctp_sendv().
* Add support for SCTP_SENDV_NOINFO.
* Improve the error handling of sctp_sendv() and sctp_recv().

MFC after: 1 month
2011-06-16 15:36:09 +00:00
Tai-hwa Liang
c1434464b8 Using the correct format string(%zu) for size_t type. This should fix 64
bits builds.

Submitted by:	Garrett Cooper <yanegomi@gmail.com>
2011-06-16 15:35:12 +00:00
Tai-hwa Liang
72d8b2903f Unbreaking build on sparc64.
Submitted by:	Garrett Cooper <yanegomi@gmail.com>
2011-06-16 07:14:55 +00:00
David Xu
2575b4717b Use size of int to fetch sysctl kern.sched.cpusetsize because it had
switched from long to int type in kernel.

Fixed by: pluknet
2011-06-16 02:22:24 +00:00
Michael Tuexen
e2e7c62edc Add support for the newly added SCTP API.
In particular add support for:
* SCTP_SNDINFO, SCTP_PRINFO, SCTP_AUTHINFO, SCTP_DSTADDRV4, and
  SCTP_DSTADDRV6 cmsgs.
* SCTP_NXTINFO and SCTP_RCVINFO cmgs.
* SCTP_EVENT, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO and SCTP_DEFAULT_SNDINFO
  socket option.
* Special association ids (SCTP_FUTURE_ASSOC, ...)
* sctp_recvv() and sctp_sendv() functions.

MFC after: 1 month.
2011-06-15 23:50:27 +00:00
Craig Rodrigues
32ecdb308f Bring back following change which was undone in previous commit:
------------------------------------------------------------------------
    r172854 | marius | 2007-10-21 10:03:18 -0700 (Sun, 21 Oct 2007) | 16 lines
    Changed paths:
       M /head/lib/libstand/tftp.c

    - Given that we tell the compiler that struct ip is packed and 32-bit
      aligned, GCC 4.2.1 also generates code for sendudp() that assumes
      this alignment. GCC 4.2.1 however doesn't 32-bit align wbuf, causing
      the loader to crash due to an unaligned access of wbuf in sendudp()
      when netbooting sparc64. Solve this by specifying wbuf as packed and
      32-bit aligned, too. As for lastdata and readudp() this currently is
      no issue when compiled with GCC 4.2.1, though give lastdata the same
      treatment as wbuf for consistency and possibility of being affected
      in the future. [1]
    - Sprinkle const on a lookup table.
    ------------------------------------------------------------------------
2011-06-15 23:22:35 +00:00
Craig Rodrigues
3c33617643 Increase WARNS level to 2. 2011-06-15 22:15:28 +00:00
Craig Rodrigues
4c474d5c2f (1) When sending the TFTP RRQ packet to read a file,
send along the "blksize" option specified in RFC2348,
     and the "tsize" option specified in RFC2349.

     Add code to parse the TFTP Option Acknowledgement (OACK) packet as
     specified in RFC2347.

     For TFTP servers which support the "blksize" option, we can
     specify a TFTP Data block size larger than the default 512 bytes
     specified in RFC1350.  This offers greater read performance when
     downloading files.

     We request an initial size of 1428 bytes, which is less than the
     Ethernet MTU of 1500 bytes.  If the TFTP server sends back an OACK
     packet, then use the block size specified in the OACK packet.
     Most times it is usually the same value as what we request.
     If the TFTP server supports RFC2348, we will see performance improvements
     by transferring files over TFTP with larger block sizes.

     If we do not get back an OACK packet, then we most likely we
     are interoperating with a legacy TFTP server that does not
     support TFTP extension options, so default to the block size of
     512 bytes.

(2)  If the "tftp.blksize" environment variable is set, then
     take that value and use it when sending the TFTP RRQ packet,
     instead of 1428.  This allows us to set different values of
     "tftp.blksize" in the loader, so that we can test out different
     TFTP block sizes at run time.

Obtained from: Juniper Networks
Fixed by:  rodrigc
2011-06-15 22:13:22 +00:00
Craig Rodrigues
dc438c8ec8 Currently tftp code in the loader retransmits the previous packet if it receives any
unwanted packet(non-tftp). Change this to retransmit the packet(request or ack) only after
a timeout.

Obtained from:	Juniper Networks
Fixed by: Santhanakrishnan Balraj <sbalraj at juniper dot net>
2011-06-15 22:08:18 +00:00
Craig Rodrigues
6e4c6f18f7 Added sendrecv_tftp function instead of sendrecv for use by tftp.
In sendrecv_tftp:
    * Upon receving an unexpected block of data or error, resend the ACK
      immediately instead of waiting till the expiry of receive data timeout
      to resend the ACK.
    * change the receive timeout value between retries to be 2xMINTMO.

Obtained from: Juniper Networks
Fixed by: Santhanakrishnan Balraj <sbalraj at juniper dot net>
2011-06-15 22:04:14 +00:00
Craig Rodrigues
ee83fc0de0 In sendrecv function, change the receive timeout value between retries
to increase in steps of MINTMO, instead of doubling the timeout for every
retry.

Obtained from: Juniper Networks
Fixed by: Santhanakrishnan Balraj <sbalraj at juniper dot net>
2011-06-15 21:58:01 +00:00
Dimitry Andric
bd5abe1968 Upgrade our copy of llvm/clang to r132879, from upstream's trunk. 2011-06-12 18:01:31 +00:00
Dimitry Andric
29cafa66ad Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
2011-06-12 15:46:16 +00:00
Dimitry Andric
56fe8f1409 Vendor import of llvm trunk r132879:
http://llvm.org/svn/llvm-project/llvm/trunk@132879
2011-06-12 15:42:51 +00:00
Craig Rodrigues
78315071f5 Obtain bswap64() function implementation from
version 1.3 of src/common/lib/libc/gen/bswap64.c in NetBSD.

Obtained from: NetBSD
2011-06-10 01:13:15 +00:00
Attilio Rao
81c02539f1 MFC 2011-06-06 21:38:39 +00:00
Ed Schouten
48a16a34d8 Remove redundant assignments to WARNS.
For these directories, WARNS is already implied to be 6.
2011-06-06 20:24:17 +00:00
Attilio Rao
3bce356ea4 MFC 2011-06-04 22:05:20 +00:00
Ed Schouten
ef8821e5db Upgrade libcompiler_rt from revision 117047 to 132478.
It seems there have only been a small amount to the compiler-rt source
code in the mean time. I'd rather have the code in sync as much as
possible by the time we release 9.0. Changes:

- The libcompiler_rt library is now dual licensed under both the
  University of Illinois "BSD-Like" license and the MIT license.

- Our local modifications for using .hidden instead of .private_extern
  have been upstreamed, meaning our changes to lib/assembly.h can now be
  reverted.

- A possible endless recursion in __modsi3() has been fixed.

- Support for ARM EABI has been added, but it has no effect on FreeBSD
  (yet).

- The functions __udivmodsi4 and __divmodsi4 have been added.

Requested by:	many, including bf@ and Pedro Giffuni
2011-06-03 17:49:16 +00:00
Ed Schouten
b0a04aaa59 Import compiler-rt r132478. 2011-06-02 20:02:42 +00:00
Attilio Rao
3bf1ec3a9a MFC 2011-06-02 14:09:30 +00:00
Ulrich Spörlein
135bce2a9e mdoc: reorder sections consistently 2011-06-02 09:56:53 +00:00
Attilio Rao
1de471dfee Revert r222363, as bde@ pointed out the initial solution was far more
correct.
2011-05-31 20:59:53 +00:00
Attilio Rao
5b6ea0b538 MFC 2011-05-31 14:18:10 +00:00
Jilles Tjoelker
562b28821e posix_spawn(): Do not fail when trying to close an fd that is not open.
As noted in Austin Group issue #370 (an interpretation has been issued),
failing posix_spawn() because an fd specified with
posix_spawn_file_actions_addclose() is not open is unnecessarily harsh, and
there are existing implementations that do not fail posix_spawn() for this
reason.

Reviewed by:	ed
MFC after:	10 days
2011-05-30 21:41:06 +00:00
Steve Kargl
9aa461b570 Clean up the unneeded cpp macro INLINE_REM_PIO2L.
Reviewed by:	das
Approved by:	das (mentor)
2011-05-30 19:41:28 +00:00
Doug Barton
dcdfcb5422 Vendor import of BIND 9.6-ESV-R4-P1 2011-05-27 23:50:10 +00:00
Attilio Rao
9cb46334ee MFC 2011-05-27 16:09:10 +00:00
Attilio Rao
d361ed4b1c Style fix: cast to size_t rather than u_long when comparing to sizeof()
rets.

Requested by:	kib
2011-05-27 16:01:51 +00:00
Attilio Rao
d5880f9cdf In the near future cpuset_t objects in struct pcpu will be axed out, but
as long as this does not happen, we need to fix interfaces to userland
in order to not break run-time accesses to the structure.

Reviwed by:	kib
Tested by:	pluknet
2011-05-27 15:50:14 +00:00
Gabor Kovesdan
15a4dfe2a5 - Move some internal functions to the private namespace
Submitted by:	kan
Approved by:	delphij (mentor)
2011-05-27 10:40:34 +00:00
Attilio Rao
7fcdc9a26f MFC 2011-05-26 17:38:00 +00:00
Ruslan Ermilov
a6d11f7139 [mdoc] Fixed .Dt call. 2011-05-25 14:13:53 +00:00
Attilio Rao
8c4431d022 MFC 2011-05-22 20:41:10 +00:00
Dimitry Andric
02003216e8 On amd64, change clang's default triple to 'x86_64-unknown-freebsd9.0',
similar to what we do for binutils.  When clang's default triple starts
with 'amd64-', it does not pass a proper -target-cpu option to its
first stage.

This can lead to problems, for example when structs are memcpy'd, and
clang erroneously assumes they are 16-byte aligned.  It will then use
the 'movaps' SSE instruction to implement the copy, which results in a
bus error if the struct is really 8-byte aligned.

I encountered this issue when gcc's /usr/libexec/cc1 started crashing
with SIGBUS, after rebuilding world with clang ToT, but it also affects
the version of clang that we have in the tree.  We were just lucky until
now, apparently. :)
2011-05-22 16:32:44 +00:00
Attilio Rao
5f6b159db7 MFC 2011-05-18 16:01:29 +00:00
Sergey Kandaurov
d7b666ae97 Release allocated memory in procstat_close().
Reviewed by:	stass
2011-05-18 10:04:54 +00:00
Attilio Rao
fea3a3fa94 MFC 2011-05-17 22:03:01 +00:00
Jilles Tjoelker
7a18096cea mq_setattr(2): Add missing const to man page.
The declaration in the header file is correct.

MFC after:	1 week
2011-05-17 21:03:34 +00:00
Poul-Henning Kamp
cb315db598 Ok, so we use different comment conventions in Symbol.map and Version.def
"#notimpressed" as my twittering friends would say.
2011-05-17 19:20:32 +00:00
Florent Thoumie
2eb4b00cbb Backout libinstall.a -> libpkg commit.
Discussed with:	erwin, brooks, bapt
2011-05-17 19:11:47 +00:00
Poul-Henning Kamp
09eed402a2 Bump shlib version
Instigate symbol versioning
Pray that I don't break the build.
2011-05-17 17:37:58 +00:00
Attilio Rao
447274a88b MFC 2011-05-15 15:47:16 +00:00
Stanislav Sedov
72266aa3ba - Whitespace fix. 2011-05-15 00:46:25 +00:00
Stanislav Sedov
2f7e4c22b9 - Add symbol versioning to libprocstat.
Suggested by:	kib
2011-05-14 22:15:38 +00:00
Attilio Rao
e0c109e8c1 MFC 2011-05-14 02:28:26 +00:00
Attilio Rao
4b547324c0 Disconnect sun4v architecture from the three.
Some files keep the SUN4V tags as a code reference, for the future,
if any rewamped sun4v support wants to be added again.

Reviewed by:	marius
Tested by:	sbruno
Approved by:	re
2011-05-14 01:53:38 +00:00
Attilio Rao
b2aa562e7b MFC 2011-05-13 20:58:48 +00:00
Sergey Kandaurov
e2ea39cbdb Update sticky(7) cross references.
PR:		docs/124468
X-MFC with:	r218998
2011-05-13 16:29:57 +00:00
Attilio Rao
739e31f6d7 MFC 2011-05-13 15:20:57 +00:00
Dag-Erling Smørgrav
15b68c63bb Mark all socket and file descriptors close-on-exec.
PR:		bin/151866
MFC after:	3 weeks
2011-05-13 07:21:41 +00:00
Stanislav Sedov
59ea47d08d - Don't try to build NWFS support module if NCP/IPX is disabled in the build.
- Rename ZFS definition to LIBPROCSTAT_ZFS to be consistent with NWFS and to
  prevent possible collisions.

Reported by:	many
2011-05-12 22:21:39 +00:00
Dag-Erling Smørgrav
ee3cb0e502 Builds cleanly at the default WARNS level (WARNS=6). 2011-05-12 21:30:46 +00:00
Dag-Erling Smørgrav
eb9b80c30d Increase WARNS to 4. 2011-05-12 21:26:42 +00:00
Dag-Erling Smørgrav
c12c6e3cda Mechanical whitespace cleanup. 2011-05-12 21:18:55 +00:00
Dag-Erling Smørgrav
a42eecded0 Increase WARNS to 3. 2011-05-12 21:12:24 +00:00
Attilio Rao
ef607a6aa3 MFC 2011-05-12 14:01:40 +00:00
Stanislav Sedov
0daf62d9f5 - Commit work from libprocstat project. These patches add support for runtime
file and processes information retrieval from the running kernel via sysctl
  in the form of new library, libprocstat.  The library also supports KVM backend
  for analyzing memory crash dumps.  Both procstat(1) and fstat(1) utilities have
  been modified to take advantage of the library (as the bonus point the fstat(1)
  utility no longer need superuser privileges to operate), and the procstat(1)
  utility is now able to display information from memory dumps as well.

  The newly introduced fuser(1) utility also uses this library and able to operate
  via sysctl and kvm backends.

  The library is by no means complete (e.g. KVM backend is missing vnode name
  resolution routines, and there're no manpages for the library itself) so I
  plan to improve it further.  I'm commiting it so it will get wider exposure
  and review.

  We won't be able to MFC this work as it relies on changes in HEAD, which
  was introduced some time ago, that break kernel ABI.  OTOH we may be able
  to merge the library with KVM backend if we really need it there.

Discussed with:	rwatson
2011-05-12 10:11:39 +00:00
Attilio Rao
d40d5f64a2 Sync with -CURRENT 2011-05-10 18:01:53 +00:00
Attilio Rao
be720a4061 Fix a mismerge. 2011-05-08 14:45:53 +00:00
Attilio Rao
34e4a6f408 Revert MAXCPU introduction. In userland it is always 1.
Noted by:	marcel
2011-05-08 14:29:25 +00:00
Attilio Rao
b9f714be9f MFC 2011-05-07 23:34:14 +00:00
Kai Wang
b8331e4264 Document the behavior of elf_getdata() and elf_rawdata() with
zero-sized ELF sections.

Obtained from:	elftoolchain
2011-05-07 11:29:48 +00:00
Kai Wang
08a7f479dd For zero-sized sections, set the d_buf field of the Elf_Data
descriptor returned by `elf_rawdata()` to NULL.

Obtained from:	elftoolchain
2011-05-07 11:04:36 +00:00
David E. O'Brien
9b2a96cc04 Add the ability to search for all the inlined instances of a given function.
Reviewed by:	jb
Obtained from:	Juniper Networks
2011-05-07 01:05:31 +00:00
Attilio Rao
aa8b9e0706 MFC 2011-05-06 22:45:33 +00:00
Michael Tuexen
48f65f00fa * Update copyright notice.
* Cleanup usage of iov's.
* Add support for SCTP_TIMEOUTS socketoption.
* Fix a bug in sctp_recvmsg(): return the msg_flags in case of an error.
* Fix a bug in the error handling of sctp_peeloff(): return the -1.
2011-05-05 19:49:27 +00:00
David E. O'Brien
b928a692c2 Don't duplicate define the stdint types. 2011-05-05 14:45:24 +00:00
Attilio Rao
71a19bdc64 Commit the support for removing cpumask_t and replacing it directly with
cpuset_t objects.
That is going to offer the underlying support for a simple bump of
MAXCPU and then support for number of cpus > 32 (as it is today).

Right now, cpumask_t is an int, 32 bits on all our supported architecture.
cpumask_t on the other side is implemented as an array of longs, and
easilly extendible by definition.

The architectures touched by this commit are the following:
- amd64
- i386
- pc98
- arm
- ia64
- XEN

while the others are still missing.
Userland is believed to be fully converted with the changes contained
here.

Some technical notes:
- This commit may be considered an ABI nop for all the architectures
  different from amd64 and ia64 (and sparc64 in the future)
- per-cpu members, which are now converted to cpuset_t, needs to be
  accessed avoiding migration, because the size of cpuset_t should be
  considered unknown
- size of cpuset_t objects is different from kernel and userland (this is
  primirally done in order to leave some more space in userland to cope
  with KBI extensions). If you need to access kernel cpuset_t from the
  userland please refer to example in this patch on how to do that
  correctly (kgdb may be a good source, for example).
- Support for other architectures is going to be added soon
- Only MAXCPU for amd64 is bumped now

The patch has been tested by sbruno and Nicholas Esborn on opteron
4 x 12 pack CPUs. More testing on big SMP is expected to came soon.
pluknet tested the patch with his 8-ways on both amd64 and i386.

Tested by:	pluknet, sbruno, gianni, Nicholas Esborn
Reviewed by:	jeff, jhb, sbruno
2011-05-05 14:39:14 +00:00
Attilio Rao
a7a347967f MFC 2011-05-05 14:05:29 +00:00
David E. O'Brien
9980697a44 libarchive is mixing libmd and libcrypto -- correct to use one or the other.
[mixing the two can be quite bad -- they define the same context structures,
 but with differing structure members (and sizes)]

Update the hash function support comments, and update config_freebsd.h
to match.

Approved by:	kientzle
2011-05-05 01:16:06 +00:00
David E. O'Brien
ad45dd4174 s/shaN_crypt/crypt_shaN/g to be a more consistent with the existing naming.
Reviewed by:	markm
2011-05-05 01:09:42 +00:00
Attilio Rao
7505ef3a41 MFC 2011-05-04 15:45:23 +00:00
Xin LI
5b5140322d Fix prototype for ffsll(3) and fls(3).
PR:		docs/156796
Submitted by:	Jean-Yves Migeon <jeanyves.migeon free.fr>
MFC after:	3 days
2011-05-03 19:33:06 +00:00
Attilio Rao
94ebcddde3 MFC 2011-05-03 18:57:46 +00:00
Craig Rodrigues
51f95b0a42 Rename DEBUG macro to TFTP_DEBUG, to be more consistent with
debug macros in other files.
2011-05-03 07:46:02 +00:00
Craig Rodrigues
3eb882f031 - Comment out unused variable.
- Add parentheses around expression to eliminate compiler warning.
2011-05-03 07:43:47 +00:00
Craig Rodrigues
a259acefff Add #include <netinet/in_pcb.h> for missing forward declation of
struct inpcb.
2011-05-03 07:39:54 +00:00
Craig Rodrigues
74ff69fe44 Switch to ANSI function prototypes in a few places.
Get rid of some unused parameter warnings.
2011-05-03 04:44:50 +00:00
Attilio Rao
171c7d9bf6 MFC 2011-05-02 22:03:30 +00:00
Dimitry Andric
3b0f406639 Upgrade our copy of llvm/clang to r130700, from upstream's trunk. 2011-05-02 21:04:37 +00:00
Dimitry Andric
01af97d3b2 Vendor import of clang trunk r130700:
http://llvm.org/svn/llvm-project/cfe/trunk@130700
2011-05-02 19:39:53 +00:00
Dimitry Andric
6b943ff3a3 Vendor import of llvm trunk r130700:
http://llvm.org/svn/llvm-project/llvm/trunk@130700
2011-05-02 19:34:44 +00:00
Attilio Rao
1d221389b2 Remove the redefinition of MEMSTAT_MAXCPU and just use MAXCPU for that.
Reviewed by:	sbruno
2011-05-02 17:13:40 +00:00
Attilio Rao
77bdc950f4 MFC @ r221286 2011-05-01 00:48:03 +00:00
Steve Kargl
c273267e83 Improve the accuracy from a max ULP of ~2000 to max ULP < 0.79
on i386-class hardware for sinl and cosl.  The hand-rolled argument
reduction have been replaced by e_rem_pio2l() implementations.  To
preserve history the following commands have been executed:

svn cp src/e_rem_pio2.c ld80/e_rem_pio2l.h
mv ${HOME}/bde/ld80/e_rem_pio2l.c ld80/e_rem_pio2l.h

svn cp src/e_rem_pio2.c ld128/e_rem_pio2l.h
mv ${HOME}/bde/ld128/e_rem_pio2l.c ld128/e_rem_pio2l.h

The ld80 version has been tested by bde, das, and kargl over the
last few years (bde, das) and few months (kargl).  An older ld128
version was tested by das.  The committed version has only been
compiled tested via 'make universe'.

Approved by: das (mentor)
Obtained from: bde
2011-04-29 23:13:43 +00:00
David E. O'Brien
ce8679e47d Protect the reachover built symbols after the SHA256/512 crypt(3) addition. 2011-04-27 21:33:56 +00:00
Glen Barber
796b74169c - Clarification on kld_file_stat.size
- While here, remove a few C comments that don't seem to contribute
  anything additional to the man page.

PR:		146047
Submitted by:	arundel
MFC after:	3 days
2011-04-23 20:59:58 +00:00
Ryan Stone
aad93b043a r179417 introduced a bug into pthread_once(). Previously pthread_once()
used a global pthread_mutex_t for synchronization.  r179417 replaced that
with an implementation that directly used atomic instructions and thr_*
syscalls to synchronize callers to pthread_once.  However, calling
pthread_mutex_lock on the global mutex implicitly ensured that
_thr_check_init() had been called but with r179417 this was no longer
guaranteed.  This meant that if you were unlucky enough to have your first
call into libthr be a call to pthread_once(), you would segfault when
trying to access the pointer returned by _get_curthread().

The fix is to explicitly call _thr_check_init() from pthread_once().

Reviewed by:	davidxu
Approved by:	emaste (mentor)
MFC after:	1 week
2011-04-20 14:19:34 +00:00
Matthew D Fleming
d91f88f7f3 Add the posix_fallocate(2) syscall. The default implementation in
vop_stdallocate() is filesystem agnostic and will run as slow as a
read/write loop in userspace; however, it serves to correctly
implement the functionality for filesystems that do not implement a
VOP_ALLOCATE.

Note that __FreeBSD_version was already bumped today to 900036 for any
ports which would like to use this function.

Also reserve space in the syscall table for posix_fadvise(2).

Reviewed by:	-arch (previous version)
2011-04-18 16:32:22 +00:00
Jilles Tjoelker
3472288282 getfh(2): Add xrefs for fhopen(2), open(2), stat(2).
MFC after:	1 week
2011-04-14 22:06:11 +00:00
David E. O'Brien
189e4fad8a Add $FreeBSD$'s. 2011-04-14 15:42:15 +00:00
Sergey Kandaurov
603c2b9b9b Remove vestiges of disklabel(5).
Reviewed by:	uqs
MFC after:	5 days
2011-04-14 08:53:04 +00:00
Xin LI
7d14df1a2d Add support for IEE/IEC (and now also SI) power of two notions of
prefixes (Ki, Mi, Gi...) for humanize_number(3).

Note that applications has to pass HN_IEC_PREFIXES to use this
feature for backward compatibility reasons.

Reviewed by:	arundel
MFC after:	2 weeks
2011-04-12 22:48:03 +00:00
Rick Macklem
e2c83f74f4 Fix a bug in the userland rpc library, where it would use a
negative return value from write to update its position in
a buffer. The patch, courtesy of Andrey Simonenko, also simplifies
a conditional by removing the "i != cnt" clause, since it is
always true at this point in the code. The bug caused problems
for mountd, when it generated a large reply to an exports RPC
request.

Submitted by:	simon at comsys.ntu-kpi.kiev.ua
MFC after:	2 weeks
2011-04-10 14:11:07 +00:00
Mark Murray
a5c28e29e2 Document SHA256/512 modes.
MFC after:	1 month
2011-04-09 14:09:46 +00:00
Mark Murray
3d6f63c046 Add SHA256/512 ($5$ and $6$) to crypt(3). Used in linux-world, doesn't
hurt us.

PR:		misc/124164
Submitted by:	KIMURA Yasuhiro < yasu utahime org >
MFC after:	1 month
2011-04-09 14:02:04 +00:00
Mark Murray
3b50f6bf83 Add SHA512 (Actually, this is Colin Percival's code for SHA256, with
relevant constants changed).

While I'm here clean up the tests and Makefile.

PR:		misc/124164
Submitted by:	KIMURA Yasuhiro < yasu utahime org >
MFC after:	1 month
2011-04-09 13:56:29 +00:00
Edward Tomasz Napierala
181b4eebb9 Make it possible to use permission sets (full_set, modify_set, read_set
and write_set) with setfacl(1).

PR:		kern/154113
Submitted by:	Shawn Webb <lattera at gmail dot com> (earlier version)
MFC after:	1 month
2011-04-09 07:42:25 +00:00
Jilles Tjoelker
2973057493 Allow strerror(0) and strerror_r(0, ...).
Of course, strerror_r() may still fail with ERANGE.

Although the POSIX specification said this could fail with EINVAL and
doing this likely indicates invalid use of errno, most other
implementations permitted it, various POSIX testsuites require it to
work (matching the older sys_errlist array) and apparently some
applications depend on it.

PR:		standards/151316
MFC after:	1 week
2011-04-05 21:56:05 +00:00
David E. O'Brien
1e3f14466b * Add the readline(3) API to libedit. The libedit versions of
{readline,history}.h are in /usr/include/edit so as to not conflict with
  the GNU libreadline versions.  To use the libedit readline(3) one should
  add "-I/usr/include/edit" to their Makefile
  (spelled "-I${DESTDIR}/${INCLUDEDIR}/edit" within the FreeBSD source tree).

* Enable its use in the BSD licensed utilities that support readline(3).

* To make it easier to sync libedit development with NetBSD, histedit.h
  is moved into libedit's directory as history shows shown we keep merging
  it into that location.

Obtained from:	NetBSD
Sponsored by:	Juniper Networks
2011-04-05 18:41:01 +00:00