Commit Graph

13934 Commits

Author SHA1 Message Date
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
Sergey Kandaurov
1046090f1f Do not increment num_args if strsep(3) returned an empty field.
That fixes devstat_buildmatch(3) crashes with certain strings.

Reported by:	arundel
MFC after:	2 weeks
2011-04-04 09:25:27 +00:00
Konstantin Belousov
05f2ecd1fa Fix mdoc errors.
Submitted by:	ru
MFC after:	3 days
2011-04-01 19:57:27 +00:00
Edward Tomasz Napierala
4f8c32aa62 Expose the rctl(2) API in libc. 2011-03-30 18:08:31 +00:00
Sergey Kandaurov
af47829540 Use FD_CLOEXEC explicitly.
MFC after:	3 days
2011-03-30 14:15:18 +00:00
Pawel Jakub Dawidek
6d0d40f668 Don't calculate len too early. 2011-03-26 07:17:24 +00:00
Pawel Jakub Dawidek
32981eb31b Follow style(9) in example code and handle opendir(3) error. 2011-03-26 07:15:57 +00:00
Konstantin Belousov
bdadacaf66 Document O_CLOEXEC.
Reviewed by:	jhb
MFC after:	1 week
2011-03-25 14:01:18 +00:00
Sergey Kandaurov
c6b2aa689a Add missing resource limits:
- RLIMIT_NPTS
- RLIMIT_SWAP

MFC after:	1 week
2011-03-24 16:06:57 +00:00
Xin LI
a699e14f45 humanize_number(3) multiply the input number by 100, which could cause an
integer overflow when the input is very large (for example, 100 Pi would
become about 10 Ei which exceeded signed int64_t).

Solve this issue by splitting the division into two parts and avoid the
multiplication.

PR:		bin/146205
Reviewed by:	arundel
MFC after:	1 month
2011-03-23 22:08:01 +00:00
Edward Tomasz Napierala
cdec385674 Move the code around so that libc behaviour does not depend on a variable
that was supposed to be kernel-only.  There should be no functional changes.
2011-03-22 17:44:07 +00:00
Glen Barber
5f2e9efbf9 s/buffer/buf as is used in the code.
Submitted by:	arundel (via doc@)
MFC after:	3 days
2011-03-21 23:59:20 +00:00
Jilles Tjoelker
2908f971d7 index(3): Mention that index/rindex are deprecated and not specified by
POSIX.1-2008.

MFC after:	1 week
2011-03-20 20:53:55 +00:00
Ed Schouten
f170b6928b Import compiler-rt r127823.
Changes:

- License change; now it's also dual licensed under the MIT licence.
- Addition of divmodsi4 and udivmodsi4.
2011-03-17 19:47:28 +00:00
Marcel Moolenaar
3166a207c5 When building libc with the syscall compatibility, don't also generate the
syscall assembly files. This results in conflicting dependencies and can
cause unexpected results for parallel builds. This is because the .c file
and the .S file both generate the same .o file.

Submitted by:	Simon Gerraty <sjg@juniper.net>
Sponsored by:	Juniper Networks
2011-03-17 04:40:37 +00:00
Marcel Moolenaar
a8d044f390 Don't add sigwait.c to MISRCS here when sigwait.c lives under ../sys and
it's already added to SRCS there.
2011-03-17 04:30:43 +00:00
Pawel Jakub Dawidek
681ff708cf From fts.c comment:
The "FTS_NOSTAT" option can avoid a lot of calls to stat(2) if it knows that a
directory could not possibly have subdirectories. This is decided by looking at
the link count: a subdirectory would increment its parent's link count by
virtue of its own ".." entry.  This assumption only holds for UFS-like
filesystems that implement links and directories this way, so we must punt for
others.

It looks like ZFS is a UFS-like file system, as the above also holds for ZFS.
Add ZFS to the list of file systems that allow for such optimization.

MFC after:	1 month
2011-03-16 08:58:09 +00:00
Jilles Tjoelker
dd888c677b rfork(2): Discourage rfork_thread-like approaches.
Calling rfork_thread(3) does not interoperate with pthreads and global state
is not properly protected.

Remove the BUGS section suggesting LinuxThreads entirely. With the current
pthread library libthr, all threads are kernel-level entities so there seems
little reason to use LinuxThreads.
2011-03-15 23:51:47 +00:00
Steve Kargl
1cd0ec03d6 Take two. Add the missing file that should have been committed
with r219571 and re-enable building of cbrtl.

Implement the long double version for the cube root function, cbrtl.
The algorithm uses Newton's iterations with a crude estimate of the
cube root to converge to a result.

Reviewed by:    bde
Approved by:    das
2011-03-12 19:37:35 +00:00
Steve Kargl
44bc6ce420 Temporary disable the building of cbrtl until I
can determine why svn will not allow one to commit
a new file.

Approved by:	das (implicit)
2011-03-12 17:03:41 +00:00
Steve Kargl
dfe5233b59 Implement the long double version for the cube root function, cbrtl.
The algorithm uses Newton's iterations with a crude estimate of the
cube root to converge to a result.

Reviewed by:	bde
Approved by:	das
2011-03-12 16:50:39 +00:00
Robert Watson
792892ee17 Move cap_enter(2) and cap_getmode(2) symbols from FBSD_1.1 to FBSD_1.2.
Suggested by:	kib
Obtained from:	Capsicum Project
Sponsored by:	Google
MFC after:	3 months
2011-03-12 12:10:17 +00:00
Dag-Erling Smørgrav
864cac079f Mention the name of the module in warning messages. 2011-03-12 11:26:37 +00:00
Dag-Erling Smørgrav
e84da6fb39 Add "ruser" and "luser" options. The former corresponds to the current
behavior, where the module checks that the supplicant is a member of the
required group.  The latter checks the target user instead.  If neither
option was specified, pam_group(8) assumes "ruser" and issues a warning.
I intend to eventually change the default to "luser" to match the
behavior of similarly-named service modules in other operating systems.

MFC after:	1 month
2011-03-12 11:12:30 +00:00
Marius Strobl
77ccab511d Now that TLS generally is available on sparc64 since r219534 turn on
support for it. Note that while sparc64 also supports the static TLS
model and thus tls_model("initial-exec"), using the default model
turned out to yield slightly better buildstone performance.
2011-03-11 21:35:38 +00:00
Dag-Erling Smørgrav
8e391be103 No newline required.
MFC after:	2 weeks
2011-03-09 14:38:00 +00:00
Ryan Stone
f88f24de4d Correct a typo in the malloc(3) manpage. Malloc options are set in the
MALLOC_OPTIONS environment variable, not JEMALLOC_OPTIONS.

Reviewed by:	jasone
Approved by:	emaste (mentor)
2011-03-07 15:19:17 +00:00
David Schultz
d132715684 Add cexp() to the complex(3) manpage. Thanks to bde for pointing out
that I missed this.
2011-03-07 08:54:20 +00:00
David Schultz
d76098d531 Remove part of an uncommitted change that snuck into the last commit. 2011-03-07 08:46:14 +00:00
David Schultz
97a539be1f Convert log10f() to use __kernel_log(), which is more accurate and simpler. 2011-03-07 03:12:08 +00:00
David Schultz
acda0929b2 Convert log10() to use __kernel_log(), which is more accurate and simpler. 2011-03-07 03:11:27 +00:00
David Schultz
f3732b5aaa Add cexp() and cexpf().
Reviewed by:	bde (earlier version)
2011-03-07 03:09:24 +00:00
Pawel Jakub Dawidek
a9cf49ab39 Because we call __printf_out() with a on-stack buffer, also call
__printf_flush() so we are sure it won't be referenced after we return.

MFC after:	2 weeks
2011-03-06 19:47:46 +00:00
Pawel Jakub Dawidek
fdf6b12d1c expand_number() needs uint64_t, declare it here if not already declared.
MFC after:	3 days
2011-03-06 17:46:06 +00:00
Pawel Jakub Dawidek
f03ca7241b Fix various issues in how %#T is handled:
- If precision is 0, don't print period followed by no digits.
- If precision is 0 stop printing units as soon as possible
  (eg. if we have three years and five days and precision is 0
   print only 3y5d).
- If precision is not 0, print all units (eg. 3y0d0h0m0s.00).

MFC after:	2 weeks
2011-03-06 17:43:32 +00:00
Edward Tomasz Napierala
ffa5101067 Mention setloginclass(2) in login_class(3). 2011-03-06 08:56:44 +00:00
Edward Tomasz Napierala
8ce58daf17 Move getloginclass(2) and setloginclass(2) to FBSD_1.2, where they should've
been added in the first place.
2011-03-06 08:55:36 +00:00
Edward Tomasz Napierala
e057276a4e Add FBSD_1.2; syscalls added in 9-CURRENT are supposed to go there.
Suggested by:	kib
2011-03-06 08:52:59 +00:00
Edward Tomasz Napierala
7369a541f7 Add manual page for getloginclass(2) and setloginclass(2). 2011-03-06 08:35:50 +00:00
Edward Tomasz Napierala
2bfc50bc4f Add two new system calls, setloginclass(2) and getloginclass(2). This makes
it possible for the kernel to track login class the process is assigned to,
which is required for RCTL.  This change also make setusercontext(3) call
setloginclass(2) and makes it possible to retrieve current login class using
id(1).

Reviewed by:	kib (as part of a larger patch)
2011-03-05 12:40:35 +00:00
Edward Tomasz Napierala
e43af6d3b6 Make acl_strip_np(3) use new trivial ACL format for NFSv4 ACls (three
entries instead of six).  This makes "setfacl -b" do the right thing
for ACLs on ZFS.  UFS recognizes both kinds of trivial ACLs; no change
there.

MFC after:	2 months
2011-03-04 17:23:10 +00:00
Robert Watson
d2deca0335 Make cap_new(2) and cap_getmode(2) symbols from libc public so applications
can link against them.  Add man pages for the new system calls, with one
errant forward reference to changes not yet present in FreeBSD, but soon
will be.

Reviewed by:	anderson
Obtained from:	Capsicum Project
Sponsored by:	Google, Inc.
Discussed with:	benl, kris, pjd
MFC after:	3 months
2011-03-03 11:31:08 +00:00
Robert Watson
31cd487f40 Add description of ECAPMODE to errno(2) man page.
Discussed with: anderson
Obtained from:  Capsicum Project
Sponsored by:   Google, Inc.
MFC after:      3 months
2011-03-03 11:29:48 +00:00
Robert Watson
b70ad7a80d Add text string for ECAPMODE to libc.
Discussed with:	anderson
Obtained from:	Capsicum Project
Sponsored by:	Google, Inc.
MFC after:	3 months
2011-03-03 11:28:57 +00:00
Ulrich Spörlein
c9bb895ec8 Fix some duplicate-word typos in manpages.
Submitted by:	arundel
MFC after:	1 week
2011-03-02 21:59:53 +00:00
Dimitry Andric
6882fd36bf Put in a temporary workaround for ctfmerge hanging on processing
kernel.debug (or possibly other files), when WITH_CTF is active.

This is caused by a bug in clang's integrated assembler, causing malloc
to sometimes hang during initialization in statically linked executables
that use threading, such as the copy of ctfmerge that is built during
the bootstrap stage of buildworld.  The bug has been submitted upstream:

  http://llvm.org/bugs/show_bug.cgi?id=9352

Note that you might have to rebuild and install libc first, to get your
kernel build to finish, because the ctfmerge binary built during
bootstrap is linked with your base system's copy of libc.a, which might
already contain a bad copy of malloc.o.
2011-03-01 17:15:44 +00:00
Rebecca Cran
ac095af538 Remove duplicate "in".
Suggested by:	Rob Farmer <rfarmer at predatorlabs.net>
MFC after:	3 days
2011-03-01 11:47:51 +00:00
Hans Petter Selasky
892f48069d - Add missing MLINKS for libusb and some manpage fixes.
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-02-28 18:53:06 +00:00
Hans Petter Selasky
1c49736857 - Add support for software pre-scaling of ISOCHRONOUS transfers.
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-02-28 17:23:15 +00:00
Rebecca Cran
b633aa9451 Revert some of r177626. "in in" is valid in certain sentences.
PR:		121490
MFC after:	3 days
2011-02-28 10:03:48 +00:00
Dimitry Andric
dd6029ff3a Update llvm/clang to trunk r126547.
There are several bugfixes in this update, but the most important one is
to ensure __start_ and __stop_ symbols for linker sets and kernel module
metadata are always emitted in object files:

  http://llvm.org/bugs/show_bug.cgi?id=9292

Before this fix, if you compiled kernel modules with clang, they would
not be properly processed by kldxref, and if they had any dependencies,
the kernel would fail to load those.  Another problem occurred when
attempting to mount a tmpfs filesystem, which would result in 'operation
not supported by device'.
2011-02-27 01:32:10 +00:00
Dimitry Andric
86b360ada3 Instead of defining LLVM_MULTITHREADED as 0 or 1, define or undefine it,
and test appropriately.  Otherwise it might erroneously pick up some
pthread primitives, and fail to link.
2011-02-27 00:02:48 +00:00
Dimitry Andric
45cc80a79c Update llvm's config.h files to match more closely what is generated by
a regular autoconf-based build.  More cosmetic than functional changes.
2011-02-26 23:12:36 +00:00
Dimitry Andric
c3b054d250 Vendor import of clang trunk r126547:
http://llvm.org/svn/llvm-project/cfe/trunk@126547
2011-02-26 22:09:03 +00:00
Dimitry Andric
d0e4e96dc1 Vendor import of llvm trunk r126547:
http://llvm.org/svn/llvm-project/llvm/trunk@126547
2011-02-26 22:03:50 +00:00
Ed Schouten
339f34e3a0 Fix style(9) issues in pututxline(3).
Also, make sure to initialize the `ret' variable properly.

Reported by:	Cedric Jonas <cedric c84 eu>
Patch by:	Garrett Cooper <yanegomi gmail com>
2011-02-25 23:05:35 +00:00
Gabor Kovesdan
ad30f8e79b Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.

This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:

- Some utilities have been added. There is a conversion table generator,
  which can compare conversion tables to reference data generated by
  GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
  and cleaned up, now it is easy to read and it is also easier to add
  support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
  transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
  now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
  iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
  GNU version, i.e. sources should build with base iconv.h and
  GNU libiconv. It also includes a macro magic to deal with the
  char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
  encoding in use
- Various cleanups and style(9) fixes.

Approved by:	delphij (mentor)
Obtained from:	The NetBSD Project
Sponsored by:	Google Summer of Code 2009
2011-02-25 00:04:39 +00:00
Sergey Kandaurov
7ec9c8d170 Remove sysctl vm.max_proc_mmap used to protect from KVA space exhaustion.
As it was pointed out by Alan Cox, that no longer serves its purpose with
the modern UMA allocator compared to the old one used in 4.x days.

The removal of sysctl eliminates max_proc_mmap type overflow leading to
the broken mmap(2) seen with large amount of physical memory on arches
with factually unbound KVA space (such as amd64).  It was found that
slightly less than 256GB of physmem was enough to trigger the overflow.

Reviewed by:	alc, kib
Approved by:	avg (mentor)
MFC after:	2 months
2011-02-24 09:22:56 +00:00
Dimitry Andric
ceed9a6cf9 Fix the 32-bit build stage on amd64 when WITH_CTF is enabled. It seems
ctfconvert will corrupt object files that are compiled with -g, if it is
not run with -g itself.

To fix it, remove -g from CFLAGS in lib/librt/Makefile.  If you need to
compile this library with debug info, use DEBUG_FLAGS=-g instead, which
will work correctly, even when using WITH_CTF.
2011-02-23 21:17:38 +00:00
Jayachandran C.
ba8d74d95f Fix bzero() for 64-bit.
The existing implementation of bzero incorrectly clears bytes when the
start address is not word aligned. Fix it by using REG_SHI macro which
works on both 32 and 64 bit.

Submitted by:	Artem Belevich (fbsdlist at src cx)
2011-02-22 07:49:51 +00:00
Rebecca Cran
6bccea7c2b Fix typos - remove duplicate "the".
PR:	bin/154928
Submitted by:	Eitan Adler <lists at eitanadler.com>
MFC after: 	3 days
2011-02-21 09:01:34 +00:00
Dimitry Andric
2754fe609d Upgrade our copy of llvm/clang to r126079, from upstream's trunk.
This contains many improvements, primarily better C++ support, an
integrated assembler for x86 and support for -pg.
2011-02-20 19:33:47 +00:00
Dimitry Andric
bca07a4524 Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
2011-02-20 13:06:31 +00:00
Dimitry Andric
cf099d1121 Vendor import of llvm trunk r126079:
http://llvm.org/svn/llvm-project/llvm/trunk@126079
2011-02-20 12:57:14 +00:00
Murray Stokely
11725f2142 Add complex(3) manual page documenting our partial support for C99
complex arithmetic in libm.

Reviewed by:	David Schultz <das@FreeBSD.org>
MFC after:	2 weeks
2011-02-20 05:29:00 +00:00
Ed Schouten
b30bfd4339 Add a utility, utxrm(8).
Most of the ports I broke when I imported utmpx, were simple management
utilities for the utmp database, allowing you to add/remove entries
manually.

Add a small tool called utxrm(8), which allows you to remove an entry
from the utmpx database by hand. This is useful when a login daemon
crashes or fails to remove the entry during shutdown.
2011-02-19 11:44:04 +00:00
Ed Schouten
1ae6a21db9 Properly styleify utmpx code and document error codes in man page.
Submitted by:	Garrett Cooper
2011-02-19 11:31:56 +00:00
Nathan Whitehorn
79c77d726e Turn off default generation of userland dot symbols on powerpc64 now that
we have a binutils that supports it. Kernel dot symbols remain on to assist
DDB.
2011-02-18 21:44:53 +00:00
Dimitry Andric
152e60f2fe Fix some leftover binaries and shared libraries in the system that still
have an executable stack, due to linking in hand-assembled .S or .s
files, that have no .GNU-stack sections:

RWX --- ---  /lib/libcrypto.so.6
RWX --- ---  /lib/libmd.so.5
RWX --- ---  /lib/libz.so.6
RWX --- ---  /lib/libzpool.so.2
RWX --- ---  /usr/lib/liblzma.so.5

These were found using scanelf, from the sysutils/pax-utils port.

Reviewed by:	kib
2011-02-15 22:03:09 +00:00
Ed Schouten
ed65ee524d Don't forget to bump man page date for r218711. 2011-02-15 20:07:35 +00:00
Ed Schouten
b6c3206f30 Remove dead reference to regexp(3). Use regex(3) instead.
PR:		docs/149950
Submitted by:	arundel@
2011-02-15 20:04:13 +00:00
Rebecca Cran
dcdb209924 Document some more sysconf(3) variables.
MFC after:	1 month
2011-02-13 17:43:56 +00:00
Konstantin Belousov
49e51fb02c Replace ERROR() macro with inline function. In-tree gcc cannot tolerate
the construct like printf("%\s", NULL) resulting from macroexpand of
ERROR(u, NULL), making it impossible to use LIBUFS_DEBUGGING.

With inline function, compiler cannot detect the NULL argument to
known function and does not try to convert it into puts().

In collaboration with:	pho
2011-02-12 12:46:00 +00:00
Warner Losh
6998f84670 Revert last commit: CPUTYPE will be defined here 2011-02-11 02:34:26 +00:00
Warner Losh
64a5f83e35 Don't require CPUTYPE to be defined for ARM, but use it if it is. 2011-02-11 02:24:04 +00:00
David Schultz
b5209b6228 Fix a bug where the wrong argument was passed to SET_FLOAT_WORD().
This bug results in a type mismatch that happens to be harmless
because of the way SET_FLOAT_WORD() works.

Submitted by:	bde
2011-02-10 07:38:38 +00:00
David Schultz
5ffd745ec2 Fix a bug where the wrong argument was passed to INSERT_WORDS().
This bug results in a type mismatch that happens to be harmless
because of the way INSERT_WORDS() works.

Submitted by:	bde
2011-02-10 07:38:13 +00:00
David Schultz
e044d80d08 For small arguments, these functions use simple approximations,
e.g. cos(small) = 1, sin(small) = small.  This commit tightens
the thresholds at which the simple approximations are used.

Reviewed by:	bde
2011-02-10 07:37:50 +00:00
David Schultz
b775d18789 Fix a bogus threshold that was copied from the double precision version.
This commit should have no effect on correctness; it merely changes the
threshold at which a simpler approximation can be used.

Reviewed by:	bde
2011-02-10 07:37:29 +00:00
Warner Losh
82394a8d94 sys/rman.h now requires sys/types.h. Include it to make the API match
the man page again.

Submitted by:	Raphael Kubo da Costa
MFC after:	2 weeks
2011-02-10 04:53:09 +00:00
Jung-uk Kim
678b238c85 Introduce a non-portable function pthread_getthreadid_np(3) to retrieve
calling thread's unique integral ID, which is similar to AIX function of
the same name.  Bump __FreeBSD_version to note its introduction.

Reviewed by:	kib
2011-02-07 21:26:46 +00:00
Jilles Tjoelker
2fee45fd74 rfork_thread(3): Mark deprecated in favor of pthread_create(3). 2011-02-06 23:26:14 +00:00
Doug Barton
5143adb549 Update to BIND 9.6.3, the latest from ISC on the 9.6 branch.
All 9.6 users with DNSSEC validation enabled should upgrade to this
version, or the latest version in the 9.7 branch, prior to 2011-03-31
in order to avoid validation failures for names in .COM as described
here:

https://www.isc.org/announcement/bind-9-dnssec-validation-fails-new-ds-record

In addition the fixes for this and other bugs, there are also the
following:

  * Various fixes to kerberos support, including GSS-TSIG
  * Various fixes to avoid leaking memory, and to problems that could
    prevent a clean shutdown of named
2011-02-06 22:46:07 +00:00
Doug Barton
fccc60c828 Vendor import of BIND 9.6.3 2011-02-05 03:14:55 +00:00
Konstantin Belousov
9f2e8bdff3 Remove duplicate .note.GNU-stack section declaration.
Reported by:	arundel
2011-02-04 21:54:06 +00:00
Konstantin Belousov
adc6846785 Remove duplicate .note.GNU-stack section declaration. bcopy already
made the neccessary provisions.

Reported by:	arundel
2011-02-04 21:04:00 +00:00
Jilles Tjoelker
12dacf622b Make sys_signame upper case.
This matches the constants from <signal.h> with 'SIG' removed, which POSIX
requires kill and trap to accept and 'kill -l' to write.

'kill -l', 'trap', 'trap -l' output is now upper case.

In Turkish locales, signal names with an upper case 'I' are now accepted,
while signal names with a lower case 'i' are no longer accepted, and the
output of 'killall -l' now contains proper capital 'I' without dot instead
of a dotted capital 'I'.
2011-02-04 16:40:50 +00:00
Ulrich Spörlein
948db0b9e9 libkvm: fix logic inversion introduced with last commit
Reported by:	Brandon Gooch <jamesbrandongooch@gmail.com>
Pointy hat to:	uqs
2011-02-02 17:01:26 +00:00
Warner Losh
41ea72bd1d Whitespace nit 2011-02-01 22:50:23 +00:00
Martin Matuska
4a81e416d6 Reintroduce bugfix from r210103 and fix xz on strong-aligned architectures.
This fix was accidentially reverted with the 5.0.0 update in r215187.

PR:		bin/154310
Submitted by:	Michael Moll <kvedulv@kvedulv.de>
MFC after:	3 days
2011-02-01 10:28:05 +00:00
Jayachandran C.
7b87c35eba Fix n32 compile.
These changes are needed to fix n32 compile after the recent change of
mips n32 MACHINE_ARCH to mipsn32eb/mipsn32el.

Reviewed by:	imp, bz (earlier version)
2011-01-27 14:16:12 +00:00
Konstantin Belousov
f1410015f0 Emit .note.GNU-stack for the syscall stubs generated by libc only on
architectures that support this .note. In particular, do not unneccessary
emit the notes on ia64 and sparc64, which ABI require non-executable stacks.

Tested by:	marcel
2011-01-25 21:06:49 +00:00
Alexander Kabaev
1bc9325f8a Do not allocate buffer to hold data for zero-sized sections. 2011-01-25 19:17:50 +00:00
Konstantin Belousov
1567387db9 Document PT_FLAG_FORKED, PT_FOLLOW_FORK, pl_tdname and pl_child_pid.
MFC after:	2 weeks
2011-01-25 11:02:12 +00:00
Ulrich Spörlein
6ee6ac7fec libkvm: Unbreak build for powerpc64/powerpc
This slipped through my testing due to the recent roto-tiling of the
ARCH/TARGET parts that I need to catch up with. Mea culpa.
2011-01-24 11:06:40 +00:00
Ulrich Spörlein
de788839e2 libkvm: fix process runtime calculation on crashdumps
Fix a long standing bug, where the procs ticks where assumed to be in
us. Instead, read cpu_tick_frequency from the kernel and use the same
logic to convert runtime. This is still too optimistic in that it
assumes cpu_tick_frequency is available and fixed. Since this function
is only called on crashdumps, I think we can live with that. Testing has
shown the values to be correct for different kern.hz inside Virtualbox.

Bump WARNS. Alignment issues on some archs mean this is still at 3.

Reviewed by:	bde
2011-01-23 11:08:36 +00:00
Ulrich Spörlein
c10970dd7d libkvm code janitoring
- make WARNS=6 clean for archs w/o strict alignment requirments
- add const, ANSIfy, remove unused vars, cast types for comparison
- thanks to differing definitions of VM_MIN_ADDRESS across our archs, we
  need to trick the compiler to not complain about signedness. We could
  either fix VM_MIN_ADDRESS to always be a simple integer or make the
  check conditional on $ARCH.

Closes PRs:	kern/42386, kern/83364
Reviewed by:	bde
2011-01-23 11:08:28 +00:00
Jilles Tjoelker
198c89c306 getgroups(2): Remove mention of <sys/param.h> and refer to sysconf(3).
Because {NGROUPS_MAX} may become variable, its value should be obtained
using sysconf(3). If a #define is used anyway, it should be obtained by
including <limits.h> as that is in POSIX like getgroups(2) itself is.
<sys/param.h> is not in POSIX.

MFC after:	1 week
2011-01-21 22:15:17 +00:00
Matthew D Fleming
cbc134ad03 Introduce signed and unsigned version of CTLTYPE_QUAD, renaming
existing uses.  Rename sysctl_handle_quad() to sysctl_handle_64().
2011-01-19 23:00:25 +00:00
Dag-Erling Smørgrav
e8eaf30078 Fix a bug related to connection caching which could cause a crash after
a STAT command.

PR:		kern/153748 (different patch)
Submitted by:	Mark Johnston <markjdb@gmail.com>
MFC after:	2 weeks
2011-01-17 17:25:46 +00:00
Jilles Tjoelker
c3954e3936 mknod(2): The required include is <sys/stat.h>, not <unistd.h>.
This is what SUSv4 requires, and also the only thing that works if strict
standards compliance is requested or mknodat() is needed.

PR:		standards/123688
Submitted by:	gcooper
MFC after:	1 week
2011-01-16 21:59:50 +00:00