Commit Graph

10763 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
4b0ae51212 MFp4 @229085:
Rearrange the code so we don't call ioctl(TIOCGWINSZ) if the -s option is given,
as the result won't be used then.

Sponsored by:	The FreeBSD Foundation
2013-05-28 21:21:46 +00:00
Ed Schouten
af8e44c84a Prevent shadowing.
The name line_number seems to be used as a function parameter name for
one of the Lex functions. Change the name to linenumber.
2013-05-25 15:36:15 +00:00
Glen Barber
ffca5883e8 Revert r250972 to fix build. 2013-05-25 07:17:16 +00:00
Stefan Eßer
2360cb0eea The error handling for writes to the target file could lead to the final
fclose() being skipped. Fix this by using boolean "&" and "|" instead of
short-cut operators "&&" and "||".
While here, increment the last part of the version string. The reason is
the fixed output file selection logic in pch.c, which was committed as
r250943, yesterday.

Reviewed by:	pfg
2013-05-24 18:54:52 +00:00
Stefan Eßer
6b239879f8 Fix target selection logic, which did not comply with the man page.
Instead of using the file with the least order of path name components,
shortest filename and finally the shortest basename (with the search
stopping as soon as one of these conditions is true), the first filename
checked was used as the reference, and another filename was only selected
if all of the above comparisons are in favour of the latter file.

This was wrong, because filenames with path less components were only
considered, if both of the other conditions were true as well. In fact,
the first filename to be checked had good chances to be selected in the
end, since it only needed to be better with regard to any one of the
three criteria ...

Reviewed by:	delphij@freebsd.org
2013-05-23 20:57:20 +00:00
Guy Helmer
08ad1a7ac6 Add support for netgroup, based on patch in the PR but made consistent
with existing style.

PR:		bin/132692
2013-05-23 20:52:30 +00:00
Ed Schouten
b94c7c3e21 Let iconv build on -HEAD properly.
- Add NO_WMISSING_VARIABLE_DECLARATIONS where we use Yacc/Lex.
- Add variable declarations where possible.
- Add missing static keyword.
2013-05-23 18:07:01 +00:00
Jung-uk Kim
9c5a52cf88 Work around build breakages with GCC 4.2.
Reported by:	tinderbox
2013-05-23 05:42:35 +00:00
Eitan Adler
89c5c3aab8 Avoid signed overflow in error handling code.
Reviewed by:	cperciva, bjk
2013-05-21 19:56:03 +00:00
Jung-uk Kim
ab76bc977a Connect flex 2.5.37 to the build and bump __FreeBSD_version. 2013-05-21 19:32:35 +00:00
Simon J. Gerraty
52d8625616 Sync with upstream version (20130520) that includes same fixes made last week. 2013-05-20 22:51:11 +00:00
Simon J. Gerraty
3c1c0edeef Per the comment, we cannot rely on bsd.own.mk
we could be on an old system that knows noting of MK_BMAKE
or on an almost up to date one that is defaulting it to "no"
neither of which will work.
2013-05-17 22:18:27 +00:00
Simon J. Gerraty
8ebb983529 We really need to get the bsd.own.mk from this tree so the
correct options are set.
Also defined NO_PWD_OVERRIDE to match behavior of fmake.
2013-05-17 19:37:16 +00:00
Xin LI
f26784139f guard against MK_SHARED_TOOLCHAIN not being defined. 2013-05-16 22:35:33 +00:00
Xin LI
ac2c0328ca Similar to r250719: guard against MK_BMAKE not being defined. 2013-05-16 22:25:17 +00:00
Simon J. Gerraty
4c67ba2c7b Reverse the sense of the test wrt bmake, and guard against
MK_BMAKE not being defined.
2013-05-16 21:26:46 +00:00
Simon J. Gerraty
3ddfb24d3a Build bmake by default.
If someone explicitly builds usr.bin/make while MK_BMAKE==yes,
install it as 'fmake'.

Reviewed by:	brooks
2013-05-16 15:28:38 +00:00
Joel Dahl
2710751bc3 mdoc sweep. 2013-05-12 22:22:12 +00:00
Antoine Brodin
290b7b224a Add some missing DPADD. 2013-05-11 13:46:05 +00:00
Xin LI
4262755097 REST IN PEACE
Alexander Botero-Lowry

Born June 2, 1986 in Austin, Texas
Died August 24, 2012 in San Francisco, California

Thank you for your contributions, you will be
greatly missed.
2013-05-10 20:02:15 +00:00
Eitan Adler
b5be420a7c Add option to lockf to avoid creating a file if it does not exist.
PR:	bin/170775
Submitted by:	Matthew Story <matthewstory@gmail.com>
Reviewed by:	scottl
MFC after:	1 week
2013-05-10 17:30:29 +00:00
Eitan Adler
a93b9b7d11 Bump .Dd for recent content change.
Reported by:	delphij
2013-05-10 12:49:16 +00:00
Eitan Adler
7f418e3407 Implement 'split -d' which allows a numeric suffix instead of an
alphabetic one.

PR:		bin/116209
Submitted by:	Marcin Gryszkalis <mg@fork.pl> (adapted from)
Reviewed by:	will
MFC after:	1 week
2013-05-10 04:23:03 +00:00
Eitan Adler
a274be7720 Style(9) changes fo xargs.c 2013-05-10 03:49:05 +00:00
Jung-uk Kim
a7880d59c9 Improve compatibility with recent flex from flex.sourceforge.net. 2013-05-03 23:51:32 +00:00
Jung-uk Kim
8ce3644c91 Reduce diff with upstream. 2013-05-03 23:29:38 +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
Edwin Groothuis
3b48e348d5 Op 30 April 2013 trad koninging Beatrix af en werd kroonprins Willem
Alexander de nieuwe koning. Koningsdag is op 27 April.

On 30 April 2013 queen Beatrix resigned and crownprince Willem
Alexander became the new king. King's day is on 27 April.

MFC after:	1 week
2013-05-03 02:03:35 +00:00
Rick Macklem
af3ed447c5 Document that the NFSv4 server statistics are operation counts and
not RPC counts.
This is a content change.

MFC after:	2 weeks
2013-05-01 22:16:29 +00:00
Eitan Adler
b4634967f0 When the world is built WITHOUT_OPENSSH also don't
install ssh-copy-id.

PR:		misc/177590
Submitted by:	Oleg Ginzburg <olevole@olevole.ru>
Reviewed by:	imp
2013-04-28 17:58:11 +00:00
Joel Dahl
927853b45c Fix EXIT STATUS. biff reports its status when it was invoked.
Submitted by:	Ryan Kavanagh,
		Jason McIntyre <jmc@kerhand.co.uk>
Obtained from:	OpenBSD
2013-04-28 09:29:44 +00:00
Eitan Adler
b268ae6440 Constify where appropriate.
Reported by:	emaste
Approved by:	cperciva (mentor)
MFC After:	3 days
2013-04-23 13:03:17 +00:00
Eitan Adler
4145c5f17e Cleanups to touch.c
- use const where appropriate
	- use static where appropriate
	- use explicit checks checks for error conditions

Reviewed by:	sbruno
Approved by:	cperciva (mentor)
Obtained by:	DragonFlyBSD
2013-04-23 13:03:14 +00:00
Mikolaj Golub
e344fb0222 Wrong cast.
MFC after:	1 month
2013-04-20 15:37:33 +00:00
Mikolaj Golub
7fe6d16ef9 Sync gcore(1) with the recent changes in kernel code aimed at adding
procstat notes to a process core file.

Suggested by:	jhb
MFC after:	1 month
2013-04-20 08:23:19 +00:00
Mikolaj Golub
948baa409b Make use of newly added libprocstat(3) ability to extract procstat
info from a process core file.

So now one can run procstat(1) on a process core e.g. to get a list of
files opened by a process when it crashed:

root@lisa:/ # procstat -f /root/vi.core
  PID COMM               FD T V FLAGS     REF  OFFSET PRO NAME
  658 vi               text v r r--------   -       - -   /usr/bin/vi
  658 vi               ctty v c rw-------   -       - -   /dev/pts/0
  658 vi                cwd v d r--------   -       - -   /root
  658 vi               root v d r--------   -       - -   /
  658 vi                  0 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  1 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  2 v c rw-------  11    3208 -   /dev/pts/0
  658 vi                  3 v r r----n-l-   1       0 -   /tmp/vi.0AYKz3Lps7
  658 vi                  4 v r rw-------   1       0 -   /var/tmp/vi.recover/vi.GaGYsz
  658 vi                  5 v r rw-------   1       0 -   -

PR:		kern/173723
Suggested by:	jhb
MFC after:	1 month
2013-04-20 08:22:09 +00:00
Mikolaj Golub
d86fa0c72c Use procstat_getkstack(3) for retrieving process kernel stacks
instead of direct sysctl calls.

MFC after:	1 month
2013-04-20 08:19:06 +00:00
Mikolaj Golub
61e1b7c67b Use libprocstat(3) to retrieve ELF auxiliary vector.
MFC after:	1 month
2013-04-20 08:15:43 +00:00
Mikolaj Golub
729e63c34b Use libprocstat(3) to retrieve process command line arguments and
environment variables.

MFC after:	1 month
2013-04-20 08:08:29 +00:00
Mikolaj Golub
66e2f9998b Use libprocstat(3) when retrieving binary information for a process.
MFC after:	1 month
2013-04-20 08:05:04 +00:00
Mikolaj Golub
21b4f75a2c Use procstat_getrlimit(3) for retrieving rlimit information instead of
direct sysctl calls.

MFC after:	1 month
2013-04-20 08:01:00 +00:00
Mikolaj Golub
90a15eb9cb Use procstat_getumask(3) for retrieving umaks information instead of
direct sysctl.

MFC after:	1 month
2013-04-20 07:58:20 +00:00
Mikolaj Golub
e40d6078cd Use procstat_getgroups(3) for retrieving groups information instead of
direct sysctl.

MFC after:	1 month
2013-04-20 07:55:31 +00:00
Mikolaj Golub
eee7107cfb Use more generic procstat_getvmmap(3) for retrieving VM layout of a process.
MFC after:	1 month
2013-04-20 07:52:23 +00:00
Mikolaj Golub
efade1503b Use procstat_getprocs(3) for retrieving thread information instead of
direct sysctl calls.

MFC after:	1 month
2013-04-20 07:50:59 +00:00
Ed Schouten
7e659f9491 Add the Clang specific -Wmissing-variable-declarations to WARNS=6.
This compiler flag enforces that that people either mark variables
static or use an external declarations for the variable, similar to how
-Wmissing-prototypes works for functions.

Due to the fact that Yacc/Lex generate code that cannot trivially be
changed to not warn because of this (lots of yy* variables), add a
NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this
specific compiler warning.

Announced on:	toolchain@
2013-04-19 19:45:00 +00:00
Andrey V. Elsukov
b543f3b167 Replace hardcoded numbers. Also use interface-local scope name instead
of node-local.
2013-04-16 11:25:45 +00:00
Joel Dahl
74dbdd24b9 Fix typo from previous commit.
Submitted by:	Ronald Klop <ronald-freebsd8@klop.yi.org>
2013-04-14 08:49:35 +00:00
Joel Dahl
67a07ea1bf LSD first synthesised 16/11/38, not 7/4/43.
Submitted by:	James J. Lippard
Obtained from:	OpenBSD
2013-04-14 08:47:01 +00:00
Joel Dahl
6857ced81d Correct spelling is "Christiaan Huygens".
Submitted by:	James J. Lippard
Obtained from:	OpenBSD
2013-04-14 08:40:24 +00:00
Dimitry Andric
139f7f9bf5 Upgrade our copy of llvm/clang to trunk r178860, in preparation of the
upcoming 3.3 release (branching and freezing expected in a few weeks).

Preliminary release notes can be found at the usual location:
<http://llvm.org/docs/ReleaseNotes.html>

An MFC is planned once the actual 3.3 release is finished.
2013-04-12 17:57:40 +00:00
Pietro Cerutti
1a47f28b71 - Do not bail out if stat(2) fails with ENOENT in the spool directory. This
happens if another atrm process removes a job while we're scanning through
  the directory.
- While at it, optimize a bit the directory scanning, so that we quit looping
  as soon as all jobs specified in argv have been dealt with.

Approved by:	cognet
2013-04-12 14:32:16 +00:00
Pietro Cerutti
b9e6237dab - Switch order of setting real uid and gid. If we set uid first, then we
don't have enough privileges to set gid.

  This looks like a long standing bug, just recently revealed by r241852.

Approved by:	cognet
2013-04-12 14:19:44 +00:00
Kenneth D. Merry
5e79631638 Fix bugs in the elapsed time calculation in ctlstat_standard()
pointed out by bde:

- Casting to long double isn't needed.
- The division isn't needed, multiplication can be used.
  "When 1 nanosecond is in a floating point literal, the whole
  expression is automatically promoted correctly."
- non-KNF indentation (1 tab) for the newly split line
- different non-KNF indentation (5 spaces) for the previously split
  line
- exessive parentheses around the division operation
- bogus blank line which splits up the etime initialization
- general verboseness from the above.

Submitted by:	bde
MFC after:	3 days
2013-04-11 21:18:04 +00:00
Joel Dahl
2063b2c09b Minor spelling and grammar fixes. 2013-04-11 19:05:24 +00:00
Joel Dahl
b1edef175b Remove contractions. 2013-04-11 18:46:41 +00:00
Eitan Adler
680b190c84 fuser(1) requires a filename.
Reviewed by:	lstewart
Approved by:	bcr (mentor)
MFC after:	3 days
2013-04-11 12:24:29 +00:00
Gleb Smirnoff
29dde48df4 Use kvm_counter_u64_fetch() to fix obtaining ipstat and tcpstat from
kernel core files.

Sponsored by:	Nginx, Inc.
2013-04-10 20:29:23 +00:00
Kenneth D. Merry
ffc3b12c07 Fix a time calculation error in ctlstat_standard().
ctlstat.c:	When converting a timeval to a floating point
		number in ctlstat_standard(), cast the nanoseconds
		calculation to a long double, so we don't lose
		precision.  Without the cast, we wind up with a
		time in whole seconds only.

Sponsored by:	Spectra Logic
MFC after:	3 days
2013-04-10 16:01:45 +00:00
Gleb Smirnoff
5923c29332 Merge from projects/counters: TCP/IP stats.
Convert 'struct ipstat' and 'struct tcpstat' to counter(9).

  This speeds up IP forwarding at extreme packet rates, and
makes accounting more precise.

Sponsored by:	Nginx, Inc.
2013-04-08 19:57:21 +00:00
Jaakko Heinonen
67e09bb94c Correct the path.
PR:		176256
Submitted by:	jhs
2013-04-06 13:42:37 +00:00
William Grzybowski
6678108f37 Add myself as a ports committer and my mentor relationship.
While in the repository, add myself to calendar.freebsd.

Approved by:	jpaetzel (mentor)
2013-04-04 23:11:56 +00:00
Simon J. Gerraty
1748de26cb Update to bmake-20130330 2013-04-02 21:31:11 +00:00
Edward Tomasz Napierala
325621458d Make it possible to build CTL as a module.
Reviewed by:	ken
Sponsored by:	FreeBSD Foundation
2013-04-02 09:42:42 +00:00
Tony Finch
31f5980bd9 Update to upstream version 2.7
The most notable new feature is support for processing multiple
files in one invocation. There is also support for more make-friendly
exit statuses.

The most notable bug fix is #line directives now include the input
file name.

Obtained from: http://dotat.at/prog/unifdef
2013-03-28 20:33:07 +00:00
Alexander Motin
8d2419b571 Make systat -vmstat to use suffixes to display big floating point numbers
that are not fitting into the specified field width, same as done for ints.
In particular that allows to properly display disk tps above 100k, that are
reachable with modern SSDs.
2013-03-23 13:11:54 +00:00
Martin Matuska
acc60b03c1 MFV r248590,248594:
Update libarchive to 3.1.2

Some of new features:
  - support for lrzip and grzip compression
  - support for writing tar v7 format
  - b64encode and uuencode filters
  - support for __MACOSX directory in Zip archives
  - support for lzop compresion (external utility)
2013-03-22 13:36:03 +00:00
Martin Matuska
ebb8fc42be Replace deprecated (or remove obsolete) libarchive 2.8 functions
with libarchive 3.0 counterparts
2013-03-22 10:17:42 +00:00
Jilles Tjoelker
ddd956b0b7 find: Include nanoseconds when comparing timestamps of files.
When comparing to the timestamp of a given file using -newer, -Xnewer and
-newerXY (where X and Y are one of m, c, a, B), include nanoseconds in the
comparison.

The primaries that compare a timestamp of a file to a given value (-Xmin,
-Xtime, -newerXt) continue to compare times in whole seconds.

Note that the default value 0 of vfs.timestamp_precision almost always
causes the nanoseconds part to be 0. However, touch -d can set a timestamp
to the microsecond regardless of that sysctl.

MFC after:	1 week
2013-03-17 22:51:58 +00:00
Joel Dahl
9ca6ee33d0 Remove EOL whitespace accidentally introduced in r248393. 2013-03-17 06:57:25 +00:00
Joel Dahl
d04158c3c6 Move example to EXAMPLES. 2013-03-17 06:36:04 +00:00
Joel Dahl
b16958a100 Add a couple of examples.
Obtained from:	OpenBSD
2013-03-16 22:53:38 +00:00
Sergey Kandaurov
99f23359a5 Fix version in the .Fx macro.
Reported by:	<deeptech71@gmail.com>
2013-03-16 22:37:56 +00:00
Brooks Davis
f1f8908049 Replace our (un)vis(1) commands with implementations from NetBSD to
match our import of the (un)vis(3) APIs.

This adds support for multibyte encoding and the -h and -m flags which
support HTTP and MIME encoding respectively.

PR:		bin/175418
Obtained from:	NetBSD
2013-03-15 00:05:50 +00:00
David E. O'Brien
64508c55f2 No need to call an external program. 2013-03-13 22:50:14 +00:00
Mark Johnston
e16c1e1fd2 Revert r246917, as it is causing incorrect behaviour as reported on
freebsd-current.

PR:		bin/175213
Approved by:	emaste (co-mentor)
2013-03-12 19:18:10 +00:00
John Baldwin
ee66c8b94e Fix the 'C' field for a running thread to match the behavior described
in the manpage by having it display the current CPU (ki_oncpu) rather
than the previously used CPU (ki_lastcpu).  ki_lastcpu is still used for
all other thread states.

Reported by:	Chris Ross <cross+freebsd@distal.com>
MFC after:	1 week
2013-03-11 16:33:05 +00:00
Gleb Smirnoff
2a75563d4a Fix spelling.
PR:		176777
Submitted by:	Andrey Simonenko <simon comsys.ntu-kpi.kiev.ua>
2013-03-11 13:08:32 +00:00
Alexander V. Chernikov
7e4f8ab64a Add forgotten .El
MFC with:	r248112
2013-03-09 20:04:47 +00:00
Alexander V. Chernikov
69cf5b29fd Document netstat -Q flags meaning.
MFC after:	1 week
2013-03-09 20:01:35 +00:00
Attilio Rao
a92189b377 Garbage collect NWFS and NCP bits which are now completely disconnected
from the tree since few months.

This patch is not targeted for MFC.
2013-03-09 12:45:36 +00:00
Olivier Houchard
57fb38ba93 Add arm bits to truss. 2013-03-07 23:44:35 +00:00
Dimitry Andric
d023c5ae25 Make c99(1) invoke /usr/bin/cc with argv[0] set to "/usr/bin/cc" instead
of just "cc", since there is no reason to cause additional path searches
in this case.

MFC after:	3 days
2013-03-07 21:37:23 +00:00
Dimitry Andric
b1bbb41f96 Make c89(1) invoke /usr/bin/cc with argv[0] also set to /usr/bin/cc,
similar to what c99(1) does, to prevent "c89: illegal option -- 1"
messages, when clang is /usr/bin/cc.

Reported by:	tijl
MFC after:	3 days
2013-03-07 21:34:16 +00:00
Eitan Adler
240299864c Fix typo ('1' != 'l')
PR:		bin/175975
Submitted by:	William Ahern <william@25thandclement.com>
Approved by:	cperciva (mentor)
2013-03-04 02:21:06 +00:00
Eitan Adler
fd9593d55a Due to calendar(1)'s abuse of the C preprocessor "unix" gets expanded to
"1".  'Fix' this.

PR:		bin/175790
Submitted by:	ak
Approved by:	cperciva (mentor)
2013-03-04 02:21:03 +00:00
David Malone
9ed0c92c91 Add an option for finding sparse files.
Reviewed by:	iedowse
MFC after:	3 weeks
2013-03-03 20:10:56 +00:00
Pawel Jakub Dawidek
7493f24ee6 - Implement two new system calls:
int bindat(int fd, int s, const struct sockaddr *addr, socklen_t addrlen);
	int connectat(int fd, int s, const struct sockaddr *name, socklen_t namelen);

  which allow to bind and connect respectively to a UNIX domain socket with a
  path relative to the directory associated with the given file descriptor 'fd'.

- Add manual pages for the new syscalls.

- Make the new syscalls available for processes in capability mode sandbox.

- Add capability rights CAP_BINDAT and CAP_CONNECTAT that has to be present on
  the directory descriptor for the syscalls to work.

- Update audit(4) to support those two new syscalls and to handle path
  in sockaddr_un structure relative to the given directory descriptor.

- Update procstat(1) to recognize the new capability rights.

- Document the new capability rights in cap_rights_limit(2).

Sponsored by:	The FreeBSD Foundation
Discussed with:	rwatson, jilles, kib, des
2013-03-02 21:11:30 +00:00
Pawel Jakub Dawidek
2609222ab4 Merge Capsicum overhaul:
- Capability is no longer separate descriptor type. Now every descriptor
  has set of its own capability rights.

- The cap_new(2) system call is left, but it is no longer documented and
  should not be used in new code.

- The new syscall cap_rights_limit(2) should be used instead of
  cap_new(2), which limits capability rights of the given descriptor
  without creating a new one.

- The cap_getrights(2) syscall is renamed to cap_rights_get(2).

- If CAP_IOCTL capability right is present we can further reduce allowed
  ioctls list with the new cap_ioctls_limit(2) syscall. List of allowed
  ioctls can be retrived with cap_ioctls_get(2) syscall.

- If CAP_FCNTL capability right is present we can further reduce fcntls
  that can be used with the new cap_fcntls_limit(2) syscall and retrive
  them with cap_fcntls_get(2).

- To support ioctl and fcntl white-listing the filedesc structure was
  heavly modified.

- The audit subsystem, kdump and procstat tools were updated to
  recognize new syscalls.

- Capability rights were revised and eventhough I tried hard to provide
  backward API and ABI compatibility there are some incompatible changes
  that are described in detail below:

	CAP_CREATE old behaviour:
	- Allow for openat(2)+O_CREAT.
	- Allow for linkat(2).
	- Allow for symlinkat(2).
	CAP_CREATE new behaviour:
	- Allow for openat(2)+O_CREAT.

	Added CAP_LINKAT:
	- Allow for linkat(2). ABI: Reuses CAP_RMDIR bit.
	- Allow to be target for renameat(2).

	Added CAP_SYMLINKAT:
	- Allow for symlinkat(2).

	Removed CAP_DELETE. Old behaviour:
	- Allow for unlinkat(2) when removing non-directory object.
	- Allow to be source for renameat(2).

	Removed CAP_RMDIR. Old behaviour:
	- Allow for unlinkat(2) when removing directory.

	Added CAP_RENAMEAT:
	- Required for source directory for the renameat(2) syscall.

	Added CAP_UNLINKAT (effectively it replaces CAP_DELETE and CAP_RMDIR):
	- Allow for unlinkat(2) on any object.
	- Required if target of renameat(2) exists and will be removed by this
	  call.

	Removed CAP_MAPEXEC.

	CAP_MMAP old behaviour:
	- Allow for mmap(2) with any combination of PROT_NONE, PROT_READ and
	  PROT_WRITE.
	CAP_MMAP new behaviour:
	- Allow for mmap(2)+PROT_NONE.

	Added CAP_MMAP_R:
	- Allow for mmap(PROT_READ).
	Added CAP_MMAP_W:
	- Allow for mmap(PROT_WRITE).
	Added CAP_MMAP_X:
	- Allow for mmap(PROT_EXEC).
	Added CAP_MMAP_RW:
	- Allow for mmap(PROT_READ | PROT_WRITE).
	Added CAP_MMAP_RX:
	- Allow for mmap(PROT_READ | PROT_EXEC).
	Added CAP_MMAP_WX:
	- Allow for mmap(PROT_WRITE | PROT_EXEC).
	Added CAP_MMAP_RWX:
	- Allow for mmap(PROT_READ | PROT_WRITE | PROT_EXEC).

	Renamed CAP_MKDIR to CAP_MKDIRAT.
	Renamed CAP_MKFIFO to CAP_MKFIFOAT.
	Renamed CAP_MKNODE to CAP_MKNODEAT.

	CAP_READ old behaviour:
	- Allow pread(2).
	- Disallow read(2), readv(2) (if there is no CAP_SEEK).
	CAP_READ new behaviour:
	- Allow read(2), readv(2).
	- Disallow pread(2) (CAP_SEEK was also required).

	CAP_WRITE old behaviour:
	- Allow pwrite(2).
	- Disallow write(2), writev(2) (if there is no CAP_SEEK).
	CAP_WRITE new behaviour:
	- Allow write(2), writev(2).
	- Disallow pwrite(2) (CAP_SEEK was also required).

	Added convinient defines:

	#define	CAP_PREAD		(CAP_SEEK | CAP_READ)
	#define	CAP_PWRITE		(CAP_SEEK | CAP_WRITE)
	#define	CAP_MMAP_R		(CAP_MMAP | CAP_SEEK | CAP_READ)
	#define	CAP_MMAP_W		(CAP_MMAP | CAP_SEEK | CAP_WRITE)
	#define	CAP_MMAP_X		(CAP_MMAP | CAP_SEEK | 0x0000000000000008ULL)
	#define	CAP_MMAP_RW		(CAP_MMAP_R | CAP_MMAP_W)
	#define	CAP_MMAP_RX		(CAP_MMAP_R | CAP_MMAP_X)
	#define	CAP_MMAP_WX		(CAP_MMAP_W | CAP_MMAP_X)
	#define	CAP_MMAP_RWX		(CAP_MMAP_R | CAP_MMAP_W | CAP_MMAP_X)
	#define	CAP_RECV		CAP_READ
	#define	CAP_SEND		CAP_WRITE

	#define	CAP_SOCK_CLIENT \
		(CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \
		 CAP_PEELOFF | CAP_RECV | CAP_SEND | CAP_SETSOCKOPT | CAP_SHUTDOWN)
	#define	CAP_SOCK_SERVER \
		(CAP_ACCEPT | CAP_BIND | CAP_GETPEERNAME | CAP_GETSOCKNAME | \
		 CAP_GETSOCKOPT | CAP_LISTEN | CAP_PEELOFF | CAP_RECV | CAP_SEND | \
		 CAP_SETSOCKOPT | CAP_SHUTDOWN)

	Added defines for backward API compatibility:

	#define	CAP_MAPEXEC		CAP_MMAP_X
	#define	CAP_DELETE		CAP_UNLINKAT
	#define	CAP_MKDIR		CAP_MKDIRAT
	#define	CAP_RMDIR		CAP_UNLINKAT
	#define	CAP_MKFIFO		CAP_MKFIFOAT
	#define	CAP_MKNOD		CAP_MKNODAT
	#define	CAP_SOCK_ALL		(CAP_SOCK_CLIENT | CAP_SOCK_SERVER)

Sponsored by:	The FreeBSD Foundation
Reviewed by:	Christoph Mallon <christoph.mallon@gmx.de>
Many aspects discussed with:	rwatson, benl, jonathan
ABI compatibility discussed with:	kib
2013-03-02 00:53:12 +00:00
Glen Barber
eff269ee18 Properly handle '-h' argument.
PR:		176332
Reviewed by:	scottl
MFC after:	3 days
2013-02-28 01:22:14 +00:00
Xin LI
d9dcc46365 Revert r247300 for now. I'll post a new changeset for review. 2013-02-26 19:46:59 +00:00
Xin LI
285a4c7c59 Expose timespec and timeval macros when __BSD_VISIBLE is defined. This
allows userland application to use the following macros:

	timespecclear, timespecisset, timespeccmp, timespecadd,
	timespecsub;

	timevalclear, timevalisset, timevalcmp.

MFC after:	1 month
2013-02-26 02:13:02 +00:00
Joel Dahl
ed88bcd300 Remove EOL whitespace. 2013-02-25 17:32:10 +00:00
Alexander V. Chernikov
297c1ec124 Fix several new & old style issues.
Pointed by:	ae, pluknet, zont
MFC with:	r247036
2013-02-20 14:19:09 +00:00
Alexander V. Chernikov
b021472399 Add interface name filtering via 'match' cmd.
Add 'pps' cmd for switching beetween interface packets/bytes statistics.

Submitted by:	vsevolod
MFC after:	2 weeks
2013-02-20 13:47:05 +00:00
Ulrich Spörlein
eaef137cbe dtc: fix bootstrapping from 8.2-STABLE
MFC after:	1 week
Approved by:	theraven
2013-02-19 18:28:25 +00:00
Philippe Charnier
589db68931 WARNS=6 compliance 2013-02-19 13:32:26 +00:00
Philippe Charnier
321ae07f36 WARNS=6 compliance 2013-02-19 13:17:16 +00:00
Philippe Charnier
00c31a91ef Remove old-style function definition 2013-02-19 12:57:07 +00:00
Mark Johnston
43e1adfa05 Strengthen the check in IS_OUT_OF_BOUNDS to ensure that (j - 1) is a
valid index into the input buffer.

PR:		bin/175213
Reviewed by:	gabor
Approved by:	emaste (co-mentor)
MFC after:	1 week
2013-02-17 19:48:23 +00:00