summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2020-06-02 10:40:25 +0000
committerJohn Levon <john.levon@joyent.com>2020-06-02 10:40:25 +0000
commit20aad12cac7bec813b8a4fb73161e2c714f8c80b (patch)
tree1dfe5d8d9819b5d0c0cc688dc39e1cff153601cb
parent73fcfa8cfdfe93d41d7237cf98c38d7aee3b2b47 (diff)
parent5cd90a78a9b9930e642ce913b44316f5a4ae6632 (diff)
downloadillumos-joyent-20aad12cac7bec813b8a4fb73161e2c714f8c80b.tar.gz
Merge branch 'master' into OS-8182
-rw-r--r--exception_lists/cstyle7
-rw-r--r--exception_lists/hdrchk2
-rw-r--r--exception_lists/packaging9
-rw-r--r--exception_lists/wscheck7
-rw-r--r--usr/src/Makefile.master2
-rw-r--r--usr/src/cmd/bhyve/Makefile1
-rw-r--r--usr/src/cmd/bhyve/bhyverun.c22
-rw-r--r--usr/src/cmd/bhyve/bhyverun.h6
-rw-r--r--usr/src/cmd/bhyve/test/Makefile.com2
-rw-r--r--usr/src/cmd/bhyve/test/Makefile.subdirs3
-rw-r--r--usr/src/cmd/bhyve/test/Makefile.targ5
-rw-r--r--usr/src/cmd/bhyvectl/Makefile2
-rw-r--r--usr/src/cmd/boot/filelist/i386/filelist.ramdisk1
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/routeadm/svc-forwarding4
-rw-r--r--usr/src/cmd/grep/grep.c20
-rw-r--r--usr/src/cmd/mdb/common/modules/genunix/streams.c6
-rw-r--r--usr/src/cmd/mdb/i86pc/modules/unix/unix.c1
-rw-r--r--usr/src/cmd/mdb/intel/Makefile.kmdb2
-rw-r--r--usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c2
-rw-r--r--usr/src/cmd/pptadm/Makefile3
-rw-r--r--usr/src/cmd/rpcgen/Makefile18
-rw-r--r--usr/src/cmd/rpcgen/Makefile.common36
-rw-r--r--usr/src/cmd/vntsd/svc-vntsd8
-rw-r--r--usr/src/lib/libbe/common/libbe.h2
-rw-r--r--usr/src/lib/libc/port/stdio/ftell.c2
-rw-r--r--usr/src/lib/libppt/Makefile.com11
-rw-r--r--usr/src/lib/libvmm/Makefile3
-rw-r--r--usr/src/lib/libvmm/Makefile.com2
-rw-r--r--usr/src/lib/libvmmapi/Makefile3
-rw-r--r--usr/src/lib/libvmmapi/Makefile.com6
-rw-r--r--usr/src/lib/libvmmapi/common/llib-lvmmapi2
-rw-r--r--usr/src/lib/libzfs/common/libzfs_crypto.c539
-rw-r--r--usr/src/lib/libzfs/common/libzfs_impl.h48
-rw-r--r--usr/src/lib/libzfs/common/libzfs_util.c9
-rw-r--r--usr/src/man/man1/cp.134
-rw-r--r--usr/src/man/man1/elfedit.133
-rw-r--r--usr/src/man/man1/mail.130
-rw-r--r--usr/src/man/man1/mdb.12
-rw-r--r--usr/src/man/man1/wait.132
-rw-r--r--usr/src/man/man1m/ipf.1m12
-rw-r--r--usr/src/man/man1m/luxadm.1m21
-rw-r--r--usr/src/man/man1m/plockstat.1m15
-rw-r--r--usr/src/man/man3lib/libproc.3lib4
-rw-r--r--usr/src/man/man3proc/proc_arg_grab.3proc28
-rw-r--r--usr/src/man/man4/proc.44
-rw-r--r--usr/src/man/man5/lf64.538
-rw-r--r--usr/src/man/man7d/ecpp.7d10
-rw-r--r--usr/src/man/man7d/usbprn.7d17
-rw-r--r--usr/src/man/man9f/ddi_create_minor_node.9f24
-rw-r--r--usr/src/man/man9f/ddi_remove_minor_node.9f13
-rw-r--r--usr/src/pkg/manifests/system-test-libctest.mf2
-rw-r--r--usr/src/pkg/manifests/system-test-utiltest.mf4
-rw-r--r--usr/src/pkg/manifests/system-test-zfstest.mf2
-rw-r--r--usr/src/test/libc-tests/runfiles/default.run2
-rw-r--r--usr/src/test/libc-tests/tests/stdio/Makefile18
-rw-r--r--usr/src/test/libc-tests/tests/stdio/ftello_12768.c73
-rwxr-xr-xusr/src/test/smartos-test/smartos-test.sh35
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/files/Makefile5
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/files/gout671
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/files/gout681
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/files/gout691
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/files/gout701
-rw-r--r--usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh44
-rw-r--r--usr/src/test/zfs-tests/runfiles/omnios.run2
-rw-r--r--usr/src/test/zfs-tests/runfiles/openindiana.run2
-rw-r--r--usr/src/test/zfs-tests/runfiles/smartos.run2
-rw-r--r--usr/src/test/zfs-tests/tests/functional/resilver/Makefile3
-rwxr-xr-xusr/src/test/zfs-tests/tests/functional/resilver/resilver_restart_001.ksh2
-rw-r--r--usr/src/test/zfs-tests/tests/functional/resilver/resilver_restart_002.ksh110
-rw-r--r--usr/src/test/zfs-tests/tests/functional/resilver/sysevent.c45
-rw-r--r--usr/src/tools/Makefile1
-rw-r--r--usr/src/tools/rpcgen/Makefile37
-rw-r--r--usr/src/uts/common/brand/lx/syscall/lx_socket.c14
-rw-r--r--usr/src/uts/common/fs/zfs/dsl_scan.c23
-rw-r--r--usr/src/uts/common/fs/zfs/vdev.c34
-rw-r--r--usr/src/uts/common/os/dacf.c2
-rw-r--r--usr/src/uts/common/os/dacf_clnt.c6
-rw-r--r--usr/src/uts/common/os/sunddi.c32
-rw-r--r--usr/src/uts/common/sys/dacf_impl.h4
-rw-r--r--usr/src/uts/common/sys/ddi_impldefs.h4
-rw-r--r--usr/src/uts/common/sys/ddi_ufm.h4
-rw-r--r--usr/src/uts/common/sys/sunddi.h10
-rw-r--r--usr/src/uts/i86pc/io/vmm/amd/svm.c8
-rw-r--r--usr/src/uts/i86pc/io/vmm/amd/svm_support.s14
-rw-r--r--usr/src/uts/i86pc/io/vmm/intel/vmx.c9
-rw-r--r--usr/src/uts/i86pc/io/vmm/intel/vmx_support.s29
-rw-r--r--usr/src/uts/i86pc/io/vmm/io/sol_iommu.c86
-rw-r--r--usr/src/uts/i86pc/io/vmm/io/sol_ppt.c92
-rw-r--r--usr/src/uts/i86pc/io/vmm/vm/vm_page.h2
-rw-r--r--usr/src/uts/i86pc/io/vmm/x86.c75
-rw-r--r--usr/src/uts/i86pc/io/vmm/x86.h4
-rw-r--r--usr/src/uts/i86pc/ppt/Makefile8
-rw-r--r--usr/src/uts/i86pc/viona/Makefile13
-rw-r--r--usr/src/uts/i86pc/vmm/Makefile47
-rw-r--r--usr/src/uts/intel/ia32/ml/modstubs.s5
-rw-r--r--usr/src/uts/sun4/os/cpu_states.c8
96 files changed, 1080 insertions, 959 deletions
diff --git a/exception_lists/cstyle b/exception_lists/cstyle
index 9a76360653..b7f0327ffe 100644
--- a/exception_lists/cstyle
+++ b/exception_lists/cstyle
@@ -1364,6 +1364,7 @@ syntax: glob
usr/src/cmd/bhyve/acpi.[ch]
usr/src/cmd/bhyve/ahci.h
usr/src/cmd/bhyve/atkbdc.[ch]
+usr/src/cmd/bhyve/audio.[ch]
usr/src/cmd/bhyve/bhyvegc.[ch]
usr/src/cmd/bhyve/bhyverun.[ch]
usr/src/cmd/bhyve/block_if.[ch]
@@ -1373,6 +1374,9 @@ usr/src/cmd/bhyve/consport.c
usr/src/cmd/bhyve/dbgport.[ch]
usr/src/cmd/bhyve/fwctl.[ch]
usr/src/cmd/bhyve/gdb.[ch]
+usr/src/cmd/bhyve/hda_codec.c
+usr/src/cmd/bhyve/hda_reg.h
+usr/src/cmd/bhyve/hdac_reg.h
usr/src/cmd/bhyve/inout.[ch]
usr/src/cmd/bhyve/ioapic.[ch]
usr/src/cmd/bhyve/iov.[ch]
@@ -1380,10 +1384,13 @@ usr/src/cmd/bhyve/mem.[ch]
usr/src/cmd/bhyve/mevent.[ch]
usr/src/cmd/bhyve/mevent_test.c
usr/src/cmd/bhyve/mptbl.[ch]
+usr/src/cmd/bhyve/net_utils.[ch]
+usr/src/cmd/bhyve/net_backends.[ch]
usr/src/cmd/bhyve/pci_ahci.c
usr/src/cmd/bhyve/pci_e82545.c
usr/src/cmd/bhyve/pci_emul.[ch]
usr/src/cmd/bhyve/pci_fbuf.c
+usr/src/cmd/bhyve/pci_hda.[ch]
usr/src/cmd/bhyve/pci_hostbridge.c
usr/src/cmd/bhyve/pci_irq.[ch]
usr/src/cmd/bhyve/pci_lpc.[ch]
diff --git a/exception_lists/hdrchk b/exception_lists/hdrchk
index 08a3179039..c6a5ffe4d3 100644
--- a/exception_lists/hdrchk
+++ b/exception_lists/hdrchk
@@ -392,6 +392,7 @@ syntax: glob
usr/src/cmd/bhyve/acpi.h
usr/src/cmd/bhyve/ahci.h
usr/src/cmd/bhyve/atkbdc.h
+usr/src/cmd/bhyve/audio.h
usr/src/cmd/bhyve/bhyvegc.h
usr/src/cmd/bhyve/bhyverun.h
usr/src/cmd/bhyve/block_if.h
@@ -403,6 +404,7 @@ usr/src/cmd/bhyve/ioapic.h
usr/src/cmd/bhyve/mem.h
usr/src/cmd/bhyve/mptbl.h
usr/src/cmd/bhyve/pci_emul.h
+usr/src/cmd/bhyve/pci_hda.h
usr/src/cmd/bhyve/pci_irq.h
usr/src/cmd/bhyve/pci_lpc.h
usr/src/cmd/bhyve/ps2kbd.h
diff --git a/exception_lists/packaging b/exception_lists/packaging
index 3c65d11c27..1cfee14339 100644
--- a/exception_lists/packaging
+++ b/exception_lists/packaging
@@ -745,8 +745,10 @@ usr/lib/sparcv9/libvrrpadm.so sparc
opt/onbld/bin/i386/mandoc i386
opt/onbld/bin/sparc/mandoc sparc
opt/onbld/bin/i386/makesoftcore i386
+opt/onbld/bin/i386/rpcgen i386
opt/onbld/bin/i386/vtfontcvt i386
opt/onbld/bin/sparc/makesoftcore sparc
+opt/onbld/bin/sparc/rpcgen sparc
opt/onbld/bin/sparc/vtfontcvt sparc
#
@@ -821,19 +823,12 @@ usr/lib/libsff.so
#
lib/amd64/libvmm.so i386
lib/amd64/libvmmapi.so i386
-lib/amd64/llib-lvmmapi.ln i386
usr/include/bhyve.h i386
usr/include/libppt.h i386
usr/include/libvmm.h i386
usr/include/vmmapi.h i386
usr/lib/amd64/libppt.so i386
-usr/lib/amd64/llib-lppt.ln i386
usr/lib/libppt.so i386
-usr/lib/llib-lppt i386
-usr/lib/llib-lppt.ln i386
-usr/platform/i86pc/include/sys/vmm.h i386
-usr/platform/i86pc/include/sys/vmm_impl.h i386
-usr/platform/i86pc/include/sys/vmm_instruction_emul.h i386
#
# libcustr is private
diff --git a/exception_lists/wscheck b/exception_lists/wscheck
index 0e2f1164c5..ea93389a01 100644
--- a/exception_lists/wscheck
+++ b/exception_lists/wscheck
@@ -119,6 +119,7 @@ usr/src/test/util-tests/tests/dis/i386/*.out
usr/src/cmd/bhyve/acpi.[ch]
usr/src/cmd/bhyve/ahci.h
usr/src/cmd/bhyve/atkbdc.[ch]
+usr/src/cmd/bhyve/audio.[ch]
usr/src/cmd/bhyve/bhyvegc.[ch]
usr/src/cmd/bhyve/bhyverun.[ch]
usr/src/cmd/bhyve/block_if.[ch]
@@ -128,16 +129,22 @@ usr/src/cmd/bhyve/consport.c
usr/src/cmd/bhyve/dbgport.[ch]
usr/src/cmd/bhyve/fwctl.[ch]
usr/src/cmd/bhyve/gdb.[ch]
+usr/src/cmd/bhyve/hda_codec.c
+usr/src/cmd/bhyve/hda_reg.h
+usr/src/cmd/bhyve/hdac_reg.h
usr/src/cmd/bhyve/inout.[ch]
usr/src/cmd/bhyve/ioapic.[ch]
usr/src/cmd/bhyve/mem.[ch]
usr/src/cmd/bhyve/mevent.[ch]
usr/src/cmd/bhyve/mevent_test.c
usr/src/cmd/bhyve/mptbl.[ch]
+usr/src/cmd/bhyve/net_utils.[ch]
+usr/src/cmd/bhyve/net_backends.[ch]
usr/src/cmd/bhyve/pci_ahci.c
usr/src/cmd/bhyve/pci_e82545.c
usr/src/cmd/bhyve/pci_emul.[ch]
usr/src/cmd/bhyve/pci_fbuf.c
+usr/src/cmd/bhyve/pci_hda.[ch]
usr/src/cmd/bhyve/pci_hostbridge.c
usr/src/cmd/bhyve/pci_irq.[ch]
usr/src/cmd/bhyve/pci_lpc.[ch]
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index 659edcf19c..7c036ac21a 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -148,7 +148,7 @@ GCCLIBDIR64= $(GNUC_ROOT)/lib/$(MACH64)
DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets
-RPCGEN= /usr/bin/rpcgen
+RPCGEN= $(ONBLD_TOOLS)/bin/$(MACH)/rpcgen
STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs
ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract
MBH_PATCH= $(ONBLD_TOOLS)/bin/$(MACH)/mbh_patch
diff --git a/usr/src/cmd/bhyve/Makefile b/usr/src/cmd/bhyve/Makefile
index 9ac0361876..ea4537596a 100644
--- a/usr/src/cmd/bhyve/Makefile
+++ b/usr/src/cmd/bhyve/Makefile
@@ -26,7 +26,6 @@ all := TARGET = all
install := TARGET = install
clean := TARGET = clean
clobber := TARGET = clobber
-lint := TARGET = lint
SRCS = acpi.c \
atkbdc.c \
diff --git a/usr/src/cmd/bhyve/bhyverun.c b/usr/src/cmd/bhyve/bhyverun.c
index ccf89b4613..cb02e83858 100644
--- a/usr/src/cmd/bhyve/bhyverun.c
+++ b/usr/src/cmd/bhyve/bhyverun.c
@@ -204,13 +204,6 @@ static int acpi;
static char *progname;
static const int BSP = 0;
-#ifndef __FreeBSD__
-int bcons_wait = 0;
-int bcons_connected = 0;
-pthread_mutex_t bcons_wait_lock = PTHREAD_MUTEX_INITIALIZER;
-pthread_cond_t bcons_wait_done = PTHREAD_COND_INITIALIZER;
-#endif
-
static cpuset_t cpumask;
static void vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip);
@@ -1360,21 +1353,6 @@ main(int argc, char *argv[])
errx(EX_OSERR, "cap_enter() failed");
#endif
-#ifndef __FreeBSD__
- /*
- * If applicable, wait for bhyveconsole
- */
- if (bcons_wait) {
- printf("Waiting for bhyveconsole connection...\n");
- (void) pthread_mutex_lock(&bcons_wait_lock);
- while (!bcons_connected) {
- (void) pthread_cond_wait(&bcons_wait_done,
- &bcons_wait_lock);
- }
- (void) pthread_mutex_unlock(&bcons_wait_lock);
- }
-#endif
-
/*
* Add CPU 0
*/
diff --git a/usr/src/cmd/bhyve/bhyverun.h b/usr/src/cmd/bhyve/bhyverun.h
index 8df8e01a73..99ce739f70 100644
--- a/usr/src/cmd/bhyve/bhyverun.h
+++ b/usr/src/cmd/bhyve/bhyverun.h
@@ -51,12 +51,6 @@ extern int guest_ncpus;
extern uint16_t cores, sockets, threads;
extern char *guest_uuid_str;
extern char *vmname;
-#ifndef __FreeBSD__
-extern int bcons_wait;
-extern int bcons_connected;
-extern pthread_mutex_t bcons_wait_lock;
-extern pthread_cond_t bcons_wait_done;
-#endif
void *paddr_guest2host(struct vmctx *ctx, uintptr_t addr, size_t len);
diff --git a/usr/src/cmd/bhyve/test/Makefile.com b/usr/src/cmd/bhyve/test/Makefile.com
index 3367ae50ea..2bd67140f5 100644
--- a/usr/src/cmd/bhyve/test/Makefile.com
+++ b/usr/src/cmd/bhyve/test/Makefile.com
@@ -22,7 +22,6 @@ include $(SRC)/cmd/Makefile.cmd.64
#
CSTD= $(CSTD_GNU99)
C99MODE= -xc99=%all
-C99LMODE= -Xc99=%all
CFLAGS += $(CCVERBOSE) -_gcc=-Wimplicit-function-declaration \
-_gcc=-Wno-parentheses
@@ -59,4 +58,3 @@ ROOTOUT = $(OUTFILES:%=$(ROOTTSTDIR)/%)
ROOTTESTS = $(ROOTTSTEXES) $(ROOTTSTSH) $(ROOTOUT)
FILEMODE = 0555
LDLIBS = $(LDLIBS.cmd)
-LINTEXE = $(EXETESTS:%.exe=%.exe.ln)
diff --git a/usr/src/cmd/bhyve/test/Makefile.subdirs b/usr/src/cmd/bhyve/test/Makefile.subdirs
index 45f0aa67fa..ff7d6c91cb 100644
--- a/usr/src/cmd/bhyve/test/Makefile.subdirs
+++ b/usr/src/cmd/bhyve/test/Makefile.subdirs
@@ -19,9 +19,8 @@ all := TARGET += all
clean := TARGET += clean
clobber := TARGET += clobber
install := TARGET += install
-lint := TARGET += lint
-all clean clobber install lint: $(SUBDIRS)
+all clean clobber install: $(SUBDIRS)
$(SUBDIRS): FRC
@cd $@; pwd; $(MAKE) $(TARGET)
diff --git a/usr/src/cmd/bhyve/test/Makefile.targ b/usr/src/cmd/bhyve/test/Makefile.targ
index e3ec55cfdb..13d28a0630 100644
--- a/usr/src/cmd/bhyve/test/Makefile.targ
+++ b/usr/src/cmd/bhyve/test/Makefile.targ
@@ -43,11 +43,6 @@ $(ROOTTSTDIR)/%.exe: %.exe $(ROOTTSTDIR)
all: install
-%.exe.ln: %.c $(SUPOBJS)
- $(LINT.c) $< $(LDLIBS)
-
-lint: $(LINTEXE)
-
clean:
-$(RM) *.o $(CLEANFILES)
diff --git a/usr/src/cmd/bhyvectl/Makefile b/usr/src/cmd/bhyvectl/Makefile
index af961ada45..72b3cd913f 100644
--- a/usr/src/cmd/bhyvectl/Makefile
+++ b/usr/src/cmd/bhyvectl/Makefile
@@ -51,8 +51,6 @@ install: all $(ROOTUSRSBINPROG)
clean:
$(RM) $(OBJS) $(CLEANFILES)
-lint: lint_SRCS
-
include ../Makefile.targ
%.o: $(CONTRIB)/freebsd/lib/libutil/%.c
diff --git a/usr/src/cmd/boot/filelist/i386/filelist.ramdisk b/usr/src/cmd/boot/filelist/i386/filelist.ramdisk
index 387411504e..53d3936483 100644
--- a/usr/src/cmd/boot/filelist/i386/filelist.ramdisk
+++ b/usr/src/cmd/boot/filelist/i386/filelist.ramdisk
@@ -14,6 +14,7 @@ etc/mach
etc/name_to_major
etc/name_to_sysnum
etc/path_to_inst
+etc/ppt_aliases
etc/rtc_config
etc/system
etc/system.d
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/routeadm/svc-forwarding b/usr/src/cmd/cmd-inet/usr.sbin/routeadm/svc-forwarding
index 48f77f98e1..b0c94b9acd 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/routeadm/svc-forwarding
+++ b/usr/src/cmd/cmd-inet/usr.sbin/routeadm/svc-forwarding
@@ -40,7 +40,7 @@ proto="$2"
if [ -z "$proto" ]; then
usage
- exit $SMF_ERROR_FATAL
+ exit $SMF_EXIT_ERROR_FATAL
fi
case "$1" in
@@ -65,7 +65,7 @@ case "$1" in
;;
*)
usage
- exit $SMF_ERROR_FATAL
+ exit $SMF_EXIT_ERROR_FATAL
;;
esac
diff --git a/usr/src/cmd/grep/grep.c b/usr/src/cmd/grep/grep.c
index 7054d1f602..ac51023678 100644
--- a/usr/src/cmd/grep/grep.c
+++ b/usr/src/cmd/grep/grep.c
@@ -35,6 +35,7 @@
*/
/*
+ * Copyright 2020 Peter Tribble.
* Copyright 2018 RackTop Systems.
* Copyright 2018 Nexenta Systems, Inc.
* Copyright 2013 Damian Bogel. All rights reserved.
@@ -64,8 +65,8 @@
#define BUFSIZE 8192 /* Input buffer size */
#define MAX_DEPTH 1000 /* how deep to recurse */
-#define AFTER 1 /* 'After' Context */
-#define BEFORE 2 /* 'Before' Context */
+#define AFTER 1 /* 'After' Context */
+#define BEFORE 2 /* 'Before' Context */
#define CONTEXT (AFTER|BEFORE) /* Full Context */
#define M_CSETSIZE 256 /* singlebyte chars */
@@ -91,11 +92,11 @@ static boolean_t nvflag = B_TRUE; /* Print matching lines */
static uchar_t cflag; /* Count of matches */
static uchar_t iflag; /* Case insensitve matching */
static uchar_t Hflag; /* Precede lines by file name */
-static uchar_t hflag; /* Supress printing of filename */
+static uchar_t hflag; /* Suppress printing of filename */
static uchar_t lflag; /* Print file names of matches */
static uchar_t nflag; /* Precede lines by line number */
static uchar_t rflag; /* Search directories recursively */
-static uchar_t bflag; /* Preccede matches by block number */
+static uchar_t bflag; /* Precede matches by block number */
static uchar_t sflag; /* Suppress file error messages */
static uchar_t qflag; /* Suppress standard output */
static uchar_t wflag; /* Search for expression as a word */
@@ -110,7 +111,7 @@ static char *cmdname;
static int use_wchar, use_bmg, mblocale;
static size_t outbuflen, prntbuflen, conbuflen;
-static unsigned long conalen, conblen, conmatches;
+static unsigned long conalen, conblen, conmatches;
static char *prntbuf, *conbuf;
static wchar_t *outline;
@@ -264,11 +265,11 @@ main(int argc, char **argv)
break;
/* based on options order h or H is set as in GNU grep */
- case 'h': /* Solaris: supress printing of file name */
+ case 'h': /* Solaris: suppress printing of file name */
hflag = 1;
Hflag = 0;
break;
- /* Solaris: precede every matching with file name */
+ /* Solaris: precede every match with file name */
case 'H':
Hflag = 1;
hflag = 0;
@@ -485,7 +486,8 @@ process_path(const char *path)
if (rflag) {
if (stat(path, &st) != -1 &&
(st.st_mode & S_IFMT) == S_IFDIR) {
- outfn = 1; /* Print filename */
+ if (!hflag)
+ outfn = 1; /* Print filename unless -h */
/*
* Add trailing slash if arg
@@ -898,7 +900,7 @@ grep(int fd, const char *fn)
off_t blkoffset; /* line_offset but context-compatible */
long long lineno, linenum;
long long matches = 0; /* Number of matching lines */
- long long conacnt = 0, conbcnt = 0; /* context line count */
+ long long conacnt = 0, conbcnt = 0; /* context line count */
int newlinep; /* 0 if the last line of file has no newline */
char *ptr, *ptrend, *prntptr, *prntptrend;
char *nextptr = NULL, *nextend = NULL;
diff --git a/usr/src/cmd/mdb/common/modules/genunix/streams.c b/usr/src/cmd/mdb/common/modules/genunix/streams.c
index 245fca6070..7f18b59f23 100644
--- a/usr/src/cmd/mdb/common/modules/genunix/streams.c
+++ b/usr/src/cmd/mdb/common/modules/genunix/streams.c
@@ -23,6 +23,10 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
+ */
+
#include <mdb/mdb_modapi.h>
#include <mdb/mdb_ks.h>
@@ -147,7 +151,7 @@ static const struct str_flags stdf[] = {
{ SF(STRCLOSE), "wait for a close to complete" },
{ SF(SNDMREAD), "used for read notification" },
{ SF(OLDNDELAY), "use old NDELAY TTY semantics" },
- { SF(0x00020000), "unused" },
+ { SF(STRXPG4TTY), "Use XPG4 TTY semantics" },
{ SF(0x00040000), "unused" },
{ SF(STRTOSTOP), "block background writes" },
{ SF(STRCMDWAIT), "someone is doing an _I_CMD" },
diff --git a/usr/src/cmd/mdb/i86pc/modules/unix/unix.c b/usr/src/cmd/mdb/i86pc/modules/unix/unix.c
index bd7dfda6ed..c3b7e809e4 100644
--- a/usr/src/cmd/mdb/i86pc/modules/unix/unix.c
+++ b/usr/src/cmd/mdb/i86pc/modules/unix/unix.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
* Copyright 2019 Joyent, Inc.
*/
diff --git a/usr/src/cmd/mdb/intel/Makefile.kmdb b/usr/src/cmd/mdb/intel/Makefile.kmdb
index fea041a6dc..6151a2e46a 100644
--- a/usr/src/cmd/mdb/intel/Makefile.kmdb
+++ b/usr/src/cmd/mdb/intel/Makefile.kmdb
@@ -22,7 +22,7 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# Copyright 2019, Joyent, Inc.
+# Copyright 2019 Joyent, Inc.
#
PROMSRCS += \
diff --git a/usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c b/usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c
index 728ece57a8..c03a73f31e 100644
--- a/usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c
+++ b/usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c
@@ -24,8 +24,8 @@
* Use is subject to license terms.
*/
/*
- * Copyright (c) 2018, Joyent, Inc.
* Copyright 2019 Doma Gergő Mihály <doma.gergo.mihaly@gmail.com>
+ * Copyright 2018 Joyent, Inc.
*/
/*
diff --git a/usr/src/cmd/pptadm/Makefile b/usr/src/cmd/pptadm/Makefile
index 3be558a7a0..7094f8563c 100644
--- a/usr/src/cmd/pptadm/Makefile
+++ b/usr/src/cmd/pptadm/Makefile
@@ -21,7 +21,6 @@ include ../Makefile.ctf
LDLIBS += -lofmt -lppt -lnvpair
CSTD = $(CSTD_GNU99)
-C99LMODE = -Xc99=%all
CLEANFILES += $(OBJS)
@@ -34,8 +33,6 @@ install: all $(ROOTUSRSBINPROG)
clean:
-$(RM) $(CLEANFILES)
-lint: lint_SRCS
-
%.o: ../%.c
$(COMPILE.c) $<
$(POST_PROCESS_O)
diff --git a/usr/src/cmd/rpcgen/Makefile b/usr/src/cmd/rpcgen/Makefile
index 0d0dd2f82c..352ef22446 100644
--- a/usr/src/cmd/rpcgen/Makefile
+++ b/usr/src/cmd/rpcgen/Makefile
@@ -25,24 +25,12 @@
#
# cmd/rpcgen/Makefile
-PROG= rpcgen
-
-
-OBJS= rpc_clntout.o rpc_cout.o rpc_hout.o rpc_main.o rpc_parse.o \
- rpc_scan.o rpc_svcout.o rpc_tblout.o rpc_util.o rpc_sample.o
-SRCS= $(OBJS:%.o=%.c)
-
include ../Makefile.cmd
-
-LDLIBS +=
-CFLAGS += $(CCVERBOSE)
-CERRWARN += -_gcc=-Wno-switch
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-char-subscripts
+include Makefile.common
.KEEP_STATE:
-all: $(PROG)
+all: $(PROG)
$(PROG): $(OBJS)
$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
@@ -53,6 +41,4 @@ install: all $(ROOTPROG)
clean:
$(RM) $(OBJS)
-lint: lint_SRCS
-
include ../Makefile.targ
diff --git a/usr/src/cmd/rpcgen/Makefile.common b/usr/src/cmd/rpcgen/Makefile.common
new file mode 100644
index 0000000000..a5cfe7d878
--- /dev/null
+++ b/usr/src/cmd/rpcgen/Makefile.common
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# cmd/rpcgen/Makefile
+
+PROG= rpcgen
+
+OBJS= rpc_clntout.o rpc_cout.o rpc_hout.o rpc_main.o rpc_parse.o \
+ rpc_scan.o rpc_svcout.o rpc_tblout.o rpc_util.o rpc_sample.o
+SRCS= $(OBJS:%.o=%.c)
+
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-char-subscripts
diff --git a/usr/src/cmd/vntsd/svc-vntsd b/usr/src/cmd/vntsd/svc-vntsd
index 988fa2d6c3..3bea6c0274 100644
--- a/usr/src/cmd/vntsd/svc-vntsd
+++ b/usr/src/cmd/vntsd/svc-vntsd
@@ -87,9 +87,9 @@ add_user_entries()
w
q
EOF
- else
+ else
#
- # Add a root entry with vntsd attribute.
+ # Add a root entry with vntsd attribute.
#
$CAT >>${USER_ATTR} << EOF
# Added by svc-vntsd
@@ -155,9 +155,9 @@ if [ -x /usr/lib/ldoms/vntsd ]; then
# if vntsd exited in error with status 1, let SMF restart it
# otherwise we want it to go into maintenance.
if [ $rc -eq 1 ]; then
- exit $SMF_ERR_OTHER
+ exit $rc
else
- exit $SMF_ERR_FATAL
+ exit $SMF_EXIT_ERR_FATAL
fi
fi
else
diff --git a/usr/src/lib/libbe/common/libbe.h b/usr/src/lib/libbe/common/libbe.h
index 83dffd2dcd..b670d86ce5 100644
--- a/usr/src/lib/libbe/common/libbe.h
+++ b/usr/src/lib/libbe/common/libbe.h
@@ -81,7 +81,7 @@ extern "C" {
* in sync please make sure to add any new error messages at the end
* of this enumeration.
*/
-enum {
+typedef enum {
BE_SUCCESS = 0,
BE_ERR_ACCESS = 4000, /* permission denied */
BE_ERR_ACTIVATE_CURR, /* Activation of current BE failed */
diff --git a/usr/src/lib/libc/port/stdio/ftell.c b/usr/src/lib/libc/port/stdio/ftell.c
index dae2abea03..31aabec082 100644
--- a/usr/src/lib/libc/port/stdio/ftell.c
+++ b/usr/src/lib/libc/port/stdio/ftell.c
@@ -91,7 +91,7 @@ ftell_common(FILE *iop)
tres += adjust;
FUNLOCKFILE(lk);
- return ((long)tres);
+ return (tres);
}
long
diff --git a/usr/src/lib/libppt/Makefile.com b/usr/src/lib/libppt/Makefile.com
index 7b2ff4885f..3d5e96f436 100644
--- a/usr/src/lib/libppt/Makefile.com
+++ b/usr/src/lib/libppt/Makefile.com
@@ -22,25 +22,16 @@ include $(SRC)/lib/Makefile.lib
SRCDIR = ../common
-LIBS = $(DYNLIB) $(LINTLIB)
+LIBS = $(DYNLIB)
SRCS = $(SRCDIR)/libppt.c
CSTD= $(CSTD_GNU99)
C99LMODE= -Xc99=%all
-#
-# lint doesn't like %4s in sscanf().
-#
-LINTFLAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2
-LINTFLAGS64 += -erroff=E_BAD_FORMAT_ARG_TYPE2
-
-$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
LDLIBS += -lpcidb -ldevinfo -lcmdutils -lnvpair -lc
.KEEP_STATE:
all: $(LIBS)
-lint: lintcheck
-
include $(SRC)/lib/Makefile.targ
diff --git a/usr/src/lib/libvmm/Makefile b/usr/src/lib/libvmm/Makefile
index 66bd60eb46..0aae533bb0 100644
--- a/usr/src/lib/libvmm/Makefile
+++ b/usr/src/lib/libvmm/Makefile
@@ -26,11 +26,10 @@ all:= TARGET= all
install:= TARGET= install
clean:= TARGET= clean
clobber:= TARGET= clobber
-lint:= TARGET= lint
.KEEP_STATE:
-all install clean clobber lint: $(SUBDIRS)
+all install clean clobber: $(SUBDIRS)
install_h: $(ROOTHDRS)
check: $(CHECKHDRS)
diff --git a/usr/src/lib/libvmm/Makefile.com b/usr/src/lib/libvmm/Makefile.com
index d85abae8ce..bef555aed3 100644
--- a/usr/src/lib/libvmm/Makefile.com
+++ b/usr/src/lib/libvmm/Makefile.com
@@ -37,8 +37,6 @@ LDLIBS += -lc -lvmmapi
all: $(LIBS)
-lint: lintcheck
-
pics/%.o: $(SRC)/common/list/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
diff --git a/usr/src/lib/libvmmapi/Makefile b/usr/src/lib/libvmmapi/Makefile
index 233fcd5edb..d002a65297 100644
--- a/usr/src/lib/libvmmapi/Makefile
+++ b/usr/src/lib/libvmmapi/Makefile
@@ -27,12 +27,11 @@ all:= TARGET= all
install:= TARGET= install
clean:= TARGET= clean
clobber:= TARGET= clobber
-lint:= TARGET= lint
_msg:= TARGET= _msg
.KEEP_STATE:
-all install clean clobber lint: $(SUBDIRS)
+all install clean clobber: $(SUBDIRS)
# install rule for install_h target
diff --git a/usr/src/lib/libvmmapi/Makefile.com b/usr/src/lib/libvmmapi/Makefile.com
index 34240f4331..1653e8619c 100644
--- a/usr/src/lib/libvmmapi/Makefile.com
+++ b/usr/src/lib/libvmmapi/Makefile.com
@@ -27,7 +27,7 @@ include ../../Makefile.rootfs
SRCDIR = ../common
-LIBS = $(DYNLIB) $(LINTLIB)
+LIBS = $(DYNLIB)
CPPFLAGS = -I$(COMPAT)/freebsd -I$(CONTRIB)/freebsd \
$(CPPFLAGS.master) -I$(SRC)/uts/i86pc
@@ -35,16 +35,12 @@ CPPFLAGS = -I$(COMPAT)/freebsd -I$(CONTRIB)/freebsd \
# not linted
SMATCH=off
-$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
-
LDLIBS += -lc
.KEEP_STATE:
all: $(LIBS)
-lint: lintcheck
-
pics/%.o: $(CONTRIB)/freebsd/lib/libutil/%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
diff --git a/usr/src/lib/libvmmapi/common/llib-lvmmapi b/usr/src/lib/libvmmapi/common/llib-lvmmapi
deleted file mode 100644
index 221ed3a23e..0000000000
--- a/usr/src/lib/libvmmapi/common/llib-lvmmapi
+++ /dev/null
@@ -1,2 +0,0 @@
-/* LINTLIBRARY */
-/* PROTOLIB1 */
diff --git a/usr/src/lib/libzfs/common/libzfs_crypto.c b/usr/src/lib/libzfs/common/libzfs_crypto.c
index 72c2992f4b..0d51bea01a 100644
--- a/usr/src/lib/libzfs/common/libzfs_crypto.c
+++ b/usr/src/lib/libzfs/common/libzfs_crypto.c
@@ -15,7 +15,7 @@
/*
* Copyright (c) 2017, Datto, Inc. All rights reserved.
- * Copyright 2019 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
*/
#include <string.h>
@@ -73,15 +73,64 @@ typedef enum key_locator {
static int caught_interrupt;
-static zfs_keylocation_t
-zfs_prop_parse_keylocation(const char *str)
+static int get_key_material_file(libzfs_handle_t *, const char *, const char *,
+ zfs_keyformat_t, boolean_t, uint8_t **, size_t *);
+
+static zfs_uri_handler_t uri_handlers[] = {
+ { "file", get_key_material_file },
+ { NULL, NULL }
+};
+
+static int
+zfs_prop_parse_keylocation(libzfs_handle_t *restrict hdl, const char *str,
+ zfs_keylocation_t *restrict locp, char **restrict schemep)
{
- if (strcmp("prompt", str) == 0)
- return (ZFS_KEYLOCATION_PROMPT);
- else if (strlen(str) > 8 && strncmp("file:///", str, 8) == 0)
- return (ZFS_KEYLOCATION_URI);
+ int ret;
+
+ *locp = ZFS_KEYLOCATION_NONE;
+ *schemep = NULL;
+
+ if (strcmp("prompt", str) == 0) {
+ *locp = ZFS_KEYLOCATION_PROMPT;
+ return (0);
+ }
+
+ regmatch_t pmatch[URI_NMATCH];
+ regmatch_t *smatch = &pmatch[URI_SCHEMESUBEXP];
+
+ ret = regexec(&hdl->libzfs_urire, str, ARRAY_SIZE(pmatch), pmatch, 0);
+ switch (ret) {
+ case 0:
+ break;
+ case REG_ESPACE:
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "Out of memory"));
+ return (ENOMEM);
+ case REG_NOMATCH:
+ goto invalid;
+ default:
+ /*
+ * Any other errors from regexec are a programming bug,
+ * so consider them a fatal error.
+ */
+ (void) fprintf(stderr, "regexec failed: %d\n", ret);
+ abort();
+ }
- return (ZFS_KEYLOCATION_NONE);
+ if (smatch->rm_so == -1)
+ goto invalid;
+
+ *schemep = strndup(str + smatch->rm_so, smatch->rm_eo - smatch->rm_so);
+ if (*schemep == NULL) {
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "Out of memory"));
+ return (ENOMEM);
+ }
+
+ *locp = ZFS_KEYLOCATION_URI;
+ return (0);
+
+invalid:
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "Invalid keylocation"));
+ return (EINVAL);
}
static int
@@ -134,65 +183,235 @@ get_format_prompt_string(zfs_keyformat_t format)
}
}
+/* do basic validation of the key material */
+static int
+validate_key(libzfs_handle_t *hdl, zfs_keyformat_t keyformat,
+ const char *key, size_t keylen)
+{
+ switch (keyformat) {
+ case ZFS_KEYFORMAT_RAW:
+ /* verify the key length is correct */
+ if (keylen < WRAPPING_KEY_LEN) {
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "Raw key too short (expected %u)."),
+ WRAPPING_KEY_LEN);
+ return (EINVAL);
+ }
+
+ if (keylen > WRAPPING_KEY_LEN) {
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "Raw key too long (expected %u)."),
+ WRAPPING_KEY_LEN);
+ return (EINVAL);
+ }
+ break;
+ case ZFS_KEYFORMAT_HEX:
+ /* verify the key length is correct */
+ if (keylen < WRAPPING_KEY_LEN * 2) {
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "Hex key too short (expected %u)."),
+ WRAPPING_KEY_LEN * 2);
+ return (EINVAL);
+ }
+
+ if (keylen > WRAPPING_KEY_LEN * 2) {
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "Hex key too long (expected %u)."),
+ WRAPPING_KEY_LEN * 2);
+ return (EINVAL);
+ }
+
+ /* check for invalid hex digits */
+ for (size_t i = 0; i < WRAPPING_KEY_LEN * 2; i++) {
+ if (!isxdigit(key[i])) {
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "Invalid hex character detected."));
+ return (EINVAL);
+ }
+ }
+ break;
+ case ZFS_KEYFORMAT_PASSPHRASE:
+ /* verify the length is within bounds */
+ if (keylen > MAX_PASSPHRASE_LEN) {
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "Passphrase too long (max %u)."),
+ MAX_PASSPHRASE_LEN);
+ return (EINVAL);
+ }
+
+ if (keylen < MIN_PASSPHRASE_LEN) {
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "Passphrase too short (min %u)."),
+ MIN_PASSPHRASE_LEN);
+ return (EINVAL);
+ }
+ break;
+ default:
+ /* can't happen, checked above */
+ break;
+ }
+
+ return (0);
+}
+
static int
-get_key_material_raw(FILE *fd, const char *fsname, zfs_keyformat_t keyformat,
- boolean_t again, boolean_t newkey, uint8_t **buf, size_t *len_out)
+libzfs_getpassphrase(zfs_keyformat_t keyformat, boolean_t is_reenter,
+ boolean_t new_key, const char *fsname,
+ char **restrict res, size_t *restrict reslen)
{
- int ret = 0, bytes;
+ FILE *f = stdin;
size_t buflen = 0;
+ ssize_t bytes;
+ int ret = 0;
struct termios old_term, new_term;
struct sigaction act, osigint, osigtstp;
- *len_out = 0;
+ *res = NULL;
+ *reslen = 0;
- if (isatty(fileno(fd))) {
- /*
- * handle SIGINT and ignore SIGSTP. This is necessary to
- * restore the state of the terminal.
- */
- caught_interrupt = 0;
- act.sa_flags = 0;
- (void) sigemptyset(&act.sa_mask);
- act.sa_handler = catch_signal;
-
- (void) sigaction(SIGINT, &act, &osigint);
- act.sa_handler = SIG_IGN;
- (void) sigaction(SIGTSTP, &act, &osigtstp);
-
- /* prompt for the key */
- if (fsname != NULL) {
- (void) printf("%s %s%s for '%s': ",
- (again) ? "Re-enter" : "Enter",
- (newkey) ? "new " : "",
- get_format_prompt_string(
- (zfs_keyformat_t)keyformat),
- fsname);
- } else {
- (void) printf("%s %s%s: ",
- (again) ? "Re-enter" : "Enter",
- (newkey) ? "new " : "",
- get_format_prompt_string(
- (zfs_keyformat_t)keyformat));
+ /*
+ * handle SIGINT and ignore SIGSTP. This is necessary to
+ * restore the state of the terminal.
+ */
+ caught_interrupt = 0;
+ act.sa_flags = 0;
+ (void) sigemptyset(&act.sa_mask);
+ act.sa_handler = catch_signal;
+
+ (void) sigaction(SIGINT, &act, &osigint);
+ act.sa_handler = SIG_IGN;
+ (void) sigaction(SIGTSTP, &act, &osigtstp);
+
+ (void) printf("%s %s%s",
+ is_reenter ? "Re-enter" : "Enter",
+ new_key ? "new " : "",
+ get_format_prompt_string(keyformat));
+ if (fsname != NULL)
+ (void) printf(" for '%s'", fsname);
+ (void) fputc(':', stdout);
+ (void) fflush(stdout);
+
+ /* disable the terminal echo for key input */
+ (void) tcgetattr(fileno(f), &old_term);
+
+ new_term = old_term;
+ new_term.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
+
+ ret = tcsetattr(fileno(f), TCSAFLUSH, &new_term);
+ if (ret != 0) {
+ ret = errno;
+ errno = 0;
+ goto out;
+ }
- }
- (void) fflush(stdout);
+ bytes = getline(res, &buflen, f);
+ if (bytes < 0) {
+ ret = errno;
+ errno = 0;
+ goto out;
+ }
- /* disable the terminal echo for key input */
- (void) tcgetattr(fileno(fd), &old_term);
+ /* trim the ending newline if it exists */
+ if (bytes > 0 && (*res)[bytes - 1] == '\n') {
+ (*res)[bytes - 1] = '\0';
+ bytes--;
+ }
- new_term = old_term;
- new_term.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
+ *reslen = bytes;
- ret = tcsetattr(fileno(fd), TCSAFLUSH, &new_term);
- if (ret != 0) {
- ret = errno;
- errno = 0;
- goto out;
- }
+out:
+ /* reset the teminal */
+ (void) tcsetattr(fileno(f), TCSAFLUSH, &old_term);
+ (void) sigaction(SIGINT, &osigint, NULL);
+ (void) sigaction(SIGTSTP, &osigtstp, NULL);
+
+ /* if we caught a signal, re-throw it now */
+ if (caught_interrupt != 0)
+ (void) kill(getpid(), caught_interrupt);
+
+ /* print the newline that was not echo'd */
+ (void) printf("\n");
+
+ return (ret);
+}
+
+static int
+get_key_interactive(libzfs_handle_t *restrict hdl, const char *fsname,
+ zfs_keyformat_t keyformat, boolean_t confirm_key, boolean_t newkey,
+ uint8_t **restrict outbuf, size_t *restrict len_out)
+{
+ char *buf = NULL, *buf2 = NULL;
+ size_t buflen = 0, buf2len = 0;
+ int ret = 0;
+
+ ASSERT(isatty(fileno(stdin)));
+
+ /* raw keys cannot be entered on the terminal */
+ if (keyformat == ZFS_KEYFORMAT_RAW) {
+ ret = EINVAL;
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "Cannot enter raw keys on the terminal"));
+ goto out;
+ }
+
+ /* prompt for the key */
+ if ((ret = libzfs_getpassphrase(keyformat, B_FALSE, newkey, fsname,
+ &buf, &buflen)) != 0) {
+ freezero(buf, buflen);
+ buf = NULL;
+ buflen = 0;
+ goto out;
}
+ if (!confirm_key)
+ goto out;
+
+ if ((ret = validate_key(hdl, keyformat, buf, buflen)) != 0) {
+ freezero(buf, buflen);
+ return (ret);
+ }
+
+ ret = libzfs_getpassphrase(keyformat, B_TRUE, newkey, fsname, &buf2,
+ &buf2len);
+ if (ret != 0) {
+ freezero(buf, buflen);
+ freezero(buf2, buf2len);
+ buf = buf2 = NULL;
+ buflen = buf2len = 0;
+ goto out;
+ }
+
+ if (buflen != buf2len || strcmp(buf, buf2) != 0) {
+ freezero(buf, buflen);
+ buf = NULL;
+ buflen = 0;
+
+ ret = EINVAL;
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "Provided keys do not match."));
+ }
+
+ freezero(buf2, buf2len);
+
+out:
+ *outbuf = (uint8_t *)buf;
+ *len_out = buflen;
+ return (ret);
+}
+
+static int
+get_key_material_raw(FILE *fd, zfs_keyformat_t keyformat,
+ uint8_t **buf, size_t *len_out)
+{
+ int ret = 0;
+ size_t buflen = 0;
+
+ *len_out = 0;
+
/* read the key material */
if (keyformat != ZFS_KEYFORMAT_RAW) {
+ ssize_t bytes;
+
bytes = getline((char **)buf, &buflen, fd);
if (bytes < 0) {
ret = errno;
@@ -201,25 +420,29 @@ get_key_material_raw(FILE *fd, const char *fsname, zfs_keyformat_t keyformat,
}
/* trim the ending newline if it exists */
- if ((*buf)[bytes - 1] == '\n') {
+ if (bytes > 0 && (*buf)[bytes - 1] == '\n') {
(*buf)[bytes - 1] = '\0';
bytes--;
}
+
+ *len_out = bytes;
} else {
+ size_t n;
+
/*
* Raw keys may have newline characters in them and so can't
* use getline(). Here we attempt to read 33 bytes so that we
* can properly check the key length (the file should only have
* 32 bytes).
*/
- *buf = malloc((WRAPPING_KEY_LEN + 1) * sizeof (char));
+ *buf = malloc((WRAPPING_KEY_LEN + 1) * sizeof (uint8_t));
if (*buf == NULL) {
ret = ENOMEM;
goto out;
}
- bytes = fread(*buf, 1, WRAPPING_KEY_LEN + 1, fd);
- if (bytes < 0) {
+ n = fread(*buf, 1, WRAPPING_KEY_LEN + 1, fd);
+ if (n == 0 || ferror(fd)) {
/* size errors are handled by the calling function */
free(*buf);
*buf = NULL;
@@ -227,28 +450,43 @@ get_key_material_raw(FILE *fd, const char *fsname, zfs_keyformat_t keyformat,
errno = 0;
goto out;
}
- }
- *len_out = bytes;
+ *len_out = n;
+ }
out:
- if (isatty(fileno(fd))) {
- /* reset the teminal */
- (void) tcsetattr(fileno(fd), TCSAFLUSH, &old_term);
- (void) sigaction(SIGINT, &osigint, NULL);
- (void) sigaction(SIGTSTP, &osigtstp, NULL);
-
- /* if we caught a signal, re-throw it now */
- if (caught_interrupt != 0) {
- (void) kill(getpid(), caught_interrupt);
- }
+ return (ret);
+}
+
+static int
+get_key_material_file(libzfs_handle_t *hdl, const char *uri,
+ const char *fsname, zfs_keyformat_t keyformat, boolean_t newkey,
+ uint8_t **restrict buf, size_t *restrict len_out)
+{
+ const char *path;
+ FILE *f = NULL;
+ int ret = 0;
+
+ /*
+ * get_key_material() should guarantee we're only called for a file
+ * URI.
+ */
+ VERIFY0(strncmp(uri, "file://", 7));
+ path = uri + 7;
- /* print the newline that was not echo'd */
- (void) printf("\n");
+ if ((f = fopen(path, "r")) == NULL) {
+ ret = errno;
+ errno = 0;
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "Failed to open key material file"));
+ return (ret);
}
- return (ret);
+ ret = get_key_material_raw(f, keyformat, buf, len_out);
+
+ (void) fclose(f);
+ return (ret);
}
/*
@@ -262,41 +500,47 @@ get_key_material(libzfs_handle_t *hdl, boolean_t do_verify, boolean_t newkey,
zfs_keyformat_t keyformat, char *keylocation, const char *fsname,
uint8_t **km_out, size_t *kmlen_out, boolean_t *can_retry_out)
{
- int ret, i;
+ int ret;
zfs_keylocation_t keyloc = ZFS_KEYLOCATION_NONE;
- FILE *fd = NULL;
- uint8_t *km = NULL, *km2 = NULL;
- size_t kmlen, kmlen2;
+ uint8_t *km = NULL;
+ size_t kmlen = 0;
+ char *scheme = NULL;
+ zfs_uri_handler_t *handler = NULL;
boolean_t can_retry = B_FALSE;
/* verify and parse the keylocation */
- keyloc = zfs_prop_parse_keylocation(keylocation);
+ ret = zfs_prop_parse_keylocation(hdl, keylocation, &keyloc, &scheme);
+ if (ret != 0)
+ goto error;
/* open the appropriate file descriptor */
switch (keyloc) {
case ZFS_KEYLOCATION_PROMPT:
- fd = stdin;
- if (isatty(fileno(fd))) {
+ if (isatty(fileno(stdin))) {
can_retry = B_TRUE;
- /* raw keys cannot be entered on the terminal */
- if (keyformat == ZFS_KEYFORMAT_RAW) {
- ret = EINVAL;
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "Cannot enter raw keys on the terminal"));
- goto error;
- }
+ ret = get_key_interactive(hdl, fsname, keyformat,
+ do_verify, newkey, &km, &kmlen);
+ } else {
+ /* fetch the key material into the buffer */
+ ret = get_key_material_raw(stdin, keyformat, &km,
+ &kmlen);
}
+ if (ret != 0)
+ goto error;
break;
case ZFS_KEYLOCATION_URI:
- fd = fopen(&keylocation[7], "r");
- if (!fd) {
- ret = errno;
- errno = 0;
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "Failed to open key material file"));
- goto error;
+ for (handler = uri_handlers; handler->zuh_scheme != NULL;
+ handler++) {
+ if (strcmp(handler->zuh_scheme, scheme) != 0)
+ continue;
+ if ((ret = handler->zuh_handler(hdl, keylocation,
+ fsname, keyformat, newkey, &km, &kmlen)) != 0)
+ goto error;
}
+ ret = ENOTSUP;
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "URI scheme is not supported"));
break;
default:
ret = EINVAL;
@@ -305,127 +549,24 @@ get_key_material(libzfs_handle_t *hdl, boolean_t do_verify, boolean_t newkey,
goto error;
}
- /* fetch the key material into the buffer */
- ret = get_key_material_raw(fd, fsname, keyformat, B_FALSE, newkey,
- &km, &kmlen);
- if (ret != 0)
+ if ((ret = validate_key(hdl, keyformat, (const char *)km, kmlen)) != 0)
goto error;
- /* do basic validation of the key material */
- switch (keyformat) {
- case ZFS_KEYFORMAT_RAW:
- /* verify the key length is correct */
- if (kmlen < WRAPPING_KEY_LEN) {
- ret = EINVAL;
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "Raw key too short (expected %u)."),
- WRAPPING_KEY_LEN);
- goto error;
- }
-
- if (kmlen > WRAPPING_KEY_LEN) {
- ret = EINVAL;
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "Raw key too long (expected %u)."),
- WRAPPING_KEY_LEN);
- goto error;
- }
- break;
- case ZFS_KEYFORMAT_HEX:
- /* verify the key length is correct */
- if (kmlen < WRAPPING_KEY_LEN * 2) {
- ret = EINVAL;
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "Hex key too short (expected %u)."),
- WRAPPING_KEY_LEN * 2);
- goto error;
- }
-
- if (kmlen > WRAPPING_KEY_LEN * 2) {
- ret = EINVAL;
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "Hex key too long (expected %u)."),
- WRAPPING_KEY_LEN * 2);
- goto error;
- }
-
- /* check for invalid hex digits */
- for (i = 0; i < WRAPPING_KEY_LEN * 2; i++) {
- if (!isxdigit((char)km[i])) {
- ret = EINVAL;
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "Invalid hex character detected."));
- goto error;
- }
- }
- break;
- case ZFS_KEYFORMAT_PASSPHRASE:
- /* verify the length is within bounds */
- if (kmlen > MAX_PASSPHRASE_LEN) {
- ret = EINVAL;
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "Passphrase too long (max %u)."),
- MAX_PASSPHRASE_LEN);
- goto error;
- }
-
- if (kmlen < MIN_PASSPHRASE_LEN) {
- ret = EINVAL;
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "Passphrase too short (min %u)."),
- MIN_PASSPHRASE_LEN);
- goto error;
- }
- break;
- default:
- /* can't happen, checked above */
- break;
- }
-
- if (do_verify && isatty(fileno(fd))) {
- ret = get_key_material_raw(fd, fsname, keyformat, B_TRUE,
- newkey, &km2, &kmlen2);
- if (ret != 0)
- goto error;
-
- if (kmlen2 != kmlen ||
- (memcmp((char *)km, (char *)km2, kmlen) != 0)) {
- ret = EINVAL;
- zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
- "Provided keys do not match."));
- goto error;
- }
- }
-
- if (fd != stdin)
- (void) fclose(fd);
-
- if (km2 != NULL)
- free(km2);
-
*km_out = km;
*kmlen_out = kmlen;
if (can_retry_out != NULL)
*can_retry_out = can_retry;
+ free(scheme);
return (0);
error:
- if (km != NULL)
- free(km);
-
- if (km2 != NULL)
- free(km2);
-
- if (fd != NULL && fd != stdin)
- (void) fclose(fd);
+ freezero(km, kmlen);
+ free(scheme);
*km_out = NULL;
*kmlen_out = 0;
- if (can_retry_out != NULL)
- *can_retry_out = can_retry;
-
return (ret);
}
diff --git a/usr/src/lib/libzfs/common/libzfs_impl.h b/usr/src/lib/libzfs/common/libzfs_impl.h
index aa420a41a2..bca1fc8a93 100644
--- a/usr/src/lib/libzfs/common/libzfs_impl.h
+++ b/usr/src/lib/libzfs/common/libzfs_impl.h
@@ -24,7 +24,7 @@
* Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright (c) 2011, 2017 by Delphix. All rights reserved.
- * Copyright 2019 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
*/
#ifndef _LIBZFS_IMPL_H
@@ -36,6 +36,7 @@
#include <sys/dmu.h>
#include <sys/zfs_ioctl.h>
#include <synch.h>
+#include <regex.h>
#include <libuutil.h>
#include <libzfs.h>
@@ -93,6 +94,7 @@ struct libzfs_handle {
boolean_t libzfs_cachedprops;
boolean_t libzfs_prop_debug;
di_devlink_handle_t libzfs_devlink;
+ regex_t libzfs_urire;
};
struct zfs_handle {
@@ -144,6 +146,50 @@ typedef enum {
SHARED_SMB = 0x4
} zfs_share_type_t;
+
+/*
+ * From RFC3986 Appendix B. The regex is a bit of a beast, but with an
+ * example URI of:
+ *
+ * http://www.ics.uci.edu/pub/ietf/uri/#Related
+ *
+ * URI_REGEX should match with the following subexpressions:
+ *
+ * $1 = http:
+ * $2 = http
+ * $3 = //www.ics.uci.edu
+ * $4 = www.ics.uci.edu
+ * $5 = /pub/ietf/uri/
+ * $6 = <undefined>
+ * $7 = <undefined>
+ * $8 = #Related
+ * $9 = Related
+ *
+ * More generally:
+ *
+ * scheme = $2
+ * authority = $4
+ * path = $5
+ * query = $7
+ * fragment = $9
+ *
+ * We only care about the value of the scheme component ($2) in order to
+ * invoke the correct handler. Each handler should do any additional URI
+ * validation as required.
+ */
+#define URI_REGEX \
+ "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"
+#define URI_NMATCH 10 /* whole URI match ($0) + 9 subexps */
+#define URI_SCHEMESUBEXP 2 /* '$2' */
+
+typedef int (*zfs_uri_handler_fn_t)(struct libzfs_handle *, const char *,
+ const char *, zfs_keyformat_t, boolean_t, uint8_t **, size_t *);
+
+typedef struct zfs_uri_handler {
+ const char *zuh_scheme;
+ zfs_uri_handler_fn_t zuh_handler;
+} zfs_uri_handler_t;
+
#define CONFIG_BUF_MINSIZE 262144
int zfs_error(libzfs_handle_t *, int, const char *);
diff --git a/usr/src/lib/libzfs/common/libzfs_util.c b/usr/src/lib/libzfs/common/libzfs_util.c
index 31d66e9469..c3cf11a897 100644
--- a/usr/src/lib/libzfs/common/libzfs_util.c
+++ b/usr/src/lib/libzfs/common/libzfs_util.c
@@ -684,13 +684,20 @@ libzfs_init(void)
return (NULL);
}
+ if (regcomp(&hdl->libzfs_urire, URI_REGEX, REG_EXTENDED) != 0) {
+ free(hdl);
+ return (NULL);
+ }
+
if ((hdl->libzfs_fd = open(ZFS_DEV, O_RDWR)) < 0) {
+ regfree(&hdl->libzfs_urire);
free(hdl);
return (NULL);
}
if ((hdl->libzfs_mnttab = fopen(MNTTAB, "rF")) == NULL) {
(void) close(hdl->libzfs_fd);
+ regfree(&hdl->libzfs_urire);
free(hdl);
return (NULL);
}
@@ -701,6 +708,7 @@ libzfs_init(void)
(void) close(hdl->libzfs_fd);
(void) fclose(hdl->libzfs_mnttab);
(void) fclose(hdl->libzfs_sharetab);
+ regfree(&hdl->libzfs_urire);
free(hdl);
return (NULL);
}
@@ -734,6 +742,7 @@ libzfs_fini(libzfs_handle_t *hdl)
namespace_clear(hdl);
libzfs_mnttab_fini(hdl);
libzfs_core_fini();
+ regfree(&hdl->libzfs_urire);
free(hdl);
}
diff --git a/usr/src/man/man1/cp.1 b/usr/src/man/man1/cp.1
index a4b71a5976..97b64289ad 100644
--- a/usr/src/man/man1/cp.1
+++ b/usr/src/man/man1/cp.1
@@ -45,11 +45,10 @@
.\" Portions Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
.\" Copyright 2013 Nexenta Systems, Inc. All rights reserved.
.\"
-.TH CP 1 "Apr 15, 2013"
+.TH CP 1 "May 17, 2020"
.SH NAME
cp \- copy files
.SH SYNOPSIS
-.LP
.nf
\fB/usr/bin/cp\fR [\fB-afip@/\fR] \fIsource_file\fR \fItarget_file\fR
.fi
@@ -90,8 +89,6 @@ cp \- copy files
.fi
.SH DESCRIPTION
-.sp
-.LP
In the first synopsis form, neither \fIsource_file\fR nor \fItarget_file\fR are
directory files, nor can they have the same name. The \fBcp\fR utility copies
the contents of \fIsource_file\fR to the destination path named by
@@ -121,8 +118,6 @@ In the third or fourth synopsis forms, one or more directories specified by
the \fB-r\fR or \fB-R\fR must be specified. For each \fIsource_dir\fR, \fBcp\fR
copies all files and subdirectories.
.SH OPTIONS
-.sp
-.LP
The following options are supported for both \fB/usr/bin/cp\fR and
\fB/usr/xpg4/bin/cp\fR:
.sp
@@ -272,8 +267,6 @@ Specifying more than one of the mutually-exclusive options \fB-H\fR, \fB-L\fR,
and \fB-P\fR is not considered an error. The last option specified determines
the behavior of the utility.
.SS "/usr/bin/cp"
-.sp
-.LP
If the \fB-p\fR option is specified with either the \fB-@\fR option or the
\fB-/\fR option, \fB/usr/bin/cp\fR behaves as follows
.RS +4
@@ -291,10 +284,8 @@ When both \fB-p\fR and \fB-/\fR are specified in any order, the copy fails if
extended system attributes cannot be copied.
.RE
.SS "/usr/xpg4/bin/cp"
-.sp
-.LP
If the \fB-p\fR option is specified with either the \fB-@\fR option or the
-\fB-/\fR option, /\fBusr/xpg4/bin/cp\fR behaves as follows:
+\fB-/\fR option, \fB/usr/xpg4/bin/cp\fR behaves as follows:
.RS +4
.TP
.ie t \(bu
@@ -311,8 +302,6 @@ determines whether the copy fails if extended system attributes cannot be
preserved.
.RE
.SH OPERANDS
-.sp
-.LP
The following operands are supported:
.sp
.ne 2
@@ -352,12 +341,9 @@ A pathname of a directory to contain the copied files.
.RE
.SH USAGE
-.sp
-.LP
See \fBlargefile\fR(5) for the description of the behavior of \fBcp\fR when
encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
.SH EXAMPLES
-.LP
\fBExample 1 \fRCopying a File
.sp
.LP
@@ -462,8 +448,6 @@ $ ls -/c /tmp/file1
.sp
.SH ENVIRONMENT VARIABLES
-.sp
-.LP
See \fBenviron\fR(5) for descriptions of the following environment variables
that affect the execution of \fBcp\fR: \fBLANG\fR, \fBLC_ALL\fR,
\fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
@@ -478,8 +462,6 @@ in \fBLC_CTYPE\fR determines the locale for interpretation of sequences of
bytes of text data a characters, the behavior of character classes used in the
expression defined for the \fByesexpr\fR. See \fBlocale\fR(5).
.SH EXIT STATUS
-.sp
-.LP
The following exit values are returned:
.sp
.ne 2
@@ -500,13 +482,8 @@ An error occurred.
.RE
.SH ATTRIBUTES
-.sp
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.SS "/usr/bin/cp"
-.sp
-
-.sp
.TS
box;
c | c
@@ -519,9 +496,6 @@ Interface Stability Committed
.TE
.SS "/usr/xpg4/bin/cp"
-.sp
-
-.sp
.TS
box;
c | c
@@ -534,14 +508,10 @@ Interface Stability Committed
.TE
.SH SEE ALSO
-.sp
-.LP
\fBchmod\fR(1), \fBchown\fR(1), \fBsetfacl\fR(1), \fButime\fR(2),
\fBfgetattr\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5), \fBfsattr\fR(5),
\fBlargefile\fR(5), \fBlocale\fR(5), \fBstandards\fR(5)
.SH NOTES
-.sp
-.LP
The permission modes of the source file are preserved in the copy.
.sp
.LP
diff --git a/usr/src/man/man1/elfedit.1 b/usr/src/man/man1/elfedit.1
index 7230d8ab13..b8f27fa3a9 100644
--- a/usr/src/man/man1/elfedit.1
+++ b/usr/src/man/man1/elfedit.1
@@ -4,19 +4,16 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH ELFEDIT 1 "Jan 28, 2008"
+.TH ELFEDIT 1 "May 17, 2020"
.SH NAME
elfedit \- examine or edit ELF files
.SH SYNOPSIS
-.LP
.nf
\fBelfedit\fR [\fB-adr\fR] [\fB-e\fR \fIcmd\fR] [\fB-L\fR \fIpath\fR] [\fB-o\fR \fBdefault\fR | \fBsimple\fR | \fBnum\fR]
[\fIinfile\fR] [\fIoutfile\fR]
.fi
.SH DESCRIPTION
-.sp
-.LP
\fBelfedit\fR is a tool for examining or modifying the contents of an existing
ELF object. Specifically, \fBelfedit\fR is used to modify the ELF metadata
contained in the object. Access is provided to most of the ELF data contained
@@ -24,8 +21,6 @@ in an object, including the ELF header, section header table, program header
table, dynamic section, hardware and software capabilities, string tables, and
symbol tables.
.SS "Syntax"
-.sp
-.LP
\fBelfedit\fR processes commands from the command line (\fB-e\fR option) or
from standard input. If standard input is a terminal, \fBelfedit\fR provides
terminal editing capabilities, as well as extensive command completion. ELF
@@ -302,8 +297,6 @@ Core built in \fBelfedit\fR commands
.RE
.SS "Status And Command Documentation"
-.sp
-.LP
Status And Command Documentation
.sp
.LP
@@ -399,8 +392,6 @@ help (\fBsys:help\fR) can be used to obtain help on itself:
.sp
.SS "Module Search Path"
-.sp
-.LP
\fBelfedit\fR modules are implemented as sharable objects which are loaded on
demand. When a module is required, \fBelfedit\fR searches a module path in
order to locate the sharable object that implements the module. The path is a
@@ -444,7 +435,7 @@ appending or prepending directories to the default path.
.ad
.RS 6n
Root of file system tree holding the \fBelfedit\fR program, assuming that
-\fBelfedit\fR is installed as \fBusr/bin/elfedi\fRt within the tree. On a
+\fBelfedit\fR is installed as \fBusr/bin/elfedit\fR within the tree. On a
standard system, this is simply the standard system root directory (\fB/\fR).
On a development system, where the copy of \fBelfedit\fR can be installed
elsewhere, the use of \fB%r\fR can be used to ensure that the matching set of
@@ -507,8 +498,6 @@ The default search path can be changed by setting the \fBELFEDIT_PATH\fR
environment variable, or by using the \fB-L\fR command line option. If you
specify both, the \fB-L\fR option supersedes the environment variable.
.SH OPTIONS
-.sp
-.LP
The following options are supported:
.sp
.ne 2
@@ -628,8 +617,6 @@ examination of files for which the user does not have write permission.
.RE
.SH OPERANDS
-.sp
-.LP
The following operands are supported:
.sp
.ne 2
@@ -672,8 +659,6 @@ is opened for read-only access, and the modified object contents are written to
.RE
.SH USAGE
-.sp
-.LP
When supported by the system, \fBelfedit\fR runs as a 64-bit application,
capable of processing files greater than or equal to 2 Gbytes (2^31 bytes).
.sp
@@ -702,8 +687,6 @@ If no \fB-e\fR options are specified, \fBelfedit\fR reads commands from
issue the write (\fBsys:write\fR) and quit (\fBsys:quit\fR) commands to save
their work and exit when running in this mode.
.SH EXIT STATUS
-.sp
-.LP
The following exit values are returned:
.sp
.ne 2
@@ -733,8 +716,6 @@ Invalid command line options were specified.
.RE
.SH EXAMPLES
-.sp
-.LP
In the following examples, interactive use of \fBelfedit\fR is shown with the
shell prompt (\fB%\fR) and the \fBelfedit\fR prompt (\fB>\fR). Neither of these
characters should be entered by the user.
@@ -866,7 +847,6 @@ STT_FUNC
.sp
.SH ENVIRONMENT VARIABLES
-.sp
.ne 2
.na
\fB\fBELFEDIT_PATH\fR\fR
@@ -897,7 +877,6 @@ Interactively delivers output from \fBelfedit\fR to the screen. If not set,
.RE
.SH FILES
-.sp
.ne 2
.na
\fB\fB/usr/lib/elfedit\fR\fR
@@ -918,8 +897,6 @@ Personal \fBtecla\fR customization file for command line editing. See
.RE
.SH ATTRIBUTES
-.sp
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -934,8 +911,6 @@ Interface Stability Committed
.TE
.SH SEE ALSO
-.sp
-.LP
\fBdump\fR(1), \fBelfdump\fR(1), \fBld.so.1\fR(1), \fBmore\fR(1), \fBnm\fR(1),
\fBpvs\fR(1), \fBelf\fR(3ELF), \fBlibelf\fR(3LIB), \fBtecla\fR(5),
\fBattributes\fR(5)
@@ -943,8 +918,6 @@ Interface Stability Committed
.LP
\fILinker and Libraries Guide\fR
.SH WARNINGS
-.sp
-.LP
\fBelfedit\fR is designed to be a tool for testing and development of the ELF
system. It offers the ability to examine and change nearly every piece of ELF
metadata in the object. It quietly allows edits that can produce an invalid or
@@ -965,8 +938,6 @@ Higher level operations, such as the use of the \fBdyn:runpath\fR command to
change the \fBrunpath\fR of an object, are safe, and can be carried out without
the sort of risk detailed in this section.
.SH NOTES
-.sp
-.LP
Not every ELF operation supported by \fBelfedit\fR can be successfully carried
out on every ELF object. \fBelfedit\fR is constrained by the existing sections
found in the file.
diff --git a/usr/src/man/man1/mail.1 b/usr/src/man/man1/mail.1
index 8aad4de37e..5d8bc7b84c 100644
--- a/usr/src/man/man1/mail.1
+++ b/usr/src/man/man1/mail.1
@@ -44,12 +44,11 @@
.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
.\"
-.TH MAIL 1 "Jul 24, 2008"
+.TH MAIL 1 "May 17, 2020"
.SH NAME
mail, rmail \- read mail or send mail to users
.SH SYNOPSIS
.SS "Sending Mail"
-.LP
.nf
\fBmail\fR [\fB-tw\fR] [\fB-m\fR \fImessage_type\fR] \fIrecipient\fR...
.fi
@@ -60,20 +59,16 @@ mail, rmail \- read mail or send mail to users
.fi
.SS "Reading Mail"
-.LP
.nf
\fBmail\fR [\fB-ehpPqr\fR] [\fB-f\fR \fIfile\fR]
.fi
.SS "Debugging"
-.LP
.nf
\fBmail\fR [\fB-x\fR \fIdebug_level\fR] [\fIother_mail_options\fR] \fIrecipient\fR...
.fi
.SH DESCRIPTION
-.sp
-.LP
A \fIrecipient\fR is usually a domain style address
("\fIuser\fR@\fImachine\fR") or a user name recognized by \fBlogin\fR(1). When
\fIrecipient\fRs are named, \fBmail\fR assumes a message is being sent. It
@@ -119,8 +114,6 @@ consists of only header lines with no message content. Header lines may be
continued on the following line if that line starts with white space.
.SH OPTIONS
.SS "Sending Mail"
-.sp
-.LP
The following command-line arguments affect sending mail:
.sp
.ne 2
@@ -202,8 +195,6 @@ extended network (such as \fBsysa!sysb!sysc!user\fR or
.RE
.SS "Reading Mail"
-.sp
-.LP
The following command-line arguments affect reading mail:
.sp
.ne 2
@@ -545,8 +536,6 @@ preservation using the \fBDEL_EMPTY_MAILFILE\fR option of \fBmailcnfg\fR.)
The group \fBID\fR of the mailfile must be \fBmail\fR to allow new messages to
be delivered, and the mailfile must be writable by group \fBmail\fR.
.SS "Debugging"
-.sp
-.LP
The following command-line arguments cause \fBmail\fR to provide debugging
information:
.sp
@@ -572,8 +561,6 @@ overrides any specification of \fBDEBUG\fR in \fB/etc/mail/mailcnfg\fR. The
information provided by the \fB-x\fR option is esoteric and is probably only
useful to system administrators.
.SS "Delivery Notification"
-.sp
-.LP
Several forms of notification are available for mail by including one of the
following lines in the message header.
.sp
@@ -640,8 +627,6 @@ Same as \fB/return\fR except that the original message is not returned.
The default is \fB/nodelivery/return\fR. If contradictory options are used, the
first is recognized and later, conflicting, terms are ignored.
.SH OPERANDS
-.sp
-.LP
The following operand is supported for sending mail:
.sp
.ne 2
@@ -654,14 +639,10 @@ recognized by \fBlogin\fR(1).
.RE
.SH USAGE
-.sp
-.LP
See \fBlargefile\fR(5) for the description of the behavior of \fBmail\fR and
\fBrmail\fR when encountering files greater than or equal to 2 Gbyte ( 2^31
bytes).
.SH ENVIRONMENT VARIABLES
-.sp
-.LP
See \fBenviron\fR(5) for descriptions of the following environment variables
that affect the execution of \fBmail\fR: \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and
\fBNLSPATH\fR.
@@ -675,8 +656,6 @@ Determine the timezone used with date and time strings.
.RE
.SH EXIT STATUS
-.sp
-.LP
The following exit values are returned:
.sp
.ne 2
@@ -706,7 +685,6 @@ An error occurred after initialization.
.RE
.SH FILES
-.sp
.ne 2
.na
\fB\fBdead.letter\fR\fR
@@ -782,15 +760,13 @@ incoming mail for \fIuser\fR; that is, the \fImailfile\fR
.sp
.ne 2
.na
-\fB\fBvar/tmp/ma\fR*\fR
+\fB\fB/var/tmp/ma\fR*\fR
.ad
.RS 20n
temporary file
.RE
.SH SEE ALSO
-.sp
-.LP
\fBchmod\fR(1), \fBcsh\fR(1), \fBlogin\fR(1), \fBmailx\fR(1), \fBuucp\fR(1C),
\fBuuencode\fR(1C), \fBvacation\fR(1), \fBwrite\fR(1), \fBattributes\fR(5),
\fBenviron\fR(5), \fBlargefile\fR(5)
@@ -798,8 +774,6 @@ temporary file
.LP
\fISolaris Advanced User\&'s Guide\fR
.SH NOTES
-.sp
-.LP
The interpretation and resulting action taken because of the header lines
described in the Delivery Notifications section only occur if this version of
\fBmail\fR is installed on the system where the delivery (or failure) happens.
diff --git a/usr/src/man/man1/mdb.1 b/usr/src/man/man1/mdb.1
index e197836a1c..54f00f4b61 100644
--- a/usr/src/man/man1/mdb.1
+++ b/usr/src/man/man1/mdb.1
@@ -5,7 +5,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH MDB 1 "Feb 21, 2019"
+.TH MDB 1 "May 20, 2020"
.SH NAME
mdb \- modular debugger
.SH SYNOPSIS
diff --git a/usr/src/man/man1/wait.1 b/usr/src/man/man1/wait.1
index 6708415364..67e87e8a95 100644
--- a/usr/src/man/man1/wait.1
+++ b/usr/src/man/man1/wait.1
@@ -45,23 +45,20 @@
.\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
.\"
-.TH WAIT 1 "Mar 13, 2008"
+.TH WAIT 1 "May 17, 2020"
.SH NAME
wait \- await process completion
.SH SYNOPSIS
-.LP
.nf
.fi
.SS "/bin/sh"
-.LP
.nf
\fBwait\fR [\fIpid\fR]...
.fi
.SS "/bin/jsh /bin/ksh /usr/xpg4/bin/sh"
-.LP
.nf
\fBwait\fR [\fIpid\fR]...
.fi
@@ -72,20 +69,16 @@ wait \- await process completion
.fi
.SS "/bin/csh"
-.LP
.nf
\fBwait\fR
.fi
.SS "ksh93"
-.LP
.nf
\fBwait\fR [\fIjob...\fR]
.fi
.SH DESCRIPTION
-.sp
-.LP
The shell itself executes \fBwait\fR, without creating a new process. If you
get the error message \fBcannot fork,too many processes\fR, try using the
\fBwait\fR command to clean up your background processes. If this doesn't help,
@@ -97,8 +90,6 @@ associated with your login, and to the number the system can keep track of.
Not all the processes of a pipeline with three or more stages are children of
the shell, and thus cannot be waited for.
.SS "/bin/sh, /bin/jsh"
-.sp
-.LP
Wait for your background process whose process \fBID\fR is \fIpid\fR and report
its termination status. If \fIpid\fR is omitted, all your shell's currently
active background processes are waited for and the return code is \fB0\fR. The
@@ -109,12 +100,8 @@ and the argument, \fIjobid\fR, is preceded by a percent sign (\fB%\fR).
If \fIpid\fR is not an active process \fBID,\fR the \fBwait\fR utility returns
immediately and the return code is \fB0\fR.
.SS "csh"
-.sp
-.LP
Wait for your background processes.
.SS "ksh"
-.sp
-.LP
When an asynchronous list is started by the shell, the process \fBID\fR of the
last command in each element of the asynchronous list becomes known in the
current shell execution environment.
@@ -138,8 +125,6 @@ is the exit status of the process requested by the last \fIpid\fR or
The known process \fBID\fRs are applicable only for invocations of \fBwait\fR
in the current shell execution environment.
.SS "ksh93"
-.sp
-.LP
wait with no operands, waits until all jobs known to the invoking shell have
terminated. If one or more job operands are specified, wait waits until all of
them have completed. Each job can be specified as one of the following:
@@ -212,12 +197,10 @@ Refers to the previous job
.sp
.LP
-If one ore more job operands is a process id or process group id not known by
+If one or more job operands is a process id or process group id not known by
the current shell environment, \fBwait\fR treats each of them as if it were a
process that exited with status 127.
.SH OPERANDS
-.sp
-.LP
The following operands are supported:
.sp
.ne 2
@@ -242,8 +225,6 @@ on systems supporting the job control option.
.RE
.SH USAGE
-.sp
-.LP
On most implementations, \fBwait\fR is a shell built-in. If it is called in a
subshell or separate utility execution environment, such as one of the
following,
@@ -262,7 +243,6 @@ find . -exec wait ... \e;
it returns immediately because there is no known process \fBID\fRs to wait for
in those environments.
.SH EXAMPLES
-.LP
\fBExample 1 \fRUsing A Script To Identify The Termination Signal
.sp
.LP
@@ -315,15 +295,11 @@ wait %%
.sp
.SH ENVIRONMENT VARIABLES
-.sp
-.LP
See \fBenviron\fR(5) for descriptions of the following environment variables
that affect the execution of \fBwait\fR: \fBLANG\fR, \fBLC_ALL\fR,
\fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
.SH EXIT STATUS
.SS "ksh93"
-.sp
-.LP
The following exit values are returned by the \fBwait\fR built-in in
\fBksh93\fR:
.sp
@@ -347,8 +323,6 @@ shell environment.
.RE
.SH ATTRIBUTES
-.sp
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -365,7 +339,5 @@ Standard See \fBstandards\fR(5).
.TE
.SH SEE ALSO
-.sp
-.LP
\fBcsh\fR(1), \fBjobs\fR(1), \fBksh\fR(1), \fBksh93\fR(1), \fBsh\fR(1),
\fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
diff --git a/usr/src/man/man1m/ipf.1m b/usr/src/man/man1m/ipf.1m
index 5797e8c28e..121556e83c 100644
--- a/usr/src/man/man1m/ipf.1m
+++ b/usr/src/man/man1m/ipf.1m
@@ -3,11 +3,10 @@
.\" location.
.\" Portions Copyright (c) 2009, Sun Microsystems Inc. All Rights Reserved.
.\" Portions Copyright (c) 2015, Joyent, Inc.
-.TH IPF 1M "April 9, 2016"
+.TH IPF 1M "May 17, 2020"
.SH NAME
ipf \- alter packet filtering lists for IP packet input and output
.SH SYNOPSIS
-.LP
.nf
\fBipf\fR [\fB-6AdDEGInoPRrsvVyzZ\fR] [\fB-l\fR block | pass | nomatch]
[\fB-T\fR \fIoptionlist\fR] [\fB-F\fR i | o | a | s | S] \fB-f\fR \fIfilename\fR
@@ -15,7 +14,6 @@ ipf \- alter packet filtering lists for IP packet input and output
.fi
.SH DESCRIPTION
-.LP
The \fBipf\fR utility is part of a suite of commands associated with the
Solaris IP Filter feature. See \fBipfilter\fR(5).
.sp
@@ -34,7 +32,6 @@ matching the order in which they appear when given to \fBipf\fR.
\fB/dev/ipl\fR, and \fB/dev/ipstate\fR. The default permissions of these files
require \fBipf\fR to be run as root for all operations.
.SS "Enabling Solaris IP Filter Feature"
-.LP
Solaris IP Filter is installed with the Solaris operating system. However,
packet filtering is not enabled by default. Use the following procedure to
activate the Solaris IP Filter feature.
@@ -61,7 +58,7 @@ See \fBipnat\fR(4).
4.
(Optional) Create an address pool configuration file. See \fBippool\fR(4).
.sp
-Create an \fBipool.conf\fR file if you want to refer to a group of addresses as
+Create an \fBippool.conf\fR file if you want to refer to a group of addresses as
a single address pool. If you want the address pool configuration file to be
loaded at boot time, create a file called \fB/etc/ipf/ippool.conf\fR in which
to put the address pool. If you do not want the address pool configuration file
@@ -158,7 +155,6 @@ If you reboot your system, the IPfilter configuration is automatically
activated.
.RE
.SH OPTIONS
-.LP
The following options are supported:
.sp
.ne 2
@@ -469,7 +465,6 @@ affect fragment or state statistics.
.RE
.SH ZONES
-.LP
Each non-global zone has two ipfilter instances: the in-zone ipfilter, which
can be controlled from both the zone itself and the global zone, and the
Global Zone-controlled (GZ-controlled) instance, which can only be controlled
@@ -525,7 +520,6 @@ Contains numerous IP Filter examples.
.RE
.SH ATTRIBUTES
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -540,7 +534,6 @@ Interface Stability Committed
.TE
.SH SEE ALSO
-.LP
\fBipfstat\fR(1M), \fBipmon\fR(1M), \fBipnat\fR(1M), \fBippool\fR(1M),
\fBsvcadm\fR(1M), \fBsvc.ipfd\fR(1M), \fBipf\fR(4), \fBipnat\fR(4),
\fBippool\fR(4), \fBattributes\fR(5), \fBipfilter\fR(5), \fBzones(5)\fR
@@ -548,6 +541,5 @@ Interface Stability Committed
.LP
\fI\fR
.SH DIAGNOSTICS
-.LP
Needs to be run as root for the packet filtering lists to actually be affected
inside the kernel.
diff --git a/usr/src/man/man1m/luxadm.1m b/usr/src/man/man1m/luxadm.1m
index 71fc381a8c..4bd782458b 100644
--- a/usr/src/man/man1m/luxadm.1m
+++ b/usr/src/man/man1m/luxadm.1m
@@ -3,18 +3,16 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH LUXADM 1M "May 13, 2017"
+.TH LUXADM 1M "May 17, 2020"
.SH NAME
luxadm \- administer Sun Fire 880 storage subsystem and FC_AL devices
.SH SYNOPSIS
-.LP
.nf
\fBluxadm\fR [\fIoptions\fR]... \fIsubcommand\fR [\fIoptions\fR]... \fIenclosure\fR
[,\fIdev\fR] | \fIpathname\fR...
.fi
.SH DESCRIPTION
-.LP
The \fBluxadm\fR program is an administrative command that manages the
\fBSENA\fR, Sun Fire 880 internal storage subsystem, and individual Fiber
Channel Arbitrated Loop (\fBFC_AL\fR) devices. \fBluxadm\fR performs a variety
@@ -36,7 +34,6 @@ of the \fBSENA\fR enclosure, and an optional identifier for the particular
device in the enclosure. The individual \fBFC_AL\fR devices may be specified by
entering the \fBWWN\fR for the device or a port to the device.
.SS "Pathname"
-.LP
Specify the device or controller by either a complete physical pathname or a
complete logical pathname.
.sp
@@ -120,7 +117,6 @@ and a typical logical pathname is:
.sp
.SS "Enclosure"
-.LP
For \fBSENA,\fR a device may be identified by its enclosure name and slotname:
.br
.in +2
@@ -169,7 +165,6 @@ the disk slot number in the Sun Fire 880 internal storage subsystem, \fB0\fR -
See \fBdisks\fR(1M) and \fBdevlinks\fR(1M) for additional information on
logical names for disks and subsystems.
.SH OPTIONS
-.LP
The following options are supported by all subcommands:
.sp
.ne 2
@@ -194,7 +189,6 @@ Verbose mode.
Options that are specific to particular subcommands are described with the
subcommand in the \fBUSAGE\fR section.
.SH OPERANDS
-.LP
The following operands are supported:
.sp
.ne 2
@@ -315,7 +309,7 @@ pathname.
When the \fBSENA's\fR download is complete, the \fBSENA\fR will be reset and
the downloaded code executed. If no filename is specified, the default prom
image will be used. The default prom image for the \fBSENA\fR is in the
-directory \fBusr/lib/locale/C/LC_MESSAGES\fR and is named \fBibfirmware\fR
+directory \fB/usr/lib/locale/C/LC_MESSAGES\fR and is named \fBibfirmware\fR
.sp
When the Sun Fire 880 internal storage subsystem's download is complete, the
subsystem resets and the downloaded code begins execution. The default firmware
@@ -746,7 +740,6 @@ Spin down the specified disks in a SENA.
.RE
.SS "SENA, Sun Fire 880 Internal Storage Subsystem, and Individual FC_AL Drive Expert Mode Subcommands"
-.LP
The following subcommands are for expert use only, and are applicable only to
the \fBSENA\fR, Sun Fire 880 internal storage subsystem, and fiber channel
loops. They should only be used by users that are knowledgeable about the
@@ -867,7 +860,6 @@ the loop that contains the device specified by the enclosure or pathname.
.RE
.SS "Other Expert Mode Subcommands"
-.LP
See \fBNOTES\fR for limitations of these subcommands. They should only be used
by users that are knowledgeable about the systems they are managing.
.sp
@@ -955,7 +947,6 @@ Put the specified device online.
.RE
.SH EXAMPLES
-.LP
\fBExample 1 \fRDisplaying the \fBSENA\fRs and Individual FC_AL Devices on a
System
.sp
@@ -1207,11 +1198,9 @@ example# \fBluxadm release /dev/rdsk/c1t8d0s2\fR
.sp
.SH ENVIRONMENT VARIABLES
-.LP
See \fBenviron\fR(5) for a description of the \fBLANG\fR environment variable
that affects the execution of \fBluxadm\fR.
.SH EXIT STATUS
-.LP
The following exit values are returned:
.sp
.ne 2
@@ -1234,7 +1223,7 @@ An error occurred.
.SH FILES
.ne 2
.na
-\fB\fBusr/lib/firmware/fc_s/fc_s_fcode\fR\fR
+\fB\fB/usr/lib/firmware/fc_s/fc_s_fcode\fR\fR
.ad
.sp .6
.RS 4n
@@ -1244,7 +1233,7 @@ An error occurred.
.sp
.ne 2
.na
-\fB\fBusr/lib/locale/C/LC_MESSAGES/ibfirmware\fR\fR
+\fB\fB/usr/lib/locale/C/LC_MESSAGES/ibfirmware\fR\fR
.ad
.sp .6
.RS 4n
@@ -1252,11 +1241,9 @@ An error occurred.
.RE
.SH SEE ALSO
-.LP
\fBdevlinks\fR(1M), \fBdisks\fR(1M), \fBattributes\fR(5), \fBenviron\fR(5),
\fBses\fR(7D)
.SH NOTES
-.LP
Currently, only some device drivers
support hot plugging. If hot plugging is attempted on a disk or bus where it is
not supported, an error message of the form:
diff --git a/usr/src/man/man1m/plockstat.1m b/usr/src/man/man1m/plockstat.1m
index d1dca3ce03..5c22d6cfaf 100644
--- a/usr/src/man/man1m/plockstat.1m
+++ b/usr/src/man/man1m/plockstat.1m
@@ -3,11 +3,10 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH PLOCKSTAT 1M "Dec 10, 2017"
+.TH PLOCKSTAT 1M "May 23, 2020"
.SH NAME
plockstat \- report user-level lock statistics
.SH SYNOPSIS
-.LP
.nf
\fBplockstat\fR [\fB-vACHV\fR] [\fB-n\fR \fIcount\fR] [\fB-s\fR \fIdepth\fR] [\fB-e\fR \fIsecs\fR]
[\fB-x\fR \fIarg\fR [=val]] \fIcommand\fR [\fIarg\fR]...
@@ -20,7 +19,6 @@ plockstat \- report user-level lock statistics
.fi
.SH DESCRIPTION
-.LP
The \fBplockstat\fR utility gathers and displays user-level locking statistics.
By default, \fBplockstat\fR monitors all lock contention events, gathers
frequency and timing data about those events, and displays the data in
@@ -35,10 +33,9 @@ process specified with the \fB-p\fR option completes.
it invokes to trace events of interest. This imposes a small but measurable
performance overhead on the processes being observed. Users must have the
\fBdtrace_proc\fR privilege and have permission to observe a particular process
-with \fBplockstat\fR. Refer to the \fI\fR for more information about DTrace
-security features.
+with \fBplockstat\fR. Refer to the \fIDynamic Tracing Guide\fR for more
+information about DTrace security features.
.SH OPTIONS
-.LP
The following options are supported:
.sp
.ne 2
@@ -130,12 +127,11 @@ the option name and value with an equals sign (\fB=\fR).
\fB\fB-V\fR\fR
.ad
.RS 16n
-Print the Dtrace commands used to gather the data. The output can then be used
+Print the DTrace commands used to gather the data. The output can then be used
directly with the \fBdtrace\fR(1M) command.
.RE
.SH OPERANDS
-.LP
The following operands are supported:
.sp
.ne 2
@@ -183,7 +179,6 @@ Duration specified as a positive integer number of seconds.
.RE
.SH EXIT STATUS
-.LP
The following exit values are returned:
.sp
.ne 2
@@ -204,7 +199,6 @@ An error occurred.
.RE
.SH ATTRIBUTES
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -222,7 +216,6 @@ Interface Stability See below.
.LP
The command-line syntax is Evolving. The human-readable output is Unstable.
.SH SEE ALSO
-.LP
\fBdtrace\fR(1M), \fBlockstat\fR(1M), \fBmutex_init\fR(3C),
\fBpthread_mutex_lock\fR(3C), \fBpthread_rwlock_rdlock\fR(3C),
\fBpthread_rwlock_wrlock\fR(3C), \fBpthread_rwlock_unlock\fR(3C),
diff --git a/usr/src/man/man3lib/libproc.3lib b/usr/src/man/man3lib/libproc.3lib
index 3b38bda64f..d68897dad4 100644
--- a/usr/src/man/man3lib/libproc.3lib
+++ b/usr/src/man/man3lib/libproc.3lib
@@ -13,7 +13,7 @@
.\" Copyright (c) 2019 Carlos Neira <cneirabustos@gmail.com>
.\" Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
.\"
-.Dd February 22, 2019
+.Dd May 22, 2020
.Dt LIBPROC 3LIB
.Os
.Sh NAME
@@ -310,7 +310,7 @@ library.
.It Sy proc_arg_xpsinfo Ta Sy proc_content2str
.It Sy proc_dmodelname Ta Sy proc_finistdio
.It Sy proc_fltname Ta Sy proc_fltset2str
-.It Sy proc_flushstdio Ta Sy proc_proc_get_auxv
+.It Sy proc_flushstdio Ta Sy proc_get_auxv
.It Sy proc_fdinfo_misc Ta Sy proc_get_cred
.It Sy proc_get_fdinfo Ta Sy proc_get_priv
.It Sy proc_get_psinfo Ta Sy proc_get_status
diff --git a/usr/src/man/man3proc/proc_arg_grab.3proc b/usr/src/man/man3proc/proc_arg_grab.3proc
index 375ba4d67e..9bba2d5981 100644
--- a/usr/src/man/man3proc/proc_arg_grab.3proc
+++ b/usr/src/man/man3proc/proc_arg_grab.3proc
@@ -11,18 +11,18 @@
.\"
.\" Copyright 2015 Joyent, Inc.
.\"
-.Dd May 11, 2016
+.Dd May 22, 2020
.Dt PROC_ARG_GRAB 3PROC
.Os
.Sh NAME
.Nm proc_arg_grab ,
-.Nm proc_arg_xrgab
+.Nm proc_arg_xgrab
.Nd process grabbing utility function
.Sh SYNOPSIS
.Lb libproc
.In libproc.h
.Ft "struct ps_prochandle"
-.Fo proc_arg_grag
+.Fo proc_arg_grab
.Fa "const char *arg"
.Fa "int oflag"
.Fa "int gflag"
@@ -63,7 +63,7 @@ Allows
.Fa arg
to specify core files.
.It PR_ARG_ANY
-Encompasses all of the previous opens.
+Encompasses all of the previous flags.
.El
.Pp
The argument
@@ -96,20 +96,24 @@ If the
.Fa lwps
argument is
.Pf non- Dv NULL ,
-then if there is a thread specification present in
-.Fa arg ,
-it will be validated to see if it is a valid range and then a pointer to
-the start of the thread specification will be stored in
-.Fa lwps .
-For more information on determining process range validity, see
+then the functions will treat any portion of
+.Fa arg
+after a
+.Sq /
+character as a thread range.
+The thread range will be validated as though a call to the
.Xr proc_lwp_range_valid 3PROC
-for more information on valid and invalid tread specifications.
+function had been made, and a pointer to the start of the range will be
+stored in
+.Fa lwps .
+For a discussion of what constitutes a valid thread range, please see
+.Xr proc_lwp_range_valid 3PROC .
.Sh RETURN VALUES
Upon successful completion, the
.Fn proc_arg_grab
and
.Fn proc_arg_xgrab
-functions return a pointer to the process handle is returned.
+functions return a pointer to the process handle.
Otherwise,
.Dv NULL
is returned and
diff --git a/usr/src/man/man4/proc.4 b/usr/src/man/man4/proc.4
index 4fc8647c7f..e42afdd1fc 100644
--- a/usr/src/man/man4/proc.4
+++ b/usr/src/man/man4/proc.4
@@ -18,7 +18,7 @@
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
-.Dd January 6, 2020
+.Dd May 17, 2020
.Dt PROC 4
.Os
.Sh NAME
@@ -483,7 +483,7 @@ is the total number of active lwps in the process.
is the total number of zombie lwps in the process.
A zombie lwp is a non-detached lwp that has terminated but has not been reaped
with
-.Xr thr_join 3
+.Xr thr_join 3C
or
.Xr pthread_join 3C .
.Pp
diff --git a/usr/src/man/man5/lf64.5 b/usr/src/man/man5/lf64.5
index f1be4e3d83..f2c59d78a6 100644
--- a/usr/src/man/man5/lf64.5
+++ b/usr/src/man/man5/lf64.5
@@ -4,11 +4,10 @@
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.\" Copyright (c) 2015, Joyent, Inc. All rights reserved.
-.TH LF64 5 "Jan 14, 2015"
+.TH LF64 5 "May 17, 2020"
.SH NAME
lf64 \- transitional interfaces for 64-bit file offsets
.SH DESCRIPTION
-.LP
The data types, interfaces, and macros described on this page provide explicit
access to 64-bit file offsets. They are accessible through the transitional
compilation environment described on the \fBlfcompile64\fR(5) manual page. The
@@ -16,7 +15,6 @@ function prototype and semantics of a transitional interface are equivalent to
those of the standard version of the call, except that relevant data types are
64-bit entities.
.SS "Data Types"
-.LP
The following tables list the standard data or struct types in the left-hand
column and their corresponding explicit 64-bit file offset types in the
right-hand column, grouped by header. The absence of an entry in the left-hand
@@ -99,7 +97,7 @@ l l .
struct \fBstatvfs\fR struct \fBstatvfs64\fR
\fBfsblkcnt_t\fR f_blocks; \fBfsblkcnt64_t\fR f_blocks;
\fBfsblkcnt_t\fR f_bfree; \fBfsblkcnt64_t\fR f_bfree;
- \fBfsblkcnt_t\fR f_bavial; \fBfsblkcnt64_t\fR f_bavial;
+ \fBfsblkcnt_t\fR f_bavail; \fBfsblkcnt64_t\fR f_bavail;
\fBfsfilcnt_t\fR f_files; \fBfsfilcnt64_t\fR f_files;
\fBfsfilcnt_t\fR f_ffree; \fBfsfilcnt64_t\fR f_ffree;
\fBfsfilcnt_t\fR f_favail; \fBfsfilcnt64_t\fR f_favail;
@@ -138,7 +136,6 @@ l l .
.TE
.SS "System Interfaces"
-.LP
The following tables display the standard API and the corresponding
transitional interfaces for 64-bit file offsets. The interfaces are grouped by
header. The interface name and the affected data types are displayed in courier
@@ -148,11 +145,11 @@ font.
.TS
l l
l l .
-int \fBaio_cancel\fR(..., int \fBaio_cancel64\fR(...,
+int \fBaio_cancel\fR(..., int \fBaio_cancel64\fR(...,
struct \fBaiocb\fR *); struct \fBaiocb64\fR *);
int \fBaio_error\fR( int \fBaio_error64\fR(
const struct \fBaiocb\fR *); const struct \fBaiocb64\fR *);
-int \fBaio_fsync\fR(..., int \fBaio_fsync64\fR(...,
+int \fBaio_fsync\fR(..., int \fBaio_fsync64\fR(...,
struct \fBaiocb\fR *); struct \fBaiocb64\fR *);
int \fBaio_read\fR(struct \fBaiocb\fR *); int \fBaio_read64\fR(struct \fBaiocb64\fR *);
int \fBaio_return\fR(struct \fBaiocb\fR *); int \fBaio_return64\fR(struct \fBaiocb64\fR *);
@@ -161,7 +158,7 @@ int \fBaio_suspend\fR( int \fBaio_suspend64\fR(
int \fBaio_waitn\fR(aiocb_t *[], int \fBaio_waitn64\fR(aiocb64_t *[],
...); ...);
int \fBaio_write\fR(struct \fBaiocb\fR *); int \fBaio_write64\fR(struct \fBaiocb64\fR *);
-int \fBlio_listio\fR(..., int \fBlio_listio64\fR(...,
+int \fBlio_listio\fR(..., int \fBlio_listio64\fR(...,
const struct \fBaiocb\fR *, ...); const struct \fBaiocb64\fR *, ...);
.TE
@@ -171,12 +168,12 @@ int \fBlio_listio\fR(..., int \fBlio_listio64\fR(...,
l l
l l .
int \fBalphasort\fR( int \fBalphasort64\fR(
- const struct dirent **, const struct dirent64 **,
+ const struct dirent **, const struct dirent64 **,
const struct dirent **) const struct dirent64 **)
struct \fBdirent *\fR\fBreaddir()\fR; struct \fBdirent64 *\fR\fBreaddir64()\fR;
struct \fBdirent *\fR\fBreaddir_r()\fR; struct \fBdirent64 *\fR\fBreaddir64_r()\fR;
-int \fBscandir\fR(..., int \fBscandir64\fR(...,
- struct dirent *(*[]), struct dirent64 *(*[]),
+int \fBscandir\fR(..., int \fBscandir64\fR(...,
+ struct dirent *(*[]), struct dirent64 *(*[]),
int (*)(const struct dirent *), int (*)(const struct dirent64 *),
int (*)(const struct dirent **, int (*)(const struct dirent64 **,
const struct dirent **)) const struct dirent64 **))
@@ -202,10 +199,10 @@ l l
l l .
int \fBftw\fR(..., int \fBftw64\fR(...,
const struct \fBstat\fR *, ...); const struct \fBstat64\fR *, ...);
-
+
int \fBnftw\fR(.. int \fBnftw64\fR(...,
const struct \fBstat\fR *, ...); const struct \fBstat64\fR *, ...);
-
+
.TE
.SS "<\fBlibgen.h\fR>"
@@ -252,7 +249,7 @@ int \fBaiowrite\fR(..., \fBoff_t\fR, ...); int \fBaiowrite64\fR(..., \fBoff64_t\
l l
l l .
int \fBgetdents\fR(..., \fBdirent\fR); int \fBgetdents64\fR(..., \fBdirent64\fR);
-
+
.TE
.SS "<\fBsys/mman.h\fR>"
@@ -278,11 +275,11 @@ int \fBsetrlimit\fR(..., int \fBsetrlimit64\fR(...,
.TS
l l
l l .
-ssize_t \fBsendfile\fR(..., ssize_t \fBsendfile64\fR(...,
+ssize_t \fBsendfile\fR(..., ssize_t \fBsendfile64\fR(...,
\fBoff_t\fR *, ...); \fBoff64_t\fR *, ...);
-ssize_t \fBsendfilev\fR(..., const ssize_t \fBsendfilev64\fR(..., const
+ssize_t \fBsendfilev\fR(..., const ssize_t \fBsendfilev64\fR(..., const
struct \fBsendfilevec\fR *, ...); struct \fBsendfilevec64\fR *, ...);
-
+
.TE
.SS "<\fBsys/stat.h\fR>"
@@ -291,7 +288,7 @@ ssize_t \fBsendfilev\fR(..., const ssize_t \fBsendfilev64\fR(..., const
l l
l l .
int \fBfstat\fR(..., struct \fBstat\fR *); int \fBfstat64\fR(..., struct \fBstat64\fR *);
-int \fBfstatat\fR(..., int \fBfstatat64\fR(...,
+int \fBfstatat\fR(..., int \fBfstatat64\fR(...,
struct \fBstat\fR *, int); struct \fBstat64\fR *, int);
int \fBlstat\fR(..., struct \fBstat\fR *); int \fBlstat64\fR(..., struct \fBstat64\fR *);
int \fBstat\fR(..., struct \fBstat\fR *); int \fBstat64\fR(..., struct \fBstat64\fR *);
@@ -304,7 +301,7 @@ l l
l l .
int \fBstatvfs\fR(..., int \fBstatvfs64\fR(...,
struct \fBstatvfs\fR *); struct \fBstatvfs64\fR *);
-int \fBfstatvfs\fR(..., int \fBfstatvfs64\fR(...,
+int \fBfstatvfs\fR(..., int \fBfstatvfs64\fR(...,
struct \fBstatvfs\fR *); struct \fBstatvfs64\fR *);
.TE
@@ -328,7 +325,7 @@ int \fBalphasort\fR( int \fBalphasort64\fR(
struct \fBdirect *\fR\fBreaddir()\fR; struct \fBdirect64 *\fR\fBreaddir64()\fR;
int \fBscandir\fR(..., int \fBscandir64\fR(...,
struct \fBdirect\fR *(*[]);, ...); struct \fBdirect64\fR *(*[]);, ...);
-
+
.TE
.SS "<\fBunistd.h\fR>"
@@ -347,5 +344,4 @@ int \fBtruncate\fR(..., \fBoff_t\fR); int \fBtruncate64\fR(..., \fBoff64_t\fR);
.TE
.SH SEE ALSO
-.LP
\fBlfcompile\fR(5), \fBlfcompile64\fR(5)
diff --git a/usr/src/man/man7d/ecpp.7d b/usr/src/man/man7d/ecpp.7d
index 7d10e4ee9c..dc5259dbdf 100644
--- a/usr/src/man/man7d/ecpp.7d
+++ b/usr/src/man/man7d/ecpp.7d
@@ -3,7 +3,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH ECPP 7D "Jan 10, 2020"
+.TH ECPP 7D "May 17, 2020"
.SH NAME
ecpp \- IEEE 1284 compliant parallel port driver
.SH SYNOPSIS
@@ -25,7 +25,7 @@ ecpp@unit-address
The \fBecpp\fR driver provides a bi-directional interface to \fIIEEE 1284\fR
compliant devices as well as a forward single-directional interface to
Centronics devices. In addition to the Centronics protocol, the \fBecpp\fR
-driver supports the \fIIEEE 1284\fRCompatibility, Nibble, and ECP protocols.
+driver supports the \fIIEEE 1284\fR Compatibility, Nibble, and ECP protocols.
\fBECPP_COMPAT_MODE\fR and \fBECPP_CENTRONICS\fR modes of operation have
logically identical handshaking protocols, however devices that support
\fBECPP_COMPAT_MODE\fR are \fIIEEE 1284\fR compliant devices. \fIIEEE 1284\fR
@@ -231,8 +231,7 @@ conditions are ok, \fB0\fR is returned. Otherwise, \fB-1\fR is returned, errno
is set to \fBEIO\fR and the state of the status pins is captured. The captured
status can be retrieved using the \fBBPPIOC_GETERR\fR \fBioctl\fR(2) call. The
\fBtimeout_occurred\fR and \fBbus_error\fR fields will never be set by this
-\fBioctl\fR(2). \fBBPPIOC_TESTIO\fR and \fBBPPIOC_GETERR\fR are compatible to
-the ioctls specified in \fBbpp\fR(7D).
+\fBioctl\fR(2).
.RE
.sp
@@ -450,7 +449,7 @@ Interface stability Evolving
.SH SEE ALSO
\fBmodload\fR(1M), \fBmodunload\fR(1M), \fBupdate_drv\fR(1M), \fBioctl\fR(2),
\fBopen\fR(2), \fBread\fR(2), \fBwrite\fR(2), \fBattributes\fR(5),
-\fBbpp\fR(7D), \fBusbprn\fR(7D), \fBprnio\fR(7I), \fBstreamio\fR(7I)
+\fBusbprn\fR(7D), \fBprnio\fR(7I), \fBstreamio\fR(7I)
.sp
.LP
\fIIEEE Std 1284-1994\fR
@@ -464,4 +463,3 @@ Interface stability Evolving
Driver does not support parallel port controller on the given host. Attach
failed.
.RE
-
diff --git a/usr/src/man/man7d/usbprn.7d b/usr/src/man/man7d/usbprn.7d
index b28b0a7626..9f5d326917 100644
--- a/usr/src/man/man7d/usbprn.7d
+++ b/usr/src/man/man7d/usbprn.7d
@@ -3,11 +3,10 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH USBPRN 7D "May 13, 2017"
+.TH USBPRN 7D "May 17, 2020"
.SH NAME
usbprn \- USB printer class driver
.SH SYNOPSIS
-.LP
.nf
#include <sys/usb/clients/printer/usb_printer.h>
.fi
@@ -23,7 +22,6 @@ usbprn@unit-address
.fi
.SH DESCRIPTION
-.LP
The \fBusbprn\fR driver is a USBA (Solaris USB Architecture) compliant client
driver that supports the \fIUSB Printer Class 1.0\fR specification. The
\fBusbprn\fR driver supports a subset of the \fBecpp\fR(7D) parallel port
@@ -44,14 +42,12 @@ queue. For USB connected printers, it attempts to pre-select the
manufacturer and model information based on the 1284 device id supplied by the
printer.
.SS "UGEN (Generic USB)"
-.LP
The \fBusbprn\fR driver also supports a \fBugen\fR(7D) interface allowing raw
access to the device, for example by libusb applications, by
passing the drivers bound to each interface. Because a libusb application might
change the state of the device, you should not access the device through the
child interface drivers.
.SH DEFAULT OPERATION
-.LP
With certain minor exceptions (outlined in the Notes sections below), the
\fBusbprn\fR driver supports a subset of the \fBecpp\fR(7D) ioctl interfaces:
.sp
@@ -73,7 +69,6 @@ to their default values with each \fBattach\fR(9E). (The \fBecpp\fR(7D) driver
resets configuration variables with each \fBopen\fR(2).)
.RE
.SH WRITE OPERATION
-.LP
A \fBwrite\fR(2) operation returns the number of bytes successfully written to
the device. If a failure occurs while a driver is transferring data to printer,
the contents of the status bits are captured at the time of the error and can
@@ -81,7 +76,6 @@ be retrieved by the application program using the ECPPIOC_GETERR \fBioctl\fR(2)
call. The captured status information is overwritten each time an
ECPPIOC_TESTIO \fBioctl\fR(2) occurs.
.SH IOCTLS
-.LP
The \fBusbprn\fR driver supports \fBprnio\fR(7I) interfaces. Note that the
\fBPRNIOC_RESET\fR command has no effect on USB printers.
.sp
@@ -154,8 +148,6 @@ determine if a \fBwrite\fR(2) will succeed. If status bits are set, a transfer
will fail. If a transfer will succeed, zero is returned. If a transfer fails,
the driver returns \fBEIO\fR and the state of the status bits are captured. The
captured status can be retrieved using the BPPIOC_GETERR \fBioctl\fR(2) call.
-BPPIOC_TESTIO and BPPIOC_GETERR are compatible to the ioctls specified in
-\fBbpp\fR(7D).
.LP
Note -
.sp
@@ -243,7 +235,6 @@ Unlike \fBecpp\fR(7D), only the ECPP_CENTRONICS mode is currently supported in
.RE
.SH READ OPERATION
-.LP
The \fBread\fR operation is not supported and returns \fBEIO\fR.
.SH ERRORS
.ne 2
@@ -354,7 +345,6 @@ Character special files
.RE
.SH ATTRIBUTES
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -369,10 +359,9 @@ Architecture SPARC, x86, PCI-based systems
.TE
.SH SEE ALSO
-.LP
\fBcfgadm_usb\fR(1M), \fBprintmgr\fR(1M), \fBioctl\fR(2), \fBopen\fR(2),
\fBread\fR(2), \fBwrite\fR(2), \fBattributes\fR(5),
-\fBbpp\fR(7D), \fBecpp\fR(7D), \fBugen\fR(7D), \fBusba\fR(7D), \fBprnio\fR(7I),
+\fBecpp\fR(7D), \fBugen\fR(7D), \fBusba\fR(7D), \fBprnio\fR(7I),
\fBattach\fR(9E)
.sp
.LP
@@ -387,7 +376,6 @@ Architecture SPARC, x86, PCI-based systems
.LP
\fISystem Administration Guide: Basic Administration\fR
.SH DIAGNOSTICS
-.LP
In addition to being logged, the following messages may appear on the system
console. All messages are formatted in the following manner:
.sp
@@ -446,7 +434,6 @@ to the hot-removal may be lost.
.RE
.SH NOTES
-.LP
The USB printer will be power managed if the device is closed.
.sp
.LP
diff --git a/usr/src/man/man9f/ddi_create_minor_node.9f b/usr/src/man/man9f/ddi_create_minor_node.9f
index 583cb7c313..b33ba2704b 100644
--- a/usr/src/man/man9f/ddi_create_minor_node.9f
+++ b/usr/src/man/man9f/ddi_create_minor_node.9f
@@ -3,27 +3,24 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH DDI_CREATE_MINOR_NODE 9F "Dec 14, 2004"
+.TH DDI_CREATE_MINOR_NODE 9F "May 01, 2020"
.SH NAME
ddi_create_minor_node \- Create a minor node for this device
.SH SYNOPSIS
-.LP
.nf
#include <sys/stat.h>
#include <sys/sunddi.h>
-\fBint\fR \fBddi_create_minor_node\fR(\fBdev_info_t *\fR\fIdip\fR, \fBchar *\fR\fIname\fR, \fBint\fR \fIspec_type\fR,
- \fBminor_t\fR \fIminor_num\fR, \fBchar *\fR\fInode_type\fR, \fBint\fR \fIflag\fR);
+\fBint\fR \fBddi_create_minor_node\fR(\fBdev_info_t *\fR\fIdip\fR, \fBconst char *\fR\fIname\fR,
+ \fBint\fR \fIspec_type\fR, \fBminor_t\fR \fIminor_num\fR, \fBconst char *\fR\fInode_type\fR,
+ \fBint\fR \fIflag\fR);
.fi
.SH INTERFACE LEVEL
-.sp
-.LP
Solaris DDI specific (Solaris DDI).
.SH PARAMETERS
-.sp
.ne 2
.na
\fB\fIdip\fR \fR
@@ -198,8 +195,6 @@ it is set to \fB0\fR.
.RE
.SH DESCRIPTION
-.sp
-.LP
\fBddi_create_minor_node()\fR provides the necessary information to enable the
system to create the \fB/dev\fR and \fB/devices\fR hierarchies. The \fIname\fR
is used to create the minor name of the block or character special file under
@@ -212,8 +207,6 @@ refers to the names in the \fB/devices\fR hierarchy. See \fBdisks\fR(1M),
determines if this is a clone device or not, and what device class the node
belongs to.
.SH RETURN VALUES
-.sp
-.LP
\fBddi_create_minor_node()\fR returns:
.sp
.ne 2
@@ -235,12 +228,9 @@ Minor node creation failed.
.RE
.SH CONTEXT
-.sp
-.LP
The \fBddi_create_minor_node()\fR function can be called from user context. It
is typically called from \fBattach\fR(9E) or \fBioctl\fR(9E).
.SH EXAMPLES
-.LP
\fBExample 1 \fRCreate Data Structure Describing Minor Device with Minor Number
of 0
.sp
@@ -257,8 +247,6 @@ ddi_create_minor_node(dip, "foo", S_IFBLK, 0, DDI_NT_BLOCK, 0);
.in -2
.SH SEE ALSO
-.sp
-.LP
\fBadd_drv\fR(1M), \fBdevlinks\fR(1M), \fBdisks\fR(1M), \fBdrvconfig\fR(1M),
\fBports\fR(1M), \fBtapes\fR(1M), \fBattach\fR(9E),
\fBddi_remove_minor_node\fR(9F)
@@ -266,8 +254,6 @@ ddi_create_minor_node(dip, "foo", S_IFBLK, 0, DDI_NT_BLOCK, 0);
.LP
\fIWriting Device Drivers\fR
.SH NOTES
-.sp
-.LP
If the driver is for a network device (\fInode_type\fR \fBDDI_NT_NET\fR), note
that the driver name will undergo the driver name constraints identified in the
NOTES section of \fBdlpi\fR(7P). Additionally, the minor name must match the
@@ -288,7 +274,5 @@ that only supports style-2 minor nodes can use \fBddi_no_info\fR(9F) for its
the results of a \fBmodunload\fR(1M) of the driver or a \fBcfgadm\fR(1M) remove
of hardware controlled by the driver are undefined.
.SH WARNING
-.sp
-.LP
Drivers must remove references to GLOBAL_DEV, NODEBOUND_DEV, NODESPECIFIC_DEV,
and ENUMERATED_DEV to compile under Solaris 10 and later versions.
diff --git a/usr/src/man/man9f/ddi_remove_minor_node.9f b/usr/src/man/man9f/ddi_remove_minor_node.9f
index 4761fae149..bf8cc9e709 100644
--- a/usr/src/man/man9f/ddi_remove_minor_node.9f
+++ b/usr/src/man/man9f/ddi_remove_minor_node.9f
@@ -3,21 +3,17 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH DDI_REMOVE_MINOR_NODE 9F "Mar 10, 1992"
+.TH DDI_REMOVE_MINOR_NODE 9F "May 01, 2020"
.SH NAME
ddi_remove_minor_node \- remove a minor node for this dev_info
.SH SYNOPSIS
-.LP
.nf
-\fBvoid\fR \fBddi_remove_minor_node\fR(\fBdev_info_t\fR \fI*dip\fR, \fBchar\fR \fI*name\fR);
+\fBvoid\fR \fBddi_remove_minor_node\fR(\fBdev_info_t\fR \fI*dip\fR, \fBconst char\fR \fI*name\fR);
.fi
.SH INTERFACE LEVEL
-.sp
-.LP
Solaris \fBDDI\fR specific (Solaris \fBDDI\fR).
.SH PARAMETERS
-.sp
.ne 2
.na
\fB\fIdip\fR \fR
@@ -37,13 +33,10 @@ minor data structures from this \fBdev_info\fR.
.RE
.SH DESCRIPTION
-.sp
-.LP
\fBddi_remove_minor_node()\fR removes a data structure from the linked list of
minor data structures that is pointed to by the \fBdev_info\fR structure for
this driver.
.SH EXAMPLES
-.LP
\fBExample 1 \fRRemoving a minor node
.sp
.LP
@@ -58,8 +51,6 @@ which is linked into the \fBdev_info\fR structure pointed to by \fBdip\fR:
.in -2
.SH SEE ALSO
-.sp
-.LP
\fBattach\fR(9E), \fBdetach\fR(9E), \fBddi_create_minor_node\fR(9F)
.sp
.LP
diff --git a/usr/src/pkg/manifests/system-test-libctest.mf b/usr/src/pkg/manifests/system-test-libctest.mf
index 69252d7c82..472e4f3432 100644
--- a/usr/src/pkg/manifests/system-test-libctest.mf
+++ b/usr/src/pkg/manifests/system-test-libctest.mf
@@ -164,6 +164,8 @@ file path=opt/libc-tests/tests/stdio/fmemopentest.32 mode=0555
file path=opt/libc-tests/tests/stdio/fmemopentest.64 mode=0555
file path=opt/libc-tests/tests/stdio/ftell_ungetc.32 mode=0555
file path=opt/libc-tests/tests/stdio/ftell_ungetc.64 mode=0555
+file path=opt/libc-tests/tests/stdio/ftello_12768.64 mode=0555
+file path=opt/libc-tests/tests/stdio/ftello_12768.lfs mode=0555
file path=opt/libc-tests/tests/stdio/memstream.32 mode=0555
file path=opt/libc-tests/tests/stdio/memstream.64 mode=0555
file path=opt/libc-tests/tests/stdio/memstream_reopen.32 mode=0555
diff --git a/usr/src/pkg/manifests/system-test-utiltest.mf b/usr/src/pkg/manifests/system-test-utiltest.mf
index 9c41f4a108..c4fb87d26e 100644
--- a/usr/src/pkg/manifests/system-test-utiltest.mf
+++ b/usr/src/pkg/manifests/system-test-utiltest.mf
@@ -1432,7 +1432,11 @@ file path=opt/util-tests/tests/files/gout63 mode=0444
file path=opt/util-tests/tests/files/gout64 mode=0444
file path=opt/util-tests/tests/files/gout65 mode=0444
file path=opt/util-tests/tests/files/gout66 mode=0444
+file path=opt/util-tests/tests/files/gout67 mode=0444
+file path=opt/util-tests/tests/files/gout68 mode=0444
+file path=opt/util-tests/tests/files/gout69 mode=0444
file path=opt/util-tests/tests/files/gout7 mode=0444
+file path=opt/util-tests/tests/files/gout70 mode=0444
file path=opt/util-tests/tests/files/gout8 mode=0444
file path=opt/util-tests/tests/files/gout9 mode=0444
file path=opt/util-tests/tests/files/make_a/Makefile mode=0444
diff --git a/usr/src/pkg/manifests/system-test-zfstest.mf b/usr/src/pkg/manifests/system-test-zfstest.mf
index 0484e2b7e6..3b4bcc373e 100644
--- a/usr/src/pkg/manifests/system-test-zfstest.mf
+++ b/usr/src/pkg/manifests/system-test-zfstest.mf
@@ -2935,6 +2935,8 @@ file path=opt/zfs-tests/tests/functional/resilver/cleanup mode=0555
file path=opt/zfs-tests/tests/functional/resilver/resilver.cfg mode=0444
file path=opt/zfs-tests/tests/functional/resilver/resilver_restart_001 \
mode=0555
+file path=opt/zfs-tests/tests/functional/resilver/resilver_restart_002 \
+ mode=0555
file path=opt/zfs-tests/tests/functional/resilver/setup mode=0555
file path=opt/zfs-tests/tests/functional/resilver/sysevent mode=0555
file path=opt/zfs-tests/tests/functional/rootpool/cleanup mode=0555
diff --git a/usr/src/test/libc-tests/runfiles/default.run b/usr/src/test/libc-tests/runfiles/default.run
index d945eb7105..d69ed758c3 100644
--- a/usr/src/test/libc-tests/runfiles/default.run
+++ b/usr/src/test/libc-tests/runfiles/default.run
@@ -68,6 +68,8 @@ timeout = 600
[/opt/libc-tests/tests/stdio/fmemopentest.64]
[/opt/libc-tests/tests/stdio/ftell_ungetc.32]
[/opt/libc-tests/tests/stdio/ftell_ungetc.64]
+[/opt/libc-tests/tests/stdio/ftello_12768.lfs]
+[/opt/libc-tests/tests/stdio/ftello_12768.64]
[/opt/libc-tests/tests/stdio/memstream.32]
[/opt/libc-tests/tests/stdio/memstream.64]
[/opt/libc-tests/tests/stdio/memstream_reopen.32]
diff --git a/usr/src/test/libc-tests/tests/stdio/Makefile b/usr/src/test/libc-tests/tests/stdio/Makefile
index b94c42df30..092d62bc60 100644
--- a/usr/src/test/libc-tests/tests/stdio/Makefile
+++ b/usr/src/test/libc-tests/tests/stdio/Makefile
@@ -23,17 +23,23 @@ PROGS = \
orientation_test \
test_mbrtowc
+LFSPROGS = \
+ ftello_12768
+
PROGS32 = $(PROGS:%=%.32)
-PROGS64 = $(PROGS:%=%.64)
+PROGSLFS = $(LFSPROGS:%=%.lfs)
+PROGS64 = $(PROGS:%=%.64) $(LFSPROGS:%=%.64)
ROOTOPTDIR = $(ROOT)/opt/libc-tests/tests
ROOTOPTSTDIO = $(ROOTOPTDIR)/stdio
ROOTOPTPROGS = $(PROGS32:%=$(ROOTOPTSTDIO)/%) \
- $(PROGS64:%=$(ROOTOPTSTDIO)/%)
+ $(PROGS64:%=$(ROOTOPTSTDIO)/%) \
+ $(PROGSLFS:%=$(ROOTOPTSTDIO)/%)
include $(SRC)/cmd/Makefile.cmd
CPPFLAGS += -D_REENTRANT -D__EXTENSIONS__
+LFSCPPFLAGS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
#
# libumem is used to interpose on all of these tests to modify the
@@ -58,10 +64,10 @@ orientation_test.64 := SMOFF += all_func_returns
.KEEP_STATE:
-install: $(ROOTOPTPROGS)
-
all: $(PROGS32) $(PROGS64)
+install: $(ROOTOPTPROGS)
+
clean:
$(ROOTOPTPROGS): $(PROGS32) $(PROGS64) $(ROOTOPTSTDIO)
@@ -79,6 +85,10 @@ $(ROOTOPTSTDIO)/%: %
$(LINK64.c) -o $@ $< $(LDLIBS64)
$(POST_PROCESS)
+%.lfs: %.c
+ $(LINK.c) $(LFSCPPFLAGS) -o $@ $< $(LDLIBS)
+ $(POST_PROCESS)
+
%.32: %.c
$(LINK.c) -o $@ $< $(LDLIBS)
$(POST_PROCESS)
diff --git a/usr/src/test/libc-tests/tests/stdio/ftello_12768.c b/usr/src/test/libc-tests/tests/stdio/ftello_12768.c
new file mode 100644
index 0000000000..014f207876
--- /dev/null
+++ b/usr/src/test/libc-tests/tests/stdio/ftello_12768.c
@@ -0,0 +1,73 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2020 Oxide Computer Company
+ */
+
+/*
+ * Regression test for 12768 '12392 regressed ftello64 behavior'. The heart of
+ * the problem was a bad cast that resulted in us not properly transmitting that
+ * size.
+ */
+
+#include <stdio.h>
+#include <err.h>
+#include <stdlib.h>
+#include <sys/sysmacros.h>
+
+int
+main(void)
+{
+ FILE *f;
+ size_t i;
+ int ret = EXIT_SUCCESS;
+ static off_t offsets[] = {
+ 23,
+ 0xa0000, /* 64 KiB */
+ 0x100000, /* 1 MiB */
+ 0x7fffffffULL, /* 2 GiB - 1 */
+ 0xc0000000ULL, /* 3 GiB */
+ 0x200005432ULL /* 8 GiB + misc */
+ };
+
+ f = tmpfile();
+ if (f == NULL) {
+ err(EXIT_FAILURE, "TEST FAILED: failed to create "
+ "temporary file");
+ }
+
+ for (i = 0; i < ARRAY_SIZE(offsets); i++) {
+ off_t ftret;
+
+ if (fseeko(f, offsets[i], SEEK_SET) != 0) {
+ warn("TEST FAILED: failed to seek to %lld",
+ (long long)offsets[i]);
+ ret = EXIT_FAILURE;
+ }
+
+ ftret = ftello(f);
+ if (ftret == -1) {
+ warn("TEST FAILED: failed to get stream position at "
+ "%lld", (long long)offsets[i]);
+ ret = EXIT_FAILURE;
+ }
+
+ if (ftret != offsets[i]) {
+ warnx("TEST FAILED: stream position mismatch: expected "
+ "%lld, found %lld", (long long)offsets[i],
+ (long long)ftret);
+ ret = EXIT_FAILURE;
+ }
+ }
+
+ return (ret);
+}
diff --git a/usr/src/test/smartos-test/smartos-test.sh b/usr/src/test/smartos-test/smartos-test.sh
index d3bc4d1840..4c63905aa7 100755
--- a/usr/src/test/smartos-test/smartos-test.sh
+++ b/usr/src/test/smartos-test/smartos-test.sh
@@ -12,7 +12,7 @@
#
#
-# Copyright 2019 Joyent, Inc.
+# Copyright 2020 Joyent, Inc.
#
#
@@ -238,21 +238,46 @@ function install_required_pkgs {
function add_test_accounts {
- grep -q cyrus: /etc/passwd
+ grep -q '^cyrus:' /etc/passwd
if [[ $? -ne 0 ]]; then
log "Adding cyrus user"
echo "cyrus:x:977:1::/zones/global/cyrus:/bin/sh" >> /etc/passwd
- echo "cyrus:*LK*:::::::" >> /etc/shadow
+ if ! grep -q '^cyrus:' /etc/shadow; then
+ echo "cyrus:*LK*:::::::" >> /etc/shadow
+ fi
mkdir -p /zones/global/cyrus
chown cyrus /zones/global/cyrus
fi
- grep -q ztest: /etc/passwd
+ grep -q '^ztest:' /etc/passwd
if [[ $? -ne 0 ]]; then
log "Adding ztest user"
echo "ztest:x:978:1::/zones/global/ztest:/bin/sh" >> /etc/passwd
- echo "ztest:*LK*:::::::" >> /etc/shadow
+ if ! grep -q '^ztest:' /etc/shadow; then
+ # For sudo to work, the ztest account must not be locked
+ echo "ztest:NP:::::::" >> /etc/shadow
+ fi
mkdir -p /zones/global/ztest
chown ztest /zones/global/ztest
+ zprofile=/zones/global/ztest/.profile
+ if [[ ! -f $zprofile ]]; then
+ cat > $zprofile <<-EOF
+PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/tools/bin:/opt/tools/sbin:/opt/zfs-tests/bin
+export PATH
+
+KEEP="zones"
+export KEEP
+EOF
+
+ if [[ -n "$DISKS" ]]; then
+ echo "DISKS=\"$DISKS\"" >> $zprofile
+ echo "export DISKS" >> $zprofile
+ else
+ msg="echo Please set \$DISKS appropriate before running zfstest"
+ echo $msg >> $zprofile
+ fi
+
+ chown ztest $zprofile
+ fi
fi
if [[ ! -f /opt/tools/etc/sudoers.d/ztest ]]; then
mkdir -p /opt/tools/etc/sudoers.d
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/files/Makefile b/usr/src/test/util-tests/tests/grep_xpg4/files/Makefile
index cec093b8a1..1d332a352f 100644
--- a/usr/src/test/util-tests/tests/grep_xpg4/files/Makefile
+++ b/usr/src/test/util-tests/tests/grep_xpg4/files/Makefile
@@ -12,6 +12,7 @@
#
# Copyright (c) 2013 by Delphix. All rights reserved.
# Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2020 Peter Tribble.
#
include $(SRC)/cmd/Makefile.cmd
@@ -95,6 +96,10 @@ PROGS = test0 \
gout64 \
gout65 \
gout66 \
+ gout67 \
+ gout68 \
+ gout69 \
+ gout70 \
testnl
CMDS = $(PROGS:%=$(TESTDIR)/%)
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/files/gout67 b/usr/src/test/util-tests/tests/grep_xpg4/files/gout67
new file mode 100644
index 0000000000..7898192261
--- /dev/null
+++ b/usr/src/test/util-tests/tests/grep_xpg4/files/gout67
@@ -0,0 +1 @@
+a
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/files/gout68 b/usr/src/test/util-tests/tests/grep_xpg4/files/gout68
new file mode 100644
index 0000000000..f69ef4b88d
--- /dev/null
+++ b/usr/src/test/util-tests/tests/grep_xpg4/files/gout68
@@ -0,0 +1 @@
+test0:a
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/files/gout69 b/usr/src/test/util-tests/tests/grep_xpg4/files/gout69
new file mode 100644
index 0000000000..88ccf63397
--- /dev/null
+++ b/usr/src/test/util-tests/tests/grep_xpg4/files/gout69
@@ -0,0 +1 @@
+/tmp/test0/test0:a
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/files/gout70 b/usr/src/test/util-tests/tests/grep_xpg4/files/gout70
new file mode 100644
index 0000000000..7898192261
--- /dev/null
+++ b/usr/src/test/util-tests/tests/grep_xpg4/files/gout70
@@ -0,0 +1 @@
+a
diff --git a/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh b/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh
index 0f4b77f9c9..f71cd98276 100644
--- a/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh
+++ b/usr/src/test/util-tests/tests/grep_xpg4/grep_test.ksh
@@ -13,6 +13,7 @@
#
# Copyright 2017 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2020 Peter Tribble.
#
XGREP=${XGREP:=/usr/bin/grep}
@@ -147,3 +148,46 @@ while read flags; do
echo "passed"
((i++))
done < /tmp/flags
+
+FLAGS4="-h
+-H"
+
+echo "$FLAGS4" > /tmp/flags
+
+while read flags; do
+ print -n "test $i: grep $flags: "
+ $XGREP $flags a test0 > out
+ err="$?"
+ if [[ $err -ne 0 ]]; then
+ fail "failed on exit: $err"
+ elif [ -n "$(diff out gout$i)" ]; then
+ print "$(diff out gout$i)"
+ fail "output is different"
+ fi
+ echo "passed"
+ ((i++))
+done < /tmp/flags
+
+FLAGS5="-r
+-hr"
+
+# need a directory with predictable contents
+rm -fr /tmp/test0
+mkdir /tmp/test0
+cp test0 /tmp/test0
+
+echo "$FLAGS5" > /tmp/flags
+
+while read flags; do
+ print -n "test $i: grep $flags: "
+ $XGREP $flags a /tmp/test0 > out
+ err="$?"
+ if [[ $err -ne 0 ]]; then
+ fail "failed on exit: $err"
+ elif [ -n "$(diff out gout$i)" ]; then
+ print "$(diff out gout$i)"
+ fail "output is different"
+ fi
+ echo "passed"
+ ((i++))
+done < /tmp/flags
diff --git a/usr/src/test/zfs-tests/runfiles/omnios.run b/usr/src/test/zfs-tests/runfiles/omnios.run
index 3a47542aa6..4dbfde3fb0 100644
--- a/usr/src/test/zfs-tests/runfiles/omnios.run
+++ b/usr/src/test/zfs-tests/runfiles/omnios.run
@@ -206,7 +206,7 @@ tests = ['zfs_rename_001_pos', 'zfs_rename_002_pos', 'zfs_rename_003_pos',
tests = ['zfs_reservation_001_pos', 'zfs_reservation_002_pos']
[/opt/zfs-tests/tests/functional/resilver]
-tests = ['resilver_restart_001']
+tests = ['resilver_restart_001', 'resilver_restart_002']
tags = ['functional', 'resilver']
[/opt/zfs-tests/tests/functional/cli_root/zfs_rollback]
diff --git a/usr/src/test/zfs-tests/runfiles/openindiana.run b/usr/src/test/zfs-tests/runfiles/openindiana.run
index c2ed8ca04d..21473782c2 100644
--- a/usr/src/test/zfs-tests/runfiles/openindiana.run
+++ b/usr/src/test/zfs-tests/runfiles/openindiana.run
@@ -206,7 +206,7 @@ tests = ['zfs_rename_001_pos', 'zfs_rename_002_pos', 'zfs_rename_003_pos',
tests = ['zfs_reservation_001_pos', 'zfs_reservation_002_pos']
[/opt/zfs-tests/tests/functional/resilver]
-tests = ['resilver_restart_001']
+tests = ['resilver_restart_001', 'resilver_restart_002']
tags = ['functional', 'resilver']
[/opt/zfs-tests/tests/functional/cli_root/zfs_rollback]
diff --git a/usr/src/test/zfs-tests/runfiles/smartos.run b/usr/src/test/zfs-tests/runfiles/smartos.run
index e48a25b669..c8d6dc4783 100644
--- a/usr/src/test/zfs-tests/runfiles/smartos.run
+++ b/usr/src/test/zfs-tests/runfiles/smartos.run
@@ -165,7 +165,7 @@ tests = ['zfs_rename_001_pos', 'zfs_rename_002_pos', 'zfs_rename_003_pos',
tests = ['zfs_reservation_001_pos', 'zfs_reservation_002_pos']
[/opt/zfs-tests/tests/functional/resilver]
-tests = ['resilver_restart_001']
+tests = ['resilver_restart_001', 'resilver_restart_002']
tags = ['functional', 'resilver']
[/opt/zfs-tests/tests/functional/cli_root/zfs_rollback]
diff --git a/usr/src/test/zfs-tests/tests/functional/resilver/Makefile b/usr/src/test/zfs-tests/tests/functional/resilver/Makefile
index 85ee34a135..dd564d19c2 100644
--- a/usr/src/test/zfs-tests/tests/functional/resilver/Makefile
+++ b/usr/src/test/zfs-tests/tests/functional/resilver/Makefile
@@ -19,6 +19,7 @@ PROG = sysevent
SCRIPTS = cleanup \
resilver_restart_001 \
+ resilver_restart_002 \
setup
include $(SRC)/cmd/Makefile.cmd
@@ -40,6 +41,8 @@ $(FILES) := FILEMODE = 0444
CPPFLAGS += -D__EXTENSIONS__
LDLIBS += -lsysevent
+CSTD = $(CSTD_GNU99)
+
all: $(PROG)
$(PROG): $(OBJS)
diff --git a/usr/src/test/zfs-tests/tests/functional/resilver/resilver_restart_001.ksh b/usr/src/test/zfs-tests/tests/functional/resilver/resilver_restart_001.ksh
index 87e0e68cff..6333f4197a 100755
--- a/usr/src/test/zfs-tests/tests/functional/resilver/resilver_restart_001.ksh
+++ b/usr/src/test/zfs-tests/tests/functional/resilver/resilver_restart_001.ksh
@@ -105,7 +105,7 @@ log_onexit cleanup
# Monitor for resilver start events and log them to $EVTFILE as they occur
EVTFILE=$(mktemp /tmp/resilver_events.XXXXXX)
-EVTPID=$($SYSEVENT $EVTFILE)
+EVTPID=$($SYSEVENT -o $EVTFILE ESC_ZFS_resilver_start)
log_must test -n "$EVTPID"
log_must truncate -s $VDEV_FILE_SIZE ${VDEV_FILES[@]} $SPARE_VDEV_FILE
diff --git a/usr/src/test/zfs-tests/tests/functional/resilver/resilver_restart_002.ksh b/usr/src/test/zfs-tests/tests/functional/resilver/resilver_restart_002.ksh
new file mode 100644
index 0000000000..da111da9fd
--- /dev/null
+++ b/usr/src/test/zfs-tests/tests/functional/resilver/resilver_restart_002.ksh
@@ -0,0 +1,110 @@
+#!/bin/ksh -p
+
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2020, Datto Inc. All rights reserved.
+#
+
+. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/resilver/resilver.cfg
+
+SYSEVENT=$STF_SUITE/tests/functional/resilver/sysevent
+
+#
+# DESCRIPTION:
+# Testing resilver completes when scan errors are encountered, but relevant
+# DTL's have not been lost.
+#
+# STRATEGY:
+# 1. Create a pool (1k recordsize)
+# 2. Create a 32m file (32k records)
+# 3. Inject an error halfway through the file
+# 4. Start a resilver, ensure the error is triggered and that the resilver
+# does not restart after finishing
+#
+# NB: use legacy scanning to ensure scan of specific block causes error
+#
+
+function cleanup
+{
+ log_must zinject -c all
+ destroy_pool $TESTPOOL
+ rm -f ${VDEV_FILES[@]} $SPARE_VDEV_FILE
+ log_must set_tunable32 zfs_scan_legacy $ORIG_SCAN_LEGACY
+ [[ -n "$EVTPID" ]] && kill "$EVTPID"
+ [[ -n "$EVTFILE" ]] && rm -f "$EVTFILE"
+}
+
+log_assert "Check for resilver restarts caused by scan errors"
+
+ORIG_SCAN_LEGACY=$(get_tunable zfs_scan_legacy)
+
+log_onexit cleanup
+
+# use legacy scan to ensure injected error will be triggered
+log_must set_tunable32 zfs_scan_legacy 1
+
+ # create the pool and a 32M file (32k blocks)
+log_must truncate -s $VDEV_FILE_SIZE ${VDEV_FILES[0]} $SPARE_VDEV_FILE
+log_must zpool create -f -O recordsize=1k $TESTPOOL ${VDEV_FILES[0]}
+log_must dd if=/dev/urandom of=/$TESTPOOL/file bs=1M count=32 > /dev/null 2>&1
+
+# determine objset/object
+objset=$(zdb -d $TESTPOOL/ | sed -ne 's/.*ID \([0-9]*\).*/\1/p')
+object=$(ls -i /$TESTPOOL/file | awk '{print $1}')
+
+# inject event to cause error during resilver
+log_must zinject -b `printf "%x:%x:0:3fff" $objset $object` $TESTPOOL
+
+
+EVTFILE=$(mktemp /tmp/resilver_events.XXXXXX)
+EVTPID=$($SYSEVENT -o $EVTFILE ESC_ZFS_resilver_start ESC_ZFS_resilver_finish)
+log_must test -n "$EVTPID"
+
+# start resilver
+log_must zpool attach $TESTPOOL ${VDEV_FILES[0]} $SPARE_VDEV_FILE
+
+log_note "waiting for read errors to start showing up"
+for iter in {0..59}
+do
+ zpool sync $TESTPOOL
+ err=$(zpool status $TESTPOOL | grep ${VDEV_FILES[0]} | awk '{print $3}')
+ (( $err > 0 )) && break
+ sleep 1
+done
+
+(( $err == 0 )) && log_fail "Unable to induce errors in resilver"
+
+log_note "waiting for resilver to finish"
+for iter in {0..59}
+do
+ finish=$(grep "ESC_ZFS_resilver_finish" $EVTFILE | wc -l)
+ (( $finish > 0 )) && break
+ sleep 1
+done
+
+(( $finish == 0 )) && log_fail "resilver took too long to finish"
+
+# wait a few syncs to ensure that zfs does not restart the resilver
+log_must zpool sync $TESTPOOL
+log_must zpool sync $TESTPOOL
+
+# check if resilver was restarted
+start=$(grep "ESC_ZFS_resilver_start" $EVTFILE | wc -l)
+(( $start != 1 )) && log_fail "resilver restarted unnecessarily"
+
+log_pass "Resilver did not restart unnecessarily from scan errors"
diff --git a/usr/src/test/zfs-tests/tests/functional/resilver/sysevent.c b/usr/src/test/zfs-tests/tests/functional/resilver/sysevent.c
index 1310c07f90..62a8b2faa2 100644
--- a/usr/src/test/zfs-tests/tests/functional/resilver/sysevent.c
+++ b/usr/src/test/zfs-tests/tests/functional/resilver/sysevent.c
@@ -52,7 +52,6 @@ process_event(sysevent_t *ev)
errx(EXIT_FAILURE, "failed to retrieve sysevent metadata");
VERIFY0(strcmp(class, EC_ZFS));
- VERIFY0(strcmp(subclass, ESC_ZFS_RESILVER_START));
flockfile(out);
(void) fprintf(out, "Received %s.%s event\n", class, subclass);
@@ -77,11 +76,8 @@ child_fatal(int fd, const char *msg, ...)
}
static void
-do_child(int fd)
+do_child(int fd, char * const subclasses[], size_t n)
{
- const char *subclasses[] = {
- ESC_ZFS_RESILVER_START,
- };
sysevent_handle_t *handle;
int ret = 0;
@@ -90,8 +86,8 @@ do_child(int fd)
strerror(errno));
}
- if (sysevent_subscribe_event(handle, EC_ZFS, subclasses,
- ARRAY_SIZE(subclasses)) != 0) {
+ if (sysevent_subscribe_event(handle, EC_ZFS,
+ (const char **)subclasses, n) != 0) {
child_fatal(fd, "failed to subscribe to sysevents: %s",
strerror(errno));
}
@@ -107,20 +103,39 @@ do_child(int fd)
(void) pause();
}
+static void
+usage(const char *name)
+{
+ (void) fprintf(stderr, "Usage: %s [-o outfile] zfs_event...\n", name);
+ exit(2);
+}
+
int
-main(int argc, char **argv)
+main(int argc, char * const argv[])
{
+ const char *outfile = NULL;
pid_t child;
int fds[2];
int ret = 0;
-
- if (argc < 2) {
- (void) fprintf(stderr, "Usage: %s outfile\n", argv[0]);
- exit(EXIT_FAILURE);
+ int c;
+
+ while ((c = getopt(argc, argv, "o:")) != -1) {
+ switch (c) {
+ case 'o':
+ outfile = optarg;
+ break;
+ case '?':
+ (void) fprintf(stderr, "Invalid option -%c\n", optopt);
+ usage(argv[0]);
+ }
}
- if ((out = fopen(argv[1], "w")) == NULL)
- err(EXIT_FAILURE, "unable to open %s", argv[1]);
+ if (outfile != NULL) {
+ if ((out = fopen(optarg, "w")) == NULL)
+ err(EXIT_FAILURE, "unable to open %s", optarg);
+ } else {
+ out = stdout;
+ }
VERIFY0(pipe(fds));
@@ -128,7 +143,7 @@ main(int argc, char **argv)
case -1:
err(EXIT_FAILURE, "unable to fork");
case 0:
- do_child(fds[1]);
+ do_child(fds[1], argv + optind, (size_t)(argc - optind));
break;
default:
break;
diff --git a/usr/src/tools/Makefile b/usr/src/tools/Makefile
index 60c74fb342..64bd18f4e0 100644
--- a/usr/src/tools/Makefile
+++ b/usr/src/tools/Makefile
@@ -77,6 +77,7 @@ UNSHIPPED_SUBDIRS = \
localedef \
man \
mandoc \
+ rpcgen \
tic \
vtfontcvt \
zic
diff --git a/usr/src/tools/rpcgen/Makefile b/usr/src/tools/rpcgen/Makefile
new file mode 100644
index 0000000000..6108ec0700
--- /dev/null
+++ b/usr/src/tools/rpcgen/Makefile
@@ -0,0 +1,37 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2020 Toomas Soome <tsoome@me.com>
+#
+
+CMDDIR= $(SRC)/cmd/rpcgen
+
+include ../Makefile.tools
+include $(CMDDIR)/Makefile.common
+
+.KEEP_STATE:
+
+all: $(PROG)
+
+install: all .WAIT $(ROOTONBLDMACHPROG)
+
+clean:
+ $(RM) $(PROG) $(OBJS)
+
+$(PROG): $(OBJS)
+ $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
+ $(POST_PROCESS)
+
+%.o: $(CMDDIR)/%.c
+ $(COMPILE.c) -o $@ $<
+
+include ../Makefile.targ
diff --git a/usr/src/uts/common/brand/lx/syscall/lx_socket.c b/usr/src/uts/common/brand/lx/syscall/lx_socket.c
index 628b3490db..b67deee14f 100644
--- a/usr/src/uts/common/brand/lx/syscall/lx_socket.c
+++ b/usr/src/uts/common/brand/lx/syscall/lx_socket.c
@@ -3974,6 +3974,20 @@ lx_getsockopt_socket(sonode_t *so, int optname, void *optval,
lx_socket_aux_data_t *sad;
switch (optname) {
+ case LX_SO_PROTOCOL:
+ /*
+ * We need to special-case netlink and AF_UNIX too.
+ */
+ if (so->so_family != AF_LX_NETLINK && so->so_family != AF_UNIX)
+ break; /* Common-case it. */
+ if (*optlen < sizeof (int)) {
+ error = EINVAL;
+ } else {
+ *intval = so->so_protocol;
+ }
+ *optlen = sizeof (int);
+ return (error);
+
case LX_SO_TYPE:
/*
* Special handling for connectionless AF_UNIX sockets.
diff --git a/usr/src/uts/common/fs/zfs/dsl_scan.c b/usr/src/uts/common/fs/zfs/dsl_scan.c
index 427ed961bb..fa7b9fb2fc 100644
--- a/usr/src/uts/common/fs/zfs/dsl_scan.c
+++ b/usr/src/uts/common/fs/zfs/dsl_scan.c
@@ -549,6 +549,22 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t txg)
zfs_dbgmsg("new-style scrub was modified "
"by old software; restarting in txg %llu",
(longlong_t)scn->scn_restart_txg);
+ } else if (dsl_scan_resilvering(dp)) {
+ /*
+ * If a resilver is in progress and there are already
+ * errors, restart it instead of finishing this scan and
+ * then restarting it. If there haven't been any errors
+ * then remember that the incore DTL is valid.
+ */
+ if (scn->scn_phys.scn_errors > 0) {
+ scn->scn_restart_txg = txg;
+ zfs_dbgmsg("resilver can't excise DTL_MISSING "
+ "when finished; restarting in txg %llu",
+ (u_longlong_t)scn->scn_restart_txg);
+ } else {
+ /* it's safe to excise DTL when finished */
+ spa->spa_scrub_started = B_TRUE;
+ }
}
}
@@ -887,7 +903,6 @@ dsl_scan_done(dsl_scan_t *scn, boolean_t complete, dmu_tx_t *tx)
"errors=%llu", spa_get_errlog_size(spa));
if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) {
- spa->spa_scrub_started = B_FALSE;
spa->spa_scrub_active = B_FALSE;
/*
@@ -915,6 +930,12 @@ dsl_scan_done(dsl_scan_t *scn, boolean_t complete, dmu_tx_t *tx)
spa_errlog_rotate(spa);
/*
+ * Don't clear flag until after vdev_dtl_reassess to ensure that
+ * DTL_MISSING will get updated when possible.
+ */
+ spa->spa_scrub_started = B_FALSE;
+
+ /*
* We may have finished replacing a device.
* Let the async thread assess this and handle the detach.
*/
diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c
index f824490255..9773ec7960 100644
--- a/usr/src/uts/common/fs/zfs/vdev.c
+++ b/usr/src/uts/common/fs/zfs/vdev.c
@@ -99,6 +99,12 @@ boolean_t vdev_validate_skip = B_FALSE;
int zfs_vdev_dtl_sm_blksz = (1 << 12);
/*
+ * Ignore errors during scrub/resilver. Allows to work around resilver
+ * upon import when there are pool errors.
+ */
+int zfs_scan_ignore_errors = 0;
+
+/*
* vdev-wide space maps that have lots of entries written to them at
* the end of each transaction can benefit from a higher I/O bandwidth
* (e.g. vdev_obsolete_sm), thus we default their block size to 128K.
@@ -2465,7 +2471,6 @@ vdev_dtl_should_excise(vdev_t *vd)
spa_t *spa = vd->vdev_spa;
dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan;
- ASSERT0(scn->scn_phys.scn_errors);
ASSERT0(vd->vdev_children);
if (vd->vdev_state < VDEV_STATE_DEGRADED)
@@ -2515,10 +2520,29 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t txg, uint64_t scrub_txg, int scrub_done)
if (vd->vdev_ops->vdev_op_leaf) {
dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan;
+ boolean_t wasempty = B_TRUE;
mutex_enter(&vd->vdev_dtl_lock);
/*
+ * If requested, pretend the scan completed cleanly.
+ */
+ if (zfs_scan_ignore_errors && scn)
+ scn->scn_phys.scn_errors = 0;
+
+ if (scrub_txg != 0 &&
+ !range_tree_is_empty(vd->vdev_dtl[DTL_MISSING])) {
+ wasempty = B_FALSE;
+ zfs_dbgmsg("guid:%llu txg:%llu scrub:%llu started:%d "
+ "dtl:%llu/%llu errors:%llu",
+ (u_longlong_t)vd->vdev_guid, (u_longlong_t)txg,
+ (u_longlong_t)scrub_txg, spa->spa_scrub_started,
+ (u_longlong_t)vdev_dtl_min(vd),
+ (u_longlong_t)vdev_dtl_max(vd),
+ (u_longlong_t)(scn ? scn->scn_phys.scn_errors : 0));
+ }
+
+ /*
* If we've completed a scan cleanly then determine
* if this vdev should remove any DTLs. We only want to
* excise regions on vdevs that were available during
@@ -2554,6 +2578,14 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t txg, uint64_t scrub_txg, int scrub_done)
space_reftree_generate_map(&reftree,
vd->vdev_dtl[DTL_MISSING], 1);
space_reftree_destroy(&reftree);
+
+ if (!range_tree_is_empty(vd->vdev_dtl[DTL_MISSING])) {
+ zfs_dbgmsg("update DTL_MISSING:%llu/%llu",
+ (u_longlong_t)vdev_dtl_min(vd),
+ (u_longlong_t)vdev_dtl_max(vd));
+ } else if (!wasempty) {
+ zfs_dbgmsg("DTL_MISSING is now empty");
+ }
}
range_tree_vacate(vd->vdev_dtl[DTL_PARTIAL], NULL, NULL);
range_tree_walk(vd->vdev_dtl[DTL_MISSING],
diff --git a/usr/src/uts/common/os/dacf.c b/usr/src/uts/common/os/dacf.c
index 8d4cd486d8..592b1cd570 100644
--- a/usr/src/uts/common/os/dacf.c
+++ b/usr/src/uts/common/os/dacf.c
@@ -642,7 +642,7 @@ dacf_arglist_delete(dacf_arg_t **list)
* Match a device-spec to a rule.
*/
dacf_rule_t *
-dacf_match(dacf_opid_t op, dacf_devspec_t ds, void *match_info)
+dacf_match(dacf_opid_t op, dacf_devspec_t ds, const void *match_info)
{
dacf_rule_t *rule;
diff --git a/usr/src/uts/common/os/dacf_clnt.c b/usr/src/uts/common/os/dacf_clnt.c
index e40509d33b..fdb1696fb2 100644
--- a/usr/src/uts/common/os/dacf_clnt.c
+++ b/usr/src/uts/common/os/dacf_clnt.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* DACF (Device Autoconfiguration Framework) client code.
*
@@ -67,8 +65,8 @@
* for the operation to be invoked at post-attach and/or pre-detach time.
*/
void
-dacfc_match_create_minor(char *name, char *node_type, dev_info_t *dip,
- struct ddi_minor_data *dmdp, int flag)
+dacfc_match_create_minor(const char *name, const char *node_type,
+ dev_info_t *dip, struct ddi_minor_data *dmdp, int flag)
{
dacf_rule_t *r;
char *dev_path, *dev_pathp, *drv_mname = NULL;
diff --git a/usr/src/uts/common/os/sunddi.c b/usr/src/uts/common/os/sunddi.c
index 0dde96307b..1c6d02ed4a 100644
--- a/usr/src/uts/common/os/sunddi.c
+++ b/usr/src/uts/common/os/sunddi.c
@@ -5614,7 +5614,7 @@ fail:
* devfs event subclass names as device class names.
*/
static int
-derive_devi_class(dev_info_t *dip, char *node_type, int flag)
+derive_devi_class(dev_info_t *dip, const char *node_type, int flag)
{
int rv = DDI_SUCCESS;
@@ -5659,10 +5659,10 @@ derive_devi_class(dev_info_t *dip, char *node_type, int flag)
* exceed IFNAMSIZ (16) characters in length.
*/
static boolean_t
-verify_name(char *name)
+verify_name(const char *name)
{
- size_t len = strlen(name);
- char *cp;
+ size_t len = strlen(name);
+ const char *cp;
if (len == 0 || len > IFNAMSIZ)
return (B_FALSE);
@@ -5680,9 +5680,9 @@ verify_name(char *name)
* attach it to the given devinfo node.
*/
-int
-ddi_create_minor_common(dev_info_t *dip, char *name, int spec_type,
- minor_t minor_num, char *node_type, int flag, ddi_minor_type mtype,
+static int
+ddi_create_minor_common(dev_info_t *dip, const char *name, int spec_type,
+ minor_t minor_num, const char *node_type, int flag, ddi_minor_type mtype,
const char *read_priv, const char *write_priv, mode_t priv_mode)
{
struct ddi_minor_data *dmdp;
@@ -5793,7 +5793,7 @@ ddi_create_minor_common(dev_info_t *dip, char *name, int spec_type,
*/
if (!(DEVI_IS_ATTACHING(dip) || DEVI_IS_DETACHING(dip)) &&
mtype != DDM_INTERNAL_PATH) {
- (void) i_log_devfs_minor_create(dip, name);
+ (void) i_log_devfs_minor_create(dip, dmdp->ddm_name);
}
/*
@@ -5804,16 +5804,16 @@ ddi_create_minor_common(dev_info_t *dip, char *name, int spec_type,
}
int
-ddi_create_minor_node(dev_info_t *dip, char *name, int spec_type,
- minor_t minor_num, char *node_type, int flag)
+ddi_create_minor_node(dev_info_t *dip, const char *name, int spec_type,
+ minor_t minor_num, const char *node_type, int flag)
{
return (ddi_create_minor_common(dip, name, spec_type, minor_num,
node_type, flag, DDM_MINOR, NULL, NULL, 0));
}
int
-ddi_create_priv_minor_node(dev_info_t *dip, char *name, int spec_type,
- minor_t minor_num, char *node_type, int flag,
+ddi_create_priv_minor_node(dev_info_t *dip, const char *name, int spec_type,
+ minor_t minor_num, const char *node_type, int flag,
const char *rdpriv, const char *wrpriv, mode_t priv_mode)
{
return (ddi_create_minor_common(dip, name, spec_type, minor_num,
@@ -5821,8 +5821,8 @@ ddi_create_priv_minor_node(dev_info_t *dip, char *name, int spec_type,
}
int
-ddi_create_default_minor_node(dev_info_t *dip, char *name, int spec_type,
- minor_t minor_num, char *node_type, int flag)
+ddi_create_default_minor_node(dev_info_t *dip, const char *name, int spec_type,
+ minor_t minor_num, const char *node_type, int flag)
{
return (ddi_create_minor_common(dip, name, spec_type, minor_num,
node_type, flag, DDM_DEFAULT, NULL, NULL, 0));
@@ -5842,7 +5842,7 @@ ddi_create_internal_pathname(dev_info_t *dip, char *name, int spec_type,
}
void
-ddi_remove_minor_node(dev_info_t *dip, char *name)
+ddi_remove_minor_node(dev_info_t *dip, const char *name)
{
int circ;
struct ddi_minor_data *dmdp, *dmdp1;
@@ -8950,7 +8950,7 @@ i_ddi_devi_class(dev_info_t *dip)
}
int
-i_ddi_set_devi_class(dev_info_t *dip, char *devi_class, int flag)
+i_ddi_set_devi_class(dev_info_t *dip, const char *devi_class, int flag)
{
struct dev_info *devi = DEVI(dip);
diff --git a/usr/src/uts/common/sys/dacf_impl.h b/usr/src/uts/common/sys/dacf_impl.h
index 0d30ae061c..094e764c87 100644
--- a/usr/src/uts/common/sys/dacf_impl.h
+++ b/usr/src/uts/common/sys/dacf_impl.h
@@ -121,7 +121,7 @@ void dacf_rsrv_make(dacf_rsrvlist_t *, dacf_rule_t *, void *,
void dacf_process_rsrvs(dacf_rsrvlist_t **, dacf_opid_t, int);
void dacf_clr_rsrvs(dev_info_t *, dacf_opid_t);
-dacf_rule_t *dacf_match(dacf_opid_t, dacf_devspec_t, void *);
+dacf_rule_t *dacf_match(dacf_opid_t, dacf_devspec_t, const void *);
/*
* Failure codes from dacf_op_invoke, assigned to dacf_rsrvlist_t.rsrv_result
@@ -147,7 +147,7 @@ extern int dacfdebug;
* that utilize the dacf framework
*/
-void dacfc_match_create_minor(char *, char *, dev_info_t *,
+void dacfc_match_create_minor(const char *, const char *, dev_info_t *,
struct ddi_minor_data *, int);
int dacfc_postattach(dev_info_t *);
diff --git a/usr/src/uts/common/sys/ddi_impldefs.h b/usr/src/uts/common/sys/ddi_impldefs.h
index 1012c904fd..d8ddb23579 100644
--- a/usr/src/uts/common/sys/ddi_impldefs.h
+++ b/usr/src/uts/common/sys/ddi_impldefs.h
@@ -623,7 +623,7 @@ struct dev_info {
#define DEVI_SET_PCI(dip) (DEVI(dip)->devi_flags |= (DEVI_PCI_DEVICE))
char *i_ddi_devi_class(dev_info_t *);
-int i_ddi_set_devi_class(dev_info_t *, char *, int);
+int i_ddi_set_devi_class(dev_info_t *, const char *, int);
/*
* This structure represents one piece of bus space occupied by a given
@@ -709,7 +709,7 @@ struct ddi_minor {
dev_t dev; /* device number */
int spec_type; /* block or char */
int flags; /* access flags */
- char *node_type; /* block, byte, serial, network */
+ const char *node_type; /* block, byte, serial, network */
struct devplcy *node_priv; /* privilege for this minor */
mode_t priv_mode; /* default apparent privilege mode */
};
diff --git a/usr/src/uts/common/sys/ddi_ufm.h b/usr/src/uts/common/sys/ddi_ufm.h
index e6ad50d9ef..42d8ff72e6 100644
--- a/usr/src/uts/common/sys/ddi_ufm.h
+++ b/usr/src/uts/common/sys/ddi_ufm.h
@@ -10,7 +10,7 @@
*/
/*
- * Copyright 2019 Joyent, Inc.
+ * Copyright 2020 Joyent, Inc.
*/
#ifndef _SYS_DDI_UFM_H
@@ -51,7 +51,7 @@ extern "C" {
* the UFM_IOC_GETCAPS should be extended appropriately.
*/
typedef enum {
- DDI_UFM_CAP_REPORT = 1 << 0,
+ DDI_UFM_CAP_REPORT = 1 << 0
} ddi_ufm_cap_t;
/*
diff --git a/usr/src/uts/common/sys/sunddi.h b/usr/src/uts/common/sys/sunddi.h
index e19e5e8b29..0dc4894839 100644
--- a/usr/src/uts/common/sys/sunddi.h
+++ b/usr/src/uts/common/sys/sunddi.h
@@ -1574,16 +1574,16 @@ void
swab(void *src, void *dst, size_t nbytes);
int
-ddi_create_minor_node(dev_info_t *dip, char *name, int spec_type,
- minor_t minor_num, char *node_type, int flag);
+ddi_create_minor_node(dev_info_t *dip, const char *name, int spec_type,
+ minor_t minor_num, const char *node_type, int flag);
int
-ddi_create_priv_minor_node(dev_info_t *dip, char *name, int spec_type,
- minor_t minor_num, char *node_type, int flag,
+ddi_create_priv_minor_node(dev_info_t *dip, const char *name, int spec_type,
+ minor_t minor_num, const char *node_type, int flag,
const char *rdpriv, const char *wrpriv, mode_t priv_mode);
void
-ddi_remove_minor_node(dev_info_t *dip, char *name);
+ddi_remove_minor_node(dev_info_t *dip, const char *name);
int
ddi_in_panic(void);
diff --git a/usr/src/uts/i86pc/io/vmm/amd/svm.c b/usr/src/uts/i86pc/io/vmm/amd/svm.c
index 4c5e3112c0..c194e3d818 100644
--- a/usr/src/uts/i86pc/io/vmm/amd/svm.c
+++ b/usr/src/uts/i86pc/io/vmm/amd/svm.c
@@ -28,6 +28,7 @@
/*
* Copyright 2018 Joyent, Inc.
+ * Copyright 2020 Oxide Computer Company
*/
#include <sys/cdefs.h>
@@ -1513,11 +1514,8 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct vm_exit *vmexit)
break;
case VMCB_EXIT_CPUID:
vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_CPUID, 1);
- handled = x86_emulate_cpuid(svm_sc->vm, vcpu,
- (uint32_t *)&state->rax,
- (uint32_t *)&ctx->sctx_rbx,
- (uint32_t *)&ctx->sctx_rcx,
- (uint32_t *)&ctx->sctx_rdx);
+ handled = x86_emulate_cpuid(svm_sc->vm, vcpu, &state->rax,
+ &ctx->sctx_rbx, &ctx->sctx_rcx, &ctx->sctx_rdx);
break;
case VMCB_EXIT_HLT:
vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_HLT, 1);
diff --git a/usr/src/uts/i86pc/io/vmm/amd/svm_support.s b/usr/src/uts/i86pc/io/vmm/amd/svm_support.s
index fad994b09c..27ef1a04af 100644
--- a/usr/src/uts/i86pc/io/vmm/amd/svm_support.s
+++ b/usr/src/uts/i86pc/io/vmm/amd/svm_support.s
@@ -36,18 +36,6 @@
/* Porting note: This is named 'svm_support.S' upstream. */
-#if defined(lint)
-
-struct svm_regctx;
-struct cpu;
-
-/*ARGSUSED*/
-void
-svm_launch(uint64_t pa, struct svm_regctx *gctx, struct cpu *cpu)
-{}
-
-#else /* lint */
-
#define VMLOAD .byte 0x0f, 0x01, 0xda
#define VMRUN .byte 0x0f, 0x01, 0xd8
#define VMSAVE .byte 0x0f, 0x01, 0xdb
@@ -160,5 +148,3 @@ ENTRY_NP(svm_launch)
popq %rbp
ret
SET_SIZE(svm_launch)
-
-#endif /* lint */
diff --git a/usr/src/uts/i86pc/io/vmm/intel/vmx.c b/usr/src/uts/i86pc/io/vmm/intel/vmx.c
index 83e137973e..754795c2e9 100644
--- a/usr/src/uts/i86pc/io/vmm/intel/vmx.c
+++ b/usr/src/uts/i86pc/io/vmm/intel/vmx.c
@@ -40,6 +40,7 @@
*
* Copyright 2015 Pluribus Networks Inc.
* Copyright 2018 Joyent, Inc.
+ * Copyright 2020 Oxide Computer Company
*/
#include <sys/cdefs.h>
@@ -1242,11 +1243,9 @@ vmx_handle_cpuid(struct vm *vm, int vcpu, struct vmxctx *vmxctx)
int handled;
#endif
- handled = x86_emulate_cpuid(vm, vcpu,
- (uint32_t*)(&vmxctx->guest_rax),
- (uint32_t*)(&vmxctx->guest_rbx),
- (uint32_t*)(&vmxctx->guest_rcx),
- (uint32_t*)(&vmxctx->guest_rdx));
+ handled = x86_emulate_cpuid(vm, vcpu, (uint64_t *)&vmxctx->guest_rax,
+ (uint64_t *)&vmxctx->guest_rbx, (uint64_t *)&vmxctx->guest_rcx,
+ (uint64_t *)&vmxctx->guest_rdx);
return (handled);
}
diff --git a/usr/src/uts/i86pc/io/vmm/intel/vmx_support.s b/usr/src/uts/i86pc/io/vmm/intel/vmx_support.s
index 0130f88dd6..f719e31e30 100644
--- a/usr/src/uts/i86pc/io/vmm/intel/vmx_support.s
+++ b/usr/src/uts/i86pc/io/vmm/intel/vmx_support.s
@@ -45,31 +45,6 @@
/* Porting note: This is named 'vmx_support.S' upstream. */
-
-
-#if defined(lint)
-
-struct vmxctx;
-struct vmx;
-
-/*ARGSUSED*/
-void
-vmx_launch(struct vmxctx *ctx)
-{}
-
-void
-vmx_exit_guest()
-{}
-
-/*ARGSUSED*/
-int
-vmx_enter_guest(struct vmxctx *ctx, struct vmx *vmx, int launched)
-{
- return (0);
-}
-
-#else /* lint */
-
#include "vmx_assym.h"
#include "vmcs.h"
@@ -155,7 +130,7 @@ vmx_enter_guest(struct vmxctx *ctx, struct vmx *vmx, int launched)
#define VMXSTKSIZE VMXSTK_FP
/*
- * vmx_enter_guest(struct vmxctx *vmxctx, int launched)
+ * vmx_enter_guest(struct vmxctx *ctx, struct vmx *vmx, int launched)
* Interrupts must be disabled on entry.
*/
ENTRY_NP(vmx_enter_guest)
@@ -380,5 +355,3 @@ ENTRY_NP(vmx_call_isr)
popq %rbp
ret
SET_SIZE(vmx_call_isr)
-
-#endif /* lint */
diff --git a/usr/src/uts/i86pc/io/vmm/io/sol_iommu.c b/usr/src/uts/i86pc/io/vmm/io/sol_iommu.c
deleted file mode 100644
index 989e88e17b..0000000000
--- a/usr/src/uts/i86pc/io/vmm/io/sol_iommu.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * This file and its contents are supplied under the terms of the
- * Common Development and Distribution License ("CDDL"), version 1.0.
- * You may only use this file in accordance with the terms of version
- * 1.0 of the CDDL.
- *
- * A full copy of the text of the CDDL should have accompanied this
- * source. A copy of the CDDL is also available via the Internet at
- * http://www.illumos.org/license/CDDL.
- */
-
-/*
- * Copyright 2017 Joyent, Inc.
- */
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/cmn_err.h>
-
-/*
- * IOMMU Stub
- *
- * Until proper iommu support can be wired into bhyve, stub out all the
- * functions to either fail, if reasonable, or panic.
- */
-
-void
-iommu_cleanup(void)
-{
-}
-
-void *
-iommu_host_domain(void)
-{
- return (NULL);
-}
-
-/*ARGSUSED*/
-void *
-iommu_create_domain(vm_paddr_t maxaddr)
-{
- return (NULL);
-}
-
-/*ARGSUSED*/
-void
-iommu_destroy_domain(void *dom)
-{
- panic("unimplemented");
-}
-
-/*ARGSUSED*/
-void
-iommu_create_mapping(void *dom, vm_paddr_t gpa, vm_paddr_t hpa, size_t len)
-{
- panic("unimplemented");
-}
-
-/*ARGSUSED*/
-void
-iommu_remove_mapping(void *dom, vm_paddr_t gpa, size_t len)
-{
- panic("unimplemented");
-}
-
-/*ARGSUSED*/
-void
-iommu_add_device(void *dom, uint16_t rid)
-{
- panic("unimplemented");
-}
-
-/*ARGSUSED*/
-void
-iommu_remove_device(void *dom, uint16_t rid)
-{
- panic("unimplemented");
-}
-
-/*ARGSUSED*/
-void
-iommu_invalidate_tlb(void *domain)
-{
- panic("unimplemented");
-}
-
diff --git a/usr/src/uts/i86pc/io/vmm/io/sol_ppt.c b/usr/src/uts/i86pc/io/vmm/io/sol_ppt.c
deleted file mode 100644
index 9d5b1f5cdc..0000000000
--- a/usr/src/uts/i86pc/io/vmm/io/sol_ppt.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * This file and its contents are supplied under the terms of the
- * Common Development and Distribution License ("CDDL"), version 1.0.
- * You may only use this file in accordance with the terms of version
- * 1.0 of the CDDL.
- *
- * A full copy of the text of the CDDL should have accompanied this
- * source. A copy of the CDDL is also available via the Internet at
- * http://www.illumos.org/license/CDDL.
- */
-
-/*
- * Copyright 2017 Joyent, Inc.
- */
-
-#include <sys/types.h>
-#include <sys/errno.h>
-#include <sys/cmn_err.h>
-
-#include <sys/vmm.h>
-
-/*
- * PCI Pass-Through Stub
- *
- * Until proper passthrough support can be wired into bhyve, stub out all the
- * functions to either fail or no-op.
- */
-
-int
-ppt_unassign_all(struct vm *vm)
-{
- return (0);
-}
-
-/*ARGSUSED*/
-int
-ppt_map_mmio(struct vm *vm, int bus, int slot, int func, vm_paddr_t gpa,
- size_t len, vm_paddr_t hpa)
-{
- return (ENXIO);
-}
-
-/*ARGSUSED*/
-int
-ppt_setup_msi(struct vm *vm, int vcpu, int bus, int slot, int func,
- uint64_t addr, uint64_t msg, int numvec)
-{
- return (ENXIO);
-}
-
-/*ARGSUSED*/
-int
-ppt_setup_msix(struct vm *vm, int vcpu, int bus, int slot, int func, int idx,
- uint64_t addr, uint64_t msg, uint32_t vector_control)
-{
- return (ENXIO);
-}
-
-/*ARGSUSED*/
-int
-ppt_assigned_devices(struct vm *vm)
-{
- return (0);
-}
-
-/*ARGSUSED*/
-boolean_t
-ppt_is_mmio(struct vm *vm, vm_paddr_t gpa)
-{
- return (B_FALSE);
-}
-
-/*ARGSUSED*/
-int
-ppt_avail_devices(void)
-{
- return (0);
-}
-
-/*ARGSUSED*/
-int
-ppt_assign_device(struct vm *vm, int bus, int slot, int func)
-{
- return (ENOENT);
-}
-
-/*ARGSUSED*/
-int
-ppt_unassign_device(struct vm *vm, int bus, int slot, int func)
-{
- return (ENXIO);
-}
diff --git a/usr/src/uts/i86pc/io/vmm/vm/vm_page.h b/usr/src/uts/i86pc/io/vmm/vm/vm_page.h
index 65f3319c97..deb25a6cc0 100644
--- a/usr/src/uts/i86pc/io/vmm/vm/vm_page.h
+++ b/usr/src/uts/i86pc/io/vmm/vm/vm_page.h
@@ -21,7 +21,7 @@
#define PQ_ACTIVE 1
-void vm_page_unwire(vm_page_t , uint8_t);
+void vm_page_unwire(vm_page_t, uint8_t);
#define VM_PAGE_TO_PHYS(page) (mmu_ptob((uintptr_t)((page)->vmp_pfn)))
diff --git a/usr/src/uts/i86pc/io/vmm/x86.c b/usr/src/uts/i86pc/io/vmm/x86.c
index d74f866013..6213173587 100644
--- a/usr/src/uts/i86pc/io/vmm/x86.c
+++ b/usr/src/uts/i86pc/io/vmm/x86.c
@@ -39,6 +39,7 @@
*
* Copyright 2014 Pluribus Networks Inc.
* Copyright 2018 Joyent, Inc.
+ * Copyright 2020 Oxide Computer Company
*/
#include <sys/cdefs.h>
@@ -90,34 +91,39 @@ log2(u_int x)
}
int
-x86_emulate_cpuid(struct vm *vm, int vcpu_id,
- uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
+x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint64_t *rax, uint64_t *rbx,
+ uint64_t *rcx, uint64_t *rdx)
{
const struct xsave_limits *limits;
uint64_t cr4;
int error, enable_invpcid, level, width = 0, x2apic_id = 0;
- unsigned int func, regs[4], logical_cpus = 0;
+ unsigned int func, regs[4], logical_cpus = 0, param;
enum x2apic_state x2apic_state;
uint16_t cores, maxcpus, sockets, threads;
- VCPU_CTR2(vm, vcpu_id, "cpuid %#x,%#x", *eax, *ecx);
+ /*
+ * The function of CPUID is controlled through the provided value of
+ * %eax (and secondarily %ecx, for certain leaf data).
+ */
+ func = (uint32_t)*rax;
+ param = (uint32_t)*rcx;
+
+ VCPU_CTR2(vm, vcpu_id, "cpuid %#x,%#x", func, param);
/*
* Requests for invalid CPUID levels should map to the highest
* available level instead.
*/
- if (cpu_exthigh != 0 && *eax >= 0x80000000) {
- if (*eax > cpu_exthigh)
- *eax = cpu_exthigh;
- } else if (*eax >= 0x40000000) {
- if (*eax > CPUID_VM_HIGH)
- *eax = CPUID_VM_HIGH;
- } else if (*eax > cpu_high) {
- *eax = cpu_high;
+ if (cpu_exthigh != 0 && func >= 0x80000000) {
+ if (func > cpu_exthigh)
+ func = cpu_exthigh;
+ } else if (func >= 0x40000000) {
+ if (func > CPUID_VM_HIGH)
+ func = CPUID_VM_HIGH;
+ } else if (func > cpu_high) {
+ func = cpu_high;
}
- func = *eax;
-
/*
* In general the approach used for CPU topology is to
* advertise a flat topology where all CPUs are packages with
@@ -135,10 +141,10 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
case CPUID_8000_0003:
case CPUID_8000_0004:
case CPUID_8000_0006:
- cpuid_count(*eax, *ecx, regs);
+ cpuid_count(func, param, regs);
break;
case CPUID_8000_0008:
- cpuid_count(*eax, *ecx, regs);
+ cpuid_count(func, param, regs);
if (vmm_is_amd()) {
/*
* As on Intel (0000_0007:0, EDX), mask out
@@ -169,7 +175,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
break;
case CPUID_8000_0001:
- cpuid_count(*eax, *ecx, regs);
+ cpuid_count(func, param, regs);
/*
* Hide SVM from guest.
@@ -263,7 +269,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
*/
vm_get_topology(vm, &sockets, &cores, &threads,
&maxcpus);
- switch (*ecx) {
+ switch (param) {
case 0:
logical_cpus = threads;
level = 1;
@@ -408,7 +414,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
break;
case CPUID_0000_0004:
- cpuid_count(*eax, *ecx, regs);
+ cpuid_count(func, param, regs);
if (regs[0] || regs[1] || regs[2] || regs[3]) {
vm_get_topology(vm, &sockets, &cores, &threads,
@@ -437,8 +443,8 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
regs[3] = 0;
/* leaf 0 */
- if (*ecx == 0) {
- cpuid_count(*eax, *ecx, regs);
+ if (param == 0) {
+ cpuid_count(func, param, regs);
/* Only leaf 0 is supported */
regs[0] = 0;
@@ -491,21 +497,21 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
if (vmm_is_intel()) {
vm_get_topology(vm, &sockets, &cores, &threads,
&maxcpus);
- if (*ecx == 0) {
+ if (param == 0) {
logical_cpus = threads;
width = log2(logical_cpus);
level = CPUID_TYPE_SMT;
x2apic_id = vcpu_id;
}
- if (*ecx == 1) {
+ if (param == 1) {
logical_cpus = threads * cores;
width = log2(logical_cpus);
level = CPUID_TYPE_CORE;
x2apic_id = vcpu_id;
}
- if (!cpuid_leaf_b || *ecx >= 2) {
+ if (!cpuid_leaf_b || param >= 2) {
width = 0;
logical_cpus = 0;
level = 0;
@@ -514,7 +520,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
regs[0] = width & 0x1f;
regs[1] = logical_cpus & 0xffff;
- regs[2] = (level << 8) | (*ecx & 0xff);
+ regs[2] = (level << 8) | (param & 0xff);
regs[3] = x2apic_id;
} else {
regs[0] = 0;
@@ -534,8 +540,8 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
break;
}
- cpuid_count(*eax, *ecx, regs);
- switch (*ecx) {
+ cpuid_count(func, param, regs);
+ switch (param) {
case 0:
/*
* Only permit the guest to use bits
@@ -565,7 +571,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id,
* pass through as-is, otherwise return
* all zeroes.
*/
- if (!(limits->xcr0_allowed & (1ul << *ecx))) {
+ if (!(limits->xcr0_allowed & (1ul << param))) {
regs[0] = 0;
regs[1] = 0;
regs[2] = 0;
@@ -590,14 +596,17 @@ default_leaf:
* how many unhandled leaf values have been seen.
*/
atomic_add_long(&bhyve_xcpuids, 1);
- cpuid_count(*eax, *ecx, regs);
+ cpuid_count(func, param, regs);
break;
}
- *eax = regs[0];
- *ebx = regs[1];
- *ecx = regs[2];
- *edx = regs[3];
+ /*
+ * CPUID clears the upper 32-bits of the long-mode registers.
+ */
+ *rax = regs[0];
+ *rbx = regs[1];
+ *rcx = regs[2];
+ *rdx = regs[3];
return (1);
}
diff --git a/usr/src/uts/i86pc/io/vmm/x86.h b/usr/src/uts/i86pc/io/vmm/x86.h
index 0d70c04fd8..cb8e12fcd2 100644
--- a/usr/src/uts/i86pc/io/vmm/x86.h
+++ b/usr/src/uts/i86pc/io/vmm/x86.h
@@ -63,8 +63,8 @@
*/
#define CPUID_0000_0001_FEAT0_VMX (1<<5)
-int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint32_t *eax, uint32_t *ebx,
- uint32_t *ecx, uint32_t *edx);
+int x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint64_t *rax, uint64_t *rbx,
+ uint64_t *rcx, uint64_t *rdx);
enum vm_cpuid_capability {
VCC_NONE,
diff --git a/usr/src/uts/i86pc/ppt/Makefile b/usr/src/uts/i86pc/ppt/Makefile
index f231dfddf6..7c41368efd 100644
--- a/usr/src/uts/i86pc/ppt/Makefile
+++ b/usr/src/uts/i86pc/ppt/Makefile
@@ -24,7 +24,6 @@ UTSBASE = ../..
#
MODULE = ppt
OBJECTS = $(PPT_OBJS:%=$(OBJS_DIR)/%)
-LINTS = $(PPT_OBJS:%.o=$(LINTS_DIR)/%.ln)
ROOTMODULE = $(USR_DRV_DIR)/$(MODULE)
CONF_SRCDIR = $(UTSBASE)/i86pc/io/vmm/io
MAPFILE = $(UTSBASE)/i86pc/io/vmm/io/ppt.mapfile
@@ -38,7 +37,6 @@ include $(UTSBASE)/i86pc/Makefile.i86pc
# Define targets
#
ALL_TARGET = $(BINARY)
-LINT_TARGET = $(MODULE).lint
INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
#
@@ -72,12 +70,6 @@ clean: $(CLEAN_DEPS)
clobber: $(CLOBBER_DEPS)
-lint: $(LINT_DEPS)
-
-modlintlib: $(MODLINTLIB_DEPS)
-
-clean.lint: $(CLEAN_LINT_DEPS)
-
install: $(INSTALL_DEPS)
#
diff --git a/usr/src/uts/i86pc/viona/Makefile b/usr/src/uts/i86pc/viona/Makefile
index dac59c9a45..b7f0fd6f53 100644
--- a/usr/src/uts/i86pc/viona/Makefile
+++ b/usr/src/uts/i86pc/viona/Makefile
@@ -24,7 +24,6 @@ UTSBASE = ../..
#
MODULE = viona
OBJECTS = $(VIONA_OBJS:%=$(OBJS_DIR)/%)
-LINTS = $(VIONA_OBJS:%.o=$(LINTS_DIR)/%.ln)
ROOTMODULE = $(USR_DRV_DIR)/$(MODULE)
CONF_SRCDIR = $(UTSBASE)/i86pc/io/viona
MAPFILE = $(UTSBASE)/i86pc/io/viona/viona.mapfile
@@ -38,17 +37,11 @@ include $(UTSBASE)/i86pc/Makefile.i86pc
# Define targets
#
ALL_TARGET = $(BINARY) $(SRC_CONFILE)
-LINT_TARGET = $(MODULE).lint
INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
#
# Overrides
#
-LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
-LINTTAGS += -erroff=E_FUNC_ARG_UNUSED
-LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
-LINTTAGS += -erroff=E_FUNC_RET_MAYBE_IGNORED2
-LINTTAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2
# needs work
SMOFF += all_func_returns
@@ -74,12 +67,6 @@ clean: $(CLEAN_DEPS)
clobber: $(CLOBBER_DEPS)
-lint: $(LINT_DEPS)
-
-modlintlib: $(MODLINTLIB_DEPS)
-
-clean.lint: $(CLEAN_LINT_DEPS)
-
install: $(INSTALL_DEPS)
#
diff --git a/usr/src/uts/i86pc/vmm/Makefile b/usr/src/uts/i86pc/vmm/Makefile
index 018a05ab92..c55abf6090 100644
--- a/usr/src/uts/i86pc/vmm/Makefile
+++ b/usr/src/uts/i86pc/vmm/Makefile
@@ -24,7 +24,6 @@ UTSBASE = ../..
#
MODULE = vmm
OBJECTS = $(VMM_OBJS:%=$(OBJS_DIR)/%)
-LINTS = $(VMM_OBJS:%.o=$(LINTS_DIR)/%.ln)
ROOTMODULE = $(USR_DRV_DIR)/$(MODULE)
CONF_SRCDIR = $(UTSBASE)/i86pc/io/vmm
MAPFILE = $(UTSBASE)/i86pc/io/vmm/vmm.mapfile
@@ -38,42 +37,11 @@ include $(UTSBASE)/i86pc/Makefile.i86pc
# Define targets
#
ALL_TARGET = $(BINARY)
-LINT_TARGET = $(MODULE).lint
INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
#
# Overrides and additions
#
-LINTTAGS += -erroff=E_EMPTY_DECLARATION
-LINTTAGS += -erroff=E_OPERANDS_INCOMPATIBLE_TYPES
-LINTTAGS += -erroff=E_VOID_CANT_RETURN_VALUE
-LINTTAGS += -erroff=E_YACC_ERROR
-LINTTAGS += -erroff=E_STATIC_UNUSED
-LINTTAGS += -erroff=E_FUNC_RET_MAYBE_IGNORED2
-LINTTAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2
-LINTTAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2
-LINTTAGS += -erroff=E_FUNC_ARG_UNUSED
-LINTTAGS += -erroff=E_FUNC_SET_NOT_USED
-LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
-LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
-LINTTAGS += -erroff=E_CONSTANT_CONDITION
-LINTTAGS += -erroff=E_PTR_TO_VOID_IN_ARITHMETIC
-LINTTAGS += -erroff=E_CONST_TRUNCATED_BY_ASSIGN
-LINTTAGS += -erroff=E_NOP_ELSE_STMT
-LINTTAGS += -erroff=E_FUNC_NO_RET_VAL
-LINTTAGS += -erroff=E_OLD_STYLE_DECL_OR_BAD_TYPE
-LINTTAGS += -erroff=E_VAR_USED_BEFORE_SET
-LINTTAGS += -erroff=E_INTEGER_OVERFLOW_DETECTED
-LINTTAGS += -erroff=E_STMT_NOT_REACHED
-LINTTAGS += -erroff=E_FUNC_NO_RET_VAL
-LINTTAGS += -erroff=E_USELESS_DECLARATION
-LINTTAGS += -erroff=E_EXPR_NULL_EFFECT
-LINTTAGS += -erroff=E_CASE_FALLTHRU
-LINTTAGS += -erroff=E_FUNC_DECL_VAR_ARG2
-LINTTAGS += -erroff=E_ASM_IMPOSSIBLE_CONSTRAINT
-LINTTAGS += -erroff=E_ASM_UNUSED_PARAM
-LINTTAGS += -erroff=E_NOP_IF_STMT
-LINTTAGS += -erroff=E_ZERO_OR_NEGATIVE_SUBSCRIPT
CERRWARN += -_gcc=-Wno-empty-body
@@ -86,11 +54,6 @@ $(OBJS_DIR)/vmm_sol_dev.o := SMOFF += signed_integer_overflow_check
# a can't happen: vmx_setcap() warn: variable dereferenced before check 'pptr'
$(OBJS_DIR)/vmx.o := SMOFF += deref_check
-# These sources only compile with gcc. Workaround a confluence of cruft
-# regarding dmake and shadow compilation by neutering the sun compiler.
-#amd64_CC = $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
-#CFLAGS += -_cc=-xdryrun
-
ALL_BUILDS = $(ALL_BUILDSONLY64)
DEF_BUILDS = $(DEF_BUILDSONLY64)
PRE_INC_PATH = -I$(COMPAT)/freebsd -I$(COMPAT)/freebsd/amd64 \
@@ -109,8 +72,8 @@ $(OBJS_DIR)/svm.o := CERRWARN += -_gcc=-Wno-pointer-sign -_gcc=-Wno-type-limits
$(OBJS_DIR)/vmx.o := CERRWARN += -_gcc=-Wno-unused-variable
$(OBJS_DIR)/iommu.o := CERRWARN += -_gcc=-Wno-unused-variable
-LDFLAGS += -N misc/acpica -N misc/pcie -N fs/dev -z type=kmod
-LDFLAGS += -M $(MAPFILE)
+LDFLAGS += -N misc/acpica -N misc/pcie -N fs/dev
+LDFLAGS += -z type=kmod -M $(MAPFILE)
OFFSETS_VMX = $(CONF_SRCDIR)/intel/offsets.in
OFFSETS_SVM = $(CONF_SRCDIR)/amd/offsets.in
@@ -133,12 +96,6 @@ clean: $(CLEAN_DEPS)
clobber: $(CLOBBER_DEPS)
-lint: $(LINT_DEPS)
-
-modlintlib: $(MODLINTLIB_DEPS)
-
-clean.lint: $(CLEAN_LINT_DEPS)
-
install: $(INSTALL_DEPS)
#
diff --git a/usr/src/uts/intel/ia32/ml/modstubs.s b/usr/src/uts/intel/ia32/ml/modstubs.s
index 59598c47e0..03fe983372 100644
--- a/usr/src/uts/intel/ia32/ml/modstubs.s
+++ b/usr/src/uts/intel/ia32/ml/modstubs.s
@@ -1311,8 +1311,9 @@ fcnname/**/_info: \
END_MODULE(ppt);
#endif
-/ this is just a marker for the area of text that contains stubs
-
+/*
+ * this is just a marker for the area of text that contains stubs
+ */
ENTRY_NP(stubs_end)
nop
diff --git a/usr/src/uts/sun4/os/cpu_states.c b/usr/src/uts/sun4/os/cpu_states.c
index 5c53df1182..44640b68af 100644
--- a/usr/src/uts/sun4/os/cpu_states.c
+++ b/usr/src/uts/sun4/os/cpu_states.c
@@ -185,11 +185,11 @@ abort_sequence_enter(char *msg)
*/
abort_seq_tstamp = 0LL;
mutex_exit(&abort_seq_lock);
- if (!on_intr && auditing)
- audit_enterprom(1);
+ if (!on_intr && auditing)
+ audit_enterprom(1);
(*abort_seq_handler)(msg);
- if (!on_intr && auditing)
- audit_exitprom(1);
+ if (!on_intr && auditing)
+ audit_exitprom(1);
}
} else {
if (auditing)