Commit Graph

13999 Commits

Author SHA1 Message Date
mrg
85f6c4cfe8 don't build ldd64 support if !MKCOMPAT and mips64. 2019-02-04 00:05:20 +00:00
mrg
37649e4074 - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
thorpej
68e270a267 Implement support for "pshared" POSIX semaphores.
Fixes lib/53273 (and Firefox's multi-process tab feature).
2019-02-03 03:20:23 +00:00
mrg
fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
mrg
2235c7e9bc make a fallthru comment GCC7 compatible. 2019-02-01 08:37:21 +00:00
mrg
684b182f81 compare pointers with NULL not '\0'. 2019-02-01 08:29:03 +00:00
christos
44671790a5 PR/53916: Rob Gill: remove redundant assignment to matchlen. 2019-01-28 12:04:16 +00:00
kre
d5635413aa Revert previous, it was based upon a misreading of the POSIX
spec.   POSIX requires "as if by calling strtod()" which we
did already ... by calling strtod().   Go back to doing that.
2019-01-27 12:03:09 +00:00
kre
636d0f3dee Fix merge botch 2019-01-27 05:16:55 +00:00
kre
0eb8e4ef15 Fix merge botch 2019-01-27 05:15:42 +00:00
kre
1300bdf616 Fix merge botch 2019-01-27 05:14:45 +00:00
pgoyette
d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
kre
4ca169f245 Always convert input numbers (from the command line) in the C
locale, not as set in the environment.   Conforms with POSIX spec.
2019-01-26 15:22:54 +00:00
christos
ace5fc6aeb no need for curses.h 2019-01-25 15:34:22 +00:00
christos
6b2ce0800e PR/53906: Paul Ripke: systat(1) vmstat & syscall get
"alternate system clock has died" on terminal resize (SIGWINCH)
2019-01-25 15:31:11 +00:00
martin
cf341f607a Support redrawing all windows when in a msg prompt via Ctrl-l. 2019-01-22 18:39:49 +00:00
martin
0053548254 msg_prompt_win: if the default string fits, show it separately even
in fixed size windows. Previously it would only show up when auto-sizing
prompts figured it would fit (probably an oversight).
2019-01-21 20:28:08 +00:00
uwe
a73c12be45 .Pp before .Bd is redundant.
From Edgar Pettijohn.
2019-01-13 16:48:51 +00:00
martin
8a7549a99f Allow argument expansion in menu titles as well. 2019-01-09 19:43:37 +00:00
tih
b953ff3f9a Remove a format character from a non-format string. 2019-01-08 08:22:20 +00:00
martin
afdad64472 Fix a potential NULL deref in previous - some menus start up with no
"opts" array allocated yet.
2019-01-06 11:08:34 +00:00
maya
8a135c6afb Match the function prototype of encrypthandler instead of casting to it.
Make GCC 9 snapshot happier with the code

While here, remove unnecessary braces around return (KNF).
2019-01-05 08:55:58 +00:00
maya
f96d98db06 Bump WARNS to 5, and remove unnecessary -Wno (tested with pkgsrc clang 7) 2019-01-05 06:59:46 +00:00
maya
d9e6b51adf Remove advertising clause, permitted by the copyright author. 2019-01-05 06:56:03 +00:00
maya
68daebb7bc unifdef compatibility for old BSD servers. This has been
disabled, so no binary change. from openbsd.
2019-01-05 06:47:24 +00:00
maya
28da966269 Avoid unnecessary casts, from openbsd. No binary change. 2019-01-05 06:30:05 +00:00
christos
681a027a82 recognize destructor attribute. 2019-01-04 18:51:23 +00:00
martin
b8b0f2eea4 Add an option for single (disabled) menu lines to have no shortcut. 2019-01-04 15:27:19 +00:00
martin
01b87e76cf If a menu starts with disabled options, skip those and start at the
first enabled one instead.
2019-01-02 16:32:59 +00:00
martin
0de30d2afa Match all arm (and simplify powerpc conditionals) 2019-01-01 14:01:46 +00:00
christos
395228d264 Update usage comments, add arm 2018-12-31 13:32:05 +00:00
martin
47b9b2b3a0 ibcs2 is gone 2018-12-29 18:09:32 +00:00
wiz
48f9820ef3 Fix some macro usage. Fix a typo. 2018-12-28 12:21:53 +00:00
sevan
3986ee252c Remove commentd out options for fields no longer present in source. 2018-12-26 01:54:09 +00:00
sevan
5a5cdfa229 Extend "systat vm" output to provide better insight about buffercache and
document it.

From Greg A. Woods in PR bin/36542
2018-12-26 01:47:37 +00:00
sevan
66a1de5f19 Remove reference to Installing and Operating 4.3BSD paper, at present it's not
possible to find a paper titled as such with sections starting with
"Interpreting system activity".
There is a "Monitoring System Performance" section present from the 4.1BSD
Installing and Operating paper up to and including the 4.4BSD paper. The advice
in this section has not aged very well.
From "Installing and Operating 4.3BSD-tahoe UNIX on the VAX":
"Cumulatively on one of our large machines we average about 60-100
context switches and interrupts per second and about 70-120 system calls
per second"
2018-12-25 03:38:59 +00:00
christos
2763409dc3 yydebug is now defined only if YYDEBUG is 2018-12-24 02:07:44 +00:00
christos
876968801f yydebug is now available only if YYDEBUG is set. 2018-12-23 19:09:03 +00:00
sjg
38267d9f3b ParseVErrorInternal: use .PARSEDIR and
apply realpath(3) if not absolute,
and use .PARSEFILE for consitent results.

Reviewed by: christos
2018-12-22 00:36:32 +00:00
sjg
dca4343b05 unexport-env: avoid SEGFAULT if MAKELEVEL not in env 2018-12-21 05:50:19 +00:00
martin
b18e79c6bb compat/svr4* is gone - adapt 2018-12-19 16:27:26 +00:00
christos
07ed41e72f - Default terminator to \n
- Don't print a trailing separator
Behavior now matches GNU seq (from Aram at tech-userlevel)
2018-12-17 20:10:51 +00:00
christos
25ae7c06e6 PR/53796: Valery Ushakov: make prints wrong makefile path in an error message
Use ${.CURDIR} if ${.PARSEDIR} is not absolute.
2018-12-17 02:06:00 +00:00
christos
3b6f899d34 use %s formats to avoid -flag confusion (from sjg) 2018-12-16 18:53:34 +00:00
christos
3aa82d61be Use printf instead of echo since we can't portably use \ in string (from sjg@)
http://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html
2018-12-16 17:30:57 +00:00
maya
c1e97742c6 Remove README relevant to 1995 telnet. 2018-12-15 22:56:51 +00:00
wiz
4abf4a7a7a Remove reference to krb_realmofhost(3) which does not exist.
Someone who speaks kerberos might want to check the -k description.

Remove some macros that do nothing and use \(em.
2018-12-15 22:17:02 +00:00
maya
067f4a3470 You can encrypt outside of north america now. 2018-12-15 22:12:15 +00:00
christos
dbe0036b5a minor cleanup:
- more const
- prevent overflow of the argument vector
- change a lot of unsigned to signed to eliminate casts
2018-12-14 23:40:17 +00:00
maya
4f0678d2a5 Remove unneeded casts 2018-12-14 06:28:49 +00:00
maya
5d185efcae Remove some effectively if 0'd code. 2018-12-14 06:27:40 +00:00
maya
5b38d170b8 Inline the only use of NetNonblockingIO.
While here inline SetSockOpt. From openbsd.
2018-12-14 06:17:30 +00:00
maya
4e424770ac G/C In3270 - always false 2018-12-14 06:08:18 +00:00
maya
6aa0aef1f6 Expand SIG_FUNC_RET -from openbsd. 2018-12-13 09:20:05 +00:00
maya
16d5f4a25f Remove unused code. 2018-12-13 09:07:53 +00:00
maya
e1e42e087d Remove unused code. 2018-12-13 05:22:14 +00:00
maya
342e9885b0 ExitString is used for error exit, do the minimum necessary here.
Avoid infinite loop:
telrcv->suboption->ExitString->SetForExit->telrcv

Reported by hacker fantastic, thanks!
2018-12-13 05:15:11 +00:00
maya
233931799b static-ify. 2018-12-13 05:07:03 +00:00
maya
7c20b20625 unifdef TN3270 which is never defined (and wouldn't build if it was)
delete tn3270 file no longer needed.
SetIn3270(); expands to nothing now, so remove it.

No functional change.
2018-12-13 04:49:19 +00:00
sevan
a07b17440a typo 2018-12-13 01:58:04 +00:00
sevan
daf842171c Describe what happens when you run vmstat witout any options aka the first line
of vmstat.
2018-12-13 01:29:10 +00:00
maya
3a1a1fef8c switch sprintf to snprintf in places.
Reported by hacker fantastic, thanks!

ok xtos.
2018-12-12 19:05:32 +00:00
sevan
3803d792b7 Document the source of load average figures. 2018-12-06 19:15:35 +00:00
sevan
d63ba803ad Add a statement about uptime's relation to w(1). 2018-12-06 19:01:53 +00:00
sevan
fd25e7cfc8 Document vmstat -w -1 is accepted.
via FreeBSD.
2018-12-05 23:42:23 +00:00
sevan
92ffdc1d37 Suggest kernhist(9) which is required for vmstat -u and -U
Drop Pp before Bl while here.
2018-12-05 10:35:14 +00:00
wiz
1b717af45c Sort SEE ALSO. 2018-12-04 08:01:35 +00:00
sevan
61ac015f2e Note these tools use kvm(3) and not procfs as in Solaris. 2018-12-03 17:03:44 +00:00
christos
51c91e52e5 add warn_unused_result. 2018-11-24 13:10:20 +00:00
uwe
415ab74c4d Try to provide the typesetting help requested. 2018-11-21 22:42:26 +00:00
martin
34c5a1a313 Add (optional) support for expanded static menu texts - that is: whatever
the application programmer defines as expansion, e.g. to implement
parameter substitution.
While here add rudimentary documentation of the dynamic messages
feature (so at least the parser and the syntax documented here
are in sync).
The man page could use some typesetting help...
2018-11-21 20:04:48 +00:00
scole
4c8f1ccfba PR toolchain/53710
allow 64bit target to compile on 32bit host

Ok'ed by <christos>
2018-11-16 20:49:08 +00:00
mlelstv
dd276a2ec2 The test for regular file was wrong.
From yarl on freenode, thanks!
2018-11-16 13:55:17 +00:00
christos
3b9b386971 use the data size in case stdout was a pipe (M. Levinson) 2018-11-11 01:42:36 +00:00
sevan
5c3002f0a7 Note the date Larry Levan passed away https://en.wikipedia.org/wiki/Larry_Levan 2018-11-03 22:04:30 +00:00
sevan
017d75399e Let's house this up a bit.
Add The Mix Collection, mixed by Sasha & John Digweed.
https://en.wikipedia.org/wiki/Renaissance:_The_Mix_Collection
2018-11-03 21:34:35 +00:00
kre
d4305dc776 sysctl(KERN_BOPOTIME) started returning a struct timespec in 2009.
Update to match....    We're slow but we get there eventually!

NFC for any of these programs, struct timeval and struct timespec
are the same size, and only the tv_sec field of boottime is used,
and that's unchanged.
2018-10-30 21:15:09 +00:00
christos
3e167e7237 fix typo. 2018-10-29 00:14:37 +00:00
christos
bc30e841a8 handle stdin with header partially read. 2018-10-27 23:40:04 +00:00
christos
92e36ceeff remove debugging. 2018-10-27 13:20:21 +00:00
kre
5a5ac0a56f Fix printf conversion of off_t for 32 bit hosts (fix i386 build)
(%td is for ptrdiff_t)
2018-10-27 11:52:26 +00:00
skrll
ef95ae4a36 Fix previous 2018-10-27 11:39:12 +00:00
christos
41c9b009a9 Add lzip support to gzip based on the example lzip decoder. 2018-10-26 22:10:15 +00:00
christos
a0e7897afd Disable __int128 checks if we are not building on a 64 bit host (
this is suboptimal, but it is the easiest way).
2018-10-07 14:20:01 +00:00
martin
3871bbe7ed Add -l support for xz files 2018-10-06 16:36:45 +00:00
rmind
39013e66c1 NPF: Major rework -- migrate NPF to the libnv library.
- This conversion significantly simplifies the code and moves NPF to
  a binary serialisation format (replacing the XML-like format).
- Fix some memory/reference leaks and possibly use-after-free bugs.
- Bump NPF_VERSION as this change makes libnpf incompatible with the
  previous versions.  Also, different serialisation format means NPF
  connection/config saving and loading is not compatible with the
  previous versions either.

Thanks to christos@ for extra testing.
2018-09-29 14:41:35 +00:00
kre
f910883c96 A truly ancient bug found by Edgar Fuss
When printf is running builtin in a sh, global vars aren't reset to
0 between invocations.   This affects "rval" which remembers state
from a previous %b \c and thereafter always exits after the first
format conversion, until we get a conversion that generates an
error (which resets the flag almost by accident)

	printf %b abc\\c
	abc				(no \n)
	printf %s%s hello world
	hello				(no \n, of course, no world ...)
	printf %s%s hello world
	hello
	printf %s%s hello world
	hello
	printf %d hello
	printf: hello: expected numeric value
	0				(no \n)
	printf %s%s hello world
	helloworld			(no \n, and we are back!)

This affects both /bin/sh and /bin/csh (and has for a very long time).

XXX pullup -8
2018-09-10 14:42:29 +00:00
christos
0909701cc6 recognize int128 2018-09-07 15:16:15 +00:00
kre
2bdb5be389 Inspired by PR pkg/53543
When calculating the length of the args that can be
appended in a "find .... -exec something {} +"
usage, remember to allow for the arg pointers, which
form part of what is allowed in ARG_MAX.

From a fairly empty installation of HEAD on amd64
and with a "/tmp/args" command that simply prints
its arg count, and the length of the arg strings,
with this mod I see ..

netbsd# find / -exec /tmp/args {} +
Argc 5000 Arglen 107645
Argc 5000 Arglen 151324
Argc 5000 Arglen 187725
Argc 5000 Arglen 206591
Argc 5000 Arglen 172909
Argc 5000 Arglen 186264
Argc 5000 Arglen 167906
Argc 2881 Arglen 98260

The upper limit of 5000 args is in the code.

Using the biggest of those, 5000
args, plus 206591 bytes of strings
uses 246591 bytes total (this excludes
the command name, so add a few more).
That's fairly close to the ARG_MAX
of 262144.

On another system (with longer paths) I see:
(this is just a small part of the output, using a
different version of the dummy command, and a
slightly different invocation)

Args: 4546 Len 218030
Args: 4878 Len 217991
Args: 4813 Len 218028
Args: 4803 Len 218029

There, 4878*8 + 217991 == 257015 which is about
as close as we'd want to come to the arg limit.

XXX pullup -8
2018-09-04 15:16:15 +00:00
kre
8b37a6dbec Printf's that support \e for escape all seem to also support \E.
Except us.   Now we do as well.
2018-09-04 01:13:50 +00:00
christos
6cd09489aa support deprecated("string") for libpcap 2018-09-03 15:16:33 +00:00
kre
68b40b6c11 Tighten syntax a little (no more %*4.*2d nonsense).
Include the format collected so far in "missing format char" err message.
Minor KNF and whitespace.
2018-09-03 04:10:20 +00:00
kre
24f342dfd6 PR standards/53563
POSIX requires that signed numbers (strings preceded by '+' or '-')
be allowed as inputs to all of the integer format conversions, including
those which treat the data as unsigned.

Hence we do not need a variant function whose only difference from its
companion is to reject strings starting with '-' - instead we use
the primary function (getintmax()) for everything and remove getuintmax().

Minor update to the man page to indicate that the arg to all of the
integer conversions (diouxX) must be an integer constant (with an
optional sign) and to make it blatantly clear that %o is octal and
%u is unsigned decimal (for some reason those weren't explicitly stated
unlike d i x and X).  Delete "respectively", it is not needed (and does
not really apply).

XXX pullup -8
2018-08-31 17:27:35 +00:00
riastradh
3432a2eb7f Bump config(5) version for OPT.foo.c variables. 2018-08-27 16:04:45 +00:00
riastradh
72c36f8199 Tag each .c file with the options that might have brought it in. 2018-08-27 05:35:00 +00:00
christos
4685e01b74 add WITHOUT_GZIP for the tools build. 2018-08-12 09:03:21 +00:00
christos
8e22f7e23d fix libraries 2018-08-12 08:00:32 +00:00
christos
4f89880b45 remove stray paren 2018-08-12 07:59:14 +00:00
christos
dfe5f25515 add WITHOUT_BZ2 for tools build. 2018-08-12 07:53:19 +00:00
christos
ab4aefc826 use setvbuf if available; it is more portable. 2018-08-11 19:44:19 +00:00
christos
647d6f88ee don't build NLS if we don't need to 2018-08-11 19:43:54 +00:00
christos
ce1225c115 remove dup includes (already in grep.h) 2018-08-11 16:03:37 +00:00
kre
9f2b1d9e76 Avoid an infinite loop caused by a line accidentally dropped
in 1.22 (almost 30 months ago!)

[ Discovered by rhialto@ ]
2018-07-30 22:58:09 +00:00
wiz
e694dd94ec Use An -nosplit. Use Mt. Fix some mandoc lint. 2018-07-28 08:03:41 +00:00
wiz
8c602bad3c Sync usage with man page. 2018-07-26 08:57:32 +00:00
wiz
4426bfba8a Add -S to SYNOPSIS. Sort option descriptions. 2018-07-26 08:57:26 +00:00
kamil
783e210b8b Introduce a new option -S in crunchgen(1)
The -S argument enables sanitization with a sanitizer in libc.
2018-07-25 23:41:28 +00:00
kre
47ea218fd1 NFC: More KNF (remove () around returned constants). 2018-07-25 15:35:27 +00:00
kre
5755a4ea22 NFC: whitespace & KNF. 2018-07-25 14:41:52 +00:00
christos
706eabb7af Provide MacOS/X compatible flags (where possible)
Propagate errno
2018-07-25 03:45:34 +00:00
kre
2fb3e9fabf Add the new formats to the list of format cracters (oops...) 2018-07-24 20:58:39 +00:00
kre
ddc0976a72 Add support for F a and A formats (which go with the eEfgG formats
already supported.)
2018-07-24 20:49:19 +00:00
kre
520d24e3eb Correct a typo (off by one (key)) ...
There is no 'w' format, but there is an 'e'
2018-07-24 19:49:33 +00:00
wiz
3926ef35d5 Fix typo. Comment out SEE ALSO since it only refers nonexistent man pages.
Reduce history to NetBSD until we know more details about other OSes.
Use An. Fix Dt argument.
2018-07-24 19:08:22 +00:00
christos
0d2d986001 Tiny base64 encoder/decoder command patterned after the linux and the macosx
ones with the same name,.
2018-07-24 15:26:16 +00:00
snj
d55a68a4f5 add netbsd 8.0, fix whitespace 2018-07-21 18:50:22 +00:00
joerg
e077d7edbf Ignore malformed directory entries as created by Dropbox ("/"). 2018-07-19 18:04:25 +00:00
maxv
5ae6235d0e Remove tpfmt(1). Its code was merged into tprof(8). 2018-07-13 11:14:14 +00:00
mrg
1b11df59cf don't try to decend into remove 'pmc' subdir. 2018-07-13 11:13:10 +00:00
maxv
696d8f99b2 Remove the usr.bin/pmc tool. People should use tprof instead. 2018-07-13 09:15:55 +00:00
christos
3a280067df Fix previous: cached_stats() returning < 0 means that the file is not found,
not that it was found in the cache, and centralize reporting.
2018-07-12 18:03:31 +00:00
reinoud
38c2b03323 Remove duplicate code in make(1)'s dir.c.
When the cached_stats() code was added, some old logic stayed around that
implements the cached_stats() too.
2018-07-12 17:46:37 +00:00
msaitoh
24a510d5b0 Print iqdrops, too. This change also fixes a bug that Odrops prints
iqdrops when kvm read failed.
2018-07-11 07:46:20 +00:00
christos
f4654072f5 recognize noinline attribute 2018-07-08 17:48:42 +00:00
kre
4bcba09122 Avoid printing error messages twice when an invalid
escape sequence (\ sequence) is present in an arg to a %b
conversion.
2018-07-03 01:56:39 +00:00
kre
a78ff1f90a From leot@ on tech-userlevel:
Avoid running off into oblivion when a format string,
or arg to a %b conversion ends in an unescaped backslash.

Patch from Leo slightly modified by me.
2018-07-03 01:54:42 +00:00
christos
9f321dce94 Add our syslog format. 2018-06-29 20:18:36 +00:00
christos
8910c94cf4 add missing args for 123 2018-06-29 20:18:05 +00:00
msaitoh
204f26c6d9 Print BPF direction correctly. 2018-06-26 10:00:25 +00:00
msaitoh
90fcd8faa4 Fix a bug that BPF_D_OUT isn't printed correctly. 2018-06-26 09:50:42 +00:00
msaitoh
3cd62456f9 Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

 This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
2018-06-26 06:47:57 +00:00
kamil
2ca8c8d72f Specify SANITIZER_RENAME_SYMBOL in chpass
Rename local versions of getpwent getpwnam getpwnam_r getpwuid getpwuid_r
(all of the symbols are namespaced) in order to remove symbol clash with
libc.

This program uses code directly from libc.
2018-06-25 18:05:25 +00:00
christos
fd98358317 Don't require any arguments as the usage indicates; simplifies the code
and the documentation: now "jot" works like "jot -" used to (and continues
to). From Ingo Schwarze
2018-06-25 14:29:17 +00:00
kamil
b6ed70bb6e Add new option -s to crunchgen(1) -- enable sanitization
As of today typical sanitizers require dynamic executables, while
crunchgen(1) programs are produced with static properties.

Lack of specified -s will:
 - generate a Makefile file with NOSANITIZER=
 - build programs that are dependencies with NOSANITIZER=

In future there is an option to handle sanitization in statically linked
programs.

An idea with -s LGTM by <christos>
2018-06-21 10:55:54 +00:00
kamil
f4a6ea5271 Disable SANITIZER for ldd(1)
These utilities (elf32, elf32_compat, elf64, liblldb) share code with the
ELF dynamic loader that is not being sanitized and its symbols are
installed into sanitized programs (in particular __tls_get_addr()).

Additionally libldd is used in rescue that is not expected to be sanitized
as of today.
2018-06-21 10:41:45 +00:00
christos
a2ee17b347 Keep things portable (requested by joerg) by not depending on reallocarr
and instead doing the overflow check ourselves.
2018-06-18 18:33:31 +00:00
christos
759529ae76 PR/53368: Thomas Barabosch: Potential integer overflow in usr.bin/patch/inp.c 2018-06-16 00:40:14 +00:00
mrg
2951cf94c8 move 'utsname' to the main() function scope, so that the reference to
it outside the block remains valid.

should fix an asan reported issue.
2018-06-15 20:16:35 +00:00
christos
88efda49f6 remove extra quotes. 2018-06-12 15:41:35 +00:00
christos
bf830a4102 - instead of hard-coding the include paths in mkioctls, pass them in
from the Makefile so that they are consistent.
- do more sed so that destination paths are not hard-coded inside #include
  statements.
2018-06-12 15:40:39 +00:00
kamil
2760f15b81 Correct Undefined Behavior in gzip(1)
Unportable left shift reported with MKSANITIZER=yes USE_SANITIZER=undefined:

# progress -zf ./games.tgz  tar -xp -C "./" -f -
/public/src.git/usr.bin/gzip/gzip.c:2126:33: runtime error: left shift of 251 by 24 places cannot be represented in type 'int'
100% |****************************************************************************************************************| 44500 KiB  119.69 MiB/s    00:00 ETA


Refactor the following code into something that is more clear
and fix signed integer shift, by casting all buf[] elements to
(unsigned int):

unsigned char buf[8];
uint32_t usize;
[...]
else {
    usize = buf[4] | buf[5] << 8 |
            buf[6] << 16 | buf[7] << 24;
[...]

New version:

    usize = buf[4];
    usize |= (unsigned int)buf[5] << 8;
    usize |= (unsigned int)buf[6] << 16;
    usize |= (unsigned int)buf[7] << 24;

Only the "<< 24" part needs explicit cast, but for consistency make the
integer promotion explicit and clear to a code reader.

Sponsored by <The NetBSD Foundation>
2018-06-12 00:42:17 +00:00
kamil
1c426e1841 Restore the MKGROFF=bo MKCXX=yes build
Mark the documentation in dc(1), gprof(1), rogue(6) and fsck_ffs(8) with
the .roff flag in SUBDIR.

Sponsored by <The NetBSD Foundation>
2018-06-11 14:18:16 +00:00
christos
2357fc5dd5 use SUBDIR.roff suggested by uwe@ 2018-06-10 17:55:11 +00:00
nat
911089b591 Update fstat for audio(4) and pad(4) devices.
XXX - pullup 8.

Ok christos@.
2018-06-04 01:42:49 +00:00
kamil
6d98e3fd29 ktruss: Remove symbol clash with libc
Rename local function wprintf() to xwprintf().
This is needed for installing interceptors in sanitizers.

Sponsored by <The NetBSD Foundation>
2018-06-03 13:41:30 +00:00
mrg
446e08b1e8 just include <sys/mutex.h> for mkioctls. this works fine for me
for several platforms and fixes the clang build.
2018-06-02 20:07:15 +00:00
jnemeth
bb57c3804f Update calendar files for the upcoming NetBSD 8.0 release. I'm
assuming that it will be released by August 1, which is two months
from now.  Thus I used 2018 dates for all holidays between Aug.
1st and Dec. 31st, and 2019 dates for all holidays between Jan.
1st and Jul. 31st.
2018-06-02 05:55:47 +00:00
martin
b30263c2e7 Use proper forward declaration for kmutex_t. This makes MKDTRACE=no builds
work again.
2018-05-29 14:29:53 +00:00
martin
351fd74422 Ooops, backout previous - it was an update build artifact (or something) 2018-05-29 13:10:28 +00:00
martin
2e95568bb1 Backout previous: "typedef void *kmutex_t;
is incompatible with our kmutex_t and breaks the build. ZFS will need
to find a better way to work around this.
2018-05-29 11:18:50 +00:00
wiz
b41d19c5ae Remove superfluous Pp. 2018-05-29 08:37:33 +00:00
kamil
954aa6d69d After Todd C. Miller[0] - cal(1) first appeared in Version 1 AT&T UNIX[1][2].
[0] http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/cal/cal.1?rev=1.28&content-type=text/x-cvsweb-markup
[1] https://www.bell-labs.com/usr/dmr/www/1stEdman.html
[2] https://www.bell-labs.com/usr/dmr/www/man61.pdf

Patch submitted by @rjc via https://github.com/NetBSD/src/pull/3
2018-05-29 06:07:26 +00:00
chs
ba2539a980 merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
 - dtrace FBT probes can now be placed in kernel modules.
 - ZFS now supports mmap().
2018-05-28 21:04:59 +00:00
christos
c50a4e606c - Introduce :q modifier for make variables and make it double escape $'s so
that passing variables to recursive makes with :q works as expected.
- Revert :Q to work as before.
- Adjust makefiles that use recursive make to use :q

Discussed on tech-toolchain@
XXX: pullup 8
2018-05-27 01:14:50 +00:00
leot
8d25f7611b Do not accept invalid octal character values (>= 0400).
This also avoid possible stack corruption (e.g. previously `tr -s '\400'' or
similars lead to them).

Reviewed and thanks to <pgoyette>!
2018-05-26 11:20:30 +00:00
christos
fe59327913 Since ${MAKE} converts $$ -> $ during parsing we need to put it back to
preserve the original variable value with :Q.
XXX: pullup-8
2018-05-24 00:27:24 +00:00
christos
45d3ba4e45 unit test for $ underquoting in :Q modifier 2018-05-24 00:25:44 +00:00
joerg
cebcb94770 deconst -> __UNCONST to avoid null pointer arithmetic 2018-05-23 21:20:20 +00:00
christos
45c59656f1 Remove Mail 2018-05-23 01:03:46 +00:00
jmcneill
f5e1fa54fa Add an optional '-p pidfile' parameter. 2018-05-15 01:41:29 +00:00
lukem
94c0b8f918 locate: fix support for multiple databases
Ensure that the first database is correctly added when
more than one database is provided.

Fixes problem I introduced in rev 1.17 on 2009-04-12,
and noticed recently by Simon.
2018-05-14 05:17:10 +00:00
sjg
7ccc79ce72 Just skip polling job token pipe.
The sigchld pipe ensures no busy wait.

PR: 53285
Reviewed by:
2018-05-13 22:13:28 +00:00
christos
e7f0fa0971 PR/53285: Andreas Gustafsson: Build times tripled with make/job.c 1.193
Revert previous:
    2018.05.12.15.14.49/bracket.db:build_wall_time=4896.09
    2018.05.12.18.17.04/bracket.db:build_wall_time=16268.98
2018-05-13 12:10:36 +00:00
sjg
68df7c9526 Skip setting wantToken.
polling the job token pipe adds a lot of overhead
for little gain.
For now, just leave wantToken=0

And avoid busy waiting when no tokens are available and
no jobs are running.

Reviewed by: christos
2018-05-12 18:17:04 +00:00
sevan
838100b8e4 Match sequence of flags with usage()
Following on from mandoc -Tlint, drop Pp macro before Bl and Tn macro.
2018-05-11 16:36:57 +00:00
christos
8234f5ded0 handle field rename. 2018-05-09 01:04:01 +00:00
mrg
1f3c181244 in dir_search(), don't assume a directory existing is useful, instead
confirm that there is a non zero makefile in there.  (this assumes
the makefile is called "Makefile", which is assumed in other places
in crunchgen.c already, so this doesn't make it worse.)

this fixes build issues when an empty subdir exists because some files
were moved subdir at some stage (ktrace, rcorder), and a non-prune
update may look in the wrong dir.

bump version (lots of updates between now and the previous update.)
2018-05-08 23:05:17 +00:00
maxv
5d73803e75 Remove now unused tcpip.h includes. Some were already unused before. 2018-05-03 07:13:48 +00:00
wiz
f3452549f5 Sync usage with manpage. 2018-05-03 05:14:55 +00:00
wiz
48d7082b13 Merge options without arguments in synopsis. 2018-05-03 05:13:20 +00:00
mrg
f2057d54c9 if just parsing don't try to read the uninitialised device name,
or display the unit number.

add a "-s" option that sends an ALL_SOUNDS_OFF midi event.  very
useful after an interrupted midiplay leaves notes on.
2018-05-03 01:12:57 +00:00
christos
58cf2108e5 print the mprotect perm argument symbolically. 2018-04-29 18:00:31 +00:00
christos
aa6e79d158 Keep previous location of device definitions so we can print them in error
messages.
2018-04-09 17:46:56 +00:00
christos
019d365a3a Pass -S to ed(1) so that patches containing ! commands don't run commands.
Real cause of CVS-2018-0492:
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894667)
2018-04-05 18:50:10 +00:00
christos
7a9e78e3c6 Appease the compiler gods; yes I know what I am doing adding to a literal
string.
2018-04-05 16:31:54 +00:00
christos
331fc54718 Be more selective about detecting a SYSV include as opposed to a dependency
line. Dependency lines should contain a '::' operator or ':<space>'.
2018-04-05 00:31:10 +00:00
dholland
377ca2b42e Fix bad markup. 2018-04-02 04:26:17 +00:00
wiz
2458e695f0 Remove Tn. 2018-03-12 09:29:43 +00:00
dholland
ab87b60207 Explicitly mention use of -- for format strings beginning with -,
per PR 21970.
2018-03-12 00:42:05 +00:00
christos
ecaf5f24ed deal with cvs meta-data directories not called CVS. 2018-03-11 14:59:41 +00:00
eadler
c197dbace7 [tail] Fix type of 'len'
ok pgoyette
2018-03-06 03:33:26 +00:00
dholland
7f4ac6d6b0 Don't use the local username as the default anonftp password.
once upon a time doing this was part of the social glue that held the
community together, but that was a long time ago, and now it's just an
information leak.

proposed on tech-userlevel in 2008, then apparently forgotten :-|
2018-03-04 19:57:41 +00:00
htodd
dab912008b Fix typo in comment. 2018-02-26 00:05:05 +00:00
htodd
0fc0030f2f Fix typo in error message. 2018-02-25 23:48:16 +00:00
mrg
2e19323388 add LIBKRB5_LDADD/LIBKRB5_DPADD and their static counterparts
to bsd.prog.mk.  use them instead of hard coding various lists
of libraries for krb5.

this fixes static builds.
2018-02-25 00:16:48 +00:00
sjg
b4dd1ca28c Avoid calling sysconf for every file loaded.
At start of a meta build this can be measurable overhead.

Patch from bdrewery at freebsd.org
2018-02-22 01:59:28 +00:00
sjg
13b51c6c09 Var_Set: avoid SIGSEGV if val is NULL
A NULL val is handled gracefully (by VarAdd) when
var is not previously set, so we ought not crash
the second time.

PR: 53034
2018-02-18 00:52:42 +00:00
sjg
5984bab77d Avoid unused variable warning 2018-02-13 19:37:30 +00:00
sjg
9d28f87b89 Do not treat .info as warning for -W
Reported by: lwhsu at FreeBSD.org
2018-02-12 21:38:09 +00:00
christos
a58fb25d66 more volatile to appease gcc. 2018-02-11 02:51:58 +00:00
dholland
32cded6cc9 Typos. 2018-02-08 09:05:16 +00:00
christos
fa1c26bf9a mark old compat functions. 2018-02-06 20:15:39 +00:00
christos
e7129348cf use OPENSSL_API_COMPAT 2018-02-06 20:10:05 +00:00
christos
5b83cee45e use OpenSSL-1.1 apis 2018-02-06 19:51:03 +00:00
christos
96cef95189 use BN_is_prime_ex 2018-02-06 19:32:49 +00:00
christos
59b2928637 explicitly include <string.h> since OpenSSL-1.1 does not do it for us. 2018-02-06 19:26:02 +00:00
christos
fa34604a3c Adjust to OpenSSL 1.1 2018-02-06 17:58:19 +00:00
mrg
4695f70791 fixes for GCC 6.4:
- fix an indentation issue in radioioctl().
- fix an indentation issue in mpt_run_xfer().
- grep's printline() has some {} placement issues.
2018-02-05 22:14:26 +00:00
jmcneill
95031fc0dd Fix tools build 2018-02-04 17:33:34 +00:00
jmcneill
4c511e4691 Add support for writing "AArch64 Linux kernel image" format images.
These images begin with a 64-byte header that includes a load offset,
image size, some flags, and a small (2 word) area at the start for
executable code.

These images are compatible with U-Boot's "booti" command, and can be
used to make U-Boot relocate our kernel to a 2MB aligned base address.
After relocation, U-Boot will jump to the code at the beginning of the
header, where we encode a relative branch forward instruction to branch
to the beginning of the kernel at offset +0x40.
2018-02-04 15:44:51 +00:00
mrg
aa20739e7d fixes for GCC 6.4:
mail's execute() needs a volatile for setjmp().

telnet has a missing {} issue.

isdnd's print_config() has a missing/wrong {} issue, and
its p_q931bc() has inconsistent indentation (but not any
actual problem.)

map-mbone's accept_neighbors2() compares a vs. a instead
of a vs. b.

sysinst's pm_cgd_check() has missing {} issue.

timed's main() has missing {} issue.
2018-02-04 09:01:12 +00:00
sevan
7a75668892 drop main() prototype 2018-01-23 22:12:52 +00:00
christos
632b456bd3 fix indent 2018-01-15 22:14:24 +00:00
christos
fbbe58556f Add a _Noreturn token 2018-01-15 21:58:54 +00:00
wiz
e7721e081a Stop using Tn. New sentence, new line. 2018-01-09 09:24:22 +00:00
christos
b985414b8f Merge autofs support from: Tomohiro Kusumi
XXX: Does not work yet
2018-01-09 03:31:12 +00:00
christos
541fa6f429 Don't print duplicate definitions for inline symbols. 2017-12-26 17:02:19 +00:00
maya
47dee010ce Return a non-zero (one) exit code on failure for one of the files
But keep on processing them, like ls, rm, and other programs do
2017-12-25 05:08:49 +00:00
plunky
666f6884ad consistent style: connect(2), socket(2) and setsockopt(2) return -1
for error so check for this specifically rather than < 0
2017-12-21 09:04:34 +00:00
plunky
655a736e6f fix width of .Bl list 2017-12-21 09:02:47 +00:00
plunky
516fe55a41 fix offset/indent of list 2017-12-21 08:59:27 +00:00
kre
c56c6100f2 Add names of a few more ICMPv6 messages, from RFC6275 (Mobile IPv6)
and RFC4286 (Multicast Router Discovery.) and as shown in the IANA
parameters page available at:
  https://www.ietf.org/assignments/icmpv6-parameters/icmpv6-parameters.txt

Also make the array be explicitly 256 entries long, one for each possible
code, which will detect attempts to insert names without deleting the
place holder (and mean a good solid NULL de-ref if too many place holders
are deleted, rather than just random results.)
2017-12-19 17:05:15 +00:00
bouyer
878cb1cfc5 Fix fallout from hid factorisation:
- need to install sys/dev/hid/hid.h for userland
- include it where needed - most of the time in place if usb/usbhid.h
2017-12-10 20:38:13 +00:00
leot
2c348fc3b0 Fix a typo.
(or, `Emily Dickinson' - the American poet - was born on the same date)
2017-12-09 23:16:27 +00:00
sjg
156dbb683c Ensure VAR+=val on command line is handled correctly
If VAR is not previously set, call Var_Set to deal with
the special case of VAR_CMD.

If VAR is previously set, and ctxt is VAR_CMD we should do the update
even if VAR_FROM_CMD is set.
2017-12-08 03:36:42 +00:00
mrg
2c65d957b0 deref the right address to get the pool_allocator. 2017-12-04 03:05:57 +00:00
mrg
cd83415f42 remove now wrong comment. minor KNF. 2017-12-03 21:10:01 +00:00
mrg
67dafd4718 fix the kvm version of counting pool pages for vmstat -s. 2017-12-03 21:09:01 +00:00
dholland
d3bb758424 Mention the Sand Creek massacre. 2017-12-02 18:07:34 +00:00
mrg
277fd3d5f5 add two new members to uvmexp_sysctl{}: bootpages and poolpages.
bootpages is set to the pages allocated via uvm_pageboot_alloc().
poolpages is calculated from the list of pools nr_pages members.

this brings us closer to having a valid total of pages known by
the system, vs actual pages originally managed.

XXX: poolpages needs some handling for PR_RECURSIVE pools still.
2017-12-02 08:15:42 +00:00
christos
3ee01a2ea9 - make the level computation consistent
- keep going only if things changed.
2017-11-28 15:31:33 +00:00
christos
dd0971df99 use a reference count to avoid deleting psrefs still in use. 2017-11-27 00:25:46 +00:00
jdolecek
c8469e9019 need getle16() for ext.sub_tag too
PR bin/52762 by Yosuke Sugahara
2017-11-25 17:18:15 +00:00
christos
a8dccd7b32 Make outfile always allocated, free it to set it to NULL, and don't move it
around.
2017-11-25 15:39:17 +00:00
christos
e4a9783186 - Instead of checking the recursion level before we recurse, check in on
function entry.
- Always decrement the level and reset levelparent on exit.
2017-11-24 23:42:36 +00:00
christos
0daba4343e Tidy up error messages, line wraps, initialization. NFC. 2017-11-24 18:45:59 +00:00
snj
4678f4dd6f add -b to usage. 2017-11-22 02:52:42 +00:00
kre
23014bc41f Issue PWD commands to the server only when we actually
need the results, not speculatively, just in case we might.

Allows operation with some broken servers that get confused
by PWD commands in some situations, and saves server round
trips in the (modern) common case of
	ftp ftp://path/name
where we never need to know the results from PWD.
2017-11-20 21:11:36 +00:00
christos
536abc0958 Don't print instances we've already printed. 2017-11-19 01:46:29 +00:00
kre
b83cb69bb5 Remove a stray left over debug printf that crashes the builds (ab==NULL). 2017-11-19 00:41:10 +00:00
sjg
b958c10a1a Do not append to variable set on command line
POSIX requires that variables set on the command line
be immutable.
Var_Append needs to pass FIND_CMD and skip append
if found variable has VAR_FROM_CMD flag set.
2017-11-18 22:34:04 +00:00
christos
3011cfe714 Allow multiple attachments methods to the same child+parent combination:
foo* at bar? with baz
    foo* at bar? with barf

Do this by scanning the list of iba's and allocating a new cfparent for
each. Keep track of the shared parent+child combinations by using the
same id for them.
2017-11-18 18:44:20 +00:00
christos
3434d2c82b - Factor out the remove_pspec code into a function.
- Avoid NULL pointer when printing an error.
2017-11-18 18:41:44 +00:00
christos
021dbaa0a1 add more debugging, no functional change. 2017-11-18 18:39:16 +00:00
christos
de334c4e67 avoid creating infinite loops. 2017-11-18 01:11:05 +00:00
mrg
079cbf3933 add missing 'b' to the optstring. alpha-sort the option handling. 2017-11-17 20:43:08 +00:00
christos
f4a905f0b8 When deleting orphans detect parent<->child loops and break them.
"active" is not a boolean, use the right comparison.
2017-11-16 17:08:07 +00:00
christos
4fe1ef32f3 Only open regular files. 2017-11-09 20:27:50 +00:00
christos
a802845e62 - fix "obsolete" skipping to handle obsolete entries that contain other
variables
- skip files particular to other xserver versions than ours.

XXX: How does this build in the build farm?
2017-11-05 22:52:12 +00:00
christos
d4d3ff8a98 deal with the stdbool.h mess defining bool in <net/if.h> and <net/route.h>
and then xf86Opt.h wanting to define a struct field called bool.
2017-11-05 17:44:28 +00:00
jmcneill
53aff4d5c0 add missing break after -m case 2017-11-05 11:07:32 +00:00
pgoyette
64ae8753d8 Remove the ABI version-and-length check that was recently introduced;
sysctl(9) ABIs should be stable across versions.

XXX Pull-up to -8
2017-11-03 22:45:14 +00:00
ginsbach
094918e495 The sign is optional in an exponent
Treat numbers after [Ee] as a positive number rather than an invalid
numeric sequence.  (Taken from FreeBSD but done differently.)
2017-10-29 01:28:46 +00:00
ginsbach
81821b805f Fix typos (from FreeBSD) 2017-10-29 00:02:23 +00:00
sjg
adfbaec4c0 Ignore empty MAKEOBJDIR
Otherwise we end up with .OBJDIR = ${.CURDIR}/
which is quivalent, but fails the typial
.if ${.OBJDIR} == ${.CURDIR}
2017-10-28 21:54:54 +00:00
pgoyette
cb32a134a5 Update the kernhist(9) kernel history code to address issues identified
in PR kern/52639, as well as some general cleaning-up...

(As proposed on tech-kern@ with additional changes and enhancements.)

Details of changes:

* All history arguments are now stored as uintmax_t values[1], both in
  the kernel and in the structures used for exporting the history data
  to userland via sysctl(9).  This avoids problems on some architectures
  where passing a 64-bit (or larger) value to printf(3) can cause it to
  process the value as multiple arguments.  (This can be particularly
  problematic when printf()'s format string is not a literal, since in
  that case the compiler cannot know how large each argument should be.)

* Update the data structures used for exporting kernel history data to
  include a version number as well as the length of history arguments.

* All [2] existing users of kernhist(9) have had their format strings
  updated.  Each format specifier now includes an explicit length
  modifier 'j' to refer to numeric values of the size of uintmax_t.

* All [2] existing users of kernhist(9) have had their format strings
  updated to replace uses of "%p" with "%#jx", and the pointer
  arguments are now cast to (uintptr_t) before being subsequently cast
  to (uintmax_t).  This is needed to avoid compiler warnings about
  casting "pointer to integer of a different size."

* All [2] existing users of kernhist(9) have had instances of "%s" or
  "%c" format strings replaced with numeric formats; several instances
  of mis-match between format string and argument list have been fixed.

* vmstat(1) has been modified to handle the new size of arguments in the
  history data as exported by sysctl(9).

* vmstat(1) now provides a warning message if the history requested with
  the -u option does not exist (previously, this condition was silently
  ignored, with only a single blank line being printed).

* vmstat(1) now checks the version and argument length included in the
  data exported via sysctl(9) and exits if they do not match the values
  with which vmstat was built.

* The kernhist(9) man-page has been updated to note the additional
  requirements imposed on the format strings, along with several other
  minor changes and enhancements.

[1] It would have been possible to use an explicit length (for example,
    uint64_t) for the history arguments.  But that would require another
    "rototill" of all the users in the future when we add support for an
    architecture that supports a larger size.  Also, the printf(3) format
    specifiers for explicitly-sized values, such as "%"PRIu64, are much
    more verbose (and less aesthetically appealing, IMHO) than simply
    using "%ju".

[2] I've tried very hard to find "all [the] existing users of kernhist(9)"
    but it is possible that I've missed some of them.  I would be glad to
    update any stragglers that anyone identifies.
2017-10-28 00:37:11 +00:00
christos
5716b2d864 remove the braces I accidentally added. 2017-10-23 02:38:46 +00:00
wiz
6f80828675 Remove superfluous Tn. 2017-10-23 01:06:05 +00:00
christos
ffb871e671 PR/52638: matthew green: missing argument check causes m4 to core in ifelse() 2017-10-22 23:01:34 +00:00
abhinav
3fca90b4d2 Add newsyslog.conf to the NAME section
Also fix couple of lint warnings from mandoc
2017-10-22 17:53:49 +00:00