Date: Tue, 9 Jun 2015 19:14:28 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r284188 - in projects/clang-trunk: . bin/chmod bin/cp bin/ls cddl/contrib/opensolaris/lib/libdtrace/common contrib/dtc contrib/mdocml contrib/top etc games/grdc lib/libc/aarch64/gen lib... Message-ID: <201506091914.t59JESWi064057@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Tue Jun 9 19:14:27 2015 New Revision: 284188 URL: https://svnweb.freebsd.org/changeset/base/284188 Log: Merged ^/head r283871 through r284187. Added: projects/clang-trunk/contrib/top/top.local.hs - copied unchanged from r284187, head/contrib/top/top.local.hs projects/clang-trunk/contrib/top/top.xs - copied unchanged from r284187, head/contrib/top/top.xs projects/clang-trunk/release/arm/CUBOX-HUMMINGBOARD.conf - copied unchanged from r284187, head/release/arm/CUBOX-HUMMINGBOARD.conf projects/clang-trunk/release/arm/GUMSTIX.conf - copied unchanged from r284187, head/release/arm/GUMSTIX.conf projects/clang-trunk/sys/arm/ti/am335x/tps65217x.h - copied unchanged from r284187, head/sys/arm/ti/am335x/tps65217x.h projects/clang-trunk/sys/dev/ixl/i40e_devids.h - copied unchanged from r284187, head/sys/dev/ixl/i40e_devids.h projects/clang-trunk/sys/dev/proto/proto_busdma.c - copied unchanged from r284187, head/sys/dev/proto/proto_busdma.c projects/clang-trunk/sys/dev/proto/proto_busdma.h - copied unchanged from r284187, head/sys/dev/proto/proto_busdma.h projects/clang-trunk/sys/dev/usb/template/usb_template_midi.c - copied unchanged from r284187, head/sys/dev/usb/template/usb_template_midi.c projects/clang-trunk/sys/modules/geom/geom_map/ - copied from r284187, head/sys/modules/geom/geom_map/ projects/clang-trunk/tools/bus_space/busdma.c - copied unchanged from r284187, head/tools/bus_space/busdma.c projects/clang-trunk/tools/bus_space/busdma.h - copied unchanged from r284187, head/tools/bus_space/busdma.h projects/clang-trunk/usr.sbin/pw/tests/pw-modified.conf - copied unchanged from r284187, head/usr.sbin/pw/tests/pw-modified.conf projects/clang-trunk/usr.sbin/pw/tests/pw.conf - copied unchanged from r284187, head/usr.sbin/pw/tests/pw.conf projects/clang-trunk/usr.sbin/pw/tests/pw_config.sh - copied unchanged from r284187, head/usr.sbin/pw/tests/pw_config.sh Deleted: projects/clang-trunk/contrib/top/top.X projects/clang-trunk/contrib/top/top.local.H Modified: projects/clang-trunk/UPDATING projects/clang-trunk/bin/chmod/chmod.c projects/clang-trunk/bin/cp/cp.1 projects/clang-trunk/bin/cp/cp.c projects/clang-trunk/bin/cp/extern.h projects/clang-trunk/bin/cp/utils.c projects/clang-trunk/bin/ls/ls.c projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c projects/clang-trunk/contrib/dtc/checks.c projects/clang-trunk/contrib/mdocml/read.c projects/clang-trunk/etc/Makefile projects/clang-trunk/games/grdc/grdc.c projects/clang-trunk/lib/libc/aarch64/gen/setjmp.S projects/clang-trunk/lib/libc/string/strchr.3 projects/clang-trunk/lib/libdevstat/devstat.c projects/clang-trunk/lib/libdpv/dprompt.c projects/clang-trunk/lib/libedit/edit/readline/readline.h projects/clang-trunk/lib/libedit/readline.c projects/clang-trunk/lib/libgssapi/gss_accept_sec_context.c projects/clang-trunk/lib/libugidfw/ugidfw.c projects/clang-trunk/lib/libutil/pw_util.3 projects/clang-trunk/release/Makefile.ec2 projects/clang-trunk/release/arm/BEAGLEBONE.conf projects/clang-trunk/release/arm/WANDBOARD.conf projects/clang-trunk/release/tools/arm.subr projects/clang-trunk/sbin/badsect/Makefile projects/clang-trunk/sbin/camcontrol/camcontrol.c projects/clang-trunk/sbin/camcontrol/persist.c projects/clang-trunk/share/doc/papers/bufbio/bio.ms projects/clang-trunk/share/examples/bhyve/vmrun.sh projects/clang-trunk/share/man/man4/em.4 projects/clang-trunk/share/man/man4/geom.4 projects/clang-trunk/share/man/man4/geom_map.4 projects/clang-trunk/share/man/man4/gre.4 projects/clang-trunk/share/man/man8/Makefile projects/clang-trunk/share/misc/committers-ports.dot projects/clang-trunk/share/mk/bsd.lib.mk projects/clang-trunk/share/mk/bsd.mkopt.mk projects/clang-trunk/sys/amd64/amd64/initcpu.c projects/clang-trunk/sys/amd64/amd64/pmap.c projects/clang-trunk/sys/amd64/include/md_var.h projects/clang-trunk/sys/amd64/include/vmparam.h projects/clang-trunk/sys/amd64/linux/linux_support.s projects/clang-trunk/sys/amd64/vmm/amd/svm.c projects/clang-trunk/sys/amd64/vmm/intel/vmx.c projects/clang-trunk/sys/amd64/vmm/intel/vmx.h projects/clang-trunk/sys/amd64/vmm/intel/vmx_msr.c projects/clang-trunk/sys/amd64/vmm/vmm_instruction_emul.c projects/clang-trunk/sys/arm/arm/cpu_asm-v6.S projects/clang-trunk/sys/arm/arm/elf_trampoline.c projects/clang-trunk/sys/arm/arm/exception.S projects/clang-trunk/sys/arm/arm/genassym.c projects/clang-trunk/sys/arm/arm/machdep.c projects/clang-trunk/sys/arm/arm/mp_machdep.c projects/clang-trunk/sys/arm/arm/pmap-v6-new.c projects/clang-trunk/sys/arm/arm/stack_machdep.c projects/clang-trunk/sys/arm/arm/swtch.S projects/clang-trunk/sys/arm/arm/sys_machdep.c projects/clang-trunk/sys/arm/arm/trap-v6.c projects/clang-trunk/sys/arm/arm/vfp.c projects/clang-trunk/sys/arm/arm/vm_machdep.c projects/clang-trunk/sys/arm/broadcom/bcm2835/bcm2835_spi.c projects/clang-trunk/sys/arm/freescale/imx/imx6_sdma.c projects/clang-trunk/sys/arm/include/pcpu.h projects/clang-trunk/sys/arm/include/vmparam.h projects/clang-trunk/sys/arm/ti/am335x/am335x_pmic.c projects/clang-trunk/sys/arm64/arm64/exception.S projects/clang-trunk/sys/arm64/include/vmparam.h projects/clang-trunk/sys/boot/forth/support.4th projects/clang-trunk/sys/boot/userboot/userboot/conf.c projects/clang-trunk/sys/boot/zfs/zfsimpl.c projects/clang-trunk/sys/cam/ctl/ctl.c projects/clang-trunk/sys/cam/ctl/scsi_ctl.c projects/clang-trunk/sys/cddl/compat/opensolaris/sys/nvpair.h projects/clang-trunk/sys/compat/linprocfs/linprocfs.c projects/clang-trunk/sys/compat/linux/linux_emul.c projects/clang-trunk/sys/compat/linux/linux_socket.c projects/clang-trunk/sys/conf/NOTES projects/clang-trunk/sys/conf/files projects/clang-trunk/sys/conf/options projects/clang-trunk/sys/contrib/dev/acpica/common/ahuuids.c projects/clang-trunk/sys/contrib/dev/acpica/include/acuuid.h projects/clang-trunk/sys/dev/ahci/ahci.h projects/clang-trunk/sys/dev/aic7xxx/aic79xx_pci.c projects/clang-trunk/sys/dev/cxgbe/t4_netmap.c projects/clang-trunk/sys/dev/drm/drmP.h projects/clang-trunk/sys/dev/drm/drm_agpsupport.c projects/clang-trunk/sys/dev/drm/drm_bufs.c projects/clang-trunk/sys/dev/drm/drm_drv.c projects/clang-trunk/sys/dev/drm/drm_irq.c projects/clang-trunk/sys/dev/drm/i915_drv.c projects/clang-trunk/sys/dev/drm/mach64_drv.c projects/clang-trunk/sys/dev/drm/mga_drv.c projects/clang-trunk/sys/dev/drm/r128_drv.c projects/clang-trunk/sys/dev/drm/radeon_drv.c projects/clang-trunk/sys/dev/drm/savage_drv.c projects/clang-trunk/sys/dev/drm/sis_drv.c projects/clang-trunk/sys/dev/drm/tdfx_drv.c projects/clang-trunk/sys/dev/drm2/drm_bufs.c projects/clang-trunk/sys/dev/dwc/if_dwc.c projects/clang-trunk/sys/dev/e1000/e1000_defines.h projects/clang-trunk/sys/dev/e1000/if_em.c projects/clang-trunk/sys/dev/e1000/if_em.h projects/clang-trunk/sys/dev/hwpmc/hwpmc_mod.c projects/clang-trunk/sys/dev/iwi/if_iwi.c projects/clang-trunk/sys/dev/iwn/if_iwn.c projects/clang-trunk/sys/dev/ixgbe/if_ix.c projects/clang-trunk/sys/dev/ixgbe/if_ixv.c projects/clang-trunk/sys/dev/ixgbe/ix_txrx.c projects/clang-trunk/sys/dev/ixgbe/ixgbe.h projects/clang-trunk/sys/dev/ixgbe/ixgbe_mbx.h projects/clang-trunk/sys/dev/ixgbe/ixgbe_vf.c projects/clang-trunk/sys/dev/ixl/i40e_adminq.c projects/clang-trunk/sys/dev/ixl/i40e_adminq.h projects/clang-trunk/sys/dev/ixl/i40e_adminq_cmd.h projects/clang-trunk/sys/dev/ixl/i40e_common.c projects/clang-trunk/sys/dev/ixl/i40e_hmc.c projects/clang-trunk/sys/dev/ixl/i40e_hmc.h projects/clang-trunk/sys/dev/ixl/i40e_lan_hmc.c projects/clang-trunk/sys/dev/ixl/i40e_nvm.c projects/clang-trunk/sys/dev/ixl/i40e_osdep.h projects/clang-trunk/sys/dev/ixl/i40e_prototype.h projects/clang-trunk/sys/dev/ixl/i40e_register.h projects/clang-trunk/sys/dev/ixl/i40e_type.h projects/clang-trunk/sys/dev/ixl/i40e_virtchnl.h projects/clang-trunk/sys/dev/ixl/if_ixl.c projects/clang-trunk/sys/dev/ixl/if_ixlv.c projects/clang-trunk/sys/dev/ixl/ixlv.h projects/clang-trunk/sys/dev/ixl/ixlvc.c projects/clang-trunk/sys/dev/mfi/mfi.c projects/clang-trunk/sys/dev/nand/nfc_rb.c projects/clang-trunk/sys/dev/netmap/if_em_netmap.h projects/clang-trunk/sys/dev/pci/vga_pci.c projects/clang-trunk/sys/dev/proto/proto.h projects/clang-trunk/sys/dev/proto/proto_bus_pci.c projects/clang-trunk/sys/dev/proto/proto_core.c projects/clang-trunk/sys/dev/proto/proto_dev.h projects/clang-trunk/sys/dev/usb/controller/dwc_otg.c projects/clang-trunk/sys/dev/usb/quirk/usb_quirk.c projects/clang-trunk/sys/dev/usb/template/usb_template.c projects/clang-trunk/sys/dev/usb/template/usb_template.h projects/clang-trunk/sys/dev/usb/usb_dev.c projects/clang-trunk/sys/dev/usb/usb_ioctl.h projects/clang-trunk/sys/dev/usb/usbdevs projects/clang-trunk/sys/fs/devfs/devfs_vnops.c projects/clang-trunk/sys/fs/procfs/procfs_ctl.c projects/clang-trunk/sys/fs/procfs/procfs_map.c projects/clang-trunk/sys/fs/unionfs/union_vfsops.c projects/clang-trunk/sys/geom/part/g_part_gpt.c projects/clang-trunk/sys/i386/i386/initcpu.c projects/clang-trunk/sys/i386/i386/pmap.c projects/clang-trunk/sys/i386/i386/trap.c projects/clang-trunk/sys/i386/include/md_var.h projects/clang-trunk/sys/i386/include/vmparam.h projects/clang-trunk/sys/kern/imgact_elf.c projects/clang-trunk/sys/kern/kern_proc.c projects/clang-trunk/sys/kern/kern_tc.c projects/clang-trunk/sys/kern/subr_uio.c projects/clang-trunk/sys/kern/subr_witness.c projects/clang-trunk/sys/kern/sys_process.c projects/clang-trunk/sys/kern/uipc_shm.c projects/clang-trunk/sys/kern/vfs_vnops.c projects/clang-trunk/sys/mips/conf/AR71XX_BASE projects/clang-trunk/sys/mips/conf/AR724X_BASE projects/clang-trunk/sys/mips/include/vmparam.h projects/clang-trunk/sys/modules/Makefile projects/clang-trunk/sys/modules/em/Makefile projects/clang-trunk/sys/modules/ixl/Makefile projects/clang-trunk/sys/modules/ixlv/Makefile projects/clang-trunk/sys/modules/ixv/Makefile projects/clang-trunk/sys/modules/proto/Makefile projects/clang-trunk/sys/modules/usb/template/Makefile projects/clang-trunk/sys/net80211/ieee80211.c projects/clang-trunk/sys/net80211/ieee80211_freebsd.c projects/clang-trunk/sys/net80211/ieee80211_freebsd.h projects/clang-trunk/sys/net80211/ieee80211_output.c projects/clang-trunk/sys/net80211/ieee80211_scan.c projects/clang-trunk/sys/net80211/ieee80211_scan.h projects/clang-trunk/sys/net80211/ieee80211_scan_sw.c projects/clang-trunk/sys/net80211/ieee80211_scan_sw.h projects/clang-trunk/sys/net80211/ieee80211_var.h projects/clang-trunk/sys/netinet/sctp_sysctl.c projects/clang-trunk/sys/netinet/sctp_uio.h projects/clang-trunk/sys/powerpc/include/vmparam.h projects/clang-trunk/sys/sparc64/include/vmparam.h projects/clang-trunk/sys/sys/bus.h projects/clang-trunk/sys/sys/file.h projects/clang-trunk/sys/sys/mman.h projects/clang-trunk/sys/sys/param.h projects/clang-trunk/sys/ufs/ffs/ffs_vnops.c projects/clang-trunk/sys/vm/vm_extern.h projects/clang-trunk/sys/vm/vm_mmap.c projects/clang-trunk/sys/vm/vm_object.c projects/clang-trunk/sys/vm/vm_object.h projects/clang-trunk/sys/vm/vm_page.c projects/clang-trunk/sys/vm/vm_reserv.c projects/clang-trunk/sys/x86/acpica/madt.c projects/clang-trunk/sys/x86/x86/identcpu.c projects/clang-trunk/tests/sys/kern/ptrace_test.c projects/clang-trunk/tools/bus_space/C/Makefile projects/clang-trunk/tools/bus_space/C/lang.c projects/clang-trunk/tools/bus_space/C/libbus_space.h projects/clang-trunk/tools/bus_space/Makefile.inc projects/clang-trunk/tools/bus_space/Python/lang.c projects/clang-trunk/usr.bin/colcrt/colcrt.1 projects/clang-trunk/usr.bin/colrm/colrm.1 projects/clang-trunk/usr.bin/expand/expand.1 projects/clang-trunk/usr.bin/fold/fold.1 projects/clang-trunk/usr.bin/keylogin/Makefile projects/clang-trunk/usr.bin/last/last.1 projects/clang-trunk/usr.bin/mail/Makefile projects/clang-trunk/usr.bin/mail/main.c projects/clang-trunk/usr.bin/mandoc/Makefile projects/clang-trunk/usr.bin/mkstr/mkstr.1 projects/clang-trunk/usr.bin/mkstr/mkstr.c projects/clang-trunk/usr.bin/rsh/Makefile projects/clang-trunk/usr.bin/rsh/rsh.c projects/clang-trunk/usr.bin/rup/Makefile projects/clang-trunk/usr.bin/systat/Makefile projects/clang-trunk/usr.bin/systat/main.c projects/clang-trunk/usr.bin/top/Makefile projects/clang-trunk/usr.bin/tset/tset.1 projects/clang-trunk/usr.bin/vgrind/regexp.c projects/clang-trunk/usr.bin/vgrind/vgrindefs.c projects/clang-trunk/usr.bin/vtfontcvt/Makefile projects/clang-trunk/usr.sbin/ctld/login.c projects/clang-trunk/usr.sbin/pw/grupd.c projects/clang-trunk/usr.sbin/pw/pw.8 projects/clang-trunk/usr.sbin/pw/pw.c projects/clang-trunk/usr.sbin/pw/pw.h projects/clang-trunk/usr.sbin/pw/pw_group.c projects/clang-trunk/usr.sbin/pw/pw_user.c projects/clang-trunk/usr.sbin/pw/pwupd.c projects/clang-trunk/usr.sbin/pw/pwupd.h projects/clang-trunk/usr.sbin/pw/tests/Makefile projects/clang-trunk/usr.sbin/pw/tests/pw_groupmod.sh projects/clang-trunk/usr.sbin/pw/tests/pw_useradd.sh projects/clang-trunk/usr.sbin/pw/tests/pw_usermod.sh projects/clang-trunk/usr.sbin/pwd_mkdb/pwd_mkdb.8 projects/clang-trunk/usr.sbin/pwd_mkdb/pwd_mkdb.c Directory Properties: projects/clang-trunk/ (props changed) projects/clang-trunk/cddl/ (props changed) projects/clang-trunk/cddl/contrib/opensolaris/ (props changed) projects/clang-trunk/contrib/dtc/ (props changed) projects/clang-trunk/contrib/mdocml/ (props changed) projects/clang-trunk/contrib/top/ (props changed) projects/clang-trunk/etc/ (props changed) projects/clang-trunk/lib/libc/ (props changed) projects/clang-trunk/lib/libutil/ (props changed) projects/clang-trunk/sbin/ (props changed) projects/clang-trunk/share/ (props changed) projects/clang-trunk/share/man/man4/ (props changed) projects/clang-trunk/sys/ (props changed) projects/clang-trunk/sys/amd64/vmm/ (props changed) projects/clang-trunk/sys/boot/ (props changed) projects/clang-trunk/sys/conf/ (props changed) projects/clang-trunk/sys/contrib/dev/acpica/ (props changed) Modified: projects/clang-trunk/UPDATING ============================================================================== --- projects/clang-trunk/UPDATING Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/UPDATING Tue Jun 9 19:14:27 2015 (r284188) @@ -36,6 +36,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 20141231 entry below for information about prerequisites and upgrading, if you are not already using 3.5.0 or higher. +20150604: + Generation of legacy formatted entries have been disabled by default + in pwd_mkdb(8), as all base system consumers of the legacy formatted + entries were converted to use the new format by default when the new, + machine independent format have been added and supported since FreeBSD + 5.x. + + Please see the pwd_mkdb(8) manual page for further details. + 20150525: Clang and llvm have been upgraded to 3.6.1 release. Please see the 20141231 entry below for information about prerequisites and upgrading, Modified: projects/clang-trunk/bin/chmod/chmod.c ============================================================================== --- projects/clang-trunk/bin/chmod/chmod.c Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/bin/chmod/chmod.c Tue Jun 9 19:14:27 2015 (r284188) @@ -162,14 +162,16 @@ done: argv += optind; atflag = AT_SYMLINK_NOFOLLOW; switch (p->fts_info) { - case FTS_D: /* Change it at FTS_DP. */ + case FTS_D: if (!Rflag) fts_set(ftsp, p, FTS_SKIP); - continue; + break; case FTS_DNR: /* Warn, chmod. */ warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); rval = 1; break; + case FTS_DP: /* Already changed at FTS_D. */ + continue; case FTS_ERR: /* Warn, continue. */ case FTS_NS: warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); Modified: projects/clang-trunk/bin/cp/cp.1 ============================================================================== --- projects/clang-trunk/bin/cp/cp.1 Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/bin/cp/cp.1 Tue Jun 9 19:14:27 2015 (r284188) @@ -32,7 +32,7 @@ .\" @(#)cp.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 15, 2013 +.Dd June 6, 2015 .Dt CP 1 .Os .Sh NAME @@ -45,7 +45,7 @@ .Op Fl H | Fl L | Fl P .Oc .Op Fl f | i | n -.Op Fl alpvx +.Op Fl alpsvx .Ar source_file target_file .Nm .Oo @@ -53,7 +53,7 @@ .Op Fl H | Fl L | Fl P .Oc .Op Fl f | i | n -.Op Fl alpvx +.Op Fl alpsvx .Ar source_file ... target_directory .Sh DESCRIPTION In the first synopsis form, the @@ -179,6 +179,8 @@ If the source file has both its set-user and either the user ID or group ID cannot be preserved, neither the set-user-ID nor set-group-ID bits are preserved in the copy's permissions. +.It Fl s +Create symbolic links to regular files in a hierarchy instead of copying. .It Fl v Cause .Nm @@ -298,7 +300,10 @@ differ as they copy special files as nor files while recreating a hierarchy. .Pp The -.Fl v +.Fl l, +.Fl s, +.Fl v, +.Fl x and .Fl n options are non-standard and their use in scripts is not recommended. Modified: projects/clang-trunk/bin/cp/cp.c ============================================================================== --- projects/clang-trunk/bin/cp/cp.c Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/bin/cp/cp.c Tue Jun 9 19:14:27 2015 (r284188) @@ -75,15 +75,15 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #define STRIP_TRAILING_SLASH(p) { \ - while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \ - *--(p).p_end = 0; \ + while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \ + *--(p).p_end = 0; \ } static char emptystring[] = ""; PATH_T to = { to.p_path, emptystring, "" }; -int fflag, iflag, lflag, nflag, pflag, vflag; +int fflag, iflag, lflag, nflag, pflag, sflag, vflag; static int Rflag, rflag; volatile sig_atomic_t info; @@ -102,7 +102,7 @@ main(int argc, char *argv[]) fts_options = FTS_NOCHDIR | FTS_PHYSICAL; Hflag = Lflag = 0; - while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1) + while ((ch = getopt(argc, argv, "HLPRafilnprsvx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -145,6 +145,9 @@ main(int argc, char *argv[]) rflag = Lflag = 1; Hflag = 0; break; + case 's': + sflag = 1; + break; case 'v': vflag = 1; break; @@ -163,6 +166,8 @@ main(int argc, char *argv[]) if (Rflag && rflag) errx(1, "the -R and -r options may not be specified together"); + if (lflag && sflag) + errx(1, "the -l and -s options may not be specified together"); if (rflag) Rflag = 1; if (Rflag) { @@ -183,7 +188,7 @@ main(int argc, char *argv[]) if (strlcpy(to.p_path, target, sizeof(to.p_path)) >= sizeof(to.p_path)) errx(1, "%s: name too long", target); to.p_end = to.p_path + strlen(to.p_path); - if (to.p_path == to.p_end) { + if (to.p_path == to.p_end) { *to.p_end++ = '.'; *to.p_end = 0; } @@ -240,10 +245,10 @@ main(int argc, char *argv[]) type = FILE_TO_FILE; if (have_trailing_slash && type == FILE_TO_FILE) { - if (r == -1) + if (r == -1) { errx(1, "directory %s does not exist", - to.p_path); - else + to.p_path); + } else errx(1, "%s is not a directory", to.p_path); } } else @@ -294,8 +299,8 @@ copy(char *argv[], enum op type, int fts /* * If we are in case (2) or (3) above, we need to append the - * source name to the target name. - */ + * source name to the target name. + */ if (type != FILE_TO_FILE) { /* * Need to remember the roots of traversals to create @@ -374,7 +379,8 @@ copy(char *argv[], enum op type, int fts mode = curr->fts_statp->st_mode; if ((mode & (S_ISUID | S_ISGID | S_ISTXT)) || ((mode | S_IRWXU) & mask) != (mode & mask)) - if (chmod(to.p_path, mode & mask) != 0){ + if (chmod(to.p_path, mode & mask) != + 0) { warn("chmod: %s", to.p_path); rval = 1; } @@ -382,7 +388,7 @@ copy(char *argv[], enum op type, int fts continue; } - /* Not an error but need to remember it happened */ + /* Not an error but need to remember it happened. */ if (stat(to.p_path, &to_stat) == -1) dne = 1; else { @@ -408,7 +414,7 @@ copy(char *argv[], enum op type, int fts switch (curr->fts_statp->st_mode & S_IFMT) { case S_IFLNK: - /* Catch special case of a non-dangling symlink */ + /* Catch special case of a non-dangling symlink. */ if ((fts_options & FTS_LOGICAL) || ((fts_options & FTS_COMFOLLOW) && curr->fts_level == 0)) { @@ -433,7 +439,7 @@ copy(char *argv[], enum op type, int fts * modified by the umask. Trade-off between being * able to write the directory (if from directory is * 555) and not causing a permissions race. If the - * umask blocks owner writes, we fail.. + * umask blocks owner writes, we fail. */ if (dne) { if (mkdir(to.p_path, @@ -452,7 +458,7 @@ copy(char *argv[], enum op type, int fts break; case S_IFBLK: case S_IFCHR: - if (Rflag) { + if (Rflag && !sflag) { if (copy_special(curr->fts_statp, !dne)) badcp = rval = 1; } else { @@ -462,10 +468,10 @@ copy(char *argv[], enum op type, int fts break; case S_IFSOCK: warnx("%s is a socket (not copied).", - curr->fts_path); + curr->fts_path); break; case S_IFIFO: - if (Rflag) { + if (Rflag && !sflag) { if (copy_fifo(curr->fts_statp, !dne)) badcp = rval = 1; } else { Modified: projects/clang-trunk/bin/cp/extern.h ============================================================================== --- projects/clang-trunk/bin/cp/extern.h Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/bin/cp/extern.h Tue Jun 9 19:14:27 2015 (r284188) @@ -37,7 +37,7 @@ typedef struct { } PATH_T; extern PATH_T to; -extern int fflag, iflag, lflag, nflag, pflag, vflag; +extern int fflag, iflag, lflag, nflag, pflag, sflag, vflag; extern volatile sig_atomic_t info; __BEGIN_DECLS Modified: projects/clang-trunk/bin/cp/utils.c ============================================================================== --- projects/clang-trunk/bin/cp/utils.c Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/bin/cp/utils.c Tue Jun 9 19:14:27 2015 (r284188) @@ -57,15 +57,19 @@ __FBSDID("$FreeBSD$"); #define cp_pct(x, y) ((y == 0) ? 0 : (int)(100.0 * (x) / (y))) -/* Memory strategy threshold, in pages: if physmem is larger then this, use a - * large buffer */ +/* + * Memory strategy threshold, in pages: if physmem is larger then this, use a + * large buffer. + */ #define PHYSPAGES_THRESHOLD (32*1024) -/* Maximum buffer size in bytes - do not allow it to grow larger than this */ +/* Maximum buffer size in bytes - do not allow it to grow larger than this. */ #define BUFSIZE_MAX (2*1024*1024) -/* Small (default) buffer size in bytes. It's inefficient for this to be - * smaller than MAXPHYS */ +/* + * Small (default) buffer size in bytes. It's inefficient for this to be + * smaller than MAXPHYS. + */ #define BUFSIZE_SMALL (MAXPHYS) int @@ -77,13 +81,15 @@ copy_file(const FTSENT *entp, int dne) ssize_t wcount; size_t wresid; off_t wtotal; - int ch, checkch, from_fd = 0, rcount, rval, to_fd = 0; + int ch, checkch, from_fd, rcount, rval, to_fd; char *bufp; #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED char *p; #endif - if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) { + from_fd = to_fd = -1; + if (!lflag && !sflag && + (from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) { warn("%s", entp->fts_path); return (1); } @@ -103,63 +109,65 @@ copy_file(const FTSENT *entp, int dne) if (nflag) { if (vflag) printf("%s not overwritten\n", to.p_path); - (void)close(from_fd); - return (1); + rval = 1; + goto done; } else if (iflag) { (void)fprintf(stderr, "overwrite %s? %s", - to.p_path, YESNO); + to.p_path, YESNO); checkch = ch = getchar(); while (ch != '\n' && ch != EOF) ch = getchar(); if (checkch != 'y' && checkch != 'Y') { - (void)close(from_fd); (void)fprintf(stderr, "not overwritten\n"); - return (1); + rval = 1; + goto done; } } - + if (fflag) { - /* remove existing destination file name, - * create a new file */ - (void)unlink(to.p_path); - if (!lflag) - to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT, - fs->st_mode & ~(S_ISUID | S_ISGID)); - } else { - if (!lflag) - /* overwrite existing destination file name */ - to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0); + /* + * Remove existing destination file name create a new + * file. + */ + (void)unlink(to.p_path); + if (!lflag && !sflag) { + to_fd = open(to.p_path, + O_WRONLY | O_TRUNC | O_CREAT, + fs->st_mode & ~(S_ISUID | S_ISGID)); + } + } else if (!lflag && !sflag) { + /* Overwrite existing destination file name. */ + to_fd = open(to.p_path, O_WRONLY | O_TRUNC, 0); } - } else { - if (!lflag) - to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT, - fs->st_mode & ~(S_ISUID | S_ISGID)); + } else if (!lflag && !sflag) { + to_fd = open(to.p_path, O_WRONLY | O_TRUNC | O_CREAT, + fs->st_mode & ~(S_ISUID | S_ISGID)); } - - if (to_fd == -1) { + + if (!lflag && !sflag && to_fd == -1) { warn("%s", to.p_path); - (void)close(from_fd); - return (1); + rval = 1; + goto done; } rval = 0; - if (!lflag) { + if (!lflag && !sflag) { /* - * Mmap and write if less than 8M (the limit is so we don't totally - * trash memory on big files. This is really a minor hack, but it - * wins some CPU back. + * Mmap and write if less than 8M (the limit is so we don't + * totally trash memory on big files. This is really a minor + * hack, but it wins some CPU back. * Some filesystems, such as smbnetfs, don't support mmap, * so this is a best-effort attempt. */ #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED if (S_ISREG(fs->st_mode) && fs->st_size > 0 && - fs->st_size <= 8 * 1024 * 1024 && + fs->st_size <= 8 * 1024 * 1024 && (p = mmap(NULL, (size_t)fs->st_size, PROT_READ, MAP_SHARED, from_fd, (off_t)0)) != MAP_FAILED) { wtotal = 0; for (bufp = p, wresid = fs->st_size; ; - bufp += wcount, wresid -= (size_t)wcount) { + bufp += wcount, wresid -= (size_t)wcount) { wcount = write(to_fd, bufp, wresid); if (wcount <= 0) break; @@ -204,7 +212,7 @@ copy_file(const FTSENT *entp, int dne) wtotal = 0; while ((rcount = read(from_fd, buf, bufsize)) > 0) { for (bufp = buf, wresid = rcount; ; - bufp += wcount, wresid -= wcount) { + bufp += wcount, wresid -= wcount) { wcount = write(to_fd, bufp, wresid); if (wcount <= 0) break; @@ -230,13 +238,18 @@ copy_file(const FTSENT *entp, int dne) rval = 1; } } - } else { + } else if (lflag) { if (link(entp->fts_path, to.p_path)) { warn("%s", to.p_path); rval = 1; } + } else if (sflag) { + if (symlink(entp->fts_path, to.p_path)) { + warn("%s", to.p_path); + rval = 1; + } } - + /* * Don't remove the target even after an error. The target might * not be a regular file, or its attributes might be important, @@ -244,7 +257,7 @@ copy_file(const FTSENT *entp, int dne) * to remove it if we created it and its length is 0. */ - if (!lflag) { + if (!lflag && !sflag) { if (pflag && setfile(fs, to_fd)) rval = 1; if (pflag && preserve_fd_acls(from_fd, to_fd) != 0) @@ -255,8 +268,9 @@ copy_file(const FTSENT *entp, int dne) } } - (void)close(from_fd); - +done: + if (from_fd != -1) + (void)close(from_fd); return (rval); } @@ -338,7 +352,7 @@ setfile(struct stat *fs, int fd) fdval = fd != -1; islink = !fdval && S_ISLNK(fs->st_mode); fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX | - S_IRWXU | S_IRWXG | S_IRWXO; + S_IRWXU | S_IRWXG | S_IRWXO; tspec[0] = fs->st_atim; tspec[1] = fs->st_mtim; @@ -353,7 +367,7 @@ setfile(struct stat *fs, int fd) else { gotstat = 1; ts.st_mode &= S_ISUID | S_ISGID | S_ISVTX | - S_IRWXU | S_IRWXG | S_IRWXO; + S_IRWXU | S_IRWXG | S_IRWXO; } /* * Changing the ownership probably won't succeed, unless we're root @@ -477,7 +491,7 @@ preserve_dir_acls(struct stat *fs, char return (0); /* - * If the file is a link we will not follow it + * If the file is a link we will not follow it. */ if (S_ISLNK(fs->st_mode)) { aclgetf = acl_get_link_np; @@ -536,8 +550,10 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", -"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file target_file", -" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file ... " -"target_directory"); + "usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpsvx] " + "source_file target_file", + " cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpsvx] " + "source_file ... " + "target_directory"); exit(EX_USAGE); } Modified: projects/clang-trunk/bin/ls/ls.c ============================================================================== --- projects/clang-trunk/bin/ls/ls.c Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/bin/ls/ls.c Tue Jun 9 19:14:27 2015 (r284188) @@ -413,9 +413,14 @@ main(int argc, char *argv[]) /* * If not -F, -P, -d or -l options, follow any symbolic links listed on - * the command line. + * the command line, unless in color mode in which case we need to + * distinguish file type for a symbolic link itself and its target. */ - if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash)) + if (!f_nofollow && !f_longform && !f_listdir && (!f_type || f_slash) +#ifdef COLORLS + && !f_color +#endif + ) fts_options |= FTS_COMFOLLOW; /* Modified: projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Tue Jun 9 19:14:27 2015 (r284188) @@ -156,6 +156,21 @@ typedef struct dt_module { #define DT_DM_KERNEL 0x2 /* module is associated with a kernel object */ #define DT_DM_PRIMARY 0x4 /* module is a krtld primary kernel object */ +#ifdef __FreeBSD__ +/* + * A representation of a FreeBSD kernel module, used when checking module + * dependencies. This differs from dt_module_t, which refers to a KLD in the + * case of kernel probes. Since modules can be identified regardless of whether + * they've been compiled into the kernel, we use them to identify DTrace + * modules. + */ +typedef struct dt_kmodule { + struct dt_kmodule *dkm_next; /* hash table entry */ + char *dkm_name; /* string name of module */ + dt_module_t *dkm_module; /* corresponding KLD module */ +} dt_kmodule_t; +#endif + typedef struct dt_provmod { char *dp_name; /* name of provider module */ struct dt_provmod *dp_next; /* next module */ @@ -235,6 +250,9 @@ struct dtrace_hdl { dt_idhash_t *dt_tls; /* hash table of thread-local identifiers */ dt_list_t dt_modlist; /* linked list of dt_module_t's */ dt_module_t **dt_mods; /* hash table of dt_module_t's */ +#ifdef __FreeBSD__ + dt_kmodule_t **dt_kmods; /* hash table of dt_kmodule_t's */ +#endif uint_t dt_modbuckets; /* number of module hash buckets */ uint_t dt_nmods; /* number of modules in hash and list */ dt_provmod_t *dt_provmod; /* linked list of provider modules */ Modified: projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c ============================================================================== --- projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Tue Jun 9 19:14:27 2015 (r284188) @@ -37,6 +37,7 @@ #else #include <sys/param.h> #include <sys/linker.h> +#include <sys/module.h> #include <sys/stat.h> #endif @@ -542,6 +543,22 @@ dt_module_lookup_by_ctf(dtrace_hdl_t *dt return (ctfp ? ctf_getspecific(ctfp) : NULL); } +#ifdef __FreeBSD__ +dt_kmodule_t * +dt_kmodule_lookup(dtrace_hdl_t *dtp, const char *name) +{ + uint_t h = dt_strtab_hash(name, NULL) % dtp->dt_modbuckets; + dt_kmodule_t *dkmp; + + for (dkmp = dtp->dt_kmods[h]; dkmp != NULL; dkmp = dkmp->dkm_next) { + if (strcmp(dkmp->dkm_name, name) == 0) + return (dkmp); + } + + return (NULL); +} +#endif + static int dt_module_load_sect(dtrace_hdl_t *dtp, dt_module_t *dmp, ctf_sect_t *ctsp) { @@ -1124,6 +1141,12 @@ dt_module_update(dtrace_hdl_t *dtp, stru char fname[MAXPATHLEN]; struct stat64 st; int fd, err, bits; +#ifdef __FreeBSD__ + struct module_stat ms; + dt_kmodule_t *dkmp; + uint_t h; + int modid; +#endif dt_module_t *dmp; const char *s; @@ -1270,6 +1293,33 @@ dt_module_update(dtrace_hdl_t *dtp, stru if (dmp->dm_info.objfs_info_primary) dmp->dm_flags |= DT_DM_PRIMARY; +#ifdef __FreeBSD__ + ms.version = sizeof(ms); + for (modid = kldfirstmod(k_stat->id); modid > 0; + modid = modnext(modid)) { + if (modstat(modid, &ms) != 0) { + dt_dprintf("modstat failed for id %d in %s: %s\n", + modid, k_stat->name, strerror(errno)); + continue; + } + if (dt_kmodule_lookup(dtp, ms.name) != NULL) + continue; + + dkmp = malloc(sizeof (*dkmp)); + if (dkmp == NULL) { + dt_dprintf("failed to allocate memory\n"); + dt_module_destroy(dtp, dmp); + return; + } + + h = dt_strtab_hash(ms.name, NULL) % dtp->dt_modbuckets; + dkmp->dkm_next = dtp->dt_kmods[h]; + dkmp->dkm_name = strdup(ms.name); + dkmp->dkm_module = dmp; + dtp->dt_kmods[h] = dkmp; + } +#endif + dt_dprintf("opened %d-bit module %s (%s) [%d]\n", bits, dmp->dm_name, dmp->dm_file, dmp->dm_modid); } Modified: projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h ============================================================================== --- projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h Tue Jun 9 19:14:27 2015 (r284188) @@ -44,6 +44,10 @@ extern void dt_module_destroy(dtrace_hdl extern dt_module_t *dt_module_lookup_by_name(dtrace_hdl_t *, const char *); extern dt_module_t *dt_module_lookup_by_ctf(dtrace_hdl_t *, ctf_file_t *); +#ifdef __FreeBSD__ +extern dt_kmodule_t *dt_kmodule_lookup(dtrace_hdl_t *, const char *); +#endif + extern int dt_module_hasctf(dtrace_hdl_t *, dt_module_t *); extern ctf_file_t *dt_module_getctf(dtrace_hdl_t *, dt_module_t *); extern dt_ident_t *dt_module_extern(dtrace_hdl_t *, dt_module_t *, Modified: projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Tue Jun 9 19:14:27 2015 (r284188) @@ -1178,6 +1178,9 @@ alloc: #endif dtp->dt_modbuckets = _dtrace_strbuckets; dtp->dt_mods = calloc(dtp->dt_modbuckets, sizeof (dt_module_t *)); +#ifdef __FreeBSD__ + dtp->dt_kmods = calloc(dtp->dt_modbuckets, sizeof (dt_module_t *)); +#endif dtp->dt_provbuckets = _dtrace_strbuckets; dtp->dt_provs = calloc(dtp->dt_provbuckets, sizeof (dt_provider_t *)); dt_proc_hash_create(dtp); @@ -1199,6 +1202,7 @@ alloc: if (dtp->dt_mods == NULL || dtp->dt_provs == NULL || dtp->dt_procs == NULL || dtp->dt_ld_path == NULL || #ifdef __FreeBSD__ + dtp->dt_kmods == NULL || dtp->dt_objcopy_path == NULL || #endif dtp->dt_cpp_path == NULL || dtp->dt_cpp_argv == NULL) @@ -1621,6 +1625,10 @@ dtrace_close(dtrace_hdl_t *dtp) dtrace_prog_t *pgp; dt_xlator_t *dxp; dt_dirpath_t *dirp; +#ifdef __FreeBSD__ + dt_kmodule_t *dkm; + uint_t h; +#endif int i; if (dtp->dt_procs != NULL) @@ -1648,6 +1656,15 @@ dtrace_close(dtrace_hdl_t *dtp) if (dtp->dt_tls != NULL) dt_idhash_destroy(dtp->dt_tls); +#ifdef __FreeBSD__ + for (h = 0; h < dtp->dt_modbuckets; h++) + while ((dkm = dtp->dt_kmods[h]) != NULL) { + dtp->dt_kmods[h] = dkm->dkm_next; + free(dkm->dkm_name); + free(dkm); + } +#endif + while ((dmp = dt_list_next(&dtp->dt_modlist)) != NULL) dt_module_destroy(dtp, dmp); @@ -1697,6 +1714,9 @@ dtrace_close(dtrace_hdl_t *dtp) #endif free(dtp->dt_mods); +#ifdef __FreeBSD__ + free(dtp->dt_kmods); +#endif free(dtp->dt_provs); free(dtp); } Modified: projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c ============================================================================== --- projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c Tue Jun 9 19:14:27 2015 (r284188) @@ -278,6 +278,14 @@ dt_pragma_depends(const char *prname, dt } else if (strcmp(cnp->dn_string, "module") == 0) { dt_module_t *mp = dt_module_lookup_by_name(dtp, nnp->dn_string); found = mp != NULL && dt_module_getctf(dtp, mp) != NULL; +#ifdef __FreeBSD__ + if (!found) { + dt_kmodule_t *dkmp = dt_kmodule_lookup(dtp, + nnp->dn_string); + found = dkmp != NULL && + dt_module_getctf(dtp, dkmp->dkm_module) != NULL; + } +#endif } else if (strcmp(cnp->dn_string, "library") == 0) { if (yypcb->pcb_cflags & DTRACE_C_CTL) { assert(dtp->dt_filetag != NULL); Modified: projects/clang-trunk/contrib/dtc/checks.c ============================================================================== --- projects/clang-trunk/contrib/dtc/checks.c Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/contrib/dtc/checks.c Tue Jun 9 19:14:27 2015 (r284188) @@ -624,11 +624,11 @@ static void check_avoid_default_addr_siz if (!reg && !ranges) return; - if ((node->parent->addr_cells == -1)) + if (node->parent->addr_cells == -1) FAIL(c, "Relying on default #address-cells value for %s", node->fullpath); - if ((node->parent->size_cells == -1)) + if (node->parent->size_cells == -1) FAIL(c, "Relying on default #size-cells value for %s", node->fullpath); } Modified: projects/clang-trunk/contrib/mdocml/read.c ============================================================================== --- projects/clang-trunk/contrib/mdocml/read.c Tue Jun 9 19:08:54 2015 (r284187) +++ projects/clang-trunk/contrib/mdocml/read.c Tue Jun 9 19:14:27 2015 (r284188) @@ -28,6 +28,7 @@ #include <assert.h> #include <ctype.h> #include <errno.h> +#include <err.h> #include <fcntl.h> #include <stdarg.h> #include <stdint.h> @@ -35,6 +36,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <zlib.h> #include "mandoc.h" #include "mandoc_aux.h" @@ -792,6 +794,27 @@ mparse_readfd(struct mparse *curp, int f return(curp->file_status); } +/* + * hack to avoid depending on gnuzip(1) waiting for upstream proper + * support + */ +static int +gunzip(const char *file) +{ + gzFile gz; + char buf[8192]; + int r; + + gz = gzopen(file, "r"); + if (gz == NULL) + err(EXIT_FAILURE, "cannot open %s", file); + + while ((r = gzread(gz, buf, sizeof(buf))) > 0) + fwrite(buf, 1, r, stdout); + + gzclose(gz); + return (EXIT_SUCCESS); +} enum mandoclevel mparse_open(struct mparse *curp, int *fd, const char *file) { @@ -846,9 +869,7 @@ mparse_open(struct mparse *curp, int *fd perror("dup"); exit((int)MANDOCLEVEL_SYSERR); } - execlp("gunzip", "gunzip", "-c", file, NULL); - perror("exec"); - exit((int)MANDOCLEVEL_SYSERR); + exit(gunzip(file)); default: close(pfd[1]); *fd = pfd[0]; Copied: projects/clang-trunk/contrib/top/top.local.hs (from r284187, head/contrib/top/top.local.hs) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang-trunk/contrib/top/top.local.hs Tue Jun 9 19:14:27 2015 (r284188, copy of r284187, head/contrib/top/top.local.hs) @@ -0,0 +1,68 @@ +/* + * Top - a top users display for Berkeley Unix + * + * Definitions for things that might vary between installations. + */ + +/* + * The space command forces an immediate update. Sometimes, on loaded + * systems, this update will take a significant period of time (because all + * the output is buffered). So, if the short-term load average is above + * "LoadMax", then top will put the cursor home immediately after the space + * is pressed before the next update is attempted. This serves as a visual + * acknowledgement of the command. On Suns, "LoadMax" will get multiplied by + * "FSCALE" before being compared to avenrun[0]. Therefore, "LoadMax" + * should always be specified as a floating point number. + */ +#ifndef LoadMax +#define LoadMax %LoadMax% +#endif + +/* + * "Table_size" defines the size of the hash tables used to map uid to + * username. The number of users in /etc/passwd CANNOT be greater than + * this number. If the error message "table overflow: too many users" + * is printed by top, then "Table_size" needs to be increased. Things will + * work best if the number is a prime number that is about twice the number + * of lines in /etc/passwd. + */ +#ifndef Table_size +#define Table_size %TableSize% +#endif + +/* + * "Nominal_TOPN" is used as the default TOPN when Default_TOPN is Infinity + * and the output is a dumb terminal. If we didn't do this, then + * installations who use a default TOPN of Infinity will get every + * process in the system when running top on a dumb terminal (or redirected + * to a file). Note that Nominal_TOPN is a default: it can still be + * overridden on the command line, even with the value "infinity". + */ +#ifndef Nominal_TOPN +#define Nominal_TOPN %NominalTopn% +#endif + +#ifndef Default_TOPN +#define Default_TOPN %topn% +#endif + +#ifndef Default_DELAY +#define Default_DELAY %delay% +#endif + +/* + * If the local system's getpwnam interface uses random access to retrieve + * a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining + * RANDOM_PW will take advantage of that fact. If RANDOM_PW is defined, + * then getpwnam is used and the result is cached. If not, then getpwent + * is used to read and cache the password entries sequentially until the + * desired one is found. + * + * We initially set RANDOM_PW to something which is controllable by the + * Configure script. Then if its value is 0, we undef it. + */ + +#define RANDOM_PW %random% +#if RANDOM_PW == 0 +#undef RANDOM_PW +#endif Copied: projects/clang-trunk/contrib/top/top.xs (from r284187, head/contrib/top/top.xs) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang-trunk/contrib/top/top.xs Tue Jun 9 19:14:27 2015 (r284188, copy of r284187, head/contrib/top/top.xs) @@ -0,0 +1,448 @@ +.\" NOTE: changes to the manual page for "top" should be made in the +.\" file "top.X" and NOT in the file "top.1". +.\" $FreeBSD$ +.nr N %topn% +.nr D %delay% +.TH TOP 1 Local +.UC 4 +.SH NAME +top \- display and update information about the top cpu processes +.SH SYNOPSIS +.B top +[ +.B \-abCHIijnPqStuvz +] [ +.BI \-d count +] [ +.BI \-m io | cpu +] [ +.BI \-o field +] [ +.BI \-s time +] [ +.BI \-J jail +] [ +.BI \-U username +] [ +.I number +] +.SH DESCRIPTION +.\" This defines appropriate quote strings for nroff and troff +.ds lq \&" +.ds rq \&" +.if t .ds lq `` +.if t .ds rq '' +.\" Just in case these number registers aren't set yet... +.if \nN==0 .nr N 10 +.if \nD==0 .nr D 2 +.I Top +displays the top +.if !\nN==-1 \nN +processes on the system and periodically updates this information. +.if \nN==-1 \ +\{\ +If standard output is an intelligent terminal (see below) then +as many processes as will fit on the terminal screen are displayed +by default. Otherwise, a good number of them are shown (around 20). +.\} +Raw cpu percentage is used to rank the processes. If +.I number +is given, then the top +.I number +processes will be displayed instead of the default. +.PP +.I Top +makes a distinction between terminals that support advanced capabilities +and those that do not. This +distinction affects the choice of defaults for certain options. In the +remainder of this document, an \*(lqintelligent\*(rq terminal is one that +supports cursor addressing, clear screen, and clear to end of line. +Conversely, a \*(lqdumb\*(rq terminal is one that does not support such +features. If the output of +.I top +is redirected to a file, it acts as if it were being run on a dumb +terminal. +.SH OPTIONS +.TP +.B \-C +Toggle CPU display mode. +By default top displays the weighted CPU percentage in the WCPU column +(this is the same value that +.IR ps (1) +displays as CPU). +Each time +.B \-C +flag is passed it toggles between \*(lqraw cpu\*(rq mode +and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or +the \*(lqWCPU\*(rq column respectively. +.TP +.B \-S +Show system processes in the display. Normally, system processes such as +the pager and the swapper are not shown. This option makes them visible. +.TP +.B \-a +Display command names derived from the argv[] vector, rather than real +executable name. It's useful when you want to watch applications, that +puts their status information there. If the real name differs from argv[0], +it will be displayed in parenthesis. +.TP +.B \-b +Use \*(lqbatch\*(rq mode. In this mode, all input from the terminal is +ignored. Interrupt characters (such as ^C and ^\e) still have an effect. +This is the default on a dumb terminal, or when the output is not a terminal. +.TP +.B \-H +Display each thread for a multithreaded process individually. +By default a single summary line is displayed for each process. +.TP +.B \-i +Use \*(lqinteractive\*(rq mode. In this mode, any input is immediately +read for processing. See the section on \*(lqInteractive Mode\*(rq +for an explanation of +which keys perform what functions. After the command is processed, the +screen will immediately be updated, even if the command was not +understood. This mode is the default when standard output is an +intelligent terminal. +.TP +.B \-I +Do not display idle processes. +By default, top displays both active and idle processes. +.TP +.B \-j +Display the +.IR jail (8) +ID. +.TP +.B \-t +Do not display the +.I top +process. +.TP +.BI \-m display +Display either 'cpu' or 'io' statistics. Default is 'cpu'. +.TP +.B \-n +Use \*(lqnon-interactive\*(rq mode. This is identical to \*(lqbatch\*(rq +mode. +.TP +.B \-P +Display per-cpu CPU usage statistics. +.TP +.B \-q +Renice +.I top +to -20 so that it will run faster. This can be used when the system is +being very sluggish to improve the possibility of discovering the problem. +This option can only be used by root. +.TP +.B \-u +Do not take the time to map uid numbers to usernames. Normally, +.I top +will read as much of the file \*(lq/etc/passwd\*(rq as is necessary to map +all the user id numbers it encounters into login names. This option +disables all that, while possibly decreasing execution time. The uid +numbers are displayed instead of the names. +.TP +.B \-v +Write version number information to stderr then exit immediately. +No other processing takes place when this option is used. To see current +revision information while top is running, use the help command \*(lq?\*(rq. +.TP +.B \-z +Do not display the system idle process. +.TP +.BI \-d count +Show only +.I count +displays, then exit. A display is considered to be one update of the +screen. This option allows the user to select the number of displays he *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506091914.t59JESWi064057>