Commit Graph

10151 Commits

Author SHA1 Message Date
Edwin Groothuis
f379d691e5 ncal(1) highlights the current date (or a date provided via parameter)
even if stdout is not a tty. If stdout is not a tty the data is
normally processed by other tools and no control sequences are
expected.

PR:		bin/158580
MFC after:	1 week
2011-07-11 10:41:08 +00:00
Edwin Groothuis
5a5bcf88e4 Fix the interpreter for:
Jul/Sat+3       Every third saturday of July - Jul/Sat+3

which was able to be done via:

Jul/SatThird	Every third saturday of July - Jul/SatThird

Add interpreters for:

SatFourth	Every third saturday of each month - SatFourth
Sat+4           Every third saturday of each month - Sat+4
Sat 		Every saturday of each month - Sat

MFC after:	2 weeks
2011-07-11 08:24:36 +00:00
Xin LI
7c9acc776a peeraddr is only used in sizeof() evaluations, so instead of declaring it
a variable, use typedef.

MFC after:	1 month
2011-07-11 05:57:49 +00:00
Xin LI
8dc79f22fa Use %zu when printing size_t.
MFC after:	1 month
2011-07-11 05:50:24 +00:00
Xin LI
d1d6559b08 Match size_t and ssize_t by using %zu and %zd instead of %d.
MFC after:	1 month
2011-07-11 05:46:15 +00:00
Xin LI
a2d5d610cb Use a pair of parentheses to ensure right evaluation order. 2011-07-11 05:40:46 +00:00
Xin LI
682b64839a Use strlcpy().
MFC after:	1 month
2011-07-11 05:31:52 +00:00
John Baldwin
034b7b80b2 Always skip the kernel idle process if requested, it is not specific to
the 'CPU' mode.

PR:		bin/158677
Reported by:	arundel
MFC after:	3 days
2011-07-07 13:37:46 +00:00
Ed Schouten
21632754d6 Only print entries for which ut_host points to a character device.
Now that we use utmpx, we more often have entries for which the ut_line
is left blank. To prevent us from returning struct stat for "/dev/",
check that the resulting stat structure belongs to a character device.
2011-07-05 14:12:48 +00:00
Sergey Kandaurov
2f39985f00 Fix quota(1) output.
- Fix calculation of 1024-byte sized blocks from disk blocks shown when -h
option isn't specified. It was broken with quota64 integration.
- In prthumanval(): limit the size of a buffer passed to humanize_number()
to a width of 5 bytes but allow a shorter length if requested. That's what
users expect.

PR:		bin/150151
Reviewed by:	Kirk McKusick
2011-06-30 09:20:26 +00:00
Sergey A. Osokin
877854f667 Remove needless file due to Russia scraps DST in 2011. 2011-06-28 12:32:24 +00:00
Tim Kientzle
79f67f37a7 The --newer-than test should descend into old
directories to look for new files.

PR:		bin/150890
Submitted by:	Tobias Herre
MFC after:	3 weeks
2011-06-26 17:54:11 +00:00
Joel Dahl
afd03ac8b0 More accurate birthplace. 2011-06-25 19:21:54 +00:00
Tim Kientzle
674e7c4cfd If there is a read error reading Y/N confirmation from the keyboard,
exit immediately with an error.

If there is an error opening or reading a file to put into the archive,
set the return value for a deferred error exit.

PR:		bin/154407
2011-06-25 16:27:49 +00:00
Kevin Lo
aa7e4bb466 Remove duplicated header files 2011-06-24 07:18:44 +00:00
Craig Rodrigues
f6c506d9cf Acknowledge Edwin Groothuis for the major rewrite he
did of the tftpd and tftp code to support TFTP blocksize.
2011-06-24 05:41:38 +00:00
Craig Rodrigues
fcaab598e0 Update references to RFC's that the newer TFTP implementation supports. 2011-06-22 23:26:04 +00:00
Craig Rodrigues
b68628c826 Bump date.
Document the following commands which were added in the new TFTP implementation:
blocksize, blocksize2, packetdrop, options, rollover
2011-06-22 22:55:51 +00:00
Xin LI
71024a974d Eliminate unneeded headers. 2011-06-21 20:44:06 +00:00
Xin LI
b561579962 Remove unneeded headers.
MFC after:	2 weeks
2011-06-21 20:36:10 +00:00
Xin LI
cde9717b67 Staticify cleanup() which is not referenced in other places.
MFC after:	2 weeks
2011-06-21 20:33:55 +00:00
Gavin Atkinson
cc361f6598 Merge tnftp-20100108 from the vendor branch into head.
PR:		bin/112288 bin/120256 bin/129014 bin/145528
MFC after:	1 month
2011-06-20 08:00:32 +00:00
Jilles Tjoelker
1696274411 fuser: Fix skipping "SIG" on signal names (-s).
The code did  !strncasecmp(str, "sig", 4)  which is not useful.

Also change "sig" to "SIG" matching the uppercase signal names as of
r218285. This has little effect because fuser does not enable locale.
2011-06-18 21:53:36 +00:00
Ben Laurie
5f301949ef Fix clang warnings.
Approved by:	philip (mentor)
2011-06-18 13:56:33 +00:00
Ed Schouten
c3f1b3ae09 Let the size of the namebuf depend on the size of the ut_user field. 2011-06-18 07:47:15 +00:00
Ed Schouten
9f0c9022c2 Add WITHOUT_UTMPX switch to the build system.
This knob removes the tools that are exclusively used to view and
maintain the databases maintained by utmpx, namely last, users, who,
wtmpcvt, ac, lastlogin and utxrm.

The tool w is not in this list, because it has some other functionality
which is unrelated to utmpx; it is hardlinked to the uptime tool.
2011-06-17 21:30:21 +00:00
Alexander Leidinger
b66e74b695 Add 2-clause BSD license.
Approved by:	David Kirchner <dpk@dpk.net> (initial author)
Requested by:	Otto Moerbeek <otto@drijf.net>
MFC after:	1 week
2011-06-17 06:12:28 +00:00
Craig Rodrigues
e5660633d3 Clarify that the TFTP blocksize (RFC2348) or non-standard
TFTP rollover option can be used to transfer larger files.
2011-06-16 02:27:05 +00:00
Craig Rodrigues
f4b7e64d7a Specify correct RFC2347 for TFTP options in diagnostic message. 2011-06-16 02:16:53 +00:00
Tai-hwa Liang
6ab780e5f0 Using statfs.f_fstypename rather than statfs.f_type whilst performing fstype
comparsion as nullfs will copy f_type from underlayer FS.

PR:		bin/156258
Submitted by:	Marcin Wisnicki <mwisnicki+freebsd@gmail.com>
MFC after:	1 month
2011-06-13 05:22:07 +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
Gabor Kovesdan
69a6d1985d - Use REG_NOSUB to bypass submatch counting when not necessary. This may
yield in somewhat better performance in a few cases.

Approved by:	delphij (mentor)
2011-06-12 12:51:58 +00:00
Gabor Kovesdan
cbe6b9e50f - Fix -w behavior
- Make -F and -w work together
- Fix --color to colorize all of the matches

PR:		bin/156826
Submitted by:	Yuri Pankov <yuri.pankov@gmail.com>
Approved by:	delphij (mentor)
2011-06-12 12:44:02 +00:00
Chris Rees
63ddf8edfe Add self to calendar
Approved by:	rene (mentor)
2011-06-11 21:26:12 +00:00
Julien Laffaye
d3edd193e0 - Add myself to calendar.freebsd
- Add the forgotten relation to mentors in committers-ports.dot

Approved by:	bapt@ (mentor)
2011-06-07 09:06:15 +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
Glen Barber
b6654957c3 Attempt to clear up some confusion in the following example, by stating
the '-c' argument is passed to the shell, not to su(1), which would
indicate the login class.

	'su -m <user> -c <command>'

Submitted by:	Warren Block <wblock@wonkity.com> (followup to 157078)
MFC after:	5 days
2011-06-06 19:33:19 +00:00
Dmitry Chagin
27242311a3 Fix regex for ptraceopname().
PR:		bin/157663
Submitted by:	jason wright <jason@thought.net>
MFC after:	10 days
2011-06-06 19:00:38 +00:00
Glen Barber
a53dafae57 Bump date from previous commit. :(
MFC after:	5 days
2011-06-06 15:21:53 +00:00
Glen Barber
4af4a110a7 Document that when running 'su -m <user> -c <command>', <command> is run
within a shell as <user>.

PR:		157078
Submitted by:	Warren Block <wblock@wonkity.com>
MFC after:	5 days
2011-06-06 15:17:55 +00:00
Jaakko Heinonen
0aa7541b66 Pass correct size to write(2).
PR:		bin/155915
Submitted by:	John Levine
MFC after:	2 weeks
2011-06-06 13:50:29 +00:00
Jilles Tjoelker
535d7745a8 find: Exit if there is an unknown option.
Ignoring the parameter with the unknown options is unlikely to be what was
intended.

Example:
  find -n .

Note that things like
  find -n
already caused an exit, equivalent to "find" by itself.
2011-06-04 21:59:55 +00:00
Ruslan Ermilov
a6a3e8561d When MANCOLOR environment variable is set, enable ANSI color escapes
in grotty(1).  This makes it possible to view colorized manpages in
color.

When MANPAGER environment variable is set, use it instead of PAGER.

Why another environment variable, one might ask?  With color output
enabled, both a terminal and a pager should support the ANSI color
escapes.  On a supporting terminal, less(1) with option -R would be
such a pager, while "more -s" (the current default pager for man(1))
will show garbage.  It means a different default pager is needed when
color output is enabled, but many people have PAGER set customary,
and it's unlikely to support ANSI color escapes, so introducing yet
another variable (MANPAGER) seemed like a good option to me:

- if MANPAGER is set, use that unconditionally;

- if you disable color support (it is by default), and don't set
  MANPAGER, you get an old behavior: -P pager, $PAGER, "more -s",
  in that order;

- if you enable color support (by setting MANCOLOR), and don't set
  MANPAGER, we ignore PAGER which is unlikely to support ANSI color
  escapes, and you get: -P pager, "less -Rs", in that order;

- you might have good reasons for different man(1) and general
  purpose pagers;

- later versions of GNU man(1) support MANPAGER.
2011-06-03 14:34:38 +00:00
Ruslan Ermilov
b70e20257c Don't use col(1) since grotty(1) never outputs reverse line feeds,
and because col(1) mangles ANSI color escapes if enabled.  Spaces
to tabs compression is now done by passing -h to grotty(1).

Discussed with:	uqs
2011-06-03 13:45:11 +00:00
Ruslan Ermilov
a1528c80a5 Trim more when parsing MANCONFIG directive. 2011-06-03 05:56:52 +00:00
Ruslan Ermilov
1030a67f5b Typo. 2011-06-03 05:16:54 +00:00
Ruslan Ermilov
a00944499f Added support for the MANWIDTH environment variable:
If set to a numeric value, used as the width manpages should be
displayed.  Otherwise, if set to a special value ``tty'', and
output is to a terminal, the pages may be displayed over the
whole width of the screen.
2011-06-03 05:16:33 +00:00
Ulrich Spörlein
3d12096812 Fix man -t by not passing grotty flags to groff when grotty is not
involved.

This fixes a regression introduced with r221303.

Noticed by:	jilles
2011-06-02 10:18:49 +00:00
Ulrich Spörlein
135bce2a9e mdoc: reorder sections consistently 2011-06-02 09:56:53 +00:00
Ulrich Spörlein
b2e52ced25 mdoc: fix markup 2011-06-02 09:56:42 +00:00
Warner Losh
f471745a98 Fix a couple of spelling errors.
Submitted by:	bcr@
2011-05-31 16:59:14 +00:00
John Baldwin
35b23f5d86 - Document the -H option and 'H' key alongside other options and keys
rather than at the bottom of the manpage.
- Remove an obsolete comment about SWAIT being a stale state.  It was
  resurrected for a different purpose in FreeBSD 5 to mark idle ithreads.
- Add a comment documenting that the SLEEP and LOCK states typically
  display the name of the event being waited on with lock names being
  prefixed with an asterisk and sleep event names not having a prefix.

MFC after:	1 week
2011-05-31 15:41:10 +00:00
John Baldwin
c9385548e7 Add a new option to toggle the display of the system idle process (per-CPU
idle threads).  The process is displayed by default (subject to whether or
not system processes are displayed) to preserve existing behavior.  The
system idle process can be hidden via the '-z' command line argument or the
'z' key while top is running.  When it is hidden, top more closely matches
the behavior of FreeBSD <= 4.x where idle time was not accounted to any
process.

MFC after:	2 weeks
2011-05-31 15:11:23 +00:00
Jilles Tjoelker
27a43b2e51 printf(1): Document that %c and precision for %b/%s use bytes, not chars.
This means these features do not work as expected with multibyte characters.

This perhaps less than ideal behaviour matches printf(3) and is specified by
POSIX.
2011-05-28 14:32:47 +00:00
Jilles Tjoelker
98102dabd3 printf: Allow multibyte characters for '<char> form, avoid negative codes.
Examples:
  LC_ALL=en_US.UTF-8 printf '%d\n' $(printf \'\\303\\244)
  LC_ALL=en_US.ISO8859-1 printf '%d\n' $(printf \'\\344)
Both of these should print 228.

Like some other shells, incomplete or invalid multibyte characters yield the
value of the first byte without a warning.

Note that there is no general way to go back from the character code to the
character.
2011-05-28 11:37:47 +00:00
Jilles Tjoelker
702b4f04ea find: If a part of an expression is unknown, do not call it an option.
Although most of the primaries and operators start with "-", they are not
options.

Examples:
  find . -xyz
  find . -name xyz -or bad

MFC after:	1 week
2011-05-27 22:14:49 +00:00
Edward Tomasz Napierala
7e2548ae0a Remove definitions for RACCT_FSIZE and RACCT_SBSIZE - these two are rather
performance-sensitive and not that useful, so I won't be merging them
before 9.0.
2011-05-27 19:57:58 +00:00
Aleksandr Rybalko
141fa00b5f Added myself as src committer.
Approved by: adrian (mentor)
2011-05-26 13:54:07 +00:00
Xin LI
5106ce89d0 Fix a regression introduced with previous changeset: if output is stdout,
do not check for symbolic link.
2011-05-25 18:04:11 +00:00
Ruslan Ermilov
a6d11f7139 [mdoc] Fixed .Dt call. 2011-05-25 14:13:53 +00:00
David E. O'Brien
a23d1c70b3 Build and install a BSD licensed grep.
If WITH_BSD_GREP is not set, it will be 'bsdgrep' and GNUgrep will be
'[ef]grep'.  Otherwise, BSD-grep will be the grep family, and GNUgrep
will be 'gnugrep'.

Discussed with: brooks
2011-05-25 01:04:12 +00:00
Robert Watson
8f092df025 Teach netstat(1) about the new global netisr policy sysctl,
net.isr.dispatch, and about per-protocol dispatch policies.

MFC after:	3 weeks
Reviewed by:	bz
Sponsored by:	Juniper Networks, Inc.
2011-05-24 12:38:00 +00:00
Ruslan Ermilov
71737f5a06 Ensure there is a whitespace after a mount point.
PR:		157286
Submitted by:	Marcus Reid
MFC after:	3 days
2011-05-24 06:56:40 +00:00
Xin LI
fc26891004 Match symbolic link handling behavior with GNU gzip, bzip2 and xz:
When we are operating on a symbolic link pointing to an existing
file, bail out by default, but go ahead if -f is specified.

Submitted by:	arundel
MFC after:	2 weeks
2011-05-23 09:40:21 +00:00
Xin LI
be07528c53 Diff reduction against NetBSD. The most notable change is to zdiff(1) to
handle more file formats including bzip2 and xz.

MFC after:	2 weeks
2011-05-23 09:02:44 +00:00
Sergey Kandaurov
d9b2153b4e Add missing header file.
MFC after:	1 week
2011-05-20 17:03:23 +00:00
Benedict Reuschling
6bef5d2865 Correct typos in comments, no functional changes.
Found by:	codespell
Reviewed by:	kaiw
MFC after:	1 week
2011-05-20 11:29:09 +00:00
Benedict Reuschling
b2bf146e3e Fix typos in comments, no functional changes.
Found by:       codespell
Reviewed by:    alfred
MFC after:      1 week
2011-05-19 20:35:40 +00:00
Ben Laurie
9bde021a87 Fix clang warnings.
Note: these were actually bugs (printf with no format string).

Approved by: philip (mentor)
2011-05-18 20:52:52 +00:00
Rick Macklem
1f3765902c Change the sysctl naming for the old and new NFS clients
to vfs.oldnfs.xxx and vfs.nfs.xxx respectively. This makes
the default nfs client use vfs.nfs.xxx after r221124.
2011-05-15 20:52:43 +00:00
Stanislav Sedov
0d1d6d589b - Fix several typos [1]
- fuser(1) writes usernames to stderr, not stdout [1]
- Add history section.

Submitted by: Pieter de Goeje <pieter@degoeje.nl> [1]
2011-05-14 04:02:56 +00:00
Xin LI
61382374d1 Constify a few string variables. While I'm there, also convert usage() to
use a prototype.

MFC after:	2 weeks
2011-05-13 22:35:06 +00:00
Ruslan Ermilov
22a2d42fa3 Fixed an embedded shell script.
Reviewed by:	sobomax
2011-05-13 09:55:48 +00:00
Warner Losh
8d917b4b49 uintmax_t is a better type here...
Submitted by:	avg@
2011-05-12 19:10:00 +00:00
Warner Losh
76db9ccfbe Fix printf int mismatch on 32-bit architectures... 2011-05-12 17:02:56 +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
Poul-Henning Kamp
9fc9ddee09 Flush the scriptfile whenever we see a non-graphical character to get
more real-time logging, without forcing a write(2) on every single
character.
2011-05-10 10:58:57 +00:00
Xin LI
5187751e00 Regenerated with latest configure script.
MFC after:	1 month
2011-05-10 01:05:41 +00:00
Ruslan Ermilov
6d0d87ca78 - Add a forgotten -o to usage().
- Sync usage() with manpage's SYNOPSIS.
2011-05-05 10:17:49 +00:00
Ruslan Ermilov
fe3ea03ad2 [mdoc] remove a hard sentence break. 2011-05-05 10:17:08 +00:00
Rick Macklem
f90f8f0098 Update nfsstat.1 to reflect the changes done to nfsstat(1)
by r221455. This includes a new "-o" option for displaying
statistics from the old NFS client/server and a slightly
different description for the "-e" option.
This is a content change.
2011-05-04 20:28:06 +00:00
Rick Macklem
e85b7d75a4 Modify nfsstat(1) so that it reports statistics for the
new NFS client/server by default, in a format compatible
with the old NFS client/server. Also add a "-o" flag that
forces nfsstat(1) to get statistics for the old NFS
client/server.
2011-05-04 20:13:26 +00:00
Rick Macklem
c01be3b713 Modify nfsstat(1) so that it prints out the buffer cache
stats in the same way for the new client as the old one.

MFC after:	2 weeks
2011-05-04 19:28:44 +00:00
Rick Macklem
0e8f7d1995 Fix nfsstat.c so that the "-z" option works for the new
NFS subsystem.

MFC after:	2 weeks
2011-05-04 13:50:37 +00:00
Rick Macklem
785b257239 Revert r221308, since it incorrectly zero'd both client and
server stats when "-c" or "-s" was specified.
2011-05-04 13:20:44 +00:00
Ruslan Ermilov
41af50287c Fixed bad format and misorder. 2011-05-03 12:29:03 +00:00
Doug Rabson
ba675b4176 Call pam_setcred() before login_getpwclass to support home directories
on GSS-API authenticated NFS where the kerberos credentials need to be
saved so that the kernel can authenticate to the NFS server.
2011-05-03 10:18:27 +00:00
Edward Tomasz Napierala
a7ad07bff3 Change the way rctl interfaces with jails by introducing prison_racct
structure, which acts as a proxy between them.  This makes jail rules
persistent, i.e. they can be added before jail gets created, and they
don't disappear when the jail gets destroyed.
2011-05-03 07:32:58 +00:00
Dimitry Andric
565a812648 Minor updates to the clang and tblgen manpages. 2011-05-02 21:10:13 +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
Rick Macklem
dd831c63e0 Fix nfsstat.1 to indicate that "-z" now works for
the new NFS subsystems after r221308.
This is a content change.

MFC after:	2 weeks
2011-05-01 23:55:56 +00:00
Rick Macklem
d380a59d3d Fix nfsstat so that the "-z" option works for the
new NFS subsystem.

MFC after:	2 weeks
2011-05-01 23:41:35 +00:00
Ulrich Spörlein
aeea395e35 Let users' PATH decide which groff suite to pick up.
Let groff pass the -c flag to grotty, which will turn off ANSI
sequences. While these are not a problem for our more/less, they get
mangled by col(1) and this will result in garbage output.

This makes man(1) work together with textproc/groff, in case the
user decided to delete the old groff from base (-DWITHOUT_GROFF).
2011-05-01 19:47:34 +00:00
John Baldwin
a011c62e8b Raise rlogin back to a WARNS level of 6.
Tested by:	make universe
2011-04-27 17:36:37 +00:00
Doug Barton
46dccdb284 Revert r221053 by replacing WARNS?= 3 since it's breaking the build on
several arches.
2011-04-26 22:02:51 +00:00
John Baldwin
dc0a06319e Generate the network byte order version of the window size structure in a
temporary variable on the stack and then copy that into the output buffer
so that the htons() conversions use aligned accesses.

MFC after:	1 month
2011-04-26 20:14:29 +00:00
David E. O'Brien
37508ef3eb This builds OK using the parent dir's WARNS=6.
[built on both AMD64 and i386]
2011-04-26 04:09:20 +00:00
David E. O'Brien
5d46cc89b9 Catch up with r57841 which removed the possible linking against libutil
by not bothering to include its API.
2011-04-26 04:01:08 +00:00
Jilles Tjoelker
1792d820be printf(1): Move non-bugs from the BUGS section to a new section CAVEATS. 2011-04-25 19:15:58 +00:00
Jilles Tjoelker
8a906b236a printf(1): Mention effect of '#' modifier on other conversions. 2011-04-25 12:36:29 +00:00
Simon L. B. Nielsen
6e46c1cc7d Check return code of setuid() and setgid() in finger.
While they will not fail in normal circumstances, better safe than
sorry.

MFC after:	1 week
2011-04-23 14:19:26 +00:00
Jilles Tjoelker
a4a1c5b11e kdump: Show code for signals where the default action was taken.
This information is available as of kernel r220740. Trace files from older
kernels will always have 0.

MFC after:	1 week
2011-04-17 21:11:55 +00:00
Edward Tomasz Napierala
ee2509d1a2 Add manual page for rctl.conf(5). 2011-04-14 18:37:27 +00:00
Ruslan Ermilov
4898f742c7 Show client's access cache statistics. 2011-04-13 13:05:48 +00:00
Edward Tomasz Napierala
ae1fdbee9e Add link to rctl(8). 2011-04-10 10:17:01 +00:00
Edwin Groothuis
8128094045 When specifying the -t option (send tag in front of message), this tag
should also be forwarded to the remote logging host, not only when the
logging is done locally.

PR:		bin/154324
Submitted by:	Callum Gibson <callumgibson@optusnet.com.au>
MFC after:	1 week
2011-04-08 12:33:07 +00:00
Gabor Kovesdan
b66a823be8 - Adjust a comment to actual behaviour
- Makefile nit
- Add more CVS/SVN keywords to make it easier to track changes from NetBSD
  in case they add further improvements

Approved by:	delphij (mentor)
Obtained from:	The NetBSD Project
2011-04-07 13:03:35 +00:00
Gabor Kovesdan
d841ecb30d - Simplify the fixed string pattern preprocessing code
- Improve readability

Approved by:	delphij (mentor)
Obtained from:	The NetBSD Project
2011-04-07 13:01:03 +00:00
Gabor Kovesdan
acac8baf59 - Replace some strcpy()-family functions with memcpy() ones. It has been
discussed earlier that the extra safeness is not required in these
  cases and we can avoid the overhead by using the more general
  memory copy functions.

Approved by:	delphij (mentor)
Obtained from:	The NetBSD Project
2011-04-07 12:52:46 +00:00
Sergey Kandaurov
89b13f486a Document -w for swapuse.
PR:		docs/156089
Submitted by:	Andrey Ignatov <rdna att rdna.ru>
MFC after:	1 week
2011-04-05 07:56:40 +00:00
Gordon Tetlow
deeff310cc Overhaul locale handling.
Use locale(1) to determine the locale instead of trying to hand roll it.
Correctly construct groff call based on charset and locale independently,
not the mix between the two.

Submitted by:	uqs@
2011-04-02 05:01:09 +00:00
Ed Maste
41aebe5fc9 Remove $Log$ keyword, which can cause annoyance in diffs in some cases.
Revision control tools have a history command to obtain this information.
2011-03-31 14:35:33 +00:00
Edward Tomasz Napierala
20d3bac00f Fix grammar and bump date.
Submitted by:	trociny
2011-03-30 20:13:55 +00:00
Edward Tomasz Napierala
6ec54a57b4 Add rctl(8), the utility to manage rctl rules.
Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib (earlier version)
2011-03-30 18:27:52 +00:00
Ganael LAPLANCHE
8321d59192 Add myself 2011-03-28 08:37:48 +00:00
Hajimu UMEMOTO
3db78cf013 getpwnam(3) may return NULL.
Requested by:   nork
Reviewed by:    Takeharu KATO <takeharu1219__at__ybb.ne.jp>, nork
MFC after:      1 week
2011-03-27 12:53:20 +00:00
Ruslan Ermilov
afc7401525 Fixed sockets display somewhat (-L, -T, -x, -Lx, with and without -A).
(I didn't try to fix negative TCP timers with -x.)

MFC after:	3 days
2011-03-26 19:09:28 +00:00
Ruslan Ermilov
97b0bfc2e9 Discourage from using "cp -r". 2011-03-24 13:52:59 +00:00
Edwin Groothuis
8f056e41f7 Please welcome the Brazilian calendar in the FreeBSD base.
For now, calendar.brazilian points to pt_BR.ISO8859-1

Submitted by:	Renato Tambellini <rtsanch@gmail.com>
MFC after:	1 week
2011-03-23 21:22:03 +00:00
Jeff Roberson
aa0a1e58f0 - Merge in OFED 1.5.3 from projects/ofed/head 2011-03-21 09:58:24 +00:00
Sofian Brabez
f14368513d Add myself to calendar.freebsd.
Approved by:	miwi@ (mentor)
2011-03-18 09:06:06 +00:00
Ed Maste
ea9827d3be Remove uptime validity check that hasn't been necessary since r151417
switched to clock_gettime.  vmstat will now not exit with an error
if run on a system with 10 years of uptime.
2011-03-17 01:05:54 +00:00
Dmitry Chagin
28e5e0bf4c Add my birthday to the freebsd calendar. 2011-03-14 13:02:12 +00:00
Rebecca Cran
e17c4d4eb8 Fix typo. 2011-03-13 16:47:21 +00:00
Mikolaj Golub
b95f402d56 Add myself to calendar.freebsd and committers-src.dot.
Approved by:	pjd (mentor)
2011-03-11 10:11:22 +00:00
Glen Barber
be2cad28b3 Move the explanation of using arguments for the PRIMARIES above
the list of PRIMARIES.

PR:		151812
Submitted by:	Jay (jouellette of gmail com)
Patch by:	eadler
MFC after:	1 week
2011-03-10 18:00:47 +00:00
Jilles Tjoelker
de55508483 Simplify various code that allowed for sys_signame being lower case.
This was changed in r218285.
2011-03-06 19:50:47 +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
Sergey A. Osokin
7b9758e308 Expand the name of Palm Sunday holiday with more canonical Entry of the
Lord into Jerusalem.
Merge the Pentecost and Trinity Sunday holidays, they are synonyms.
Remove Body of Christ day, nonexistent holiday for Orthodox Church.
Fix typo in the name of Ioann The Baptist, introduced in previous commit.
2011-03-02 11:09:34 +00:00
Sergey A. Osokin
a4c7e084c9 Fix beginning day of the Carnival. it starts 2011-03-02 11:04:50 +00:00
Jilles Tjoelker
77fae5c16d printf: Note that this is used both as a normal program and a shell builtin. 2011-03-01 21:47:06 +00:00
Dmitry Chagin
dde5f9b938 Teach kdump to decode linux syscalls names too.
Fix bug introduced in my previous commit: the kernel always dump native
signal numbers, so no need to check the ABI in ktrpsig().

Suggested by:	jhb
MFC after:	1 Month.
2011-03-01 16:42:28 +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
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
Pawel Jakub Dawidek
10b9d77bf1 Finally... Import the latest open-source ZFS version - (SPA) 28.
Few new things available from now on:

- Data deduplication.
- Triple parity RAIDZ (RAIDZ3).
- zfs diff.
- zpool split.
- Snapshot holds.
- zpool import -F. Allows to rewind corrupted pool to earlier
  transaction group.
- Possibility to import pool in read-only mode.

MFC after:	1 month
2011-02-27 19:41:40 +00:00
Dimitry Andric
9190ccb851 Regenerate clang and tblgen manpages; the clang manpage has some minor
updates.
2011-02-27 01:45:36 +00:00
Remko Lodder
6bf23913c2 Not only had I included a syntax / style error, nice.3 is also
deprecated.
2011-02-26 11:20:51 +00:00
Dmitry Chagin
a30c325c64 Update manual page to reflect latest changes of ABI description support.
MFC after:	1 Month.
2011-02-25 22:14:12 +00:00
Dmitry Chagin
7144d36fab Teach kdump to understand sv_flags records in the trace files.
MFC after:	1 Month.
2011-02-25 22:07:23 +00:00
Remko Lodder
f0d789acde Revert the commit that I made, there is a lot of discussion
and it's not accurate anyway

Requested by:	jb, bde
2011-02-25 19:38:42 +00:00
Jaakko Heinonen
c23211e97e Document the input line length limit.
Submitted by:	Dominic Fandrey (original version)
2011-02-25 19:10:19 +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
Remko Lodder
71e4f6595b Add wording about the priority range and
mention what effect this has at certain
values.

PR:		124469
Obtained from:	NetBSD nice.1 v1.14
MFC after:	1 week
2011-02-24 16:13:33 +00:00
Rebecca Cran
974206cf70 Fix typos - remove duplicate "is".
PR:		docs/154934
Submitted by:	Eitan Adler <lists at eitanadler.com>
MFC after:	3 days
2011-02-23 09:22:33 +00:00
Ulrich Spörlein
423102c6fa Flesh out WITHOUT_GROFF support to DTRT.
A full featured groff is required during buildworld, so build it always
and don't rely on it being present on the host system.

vgrind(1) is tightly coupled to a roff processor and will not be
built/installed when groff is disabled. Also much of the roff'ed
documentation under share/doc will not be built/installed when
WITHOUT_GROFF is defined.

Reviewed by:	ru (partial)
2011-02-22 08:13:49 +00:00
Ulrich Spörlein
3dfe8ce942 Teach tools/install.sh the -d directory mode.
Sync up with flags understood by install(1) [1], and make install(1)'s
usage output not hide the clearly documented -M flag.

PR:		misc/154739 [1]
Submitted by:	arundel
2011-02-22 08:07:17 +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
Sergey A. Osokin
11b3cbc224 Replace hard-coded value by Julian2Gregorian converter function. 2011-02-18 13:41:45 +00:00
Sergey A. Osokin
49540251bd Fix the beginning day of the Great Lent, it starts on Monday for 7 weeks before Paskha.
Fix the Exaltation of the Holy Cross day.
Add more Twelve holidays (dvunadesyatye prazdniki).
2011-02-17 12:21:14 +00:00
John Baldwin
ad01891403 Properly check for errors from waitpid().
Submitted by:	gcooper
MFC after:	1 week
2011-02-15 12:42:18 +00:00
Doug Barton
4939927762 Synthesize the change from NetBSD's 1.33:
"Do not crash if a date cannot be represented (localtime returning
NULL), use the Epoch value instead."

Obtained from:  njoly@NetBSD.org
2011-02-11 05:33:35 +00:00
Sergey A. Osokin
b24cc00190 Always convert Paskha day from Julian (old) to Gregorian (new) style by
adding 13 days.  Bug introduced in 1.13 revision.
2011-02-09 06:38:32 +00:00
Sergey A. Osokin
2aa2451972 Fix Paskha and Paskha-specific holidays. 2011-02-09 05:30:38 +00:00
Glen Barber
252b39bfa2 Update manpage to remove CRT reference.
PR:		154441
Submitted by:	Ben Haga (bhaga of absoludicrous com)
Suggestion by:	pluknet
Approved by:	keramida (mentor)
MFC after:	3 days
2011-02-07 22:33:39 +00:00
Jaakko Heinonen
96a7586b7d - Use LINE_MAX from limits.h as the maximum line length instead of
BUFSIZ. Use LINE_MAX * 2 as the buffer size (BSIZE).
- Error out if we encounter a line longer than LINE_MAX. The previous
  behavior was to silently split long lines and produce corrupted
  output.

PR:		bin/151384
2011-02-07 18:10:18 +00:00
Jaakko Heinonen
a373cd6a6f Handle EOF when skipping lines. 2011-02-07 18:05:56 +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
200520dfce Fix typo in example getopt(1) script: $i vs $1 [1]
While here apply style hammer.

PR:		docs/154289 [1]
Submitted by:	Jamie Landeg Jones <jamie@bishopston.net>
MFC after:	1 week
2011-01-26 18:43:15 +00:00
Dmitry Chagin
718f2aed09 Add -H flag to print thread id. 2011-01-26 06:36:14 +00:00
John Baldwin
c06b9dd0c0 Remove dead code.
MFC after:	2 weeks
2011-01-25 22:21:05 +00:00
Ulrich Spörlein
9b61837ada Use test(1) operators and test for the catpage not being older than the
manpage.

Identical mtimes (as generated by buildworld for these files) precluded
catpages from working.

Approved by:	gordon
2011-01-25 18:32:21 +00:00
Robert Watson
bc211d112d While printing out the WSID and CPU ID only the first time it appears for
each workstream, rather than on every protocol, is prettier, it makes
machine-parsing of netstat -Q output a lot harder.  Repeat the information
and hope that the user forgives us slightly dense formatting.

MFC after:	3 days
Reported by:	bz
Sponsored by:	Juniper Networks
2011-01-24 10:58:36 +00:00
Robert Watson
7ff67a2025 Fix off-by-one whitespace error in netstat -Q workstream listing.
Reported by:	bz
MFC after:	3 days
Sponsored by:	Juniper Networks
2011-01-24 10:54:09 +00:00
Giorgos Keramidas
001dcb9133 Touch up the sample memory usage numbers a bit, to avoid wrapping
on terminal boundary.  While here add definition for 'G' and fix
the indentation of 'K' units.

Submitted by:	plunket
PR:		docs/153614
MFC after:	3 days
2011-01-23 11:08:39 +00:00
Tony Finch
9bbfc2e646 Update to upstrea version 2.5.6.
Detect IO errors properly.
Write #line directives to the correct output stream.

Obtained from:	http://dotat.at/prog/unifdef
2011-01-21 18:10:11 +00:00
Hajimu UMEMOTO
cd05232a21 - Hide the internal scope address representation of the KAME IPv6
stack from the output of `netstat -ani'.
- The node-local multicast address in the output of `netstat -rn'
  should be handled as well.

Spotted by:	Bernd Walter <ticso__at__cicely7.cicely.de>
2011-01-20 15:22:01 +00:00
Tony Finch
8bd9ecb569 Update to upstream version 2.3
Only significant change is to fix a bu when the output file overwrites
the input when the input is redirected.

Obtained from: http://dotat.at/prog/unifdef
2011-01-18 19:13:03 +00:00
John Baldwin
23cbe0938d Add two more features to cpuset(1):
- Add a new -C flag to create a new cpuset and move an existing pid into
 that set.
- Allow 'all' to be specified for a cpu list (e.g. cpuset -s 1 -l all)
 which maps to the list of all CPUs in the system.

MFC after:	2 weeks
2011-01-14 19:57:28 +00:00
Jilles Tjoelker
919e14f01e sed: Try hard links to make -i target available continually.
When creating a backup file, sed renamed the original before renaming the
changed copy into place, leading to a short time when no file with the
original name was present (usually only visible on SMP systems). Try
creating the backup file using a hard link instead, avoiding this problem.
If creating the hard link fails for any reason, fall back to the old rename
method.

When not creating a backup file, sed already renamed the changed copy onto
the original. This remains unchanged.

I am not adding the suppression of redundant fchown/fchmod to this commit,
because FreeBSD appears to check this in the kernel (for msdosfs at least).

PR:		bin/153261
Submitted by:	Pedro F. Giffuni
Reviewed by:	dds (older version)
Obtained from:	Illumos
MFC after:	2 weeks
2011-01-08 00:03:18 +00:00
Warner Losh
cd2ae2532f Retire TARGET_ABI.
Implement MACHINE_ARCH=mips64e[lb] to build N64 images.  This replaces
MACHINE_ARCH=mipse[lb] TARGET_ABI=n64.

MACHINE_ARCH=mipsn32e[lb] has been added, but currently requires
WITHOUT_CDDL due to atomic issues in libzfs.  I've not investigated
this much, but implemented this to preserve as much of the TARGET_ABI
functionality that I could.  Since its presence doesn't affect the
working cases, I've kept it in for now.

Added mips64e[lb] to make universe, so more kernels build.

And I think this (finally) closes the curtain on the tbemd tree.
2011-01-07 20:26:33 +00:00
Sergey A. Osokin
7a51c53b49 Fix typo: March -> September. 2011-01-05 21:17:14 +00:00
Josh Paetzel
53c8f97512 Add myself. 2011-01-02 23:38:05 +00:00
Jilles Tjoelker
add265c6ba printf: Do not use sh memory functions in sh builtin.
These functions throw exceptions if they fail, possibly causing memory
leaks. The normal out-of-memory handling suffices. The INTOFF around almost
all of printf prevents memory leaks due to SIGINT.
2010-12-29 21:38:00 +00:00
John Baldwin
581499c3bf Start sentences on a new line to ease life for translators. Tweak the
wording in a few places.

MFC after:	1 week
2010-12-28 18:58:15 +00:00
Ulrich Spörlein
20a95cd6fc Revert most of r210764, now that mdocml does the right
thing with empty quotation macros.

Requested by:	Alex Kozlov
2010-12-28 10:08:50 +00:00
Ed Schouten
88d5e71efe Fix style bug introduced in r216696.
Additional indentation caused the line to become longer than 80 columns.
2010-12-27 15:05:15 +00:00
Kai Wang
b60d416b6b Document the syntax accepted by the -M option.
Obtained from:	elftoolchain
2010-12-26 18:15:32 +00:00
Kai Wang
da9c9ea458 Improve the description of the -q option.
Obtained from:	elftoolchain
2010-12-26 18:12:13 +00:00
Kai Wang
3a870f82fc * Add mention of the -f, -q, -S, and -V options in the synopsis
section.
* Document the `-l`, `-M` and `-S` options.
* Improve the text describing the behavior of the `-r` option.
* Start a section on standard compliance.
* Indicate in the synopsis that the `-S` and `-s` options are mutually
  exclusive.

Obtained from:	elftoolchain
2010-12-26 18:10:39 +00:00
Maxim Konovalov
50ca181e5d o Fix -u flag description: it takes a username as an argument.
PR:		docs/153416
Submitted by:	Eitan Adler
MFC after:	1 week
2010-12-25 17:35:30 +00:00
Sergey A. Osokin
f6db469642 Fix typo (Pashka -> Paskha). 2010-12-25 11:52:04 +00:00
Ed Schouten
2d491fabff Slightly improve output of lock(1).
- Remove the /dev/ portion of the TTY name.
- In case we use lock -p, print the username that was used to obtain the
  password hash.
2010-12-25 11:24:27 +00:00
Jilles Tjoelker
6a6760db7f sh: Make warnings in the printf builtin non-fatal, like in the program.
The #define for warnx now behaves much like the libc function (except that
it uses sh command name and output).

Also, it now uses C99 __VA_ARGS__ so there is no need for three different
macros for 0, 1 or 2 parameters.
2010-12-20 23:06:57 +00:00
Philippe Charnier
0fe7f010e4 Add __unused 2010-12-20 08:47:43 +00:00
Philippe Charnier
6d8484b0d0 Add __unused. Ansi prototypes. 2010-12-19 16:25:23 +00:00
Philippe Charnier
640e31deaf Add __unused. Ansi prototypes. 2010-12-19 14:18:07 +00:00
Ulf Lilleengen
de956290ba - Signal that data should not be modified. 2010-12-18 20:43:18 +00:00
Doug Barton
34aba78b16 Bring in the relevant changes from NetBSD's 1.31:
"Use strlcpy, not strncpy, when the desired semantics are strlcpy's
rather than strncpy's."

Note: NetBSD's 1.32 is their adoption of our r216206

Obtained from:	dholland@NetBSD.org
2010-12-18 00:30:52 +00:00
Xin LI
de46de4dd1 Revert r216423 per request from Jilles.
The new behavior prevents us from being able to bail out explicitly
on unknown options that we have not implemented.  BASH for instance
have introduced a '-v' for printf(1) builtin and it seems to be bad
to pretend that we supported it and have a script break silently.
2010-12-14 20:35:08 +00:00
Xin LI
5eccc0009b When printf is being used as a sh(1) builtin, it can not call
exit(3) as pointed out by jilles@ so revert to using return(),
also change the return value back to 1 as requested by bde@.

This is logically a revert of revision 216422.
2010-12-14 18:23:15 +00:00
Gordon Tetlow
82db8a5e35 Move sysctl invocation to using a variable that's fully pathed.
This prevents errors for users that don't have /sbin in their PATH.

Submitted by:	Max Boyarov
Approved by:	mentor (wes@ implicit)
2010-12-14 06:07:18 +00:00
Xin LI
69be0c5ea2 We work on ctype's and not only on numbers so set LC_ALL instead of
LC_NUMERIC.

PR:		bin/152934
Submitted by:	Pedro F. Giffuni <giffunip tutopia.com>
Obtained from:	Illumos
2010-12-14 01:28:33 +00:00
Xin LI
02a4a3f56c IEEE Std 1003.1-2008, Section 1.4, Utility Description Defaults says
that when the options section is listed as "None", utility shall
recognize "--" as a first argument to be discarded.

This implementation is largely based on OpenBSD implementation but
we do slightly differently:

a) We skip argv[0] as the first step;
b) We test whether the next argument is "--" and ignore it.

With this change one will get:

%printf
usage: printf format [arguments ...]
%printf -v
-v%printf -- -v
-v%
%printf --
usage: printf format [arguments ...]

Which matches the behavior observed on a Debian system but different
from the Illumos change.
2010-12-14 01:16:56 +00:00
Xin LI
6715165066 Make use of EX_USAGE for usage(). 2010-12-14 00:21:34 +00:00
Xin LI
9180853b89 The only caller of mknum() provides a char instead of an int, so make it
match the definition.

PR:		bin/152934
Submitted by:	Pedro F. Giffuni <giffunip tutopia.com>
Obtained from:	Illumos
2010-12-13 19:54:42 +00:00
Xin LI
c9aca921b8 Move locale.h include to the beginning header section as pointed out by
style(9)

Submitted by:	Pedro F. Giffuni <giffunip tutopia.com>
2010-12-13 19:50:12 +00:00
Warner Losh
cab6e6e1fb FreeBSD committer Dan Moschuk has passed away. Here is his death notice:
http://www.lifenews.ca/thespec/profile/98251--moschuk-daniel

PR:		147479
2010-12-13 16:23:02 +00:00
Joel Dahl
da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
Doug Barton
de28c1d699 Bring in the change from OpenBSD's 1.14:
"synchronize synopsis and usage; "-l", "-r", "-s" and "-x" are mutually
exclusive; while here, slightly improve spacing in the source code
so it fits on a 80-column display again.

diff greatly improved by martynas@"

Obtained from:	sobrado@OpenBSD.org
2010-12-09 23:57:23 +00:00
Jilles Tjoelker
1866e8abab printf: Remove support for building as a csh builtin.
The #define BUILTIN was for building as a csh (not tcsh) builtin.
Given that csh was replaced by tcsh years ago there is no point in keeping
this.

The #define SHELL is for building as an sh builtin and is in active use.

This commit does not change the /bin/sh and /usr/bin/printf binaries.
2010-12-08 22:13:27 +00:00
Florian Smeets
f9cd2d0a8d Add myself to calendar.freebsd and committers-ports.dot
Approved by:	fjoe (mentor)
2010-12-07 23:56:51 +00:00
Jaakko Heinonen
cdfc719c2e Don't write the terminating NUL past end of buffer.
PR:		bin/152345
Submitted by:	Mateusz Guzik
2010-12-06 09:18:11 +00:00
Doug Barton
4221d3eb78 Bring in the change from NetBSD 1.28:
"\\ -> \e"

Obtained from:	joerg@NetBSD.org

Bump .Dd because we're now up to date with the latest NetBSD version
2010-12-05 22:47:08 +00:00
Doug Barton
c6281ac026 Bring in the following changes from NetBSD:
1.21
"Document the flags displayed by the default format, and mention their short
names. From espie@openbsd via jmc@openbsd."

1.24
"Fix three variable names.
From Todd T. Fries via Jason McIntyre."

Obtained from:	wiz@NetBSD.org (previous 2)

1.25
"Be consistent: document the birthtime field of struct stat for
the "B" field specifier."

Obtained from:	reed@NetBSD.org

1.26
"Drop trailing space."

Obtained from:	wiz@NetBSD.org

1.27
"Since we have st_birthtime in struct stat, it is in default display."

Obtained from:	enami@NetBSD.org

Purposely skipping the following revisions:
1.22	NetBSD-specific change
1.23	Removal of license clauses 3 and 4, already handled by imp
	in our r203971
2010-12-05 22:41:58 +00:00
Doug Barton
dc5e1d528e Bring in the change from NetBSD 1.20:
"Make sentence easier to parse. From jsing@openbsd via jmc@openbsd."

Obtained from:	wiz@NetBSD.org
2010-12-05 22:24:34 +00:00
Doug Barton
7c304a3b0f Bring in the changes from NetBSD 1.16 that we did not already have.
"Some fixes from jmc@openbsd."

Obtained from:	wiz@NetBSD.org
2010-12-05 22:20:08 +00:00
Doug Barton
d127a98c99 Bring in the changes from NetBSD 1.13 that we did not already have, with
some differences.

"Sort options. Use more mdoc macros. Some nit fixes. Bump date."

Obtained from:	wiz@NetBSD.org
2010-12-05 22:16:51 +00:00
Doug Barton
1c40e1f66c Bring in the change from NetBSD 1.12:
"document default format."

Obtained from:	yamt@NetBSD.org
2010-12-05 22:01:01 +00:00
Doug Barton
da78facc72 Bring in the following changes from NetBSD. See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44128

1.29
"Don't printf time_t with %d; fixes PR 44128 from yamt. With this change it
successfully prints mtimes after 2038."

1.30
"Improve previous with comments."

Obtained from:	dholland@NetBSD.org (both)
2010-12-05 21:53:12 +00:00
Doug Barton
d7233fd615 Fix an "unused variable" error that gets us all the way to WARNS=6 2010-12-05 21:33:05 +00:00
Doug Barton
9b3f439482 Bring in the update from NetBSD 1.28:
"Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)"

Because of code differences I had to hand-apply parts of the patch,
so responsibility for errors goes to me.

Obtained from:	lukem@NetBSD.org
2010-12-05 21:29:20 +00:00
Doug Barton
d29003e79e Bring in the update from NetBSD 1.19, the documentation of readlink -f
"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)

Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"

Obtained from:	elad@NetBSD.org
2010-12-05 21:17:02 +00:00
Doug Barton
b9f9338ea8 Bring in a new feature, adding a -f option to readlink to print the path
of the target, similar to realpath(1). See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=34662

This brings in the following changes:
1.24
"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)

Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"

Obtained from:	elad@NetBSD.org

1.25
"Fix a segfault when doing 'stat -f %R' on the stdin file handle, instead
fake the filename '(stdin)' like the %N format."

Obtained from:	mlelstv@NetBSD.org

1.27
"The ofmt variable is actually a bit mask (not the character that was
in the format string) so that we can "or" it with the bits in the
formats variable.  This fixes the missing " -> " in front of the real
path (when you use %SR).

Also, the ?: needs another space."

Obtained from:	atatat@NetBSD.org

I am purposely omitting the following changes:
1.23	A humanize_number(3) clone that should better be implemented by
	actually using humanize_number(3)
1.26	This is the removal of license clause 3 and 4, already handled
	by imp in r203971
2010-12-05 21:11:45 +00:00
Doug Barton
578800b575 Bring in the change from NetBSD 1.22:
"Fix a trivial truncation case, and eliminate a corner case that might
print a nul character."

I am purposely bypassing the following versions:
1.19	A build infrastructure change that does not apply to us
1.20	A feature I am not interested in, but don't object if someone else
	wants to pick it up
1.21	A build infrastructure change that does not apply to us

Obtained from:	atatat@NetBSD.org
2010-12-05 20:47:53 +00:00
Doug Barton
5c06c8a134 Add my own documentation for the change in our r216196, aka NetBSD's 1.18
For -L if stat(2) fails, fall back to lstat(2).

.Dd purposely not bumped because more changes are coming.
2010-12-05 09:35:07 +00:00
Doug Barton
ccdbe8ce16 Bring in the change from NetBSD 1.18:
"If using stat (the -L flag) and it fails, fall back to lstat().  It
may be the case that we're examining a broken symlink, and anything is
better than nothing."

The changes in 1.14 through 1.17 were not relevant to us.

Obtained from:	atatat@NetBSD.org
2010-12-05 09:33:04 +00:00
Ulrich Spörlein
cded07a878 Move most of the remaining USD/PSD/SMM papers into share/doc 2010-12-04 10:11:20 +00:00
Gordon Tetlow
57cd97175a Add ability to decompress different format manual pages.
Add support for .so directive in manual pages.

Approved by:	mentor (wes@)
2010-12-03 02:07:34 +00:00
Xin LI
706d26a4a4 Decode IPC_CREAT and IPC_EXCL for semget(2).
PR:		bin/152781
Submitted by:	Anton Yuzhaninov <citrin citrin ru>
MFC after:	2 weeks
2010-12-02 18:24:22 +00:00
Kevin Lo
e66a677b27 Don't error out while searching for empty directories.
Submitted by:	Bakul Shah <bakul at bitblocks dot com>
2010-12-02 01:46:06 +00:00
Kai Wang
773810fb45 Add option -D for ranlib(1). When -D is speicified, ranlib(1) will generate
a deterministic archive symbol table (i.e. timestamp for the symbol table
member header is set to 0).

Submitted by: 	 Erik Cederstrand
2010-11-28 18:53:57 +00:00
Rebecca Cran
a709913fdd Fix typo. 2010-11-27 21:35:16 +00:00
Ulrich Spörlein
9c4bab2ddc Pet make checkdpadd. 2010-11-25 19:22:24 +00:00
Nathan Whitehorn
b396ac3d0f Properly use SCHAR_MAX instead of CHAR_MAX for 0x7f. This fixes operation
of locate(1) on systems on which char is unsigned by default (ARM and
PowerPC).

Reported by:	Paul Mather
MFC after:	4 days
2010-11-23 15:08:56 +00:00
George V. Neville-Neil
b205d03d78 Restore the (state) and \n printout when not using -T.
Pointed out by:	brucec@
MFC after:	3 weeks
2010-11-22 22:55:43 +00:00
Rebecca Cran
70557f4f83 hdr.elf.e_ident[EI_OSABI] is not a bitmask so '==' should been used.
Reported by: Artem Belevich <fbsdlist at src.cx>
2010-11-22 20:18:46 +00:00
Rebecca Cran
1161d4202c Fix some more warnings found by clang. 2010-11-22 20:10:48 +00:00
Attilio Rao
7f08176ee8 Add the ability for GDB to printout the thread name along with other
thread specific informations.

In order to do that, and in order to avoid KBI breakage with existing
infrastructure the following semantic is implemented:
- For live programs, a new member to the PT_LWPINFO is added (pl_tdname)
- For cores, a new ELF note is added (NT_THRMISC) that can be used for
  storing thread specific, miscellaneous, informations. Right now it is
  just popluated with a thread name.

GDB, then, retrieves the correct informations from the corefile via the
BFD interface, as it groks the ELF notes and create appropriate
pseudo-sections.

Sponsored by:	Sandvine Incorporated
Tested by:	gianni
Discussed with:	dim, kan, kib
MFC after:	2 weeks
2010-11-22 14:42:13 +00:00
Rebecca Cran
e267ef95d5 Don't generate input() since it's not used. 2010-11-22 14:16:22 +00:00
Stephen McKay
29afe03fd1 Various syntactic tweaks to satisfy style(9). No change to execution.
Submitted by:	gcooper@
2010-11-21 21:31:29 +00:00
Stephen McKay
92095ab601 xargs can be fooled by exiting children that it did not start, causing
it to kick off a new command before the previous has finished, resulting
in corrupted (interleaved) output.  It is also fooled by non-exiting
children it did not start, failing to exit until all extraneous children
have exited.

This patch makes xargs keep track of children it starts, ignoring
pre-existing ones.
2010-11-21 10:55:16 +00:00
Kevin Lo
a48551fac2 Remove unused variable 2010-11-20 15:22:16 +00:00
Jilles Tjoelker
9897c45f31 sh: Add printf builtin.
This was removed in 2001 but I think it is appropriate to add it back:
* I do not want to encourage people to write fragile and non-portable echo
  commands by making printf much slower than echo.
* Recent versions of Autoconf use it a lot.
* Almost no software still wants to support systems that do not have
  printf(1) at all.
* In many other shells printf is already a builtin.

Side effect: printf is now always the builtin version (which behaves
identically to /usr/bin/printf) and cannot be overridden via PATH (except
via the undocumented %builtin mechanism).

Code size increases about 5K on i386. Embedded folks might want to replace
/usr/bin/printf with a hard link to /usr/bin/alias.
2010-11-19 12:56:13 +00:00
Kevin Lo
b00f982843 Fix fd leak
MFC after:	3 days
2010-11-19 10:18:58 +00:00
Kevin Lo
f9af8a7b9c Close file and directory descriptors
MFC after:	3 days
2010-11-19 10:15:29 +00:00
Ryan Stone
3c578b2a05 When netstat was run with -i/-I and -w1 to produce running counters, the idrop
field printed an absolute value rather than the delta from the last value

Approved by:	emaste (mentor)
MFC after:	1 week
2010-11-18 23:46:55 +00:00
George V. Neville-Neil
f5d34df525 Add new, per connection, statistics for TCP, including:
Retransmitted Packets
Zero Window Advertisements
Out of Order Receives

These statistics are available via the -T argument to
netstat(1).
MFC after:	2 weeks
2010-11-17 18:55:12 +00:00
Rebecca Cran
4784a27247 Memory stats are reported in bytes, not pages.
PR:	docs/151283
Submitted by:	Bas Smeelen <b.smeelen at ose.nl>
MFC after: 3 days
2010-11-13 11:43:20 +00:00
Jaakko Heinonen
e04c378683 Set FD_CLOEXEC for the output file only when the file has been specified
with the -o option. Setting the flag for stderr (the default) could
cause the traced process to redirect stderr to a random file.

PR:		bin/152151
Submitted by:	ashish
MFC after:	5 days
2010-11-13 09:28:49 +00:00
Zack Kirsch
88d196db30 Add my birthday to the calendar so everyone can send me presents.
Approved by: zml (mentor)
2010-11-10 18:45:32 +00:00
Ulrich Spörlein
91109a91ba Unbreak the test target by re-generating the initial scanner
using an updated flex(1) binary.

Also ignore the changing $FreeBSD$ ID lines when doing the diff.
This needs additional obfuscation, to not upset the svn precommit
hooks :/
2010-11-09 18:28:11 +00:00
Rebecca Cran
b1ce21c6ef Fix typos.
PR:	bin/148894
Submitted by:	olgeni
2010-11-09 10:59:09 +00:00
David E. O'Brien
6d4a0c96d3 Fix the build on 64-bit hosts. WARNS=6 fails on them. 2010-11-09 02:51:38 +00:00
David E. O'Brien
2d15e75781 Back out r214961 for skeleton.c -- it broke the groff build. 2010-11-08 19:00:22 +00:00
Ruslan Ermilov
ecfd40f14d Add/expand country/state. 2010-11-08 09:50:47 +00:00
Ruslan Ermilov
2a000d9c8c A traditional (once per three years) sort by month/day/year/login.
While here, fixed badly formatted lines.
2010-11-08 09:26:56 +00:00
David E. O'Brien
7846096d2b Add '-y' for bison compatibility.
Obtained from:	http://invisible-island.net
2010-11-07 23:44:40 +00:00
David E. O'Brien
c81609f43f Inherit WARNS from parent directory.
Submitted by:	marius
2010-11-07 23:34:05 +00:00
David E. O'Brien
92a010d28b Directly use memory allocation functions and remove needless casts in
their usage.  Also use associated modern types instead of k&r ones.
2010-11-07 23:22:42 +00:00