Commit Graph

13795 Commits

Author SHA1 Message Date
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
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
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