Commit Graph

13597 Commits

Author SHA1 Message Date
nat cf3b979950 Renane ioctl AUDIO_SETPROC to AUDIO_SETCHAN.
Add an ioctl to return channel number (AUDIO_GETCHAN). This can be used
on audio/sound/audioctl devices.

Return EIO in read/write/ioctl/poll/stat if fp has been closed or is
invalid.

Update audio.4, audioio.h and audioctl(1) to reflect these changes.
2017-03-21 07:04:29 +00:00
scole 1c8dc2cc2e Add most common thai length/area measurements of wah rai ngan 2017-03-21 01:21:59 +00:00
snj df2789d5e6 add 7.1 release date 2017-03-15 05:05:04 +00:00
sjg d998c40b6f Do not consider using -C arg "as is" for .CURDIR unless it starts with '/'.
Reviewed by: christos
2017-03-11 23:59:02 +00:00
maxv 8e6373a0b2 Add the AMD 10h family, with additional events that I believe are useful,
the DTLB misses on large pages for example.

While here, remove a few K7 flags that do not actually exist on K7 (there
must have been a confusion between K7 and K8); and make the 'pmc list'
command a little more user-friendly.
2017-03-11 10:33:46 +00:00
wiz 2c8e0836c2 Sort sections. Remove unnecessary/incorrect macros. 2017-03-10 15:34:17 +00:00
maxv 92ee76edc0 PRIu64 2017-03-10 15:06:20 +00:00
maxv 65d7f88d0e Switch to per-CPU PMC results, and completely rewrite the pmc(1) tool. Now
the PMCs are system-wide, fine-grained and more tunable by the user.

We don't do application tracking, since it would require to store the PMC
values in mdproc and starting/stopping the counters on each context switch.
While this doesn't seem to be particularly difficult to achieve, I don't
think it is really interesting; and if someone really wants to measure
the performance of an application, they can simply schedctl it to a cpu
and look at the PMC results for this cpu.

Note that several options are implemented but not yet used.
2017-03-10 13:09:11 +00:00
maxv 279ed0db08 Add a version argument, set to 1, and check it in usr.bin/pmc. Use uint32_t
instead uint8_t since we now need 12bit selectors (10h family). And while
here KNF.
2017-03-08 16:42:27 +00:00
maxv 0446600dd7 We don't use libi386 anymore. 2017-03-08 16:05:29 +00:00
christos 98fc723392 Accept PTR for addtype 2017-03-06 23:04:52 +00:00
christos 23620f03df fix typeof, add __builtin_offsetof 2017-03-06 21:01:39 +00:00
christos 0c480e0900 handle typeof in casts 2017-03-06 11:58:31 +00:00
mlelstv ba576b71a7 Enhance disk metrics by calculating a weighted sum that is incremented
by the number of concurrent I/O requests. Also introduce a new disk_wait()
function to measure requests waiting in a bufq.
iostat -y now reports data about waiting and active requests.

So far only drivers using dksubr and dk, ccd, wd and xbd collect data about
waiting requests.
2017-03-05 23:07:12 +00:00
sjg 1b370898b9 loadfile: in the mmap case ensures that the buffer ends with \n
do the same for the non-mmap case - avoids core dump.
2017-03-01 16:39:49 +00:00
kre 6087ee4af9 Improve appearance (a little) when read with nroff, rather than troff 2017-03-01 13:05:11 +00:00
christos 425b4f3910 fix printf format 2017-02-24 17:19:14 +00:00
christos bb0b3deb55 fix printf format. 2017-02-24 13:03:25 +00:00
christos c9ed210715 This only works with 32 bit Elf and COFF files, make it specific this way
and use sized types so that it works on 64 bit systems (so it can become
a tool).
2017-02-23 18:49:00 +00:00
kre 887a30551e Generate usage error for bad usage, before attempting any other operations.
This means that "mixerctl" (no args) will generate a usage msg, even when
/dev/mixer cannot be opened (or any other device given via -d or $MIXERDEVICE)

While here, get rid of "goto usage" replacing the usage: with a
static inline void __dead function...  The compiler ought to optimise
the calls into essentially the same code as existed with the goto version,
but this is much cleaner.

Also, mixerctl falls back on /dev/mixer0 if /dev/mixer cannot be opened.
(that is old code - probably from when /dev/mixer was first added)

It used to do that when called as mixerctl -d /dev/mixer or with
"MIXERDEVICE=/dev/mixer mixerctl...".   No longer.  Now the fallback (which
is probably obsolete now anyway) only happens when the user doesn't specify
any mixer device (by either method) and the default of /dev/mixer is used.
In other cases, only the device specified is tried.
2017-02-23 14:09:11 +00:00
ozaki-r 00a9cf741d Remove mkludge stuffs
For unknown reasons, IPv6 multicast addresses are linked to a first
IPv6 address assigned to an interface. Due to the design, when removing
a first address having multicast addresses, we need to save them to
somewhere and later restore them once a new IPv6 address is activated.
mkludge stuffs support the operations.

This change links multicast addresses to an interface directly and
throws the kludge away.

Note that as usual some obsolete member variables remain for kvm(3)
users. And also sysctl net.inet6.multicast_kludge remains to avoid
breaking old ifmcstat.

TODO: currently ifnet has a list of in6_multi but obviously the list
should be protocol independent. Provide a common structure (if_multi
or something) to handle in6_multi and in_multi together as well as
ifaddr does for in_ifaddr and in6_ifaddr.
2017-02-23 07:57:09 +00:00
abhinav cb05c08df5 Use Nm to refer the program name. 2017-02-22 14:01:40 +00:00
abhinav 98ea63c468 Fix spelling of "discovered" 2017-02-22 13:43:15 +00:00
kre d7b1a047f9 PR bin/50934 -- avoid core dump if a process being examined has set
its argv[0] to NULL.

XXX Needs pullups netbsd-7-0 and netbsd-7 (bug was introduced after
    netbsd-6 and never pulled up, so no netbsd-6 pullups required.)
2017-02-21 13:09:56 +00:00
leot 535ea0f76d Properly check mmap(2) return value. We can end up with a segmentation
fault if the user does not provide a regular file as look(1) file
argument.

Kindly reviewed by <Riastradh>
2017-02-21 09:23:31 +00:00
maxv 03b4ea3bfc KNF, and make it less i386-specific. 2017-02-18 16:48:38 +00:00
nonaka 165ef89073 ftp(1): split the auth processing function. 2017-02-15 11:52:11 +00:00
nat f835d36292 Audio now uses fdclone, there is no longer a limitation of one audio
instance per process.  Virtual channels are placed in a queue, so there is
no longer a compile time limit of VAUDIOCHANS.

A new sysctl has been added to control multiple user access.
Mixer labels on virtual channels are now prefixed by vchan.

audiobell.c and audioctl have been updated to reflect these changes.

Use of fdclone was posted to tech-kern@ and improvements made.
Multiuser access control changes and the use of a queue were suggessted by
pgoyette@
2017-02-10 19:31:42 +00:00
christos 24354ff041 no more warnings for ld. 2017-02-09 21:25:05 +00:00
christos ad63ac55c7 use mkstemp to prevent linker warning. 2017-02-09 21:23:48 +00:00
joerg 6332a4b097 Turn off fatal linker warnings for now due to mktemp. 2017-02-09 20:39:42 +00:00
joerg d3857c1992 Mark help as static+dead. Don't use __attribute__.
XXX needs a lot more static love. Uses mktemp and doesn't link.
2017-02-09 20:37:58 +00:00
christos dc7b019f31 the tls ifdef was a bit too aggressive. 2017-02-09 17:27:30 +00:00
christos e78ea23712 Use strncpy here because we need to be portable, and we have the +1 byte
to save us :-)
2017-02-08 17:47:36 +00:00
christos fa1ea25f42 use the logical path for -C if correct. 2017-02-07 21:16:31 +00:00
wiz e28e311f97 Use full month name in Dd. 2017-02-06 16:08:56 +00:00
christos eead193d4a Add nc. 2017-02-06 16:04:07 +00:00
christos d71fee0faa - Disable crypto for now, and functionality that we don't provide.
- Fix warnings
2017-02-06 16:03:40 +00:00
christos ac264ff54b Import OpenBSD's netcat. 2017-02-06 16:00:50 +00:00
dholland 3e58855b26 Fix misuse of arc4random by using arc4random_uniform.
Noticed by riastradh.
2017-02-06 02:26:44 +00:00
sjg 693df6904d Since we are avoiding VAR_INTERNAL, allow the variable :_ stores to
to be specified, also allows for multiple stages of modification to
be stashed.
2017-02-01 18:39:27 +00:00
sjg a4a30cd47c Just have :_ use current ctxt, avoid need to force VAR_INTERNAL. 2017-02-01 18:00:14 +00:00
christos 10c59ee542 Use the first name we requested the http/https URL for, not any name we ended
up with after random redirects.
2017-01-31 21:05:35 +00:00
sjg 197bd38659 Add check to cmpv test to ensure that target specific vars with
modifiers work as expected.
2017-01-31 18:56:35 +00:00
sjg 5a008e2e63 Use VAR_INTERNAL when calling ApplyModifiers for VAR_{CMD,GLOBAL} only. 2017-01-31 07:00:59 +00:00
sjg 5f2f8cfca3 Partially initialize Dir before MainParseArgs can be called.
The rest can be done once curdir is finalized.
2017-01-31 06:54:23 +00:00
sjg 4098307a7f Add :range and :_
:range	replaces var value with an integer sequence one per word
	in the current var value.

:_	stores the current var value in $_ so that it can be referred to
	later in the modifier series.

Reviewed by: christos
2017-01-30 02:46:20 +00:00
christos ce31bd9da4 add sqlite3 2017-01-28 23:42:36 +00:00
abhinav 5abd78da99 Fix spelling: s/overritten/overwritten 2017-01-23 10:05:25 +00:00
mrg 1e71d48020 re-do the previous to avoid malloc/free on the same size every iteration.
with this, or the previous, 'netstat -b 1' no longer leaks memory in
-current (or any older release using sysctl for this.)
2017-01-22 04:52:04 +00:00
christos e5282544de sprinkle free 2017-01-22 04:26:31 +00:00
christos 40465f45bf leave pragmas alone. 2017-01-15 21:10:24 +00:00
sjg c3ec6594d3 Allow providing a utc value to :{gm,local}time
Reviewed by: christos
2017-01-14 22:58:04 +00:00
christos 31ed49d544 don't do _KERNEL; hides bswap stuff. 2017-01-14 01:01:48 +00:00
christos a91ed3e0f7 use _KMEMUSER for <sys/file.h> 2017-01-13 04:22:51 +00:00
christos ea36f744b3 fix compilation 2017-01-12 18:52:15 +00:00
christos d59d37f770 give the absolute path for the error message. 2017-01-12 14:27:14 +00:00
ozaki-r 5787b995ac Fix showing multicast addresses of !IFF_UP interfaces
netstat appends '*' to the name of an interface without IFF_UP, so
if_nametoindex which is used in mc_print fails. mc_print needs just
an interface index so pass it instead of a tweaked interface name.
2017-01-11 01:25:05 +00:00
christos f4547403ad need <sys/stat.h> 2017-01-10 21:15:54 +00:00
christos 6dbf86bc11 need <sys/stat.h> for DEFFILEMODE etc. 2017-01-10 21:15:23 +00:00
christos 32377daaf2 need <sys/stat.h> 2017-01-10 21:14:51 +00:00
christos 1df62eba0c needs <sys/stat.h> 2017-01-10 21:14:13 +00:00
christos 5326356364 refactor includes, add <sys/stat.h> 2017-01-10 21:13:45 +00:00
christos a80110f6b6 need <sys/stat.h> 2017-01-10 21:08:48 +00:00
wiz 4e70675da5 Document --keep. From Timo Buhrmester <fstd.lkml@gmail.com> on netbsd-docs.
Use more macros while here.
2017-01-08 14:18:31 +00:00
christos d106d90e70 add pcs 2017-01-07 18:28:49 +00:00
ryo 55563c97ca "vmstat -ie[v]" auto fit to minimum columns
Reviewed by msaitoh@
2017-01-05 07:53:20 +00:00
pgoyette c0a30d4dc7 Adapt to use of bintime(9) for kernel history timestamps (7.99.55). 2017-01-05 03:42:27 +00:00
pgoyette 09c45791e2 Fix error handling confusion between error and errno 2017-01-04 01:29:18 +00:00
pgoyette 394eed3eed Adapt to new version of the sysctl export structure 2017-01-04 01:06:26 +00:00
pgoyette 58e3ff39b3 Use appropriate PRI* format specifiers for fixed-bit-size numbers
Should fix i386 build.
2017-01-02 09:24:54 +00:00
pgoyette ba8c50ff8b For kvm-based kernhist code, print size of history table and "next free"
pointer, same as we do for sysctl-based code.
2017-01-02 02:08:05 +00:00
pgoyette 6a4fc5e568 Restore the kvm-grovelling code for use on crash files (where sysctl(3)
is not available).  Otherwise, this would always report on the current
running kernel regardless of the use of -M option.
2017-01-02 01:48:56 +00:00
pgoyette 93058c7f3d For kernel history display, replace the kvm grovelling with the newly
available sysctl access to the history data.

XXX vmstat still uses kvm for several other displays
2017-01-02 01:02:19 +00:00
dholland 4e631407ca PR 51754 Charlotte Koch: fix -v output of config parser. 2016-12-31 10:13:15 +00:00
christos f51d1f25b9 Print the interface for bpf. 2016-12-30 21:08:23 +00:00
christos c9601077e7 - add buffer bounded attribute
- allow empty attributes
2016-12-30 19:53:08 +00:00
christos 4f56be094e sort, kill typo 2016-12-30 03:36:51 +00:00
christos b79407b5a4 add bounded, fix nonnull 2016-12-30 02:16:36 +00:00
christos 3e691a5244 fix __typeof 2016-12-30 00:57:10 +00:00
christos b29ce927f5 handle __ symbols differently (so we don't duplicate entries in the table)
and add non_null.
2016-12-29 23:54:29 +00:00
mrg 1383c0c74f build vmstat as n64 on mips64. only kernel histories and hash stats
need to be fixed fot this to be reverted.
2016-12-29 23:42:38 +00:00
christos ab5bdf51ae only return attributes if looking for attributes 2016-12-29 19:40:35 +00:00
christos 9ef948be1d allow cascaded attributes 2016-12-29 19:40:21 +00:00
christos a4c7faa796 Add alias attribute 2016-12-29 18:44:49 +00:00
christos 28617f6731 Add always_inline 2016-12-29 18:37:32 +00:00
christos 8deef5e5f2 Add more attributes. 2016-12-29 16:41:16 +00:00
christos a6761f0073 accept optional type attributes after struct/union members 2016-12-29 16:01:46 +00:00
christos 502c644dd9 teach lint __attribute__((__unused__)) 2016-12-27 21:52:35 +00:00
christos b074a61a87 - use UTC
- initialize tm_isdst
- use accpath to handle relative paths
2016-12-26 14:53:17 +00:00
wiz d2bf829be4 Whitespace, sort, remove some superfluous macros/quoting. 2016-12-25 11:10:53 +00:00
christos 90c8a9f073 Add -R (source filename remapping) for MKREPRO 2016-12-24 17:43:45 +00:00
abhinav 842412540f Update the description of the -t option to bring it in sync with IEEE 1003.1 -2008.
The .SS field of the datetime argument of -t option can have range from 0 to 60
as per the 1003.1 2008 standard. POSIX has removed all mentions of double leap
seconds, therefore the allowed range of seconds is now [0,60].

Also, add an ENVIRONMENT section, as the interpretation of the datetime
argument in -t option depends on the TZ environment variable.

Add an xref for parsedate(3) in SEE ALSO.

ok wiz@
2016-12-24 15:49:18 +00:00
mrg 0537635d0c for 64 bit mips platforms where we built userland largely as n32 by
default, build a handful of tools as n64 so they work properly.

unfortunately, they're also static as dynamic n64 has a problem.

of these tools pstat is probably the lowest hanging fruit to convert
to sysctl.  systat would be close were it not for the netstat screen,
which includes netstat itself.

the rest are difficult to perhaps foolish.


the upside is that netstat, pmap and fstat all work properly now.
2016-12-23 10:19:57 +00:00
mrg 20c21f9f52 in getpcblist_sysctl() if sysctlnametomib() fails, return NULL and
set *len = 0, rather than bailing.  now "netstat" doesn't give up
early on kernels without INET6.
2016-12-23 06:22:00 +00:00
mrg 65d0ad5f99 add the member name to an error string so we know what object failed
while being requested.
2016-12-22 22:41:02 +00:00
abhinav 2faad91b8c Instead of saying "The finger displays information..." say "The finger utility"
(not sure if it was intentionally written like that :)

Also, add an xref to fingerd(8)
2016-12-22 12:39:40 +00:00
abhinav 59fbdd4908 Add an xref to wait4(2) in SEE ALSO as it has been referred to for the -l option. 2016-12-21 18:01:21 +00:00
abhinav fa0751d0dd Add missing full stop. 2016-12-21 09:06:24 +00:00
abhinav 1ccf3ec022 Update SYNOPSIS to reflect that y and n options are mutually exclusive.
Also, mention what does biff(1) do if no arguments are given.
Add xref to from(1)

ok wiz@
2016-12-20 08:21:32 +00:00
christos f015338360 print only the latest entry for debugging. 2016-12-19 01:48:00 +00:00
mlelstv d19ac03c1e Print previously missing fields from a TCP6 PCB. 2016-12-17 09:12:22 +00:00
nonaka a69e0947f2 handle proxy authentication correctly. 2016-12-15 04:49:15 +00:00
abhinav 27174a0ec3 Add a HISTORY section
Move information about exit status to EXIT STATUS section
Add more xrefs

ok wiz@
2016-12-14 15:24:06 +00:00
mrg 2c22342178 copyright and date maint. 2016-12-11 08:40:10 +00:00
christos 34152e53bb Back in 1993 ${MACHINE} was a unique way to define objdirs for
every platform. Thus setting OBJMACHINE, allowed one to keep
in-tree objdirs with multiple builds. With the advent of evb*, this
has become impossible until now. Introduce OBJMACHINE_ARCH that
adds ${MACHINE_ARCH} to the objdir so that we have unique objdirs
per build again. Until we restructure things to that this is not
necessary, it is the simplest fix.
2016-12-10 23:12:39 +00:00
sjg f65fa017b9 Avoid coredump for
(FOO) = fu

reported by Ori Bernstein
2016-12-09 22:56:21 +00:00
nat 82924a36bf The audio sub-system now supports the following features as
posted to tech-kern:

    * Simultaneous playback and mixing of multiple streams
    * Playback streams can be of different encoding, frequency, precision
      and number of channels
    * Simultaneous recording to different formats
    * One audio device per process
    * Sysctls to set the common format frequency, precision and channels
    * Independent mixer controls for recording/playback per stream
    * Utilizes little cpu time for multiple streams / good performance
    * Compatible with existing programs that use OSS/NetBSD audio
    * Changes to audioctl(1) to allow specifying process id for corresponding
      audio device
2016-12-08 10:28:44 +00:00
christos 87fc2c3144 Don't apply the suffix (curdir) to MAKEOBJDIR 2016-12-07 19:57:09 +00:00
christos c977da2cd4 Refactor and simplify objdir setting code. 2016-12-07 15:00:46 +00:00
jnemeth 85fec0c0ed update floating holidays for 2017 in preparation for pullup for 7.1 release 2016-12-06 04:54:00 +00:00
mrg 15bdea6a19 add a basic "-b" option - that outputs one display and exits.
inspired by "top -b".  still requires a curses-capable output
without some fairly significant internal restructuring.
2016-12-03 03:26:27 +00:00
christos 9896a45fe7 fix leak. 2016-11-24 17:12:23 +00:00
dholland 950f040fa2 Fix "sidewaysintpr", the thing that prints interface statistics in a
loop, to use signals properly. There are two copies of this code; one
uses kvm and the other uses sysctls. One copy had been updated to use
sigset_t and sigsuspend; the other was using vintage sigpause(). Sync
up the code so both use sigpause. Also, use sig_atomic_t, and block
SIGALRM when not waiting for it to avoid a small and unlikely but real
race.

Since the non-modernized copy of the code *had* for some been
modernized to use setitimer instead of just alarm(), propagate that
change to the other copy.

These copies could share more logic than they do.
2016-11-24 00:05:13 +00:00
abhinav cac7393582 Oops, it should be Aq Mt email@address
(Thanks again wiz :-)
2016-11-18 12:16:48 +00:00
abhinav 739865b984 Use .An -nosplit
Also, use Mt for email addresses.

(Thanks wiz)
2016-11-18 10:11:34 +00:00
abhinav 5644a41214 Use more markup and complete a sentence. 2016-11-18 09:06:35 +00:00
christos 83aa60eb00 if there is more than one : it is not an X display, it is a v6 address 2016-11-16 02:03:30 +00:00
sjg 46bfaede57 Report node name rather than (null) when modified before src 2016-11-10 23:41:58 +00:00
christos b3ba15e2be Add _Generic C11 support. 2016-11-05 01:09:30 +00:00
kamil f26cf4cb48 Prefer modern simple past tense and past participle of catch
The "catched" form is obsolete and nonstandard, prefer "caught".
2016-11-03 22:08:30 +00:00
christos 7aaeae4638 fix usage (thanks wiz) 2016-10-30 19:33:49 +00:00
christos 1a5428f3fb add a flag to avoid mmap... 2016-10-30 19:13:36 +00:00
christos 4667eeb169 sysctlbyname is convenient, but ain't cheap. Cache it. 2016-10-24 00:40:17 +00:00
christos 8ff995f221 allow fractional intervals 2016-10-22 22:02:55 +00:00
christos 8481accb85 PR/51558: ast@: ftp dumps core after usage message when IPv6 URL lacks a slash.
Initialize variable so that we don't get random behavior on cleanup.
2016-10-17 00:52:53 +00:00
abhinav 77df47bda0 Fix the bug introduced in the previous commit.
The lengths of the lines being compared were not correct. Essentially, we
were comparing the length of the buffers instead of the length of the strings.

This patch also avoids calling skip() twice for the same line.

Thanks to Rin Okuyama for the patch.
2016-10-16 06:17:51 +00:00
abhinav 75088523c3 A small optimization: since we already know the length of the lines, check
if the lenghts are equal before calling strcmp(3). Most of the times, the call
to strcmp(3) can be saved if the lines are not of the same length.

Thanks to Christos for the reviews
2016-10-14 19:43:59 +00:00
dholland a76b73c7a0 typo 2016-10-13 06:22:26 +00:00
christos bb762fe5ee No point in using float here; makes evbmips64 need __truncdfsf2, and that
causes static linking issues because of softfloat.
2016-10-04 17:36:21 +00:00
joerg 740128222b When using data outside the signed char range, it is better to
consistently use an unsigned char buffer.
2016-10-04 15:06:31 +00:00
joerg 5937818688 GC header left from earlier diagnostic test. 2016-10-04 14:36:11 +00:00
joerg 2f2a5be7f3 Remove source routing support. 2016-10-04 14:35:38 +00:00
wiz 89ab2da6d9 Minor improvements, add more markup. 2016-10-03 08:20:12 +00:00
kamil b3c98abce0 Import c11(1) - a cc -std=c11 wrapper
This script is similar to c89(1) and c99(1).

It's a NetBSD extension. The c89(1) and c99(1) scripts are part of POSIX.
2016-10-03 01:00:27 +00:00
abhinav 961fb352ab Move information about exit values from DESCRIPTION to EXIT STATUS section.
ok wiz@
2016-10-02 21:06:18 +00:00
christos ea8949d86b define the attribute first. 2016-09-13 16:06:59 +00:00
christos 3a8503931f Make attribute deselection work:
- when deselecting attributes, remove files that depend on them
- when deselecting attributes, remove devices that depend on them
2016-09-09 21:09:11 +00:00
sevan 39bbc68a3b Drop main() prototype. 2016-09-05 00:40:28 +00:00
christos 1d13ed3d99 ignore the abiflags section 2016-09-03 11:35:24 +00:00
dholland ab2acfdda8 storage class first, *then* __dead 2016-09-03 06:00:32 +00:00
dholland eb640195f5 simplify __dead usage 2016-09-03 05:58:30 +00:00
dholland 0a533596ca __dead should come first; also remove more K&Risms. 2016-09-03 05:56:59 +00:00
dholland e7afde8f0f simplify __dead usage 2016-09-03 05:50:06 +00:00
sevan f237858c5d Remove K&R __P macros.
Remove main() function prototype if present.
Mark usage() as __dead if not already.
Binaries generated with & without these patches were compared with diff -r.
2016-09-03 02:24:04 +00:00
dholland 7f48560292 Document .DELETE_ON_ERROR. 2016-08-26 23:37:54 +00:00
dholland 9d33465685 Add a .DELETE_ON_ERROR: magic target that causes *failed* targets as
well as *interrupted* targets to be deleted. The name and behavior of
the variable matches gmake.

Also fix a glitch in newline output on error in compat mode that I
discovered while doing it.

Closes PR 51376.
2016-08-26 23:28:39 +00:00
christos c634867ea2 compute anonymous bitfield sizes properly. 2016-08-23 16:42:55 +00:00
sevan b99eec368e Add AUTHORS section
bump date
2016-08-22 00:15:59 +00:00
christos b8f79638e1 Don't warn about empty structs twice. 2016-08-19 11:51:27 +00:00
christos 175128e719 be less aggressive in clearing blocks to protect against:
int
main(int argc, char *argv[])
{
	int rv;

	if ((rv = ({ int _ret = 1; if (argc == 1) {} _ret; })) != 0)
	    printf("%d\n", rv);
	return 0;
}
2016-08-19 10:58:15 +00:00
christos ab22712dbd Add union casts. 2016-08-19 10:19:45 +00:00
christos c6347f3a1e add a type comparison function. 2016-08-19 10:18:11 +00:00
sevan fbe5805edc seq(1) first appeared in Research Unix 8th Edition, which was before Plan 9.
Generalise in stating that this version is not bug for bug compatible with other
implementations.
Bump date.
Via FreeBSD bug 181390 with feedback from Warren Block.
2016-08-18 22:55:28 +00:00
wiz e20c5869bb Whitespace. 2016-08-18 19:23:20 +00:00
christos 9acbaa9544 - handle sizes of structs/unions with anon members
- handle structs/unions with only anon members
2016-08-18 14:43:31 +00:00
christos 9c8f3871d5 anonymous members are C9X 2016-08-18 14:42:48 +00:00
mrg 4ffdae42fa don't hide _DEV_IC_BT8XX_H_ inside DTRACE. 2016-08-18 08:02:58 +00:00
sjg 2e603a118c Refactor the handling of .MAKE.META.IGNORE_* to meta_ignore()
so that we can call it before adding paths to missingFiles.
Ie. do not track files we have been told to ignore.
2016-08-17 15:52:42 +00:00
sjg 69fc18aad5 Add .MAKE.META.IGNORE_FILTER to allow more complicated filtering of filemon data.
The filter is applied to paths Read or Excuted, and if it expands to
nothing, the entry is skipped.

For example; dirdeps.mk can set this to:

.MAKE.META.IGNORE_FILTER = M*/${.MAKE.DEPENDFILE_PREFIX}*

when checking if DIRDEPS_CACHE is up to date, where only Makefile.depend*
are of interest.
2016-08-15 19:20:17 +00:00
sjg 53f61e0d2c PR: 51405
Description:

addErrorCMD: in compat mode, cmdp may be NULL, skip it
and stop the calls (return 1).
2016-08-11 19:53:17 +00:00
sjg 374771b4a4 Set .ERROR_CMD if we can 2016-08-10 23:49:12 +00:00
sjg 929a26a3de Use Lst_FindFrom and Lst_Succ(ln) to find next entry in missingFiles. 2016-08-10 18:49:40 +00:00
sjg c2d73114d1 Linux filemon only records D some/dir for rm -rf
rather than D entries for each file removed.
Thus we need a loop to remove all matching missingFiles entries
2016-08-10 18:25:00 +00:00
christos 6a9ab0dd0e Bump version for -no 2016-08-07 21:11:55 +00:00
christos f138f6c50d Accept "-no" as a "no" that does not cause errors if the object deleted
does not exist.
2016-08-07 10:37:24 +00:00
christos b31382fbd7 Avoid string gymnastics in an olympic year. 2016-08-05 07:22:17 +00:00
jakllsch ccf7078d06 Make this build with clang:
- Remove unused static const variables
 - Adjust impossibleish comparision.
2016-08-04 12:56:31 +00:00
wiz 4ff383b44d Bump date for new ifstat command. 2016-08-03 13:09:43 +00:00
maya 519ca6e803 Do globbing for FTP URLs of the form ftp://... too
ok christos
2016-08-03 12:33:56 +00:00
scole 6f3aa0fcd4 Add $NetBSD$ tag for new files 2016-08-02 17:53:46 +00:00
scole bd7662dc4d PR bin/51204
Add ifstat command to systat.

Imported from FreeBSD
2016-08-02 15:56:09 +00:00
dholland cf12c76a8b Don't allow initializers of the form { .a = .b = expr } as this is not
valid. Helps a bit with PR 22500.
2016-07-31 22:38:04 +00:00
dholland 096da17405 typo in comment 2016-07-31 22:36:53 +00:00
christos c351e21641 accept attributes in param decls 2016-07-20 18:14:12 +00:00
christos 29a071ed18 handle "extern __attribute__((__gnu_inline__)) __inline" 2016-07-20 17:42:14 +00:00
maya bd2a0d0ca6 Don't reference older CFATTACH_DECL 2016-07-19 17:01:04 +00:00
pgoyette e8f1cd85e9 Only emit bdevsw externs for entries in the bdev table, rather than for
entries in the cdev table.
2016-07-16 07:13:26 +00:00
christos b305547c0c more XXX removal. 2016-07-14 20:38:20 +00:00
christos 1584c6d3ed XXX: removal 2016-07-14 20:34:36 +00:00
christos fb3d963d14 remove soft interrupt queues that don't exist anymore. 2016-07-14 20:13:10 +00:00
christos bb9aed0669 remove __P 2016-07-14 19:39:41 +00:00
christos cfa835e475 dedup 2016-07-14 18:58:26 +00:00
christos 21c3ca2d5c use sysctl to print multicast addresses 2016-07-14 18:19:11 +00:00
christos 143eb5c5cf fix sysctl based interface printing, and annotate where we should add the
missing multicast printing code.
2016-07-13 22:01:12 +00:00
christos 543b506e7c Use sysctl for interface printing (-i), leave on for multicast address printing
(-ia) and comment in the code where this is missing?
XXX: should that be an ioctl or sysctl? provide getifmultiaddrs() via the
routing socket? I guess since this is just for netstat a simple sysctl or
ioctl would suffice. I lean towards sysctl.
2016-07-13 21:57:01 +00:00
shm 3d9e7389b4 Add USE_FORT support. 2016-07-13 13:10:04 +00:00
dholland bb1c83042f PR 51298 David Binderman: simplify redundant conditionals 2016-06-30 15:34:30 +00:00
dholland dc73bb47b8 PR 51192 David Binderman: fix wrong logic (probably)
XXX: this file should probably just be deleted
2016-06-30 05:56:46 +00:00
dholland b7f11ede62 Fix DEBUG_SRC build. Partly from PR 51191. 2016-06-30 05:34:04 +00:00
dholland 0088fcac6f Cleanse an old mangy way of avoiding an unused variable warning.
PR 51191 from David Binderman.
2016-06-30 05:31:00 +00:00
dholland f3d720012b Fix botched logic; PR 51191 from David Binderman. 2016-06-30 05:28:23 +00:00
sjg 846bd14287 meta_compat_parent: fflush each line 2016-06-29 22:10:08 +00:00
wiz 902b00da39 Sync usage with program. Add RCS Id. Increase column width. Fix macro usage. Improve wording. 2016-06-28 09:25:21 +00:00
wiz 5afefdc4ed Sort options in usage. 2016-06-28 09:24:46 +00:00
wiz 1e7f61c60e Infile is also optional. 2016-06-28 09:23:09 +00:00
wiz 8aeff4f5ae Sync usage between program and man page. Increase column width. 2016-06-28 09:22:16 +00:00
wiz 8e4e7d0ff8 Add RCS Id. Sort options in SYNOPSIS. Fix macro usage. Fix Dd. 2016-06-28 09:20:30 +00:00
maya dcb772676a Mention -d flag in mkesdb(1) usage
PR bin/24001
2016-06-27 20:15:16 +00:00
maya aeb2930556 Add man page for mkesdb
Imported from FreeBSD
2016-06-27 20:09:18 +00:00
maya dca09610a7 Add man page for mkcsmapper.
Imported from FreeBSD.

PR bin/24001
2016-06-27 20:07:26 +00:00
abhinav dcf78ec2af Add a FILES section and add references to terminfo(3), terminfo(5) in SEE ALSO.
Ok by wiz
2016-06-24 12:03:22 +00:00
abhinav 8dc887f792 Make all the global variables and functions static.
While there, remove unused variables and function prototypes.
Ok from christos
2016-06-23 03:58:13 +00:00
abhinav f2d77fdf32 Replace makewhatis(8) with makemandb(8) in SEE ALSO. 2016-06-16 15:11:43 +00:00
abhinav edcef964c4 Document -f option for man(1).
Also remove unsupported options for `man -k` from the synopsis and usage.
2016-06-16 15:10:58 +00:00
sjg fee87d5733 meta_oodate: set needOODATE if oodate due to missing .meta file. 2016-06-14 18:16:06 +00:00
abhinav 762c2184ca Make the function static in the definition (prototype was already declared static).
Missed in my last commit.
2016-06-13 14:58:57 +00:00
wiz 46dfe48d23 Remove trailing whitespace. Remove unnecessary quotes. 2016-06-13 06:17:19 +00:00
pgoyette fb5782856e Fix missing quote. Resolve automated test failure. 2016-06-13 02:06:44 +00:00
pgoyette cc610a3c94 Add new primaries -asince, -csince, and -since to compare file's
attributes against a user-specified timestamp (rather than the
attributes of a reference file).

Update the parse routines so they have access to the name of the
option being parsed.  This enables accurate error reporting for
"aliases" of primaries.

Now that aliases work, introduce some aliases for consistency with
Gnu findutils.
2016-06-13 00:04:40 +00:00
pgoyette d3e6512866 Use .Ic markup for consistency with the rest of the document 2016-06-12 22:25:13 +00:00
pgoyette 09ebf81448 Further clarification of the treatment of numeric user and group names. 2016-06-12 22:17:18 +00:00
dholland 9d2811fca4 Extend the numeric handling for uids with -user to gids with -group, and
document it. Leftover bit of PR 46158.
2016-06-12 20:50:10 +00:00
abhinav 736d303b6e Add libutil to the DPADD variable. 2016-06-12 14:28:26 +00:00
abhinav 89e188185f Fix a buffer overflow when reading from files containing extra long lines.
Instead of using a statically allocated buffer, manage the buffer at run-time
and reallocate as needed.

It was dumping core for following two cases:
man evrpc | ul
man xdm | ul

While there, also remove __P macro from function prototypes.

Ok from Christos.
2016-06-12 13:29:29 +00:00
pgoyette 355a32cb7e Change -{min,max}depth argument name from n to depth so that the
earlier statement concerning n being prefaced by a plus or minus.
(These exceptions to the +/- rule noted by kre@)

While here, fix markup error.  .Em for emphasis (stress) rather
than .Ar  :)
2016-06-12 03:21:35 +00:00
christos 88297dee99 fix memory leak, simplify 2016-06-07 03:04:45 +00:00
sjg e917da0d70 Extend the mtimes cache used by dir.c so it can be used by others.
We store both st_mtime and st_mode, since some callers care about the
later.

Reviewed by: christos
2016-06-07 00:40:00 +00:00
abhinav 241fae59df Convert reference to f77(1) from .Xr to .Ic as we don't have it any more.
Ok from wiz@
2016-06-06 16:32:19 +00:00
abhinav 00ae54ede2 Remove reference to uucp(1) in SEE ALSO, as it is no more there.
Ok from wiz@
2016-06-06 15:09:33 +00:00
abhinav 3c254bc4ef We don't have f77(1) anymore, remove the reference from SEE ALSO.
While there, also add .An for AUTHORS section.
Ok from wiz@.
2016-06-06 14:25:12 +00:00
dholland f6685469c0 Fix CSRG-era typo: typedef, not typdef. Spotted by Piotr Stefaniak. 2016-06-05 18:35:32 +00:00
christos fcb395931a NUL terminate. 2016-06-05 01:39:17 +00:00
sjg 35fa3446c5 Avoid breaking !NetBSD build 2016-06-05 00:48:58 +00:00
sjg ec729b232b meta_oodate even when missing-meta is true, we do not make a target in
.CURDIR out of date just because of a missing meta file.

Also we can only be missing filemon data if we had a meta file.
2016-06-04 22:17:14 +00:00
agc 3f81b60716 Following positive feedback on tech-userlevel, move the sys_info
script from othersrc to usr.bin/sys_info

	The sys_info script is a small script which will show the version
	information for installed utilities.  It also works on the kernel, and
	on most libraries.

	Its use is as follow:

		[19:41:13] agc@netbsd-002 ...external/bsd/sys_info [4568] > ./sys_info -a
		awk-20121220
		bind-9.10.3pl3
		bzip2-1.0.6
		calendar-20160601
		ftpd-20110904
		g++-4.8.5
		gcc-4.8.5
		grep-2.5.1anb1
		gzip-20150113
		bozohttpd-20151231
		NetBSD-7.99.26
		netpgp-3.99.17
		netpgpverify-20160214
		ntp-4.2.8pl5
		openssl-1.0.1r
		sqlite3-3.12.2
		openssh-7.1
		opensshd-7.1
		tcsh-6.19.00
		xz-5.2.1
		[19:41:20] agc@netbsd-002 ...external/bsd/sys_info [4569] > ./sys_info ntp ssh netpgp
		ntp-4.2.8pl5
		openssh-7.1
		netpgp-3.99.17
		[19:41:31] agc@netbsd-002 ...external/bsd/sys_info [4570] > ./sys_info ntp ssh netbsd
		ntp-4.2.8pl5
		openssh-7.1
		NetBSD-7.99.26
		[19:41:38] agc@netbsd-002 ...external/bsd/sys_info [4571] >

	The -a option can be given to the script to print out the information
	on all known components.

	The sys_info script also works on libraries, returning their
	"versions" as given by the shared object version numbers.

		[19:45:06] agc@netbsd-002 ...external/bsd/sys_info [4572] > ./sys_info libevent libXfont libc netbsd
		libevent-4.0
		libXfont-3.0
		libc-12.200
		NetBSD-7.99.26
		[19:45:27] agc@netbsd-002 ...external/bsd/sys_info [4573] >

	Alistair Crooks
	Wed Jun  1 19:44:01 PDT 2016
2016-06-04 15:27:11 +00:00
wiz 401a245f9e Fix typo in width argument; end sentence with dot. 2016-06-03 07:07:37 +00:00
agc 1f657fa580 Commit patch sent to tech-userlevel with universal approval to add a
version option for calendar(1):

	% calendar -v
	calendar-20160601
	%

For reference, see:

	http://mail-index.netbsd.org/tech-userlevel/2016/06/02/msg010081.html
2016-06-03 02:06:40 +00:00
sjg cb28c6994f Add cached_realpath()
realpath(3) is expensive, and meta mode at least uses it extensively.
We use cached_realpath() to save the result of successful calls to
realpath(3) in a private variable context.

This improves the worst case performance (eg examining libc with
nothing to do) by a factor of 4.

Reviewed by: christos
2016-06-03 01:21:59 +00:00
sjg 2d086608a8 Refactor the logic for deciding when a .meta file is needed.
Both meta_create() and meta_oodate() now share meta_needed()
to indicate if a .meta file is needed.

This allows for deciding that missing .meta file is cause of out-of-date.
The new knob 'missing-meta' controlls this, and is off by default
since the side effect files of generators like yacc will typically need
.NOMETA to avoid problems.

This however makes it much easier for folk to switch back and forth
with meta mode (eg. FreeBSD's normal build can leverage meta mode for
improved reliablility without need to clean).

Also if .MAKE.MODE does not contain 'nofilemon', the knob
'missing-filemon' allows control as to whether missing filemon data
should cause the target to be out-of-date.
Again off by default.
2016-06-03 01:16:27 +00:00
wiz 738f858418 Sort options and their descriptions. Sync usage more with man page.
Bump date in man page for new option -C.
2016-06-01 08:24:03 +00:00
kre a868903568 Add the posix -C option (-c but quieter). Fix -R to work properly when
setting \n as the record delimited using a numeric value rather than literal
\n - and to not incorrectly turn \n into a field separator if -R is used to
make some other char the record separator (\n becomes a field separator in
that case as long as the field separator remains "white space" but should not
be in any other case - unless set explicitly of course.)

Plus more cosmetic changes - the man page and usage are updated to make it
more clear that the 2 (or 1) params to -k are not fields (field1 and field2)
but specifiers of the beginning and end of one key field.   There was an
unused 'x' option in the GETOPTS string.  The usage message is reformatted
to display properly on both 80 col and > 80 col displays (on < 80 it will
still probably look pretty ugly ... perhaps not quite so bad though), and
is also updated to show the different usage for the -c case (and -C) from the
others (only 1 file permitted) - the man page synopsis has a similar update.

Using more than one of -c -C or -m generates a usage message rather than
just ignoring the -m as it did before (there was no -C before of course).

Aside from the bug fix to the interaction between -R and -t, there are no
changes that affect the way anything is sorted (or read, or written).

Discussed on tech-userlevel earlier this week.
2016-06-01 02:37:55 +00:00
christos 71229fdd60 Symbolic printing for mmap 2016-06-01 00:47:16 +00:00
pgoyette ed42ce54d9 Move __MKTEMP_OK up earlier so it has an actual impact. Reduces the
number of warnings during build.

XXX There are still some other warnings remaining to be resolved.

Fixes PR bin/48195 although we really should go back someday and fix
this correctly (by replacing all uses of mktemp(3)!)
2016-05-31 06:55:02 +00:00
dholland 96e4b50290 Use this program's Strdup() instead of strdup() so it exits on failure
instead of dumping core.
2016-05-30 16:35:35 +00:00
dholland 7ad91fe4a4 Use rewind() instead of freopen()'ing the same file for no reason. Also,
close the file when done instead of dropping it on the floor. Obsoletes
PR 50579.
2016-05-30 16:26:34 +00:00
christos c2dcc0c09c Don't make crunch binaries PIE 2016-05-29 16:12:58 +00:00
abhinav 743e3b4551 md5 is a hashing algorithm, don't say it is used for encryption.
Ok by wiz@
2016-05-24 06:15:43 +00:00
christos 8ed051d1e1 put back _PATH_WHATIS, it is used. 2016-05-21 20:54:34 +00:00
abhinav aa0cdec039 Remove unused include and unused constant. Ok from christos@. 2016-05-21 17:21:40 +00:00
sjg ccfdc94797 Propagate errors from filemon.
If we encounter errors producing a .meta file,
we should not consider the target completed successfully.
2016-05-12 20:28:34 +00:00
ozaki-r 278a4a7caa Remove duplicate routing flag list
We alreay have it in route(8) and shouldn't have another one.
(Actually the removed list is forgot to be updated.)
2016-05-12 03:44:11 +00:00
nonaka 048f8f1c7c If the negative number is passed to option '-c' or '-n',
it should occur an error.
2016-05-12 01:56:44 +00:00
sjg 1ea1c693f3 Allow for ignoring paths that match a set of patterns.
This can be expensive, so use with caution.
2016-05-10 23:45:45 +00:00
sjg 83317c9428 Apply realpath() to p before matching against metaIgnorePaths. 2016-05-10 00:02:31 +00:00
wiz 4b483a8522 New sentence, new line. Bump date for previous. 2016-05-02 09:33:15 +00:00
mlelstv 6fc95ff617 Extend syntax of config phrase, a quoted string instead of a device name
is passed as root specification string. This can be used to specify a
wedge by name.
2016-04-29 18:18:22 +00:00
riastradh feb61835e6 __diagused, not __unused -- used in an assert. 2016-04-07 23:29:59 +00:00
gson 4efe3992f9 Fully avoid the nonstandard types u_char, u_int, and u_long, which
were only used inconsistently in a few places anyway.
2016-04-06 09:57:00 +00:00
sjg f5cd368fff Skip looking for .MAKE.JOBS if either of compatMake or forceJob is true.
If -B compatMake will be true and should be honored.
If -j forceJobs will be true and the command line supplied .MAKE.JOBS
should be respected - for consistency with other usage.
2016-04-05 04:25:43 +00:00