Commit Graph

15132 Commits

Author SHA1 Message Date
Hiren Panchasara
3627fbff6c Fix a typo: It should be "strtoll" and not "stroll".
PR:	178642
Reported by:	Michael Galassi (michaelgalassi@gmail.com)
Approved by:	sbruno (mentor)
MFC after:	1 week
2013-05-14 20:25:07 +00:00
Dimitry Andric
a420df3c8a Use an ugly hack to get around bootstrapping problems when building
clang on head between r239347 and r245428.

The former revision introduced CLOCK_PROCESS_CPUTIME_ID as a clock id
for the clock_gettime() function and friends, but it was only added in
<sys/time.h>, not in <time.h>.  Any program including <time.h> would
therefore not be able to use CLOCK_PROCESS_CPUTIME_ID, even though the
value of _POSIX_CPUTIME indicates its existence.  The latter revision
synchronized the defines again.

Work around this problem by defining the id on the command line for the
particular .cpp file that needs it.  If the id ever changes value, this
hack will need to be updated.
2013-05-13 20:14:58 +00:00
Joel Dahl
2710751bc3 mdoc sweep. 2013-05-12 22:22:12 +00:00
Eitan Adler
a164074fc4 Fix several typos
PR:		kern/176054
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>
MFC after:	3 days
2013-05-12 16:43:26 +00:00
Sergey Kandaurov
b6dd17329c Typo. 2013-05-12 05:54:58 +00:00
Jilles Tjoelker
38cf77de66 posix_spawn_file_actions_adddup2(3): Document difference with dup2().
The ability to clear a file descriptor's close-on-exec flag via
posix_spawn_file_actions_adddup2() is in fact proposed in Austin Group issue
#411.

MFC after:	1 week
2013-05-09 21:29:13 +00:00
Jilles Tjoelker
39e499a8d2 posix_spawn_file_actions_addopen(3): Correct error for bad file descriptor.
As per POSIX.1-2008, posix_spawn_file_actions_add* return [EBADF] if a file
descriptor is negative, not [EINVAL]. The bug was only in the manual page;
the code is correct.

MFC after:	1 week
2013-05-09 16:42:01 +00:00
Jilles Tjoelker
ae4c676c55 wordexp(): Simplify code by deferring work to sh. 2013-05-09 11:43:45 +00:00
David Xu
66f6c2721d Fix return value for setcontext and swapcontext. 2013-05-09 04:41:03 +00:00
Mikolaj Golub
467112b4d1 Make errbuf optional, so if a caller is not interested in an error
message she can pass NULL (procstat(1) already does this).

MFC after:	2 weeks
2013-05-08 19:11:47 +00:00
Ed Maste
5906bf4984 Add libusb_get_port_path wrapper
This follows the libusbx API reference at
http://libusbx.sourceforge.net/api-1.0/group__dev.html

Reviewed by: hselasky@
2013-05-08 00:55:29 +00:00
Ed Maste
22a962c9fe Constify libusb_get_pollfds return
The correct return type, per our libusb(3) man page and the libusb.org
and libusbx projects (whose interface we intend to follow for our libusb),
is const struct libusb_pollfd **.

Unfortunately the doxygen-generated libusbx API documentation[1] omits[2]
the const for some reason.

[1] http://libusbx.sourceforge.net/api-1.0/group__poll.html#gab1a72869a926552b27a6c667695df3a2

[2] http://sourceforge.net/mailarchive/forum.php?thread_name=497D10BE.8090007%40n-dimensional.de&forum_name=libusb-devel

Reviewed by: hselasky@
2013-05-07 20:35:47 +00:00
Xin LI
1392a0b021 MFV: Update zlib to 1.2.8.
MFC after:	1 month
2013-05-05 06:20:49 +00:00
Sergey Kandaurov
e0906c9a0d POSIX 1003.1-2008: add ENOTRECOVERABLE, EOWNERDEAD errnos. 2013-05-04 19:07:22 +00:00
Sergey Kandaurov
424b842a5d Document that the return type is different from 1003.1-2008.
MFC after:	1 week
2013-05-04 17:21:44 +00:00
Sergey Kandaurov
4f79ce7b4c mdoc: missing comma in .Dd macro. 2013-05-04 17:06:47 +00:00
Sergey Kandaurov
c951cd462f Add entry for errno ECAPMODE.
MFC after:	3 days
2013-05-04 12:57:21 +00:00
Sergey Kandaurov
f45590da31 Bump date. 2013-05-04 12:44:00 +00:00
Jilles Tjoelker
7b05a79942 libkvm: Make second /dev/null file descriptor close-on-exec as well.
MFC after:	1 week
2013-05-04 11:45:48 +00:00
Jilles Tjoelker
76dce67f0f libkvm: Use O_CLOEXEC instead of separate fcntl(F_SETFD) call.
MFC after:	1 week
2013-05-04 09:47:51 +00:00
Jung-uk Kim
a7880d59c9 Improve compatibility with recent flex from flex.sourceforge.net. 2013-05-03 23:51:32 +00:00
John Baldwin
958aa57537 Similar to 233760 and 236717, export some more useful info about the
kernel-based POSIX semaphore descriptors to userland via procstat(1) and
fstat(1):
- Change sem file descriptors to track the pathname they are associated
  with and add a ksem_info() method to copy the path out to a
  caller-supplied buffer.
- Use the fo_stat() method of shared memory objects and ksem_info() to
  export the path, mode, and value of a semaphore via struct kinfo_file.
- Add a struct semstat to the libprocstat(3) interface along with a
  procstat_get_sem_info() to export the mode and value of a semaphore.
- Teach fstat about semaphores and to display their path, mode, and value.

MFC after:	2 weeks
2013-05-03 21:11:57 +00:00
Dimitry Andric
4b6b67b08e Allow building clang on older FreeBSD releases, where log2() does not
exist yet.  With this change, I have verified that building head on
8.1-RELEASE works.

Noticed by:	Ryan Stone <rysto32@gmail.com>
2013-05-03 16:29:51 +00:00
Sergey Kandaurov
67ff590b9e Also, add a missing period. 2013-05-03 13:27:13 +00:00
Sergey Kandaurov
cc7a693fa7 Remove an extra comma. 2013-05-03 12:45:45 +00:00
Sergey Kandaurov
88bbbe88d7 Remove the STANDARDS section.
querylocale is not part of IEEE Std 1003.1-2008.

MFC after:	3 days
2013-05-03 12:42:43 +00:00
Ulrich Spörlein
4bbdf74796 Always install pmc.foo(3) manpages.
There is no point in hiding, e.g. pmc.xscale(3) from a developer running
on amd64, when the target arch in question will probably never have
manual pages installed at all.

Reviewed by:	sbruno, hiren
2013-05-03 08:20:10 +00:00
Hans Petter Selasky
c77a24c24a Add new USB API to get the port path of a USB device.
MFC after:	2 weeks
Requested by:	emaste @
2013-05-03 07:44:58 +00:00
Jilles Tjoelker
ed5987bd08 accept(2), pipe(2): Fix .Dd. 2013-05-01 22:47:47 +00:00
Jilles Tjoelker
dc570d5e56 Add pipe2() system call.
The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and
O_NONBLOCK (on both sides) as part of the function.

If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p).

If the pointer is not valid, behaviour differs: pipe2() writes into the
array from the kernel like socketpair() does, while pipe() writes into the
array from an architecture-specific assembler wrapper.

Reviewed by:	kan, kib
2013-05-01 22:42:42 +00:00
Jilles Tjoelker
da7d2afb6d Add accept4() system call.
The accept4() function, compared to accept(), allows setting the new file
descriptor atomically close-on-exec and explicitly controlling the
non-blocking status on the new socket. (Note that the latter point means
that accept() is not equivalent to any form of accept4().)

The linuxulator's accept4 implementation leaves a race window where the new
file descriptor is not close-on-exec because it calls sys_accept(). This
implementation leaves no such race window (by using falloc() flags). The
linuxulator could be fixed and simplified by using the new code.

Like accept(), accept4() is async-signal-safe, a cancellation point and
permitted in capability mode.
2013-05-01 20:10:21 +00:00
Mikolaj Golub
dd70ad64bf procstat_getpathname: for kvm method, instead of returning the error
that the method is not supported, return an empty string.

This looks more handy for callers like procstat(1), which will not
abort after the failed call and still output some useful information.

MFC after:	3 weeks
2013-05-01 15:02:58 +00:00
Mikolaj Golub
1f84c47e42 KVM method support for procstat_getgroups, procstat_getumask,
procstat_getrlimit, and procstat_getosrel.

MFC after:	3 weeks
2013-05-01 15:01:05 +00:00
Brooks Davis
7be2362060 Wrap the creation of the ../include link in /usr/lib in
!defined(LIBRARIES_ONLY) so it is only created once on architectures
with 32-bit compat support.

Replace ln -fhs with ${INSTALL_SYMLINK} to the link is logged in the
METALOG.
2013-04-30 18:14:22 +00:00
Robert Watson
a532cafd5e Enable building string functions as part of libstand on mips; the Makefile
is a bit obfuscated here, as ia64 adds string source files elsewhere, so
simply exclude it here.

Reviewed by:	imp
MFC after:	3 days
Sponsored by:	DARPA, AFRL
2013-04-28 16:35:24 +00:00
Robert Watson
1f05db3e5c Merge @228176 from Perforce to fix a bug introduced in r249553:
Trim two now-unneeded (and likely harmful) lines from the libstand
  setjmp/longjmp for MIPS.

  Spotted by:   jmallett

MFC after:      3 days
Sponsored by:	DARPA, AFRL
2013-04-28 14:40:29 +00:00
David Xu
9ae844e124 Remove extra code for SA_RESETHAND, it is not needed because kernel has
already done this.
2013-04-28 03:13:45 +00:00
Jilles Tjoelker
3cb14a8923 libthr: Fix a parameter name in an internal header file. 2013-04-27 14:21:36 +00:00
Jilles Tjoelker
3143f63a23 intro(2): Fix some errors in ENFILE and EMFILE descriptions.
MFC after:	1 week
2013-04-27 11:55:23 +00:00
Ed Schouten
0315980bb8 Unbreak <stdatomic.h> on ARM + Clang.
Clang only supports atomic operations for ARMv6. For non-ARMv6, we still
need to emit these functions.

Clang's prototype for these functions slightly differs, as it is truly
based on GCC's documentation. It requires the use of signed types, but
also requires varargs. Still, we are not allowed to simply implement
this function directly. Cleverly work around this by implementing it
under a different name and using __strong_reference().
2013-04-27 04:56:02 +00:00
Jilles Tjoelker
34d0fed913 sysconf(3): Correct the description of _SC_OPEN_MAX.
Reported by:	bde
MFC after:	1 week
2013-04-26 21:43:42 +00:00
Neel Natu
ade4af668a Remove deprecated APIs to get the total and free memory available to vmm.ko.
These APIs were relevant when memory for virtual machine allocation was
hard partitioned away from the rest of the system but that is no longer
the case. The sysctls that provided this information were garbage collected
a while back.

Obtained from:	NetApp
2013-04-25 20:42:21 +00:00
Jilles Tjoelker
e160aec9a5 getdtablesize(2): Describe what this function actually does.
getdtablesize() returns the limit on new file descriptors; this says nothing
about existing descriptors.

MFC after:	1 week
2013-04-24 21:24:35 +00:00
Ed Maste
5a6307cf42 Convert libc/stdio from K&R to ANSI C
And add '__restrict' where it appeared in the header prototypes
2013-04-23 14:36:44 +00:00
Ed Maste
1d8053c5c0 Renumber clauses to reduce diffs to other versions
NetBSD, OpenBSD, and Android's Bionic all number the clauses 1 through 3,
so follow suit to make comparison easier.

Acked-by: imp@
2013-04-23 13:33:13 +00:00
Eitan Adler
d001beb260 - sl_find does not modify 'name'
- make the prototype of sl_find match NetBSD

Reviewed by:	jilles
Approved by:	cperciva (mentor)
MFC After:	3 days
2013-04-23 13:03:03 +00:00
Eitan Adler
240f872cb8 Switch from K&R prototypes to modern C
Reviewed by:	jilles
Approved by:	cperciva (mentor)
MFC After:	3 days
2013-04-23 13:03:01 +00:00
Sergey Kandaurov
89bbe1496d Keep up with negative addrlen check removal in r249649. 2013-04-22 09:18:50 +00:00
Jilles Tjoelker
2cd19a510a dup(2): Remove incorrect sentence about getdtablesize().
There are no getdtablesize() bounds on the file descriptor to be duplicated;
it only has to be open. If the RLIMIT_NOFILE rlimit was decreased after
opening the file descriptor, it may be greater than or equal to
getdtablesize() but still valid.

MFC after:	1 week
2013-04-21 19:42:04 +00:00
Mikolaj Golub
b03e2d7729 Embed revision id in the library.
MFC after:	29 days
2013-04-21 17:10:10 +00:00