Date: Tue, 28 Oct 2014 13:38:31 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r273775 - in projects/sendfile: . bin/sh bin/sh/tests/builtins contrib/file/magic/Magdir contrib/hyperv/tools contrib/libxo contrib/netbsd-tests/lib/libc/gen contrib/netbsd-tests/lib/li... Message-ID: <201410281338.s9SDcViO058731@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Tue Oct 28 13:38:30 2014 New Revision: 273775 URL: https://svnweb.freebsd.org/changeset/base/273775 Log: Merge head r258543 through r273773. Added: projects/sendfile/bin/sh/tests/builtins/getopts9.0 - copied unchanged from r273773, head/bin/sh/tests/builtins/getopts9.0 projects/sendfile/bin/sh/tests/builtins/getopts9.0.stdout - copied unchanged from r273773, head/bin/sh/tests/builtins/getopts9.0.stdout projects/sendfile/contrib/libxo/ - copied from r273773, head/contrib/libxo/ projects/sendfile/lib/libxo/ - copied from r273773, head/lib/libxo/ projects/sendfile/share/man/man4/virtio_console.4 - copied unchanged from r273773, head/share/man/man4/virtio_console.4 projects/sendfile/sys/amd64/vmm/io/vpmtmr.c - copied unchanged from r273773, head/sys/amd64/vmm/io/vpmtmr.c projects/sendfile/sys/amd64/vmm/io/vpmtmr.h - copied unchanged from r273773, head/sys/amd64/vmm/io/vpmtmr.h projects/sendfile/sys/dev/virtio/console/ - copied from r273773, head/sys/dev/virtio/console/ projects/sendfile/sys/modules/virtio/console/ - copied from r273773, head/sys/modules/virtio/console/ projects/sendfile/usr.bin/timeout/tests/ - copied from r273773, head/usr.bin/timeout/tests/ projects/sendfile/usr.bin/xo/ - copied from r273773, head/usr.bin/xo/ projects/sendfile/usr.sbin/ctld/isns.c - copied unchanged from r273773, head/usr.sbin/ctld/isns.c projects/sendfile/usr.sbin/ctld/isns.h - copied unchanged from r273773, head/usr.sbin/ctld/isns.h Deleted: projects/sendfile/contrib/xz/po/ projects/sendfile/share/man/man8/hv_kvp_daemon.8 projects/sendfile/usr.sbin/bhyve/pmtmr.c projects/sendfile/usr.sbin/pkg/elf_tables.h Modified: projects/sendfile/Makefile.inc1 projects/sendfile/bin/sh/eval.c projects/sendfile/bin/sh/options.c projects/sendfile/bin/sh/options.h projects/sendfile/contrib/file/magic/Magdir/filesystems projects/sendfile/contrib/hyperv/tools/hv_kvp_daemon.8 projects/sendfile/contrib/netbsd-tests/lib/libc/gen/t_sleep.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_link.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_listen.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mknod.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mlock.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mmap.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msync.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_poll.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_revoke.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_select.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_sigaction.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_stat.c projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_truncate.c projects/sendfile/contrib/netcat/netcat.c projects/sendfile/contrib/tzdata/africa projects/sendfile/contrib/tzdata/antarctica projects/sendfile/contrib/tzdata/asia projects/sendfile/contrib/tzdata/australasia projects/sendfile/contrib/tzdata/backward projects/sendfile/contrib/tzdata/europe projects/sendfile/contrib/tzdata/northamerica projects/sendfile/contrib/tzdata/southamerica projects/sendfile/contrib/tzdata/zone.tab projects/sendfile/contrib/tzdata/zone1970.tab projects/sendfile/contrib/xz/ChangeLog projects/sendfile/contrib/xz/FREEBSD-Xlist projects/sendfile/contrib/xz/THANKS projects/sendfile/contrib/xz/TODO projects/sendfile/contrib/xz/src/liblzma/api/lzma/block.h projects/sendfile/contrib/xz/src/liblzma/api/lzma/version.h projects/sendfile/contrib/xz/src/liblzma/check/crc32_fast.c projects/sendfile/contrib/xz/src/liblzma/check/sha256.c projects/sendfile/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c projects/sendfile/contrib/xz/src/xz/coder.c projects/sendfile/contrib/xz/src/xz/signals.c projects/sendfile/contrib/xz/src/xz/suffix.c projects/sendfile/etc/mtree/BSD.include.dist projects/sendfile/etc/mtree/BSD.tests.dist projects/sendfile/include/Makefile projects/sendfile/include/semaphore.h projects/sendfile/lib/Makefile projects/sendfile/lib/libc/gen/getgrouplist.3 projects/sendfile/lib/libc/gen/initgroups.3 projects/sendfile/lib/libc/gen/sem_destroy.3 projects/sendfile/lib/libc/gen/sem_getvalue.3 projects/sendfile/lib/libc/gen/sem_init.3 projects/sendfile/lib/libc/gen/sem_new.c projects/sendfile/lib/libc/gen/sem_open.3 projects/sendfile/lib/libc/gen/sem_post.3 projects/sendfile/lib/libc/gen/sem_timedwait.3 projects/sendfile/lib/libc/gen/sem_wait.3 projects/sendfile/lib/libc/net/nsdispatch.c projects/sendfile/lib/libc/rpc/clnt_vc.c projects/sendfile/lib/libc/stdio/open_memstream.3 projects/sendfile/lib/libc/stdlib/lsearch.c projects/sendfile/lib/libnv/Makefile projects/sendfile/lib/libusb/Makefile projects/sendfile/lib/libz/Makefile projects/sendfile/release/Makefile projects/sendfile/sbin/ifconfig/sfp.c projects/sendfile/sbin/ipfw/ipfw.8 projects/sendfile/sbin/ipfw/ipfw2.c projects/sendfile/share/man/man3/pthread_cleanup_pop.3 projects/sendfile/share/man/man3/pthread_cleanup_push.3 projects/sendfile/share/man/man4/Makefile projects/sendfile/share/man/man4/ctl.4 projects/sendfile/share/man/man4/urtwn.4 projects/sendfile/share/man/man4/virtio.4 projects/sendfile/share/man/man8/Makefile projects/sendfile/share/man/man9/fpu_kern.9 projects/sendfile/sys/amd64/amd64/pmap.c projects/sendfile/sys/amd64/amd64/uio_machdep.c projects/sendfile/sys/amd64/conf/GENERIC projects/sendfile/sys/amd64/include/pmap.h projects/sendfile/sys/amd64/include/vmm.h (contents, props changed) projects/sendfile/sys/amd64/include/vmparam.h projects/sendfile/sys/amd64/vmm/amd/svm.c (contents, props changed) projects/sendfile/sys/amd64/vmm/amd/vmcb.c (contents, props changed) projects/sendfile/sys/amd64/vmm/io/vatpic.c projects/sendfile/sys/amd64/vmm/io/vatpic.h projects/sendfile/sys/amd64/vmm/io/vatpit.c projects/sendfile/sys/amd64/vmm/io/vatpit.h projects/sendfile/sys/amd64/vmm/vmm.c projects/sendfile/sys/amd64/vmm/vmm_ioport.c projects/sendfile/sys/amd64/vmm/vmm_ioport.h projects/sendfile/sys/arm/arm/busdma_machdep-v6.c projects/sendfile/sys/arm/arm/nexus.c projects/sendfile/sys/arm/arm/pl310.c projects/sendfile/sys/arm/arm/pmap-v6.c projects/sendfile/sys/arm/at91/std.atmel projects/sendfile/sys/arm/broadcom/bcm2835/bcm2835_bsc.c projects/sendfile/sys/arm/broadcom/bcm2835/bcm2835_bscvar.h projects/sendfile/sys/arm/conf/ATMEL projects/sendfile/sys/arm/freescale/imx/imx6_ccm.c projects/sendfile/sys/arm/freescale/imx/imx6_machdep.c projects/sendfile/sys/arm/ti/cpsw/if_cpsw.c projects/sendfile/sys/cam/ata/ata_da.c projects/sendfile/sys/cam/ctl/ctl.c projects/sendfile/sys/cam/ctl/ctl.h projects/sendfile/sys/cam/ctl/ctl_cmd_table.c projects/sendfile/sys/cam/ctl/ctl_private.h projects/sendfile/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c projects/sendfile/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c projects/sendfile/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c projects/sendfile/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h projects/sendfile/sys/cddl/dev/fbt/powerpc/fbt_isa.c projects/sendfile/sys/compat/freebsd32/freebsd32_misc.c projects/sendfile/sys/compat/freebsd32/freebsd32_util.h projects/sendfile/sys/conf/NOTES projects/sendfile/sys/conf/options projects/sendfile/sys/conf/options.arm projects/sendfile/sys/contrib/rdma/krping/krping.c projects/sendfile/sys/dev/acpi_support/acpi_ibm.c projects/sendfile/sys/dev/acpica/acpi.c projects/sendfile/sys/dev/acpica/acpi_hpet.c projects/sendfile/sys/dev/asmc/asmc.c projects/sendfile/sys/dev/cxgbe/firmware/t4fw_cfg.txt projects/sendfile/sys/dev/cxgbe/firmware/t5fw_cfg.txt projects/sendfile/sys/dev/cxgbe/iw_cxgbe/cm.c projects/sendfile/sys/dev/gpio/gpiobus.c projects/sendfile/sys/dev/gpio/gpiobusvar.h projects/sendfile/sys/dev/gpio/ofw_gpiobus.c projects/sendfile/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c projects/sendfile/sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c projects/sendfile/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c projects/sendfile/sys/dev/hyperv/utilities/hv_util.c projects/sendfile/sys/dev/iicbus/iicbus.h projects/sendfile/sys/dev/iicbus/iiconf.c projects/sendfile/sys/dev/puc/pucdata.c projects/sendfile/sys/dev/uart/uart_subr.c projects/sendfile/sys/dev/usb/net/if_smsc.c projects/sendfile/sys/dev/usb/usbdevs projects/sendfile/sys/dev/usb/wlan/if_urtwn.c projects/sendfile/sys/dev/vt/vt_core.c projects/sendfile/sys/fs/nfsclient/nfs_clvfsops.c projects/sendfile/sys/fs/nfsserver/nfs_nfsdkrpc.c projects/sendfile/sys/geom/eli/g_eli.c projects/sendfile/sys/geom/geom_disk.c projects/sendfile/sys/i386/conf/GENERIC projects/sendfile/sys/i386/conf/XEN projects/sendfile/sys/i386/i386/machdep.c projects/sendfile/sys/i386/i386/pmap.c projects/sendfile/sys/kern/kern_environment.c projects/sendfile/sys/kern/kern_ffclock.c projects/sendfile/sys/kern/kern_loginclass.c projects/sendfile/sys/kern/kern_prot.c projects/sendfile/sys/kern/kern_resource.c projects/sendfile/sys/kern/kern_syscalls.c projects/sendfile/sys/kern/kern_sysctl.c projects/sendfile/sys/kern/kern_umtx.c projects/sendfile/sys/kern/sys_generic.c projects/sendfile/sys/kern/sysv_msg.c projects/sendfile/sys/kern/sysv_sem.c projects/sendfile/sys/kern/sysv_shm.c projects/sendfile/sys/kern/uipc_mqueue.c projects/sendfile/sys/kern/uipc_sem.c projects/sendfile/sys/kern/vfs_aio.c projects/sendfile/sys/kern/vfs_bio.c projects/sendfile/sys/kgssapi/gss_impl.c projects/sendfile/sys/modules/dtrace/dtraceall/dtraceall.c projects/sendfile/sys/modules/linux/Makefile projects/sendfile/sys/modules/virtio/Makefile projects/sendfile/sys/modules/vmm/Makefile projects/sendfile/sys/net/bpf.c projects/sendfile/sys/net/if.c projects/sendfile/sys/net/if_gif.c projects/sendfile/sys/netinet/cc/cc.c projects/sendfile/sys/netinet/in_gif.c projects/sendfile/sys/netinet/sctp_output.c projects/sendfile/sys/netinet/sctp_syscalls.c projects/sendfile/sys/netinet/sctp_sysctl.c projects/sendfile/sys/netinet/siftr.c projects/sendfile/sys/netinet6/in6.c projects/sendfile/sys/netinet6/in6_gif.c projects/sendfile/sys/netinet6/in6_var.h projects/sendfile/sys/netipsec/key.c projects/sendfile/sys/netipsec/key.h projects/sendfile/sys/netpfil/ipfw/ip_fw_dynamic.c projects/sendfile/sys/netpfil/ipfw/ip_fw_table_algo.c projects/sendfile/sys/nfs/nfs_nfssvc.c projects/sendfile/sys/nlm/nlm_prot_impl.c projects/sendfile/sys/ofed/drivers/net/mlx4/en_netdev.c projects/sendfile/sys/pc98/conf/GENERIC projects/sendfile/sys/powerpc/conf/GENERIC projects/sendfile/sys/powerpc/conf/GENERIC64 projects/sendfile/sys/sparc64/conf/GENERIC projects/sendfile/sys/sparc64/sparc64/mem.c projects/sendfile/sys/sys/_umtx.h projects/sendfile/sys/sys/consio.h projects/sendfile/sys/sys/mbuf.h projects/sendfile/sys/sys/sysent.h projects/sendfile/sys/sys/umtx.h projects/sendfile/sys/x86/x86/identcpu.c projects/sendfile/tools/build/mk/OptionalObsoleteFiles.inc projects/sendfile/tools/regression/lib/libc/nss/test-gethostby.c projects/sendfile/tools/regression/zfs/misc.sh projects/sendfile/tools/regression/zfs/zpool/add/files.t projects/sendfile/tools/regression/zfs/zpool/add/option-f_size_mismatch.t projects/sendfile/tools/regression/zfs/zpool/add/option-f_type_mismatch.t projects/sendfile/tools/regression/zfs/zpool/create/files.t projects/sendfile/usr.bin/Makefile projects/sendfile/usr.bin/bluetooth/rfcomm_sppd/Makefile projects/sendfile/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 projects/sendfile/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c projects/sendfile/usr.bin/gzip/Makefile projects/sendfile/usr.bin/gzip/gzip.1 projects/sendfile/usr.bin/gzip/gzip.c projects/sendfile/usr.bin/gzip/zmore projects/sendfile/usr.bin/gzip/zmore.1 projects/sendfile/usr.bin/timeout/Makefile projects/sendfile/usr.bin/timeout/timeout.1 projects/sendfile/usr.bin/timeout/timeout.c projects/sendfile/usr.bin/truss/syscalls.c projects/sendfile/usr.bin/vmstat/vmstat.c projects/sendfile/usr.sbin/bhyve/Makefile projects/sendfile/usr.sbin/bhyve/rtc.c projects/sendfile/usr.sbin/ctladm/ctladm.8 projects/sendfile/usr.sbin/ctld/Makefile projects/sendfile/usr.sbin/ctld/ctl.conf.5 projects/sendfile/usr.sbin/ctld/ctld.c projects/sendfile/usr.sbin/ctld/ctld.h projects/sendfile/usr.sbin/ctld/discovery.c projects/sendfile/usr.sbin/ctld/login.c projects/sendfile/usr.sbin/ctld/parse.y projects/sendfile/usr.sbin/ctld/token.l projects/sendfile/usr.sbin/pciconf/pciconf.c projects/sendfile/usr.sbin/pkg/Makefile projects/sendfile/usr.sbin/pkg/config.c projects/sendfile/usr.sbin/pmcstat/pmcstat.8 projects/sendfile/usr.sbin/pw/pw_group.c projects/sendfile/usr.sbin/pw/tests/pw_modify.sh projects/sendfile/usr.sbin/vidcontrol/vidcontrol.1 projects/sendfile/usr.sbin/vidcontrol/vidcontrol.c Directory Properties: projects/sendfile/ (props changed) projects/sendfile/contrib/file/ (props changed) projects/sendfile/contrib/netcat/ (props changed) projects/sendfile/contrib/tzdata/ (props changed) projects/sendfile/contrib/xz/ (props changed) projects/sendfile/etc/ (props changed) projects/sendfile/include/ (props changed) projects/sendfile/lib/libc/ (props changed) projects/sendfile/lib/libz/ (props changed) projects/sendfile/sbin/ (props changed) projects/sendfile/sbin/ipfw/ (props changed) projects/sendfile/share/ (props changed) projects/sendfile/share/man/man4/ (props changed) projects/sendfile/sys/ (props changed) projects/sendfile/sys/amd64/vmm/ (props changed) projects/sendfile/sys/cddl/contrib/opensolaris/ (props changed) projects/sendfile/sys/conf/ (props changed) projects/sendfile/sys/dev/hyperv/ (props changed) projects/sendfile/sys/modules/vmm/ (props changed) projects/sendfile/usr.sbin/bhyve/ (props changed) Modified: projects/sendfile/Makefile.inc1 ============================================================================== --- projects/sendfile/Makefile.inc1 Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/Makefile.inc1 Tue Oct 28 13:38:30 2014 (r273775) @@ -323,9 +323,9 @@ X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${ X${BINUTIL}?= ${${BINUTIL}} .endif .endfor -WMAKEENV+= CC="${XCC} ${XFLAGS}" CXX="${XCXX} ${XFLAGS} ${XXFLAGS}" \ +WMAKEENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \ DEPFLAGS="${DEPFLAGS}" \ - CPP="${XCPP} ${XFLAGS}" \ + CPP="${XCPP} ${XCFLAGS}" \ AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \ RANLIB=${XRANLIB} STRINGS=${XSTRINGS} \ @@ -351,13 +351,13 @@ TARGET_ABI= gnueabi .endif .endif .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -XFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib -XXFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 -L${WORLDTMP}/../lib/libc++ +XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib +XCXXFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 -L${WORLDTMP}/../lib/libc++ DEPFLAGS+= -I${WORLDTMP}/usr/include/c++/v1 .else TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 -XFLAGS+= -target ${TARGET_TRIPLE} +XCFLAGS+= -target ${TARGET_TRIPLE} .endif .endif Modified: projects/sendfile/bin/sh/eval.c ============================================================================== --- projects/sendfile/bin/sh/eval.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/bin/sh/eval.c Tue Oct 28 13:38:30 2014 (r273775) @@ -1039,6 +1039,7 @@ evalcommand(union node *cmd, int flags, shellparam.reset = 1; shellparam.nparam = argc - 1; shellparam.p = argv + 1; + shellparam.optp = NULL; shellparam.optnext = NULL; INTOFF; savelocalvars = localvars; Modified: projects/sendfile/bin/sh/options.c ============================================================================== --- projects/sendfile/bin/sh/options.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/bin/sh/options.c Tue Oct 28 13:38:30 2014 (r273775) @@ -325,6 +325,7 @@ setparam(char **argv) shellparam.malloc = 1; shellparam.nparam = nparam; shellparam.p = newparam; + shellparam.optp = NULL; shellparam.reset = 1; shellparam.optnext = NULL; } @@ -344,6 +345,11 @@ freeparam(struct shparam *param) ckfree(*ap); ckfree(param->p); } + if (param->optp) { + for (ap = param->optp ; *ap ; ap++) + ckfree(*ap); + ckfree(param->optp); + } } @@ -417,20 +423,33 @@ getoptsreset(const char *value) int getoptscmd(int argc, char **argv) { - char **optbase = NULL; + char **optbase = NULL, **ap; + int i; if (argc < 3) error("usage: getopts optstring var [arg]"); - else if (argc == 3) - optbase = shellparam.p; - else - optbase = &argv[3]; if (shellparam.reset == 1) { + INTOFF; + if (shellparam.optp) { + for (ap = shellparam.optp ; *ap ; ap++) + ckfree(*ap); + ckfree(shellparam.optp); + shellparam.optp = NULL; + } + if (argc > 3) { + shellparam.optp = ckmalloc((argc - 2) * sizeof *ap); + memset(shellparam.optp, '\0', (argc - 2) * sizeof *ap); + for (i = 0; i < argc - 3; i++) + shellparam.optp[i] = savestr(argv[i + 3]); + } + INTON; + optbase = argc == 3 ? shellparam.p : shellparam.optp; shellparam.optnext = optbase; shellparam.optptr = NULL; shellparam.reset = 0; - } + } else + optbase = shellparam.optp ? shellparam.optp : shellparam.p; return getopts(argv[1], argv[2], optbase, &shellparam.optnext, &shellparam.optptr); Modified: projects/sendfile/bin/sh/options.h ============================================================================== --- projects/sendfile/bin/sh/options.h Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/bin/sh/options.h Tue Oct 28 13:38:30 2014 (r273775) @@ -38,6 +38,7 @@ struct shparam { unsigned char malloc; /* if parameter list dynamically allocated */ unsigned char reset; /* if getopts has been reset */ char **p; /* parameter list */ + char **optp; /* parameter list for getopts */ char **optnext; /* next parameter to be processed by getopts */ char *optptr; /* used by getopts */ }; Copied: projects/sendfile/bin/sh/tests/builtins/getopts9.0 (from r273773, head/bin/sh/tests/builtins/getopts9.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/sendfile/bin/sh/tests/builtins/getopts9.0 Tue Oct 28 13:38:30 2014 (r273775, copy of r273773, head/bin/sh/tests/builtins/getopts9.0) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +args='-ab' +getopts ab opt $args +echo $?:$opt:$OPTARG +for dummy in dummy1 dummy2; do + getopts ab opt $args + echo $?:$opt:$OPTARG +done Copied: projects/sendfile/bin/sh/tests/builtins/getopts9.0.stdout (from r273773, head/bin/sh/tests/builtins/getopts9.0.stdout) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/sendfile/bin/sh/tests/builtins/getopts9.0.stdout Tue Oct 28 13:38:30 2014 (r273775, copy of r273773, head/bin/sh/tests/builtins/getopts9.0.stdout) @@ -0,0 +1,3 @@ +0:a: +0:b: +1:?: Modified: projects/sendfile/contrib/file/magic/Magdir/filesystems ============================================================================== --- projects/sendfile/contrib/file/magic/Magdir/filesystems Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/file/magic/Magdir/filesystems Tue Oct 28 13:38:30 2014 (r273775) @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: filesystems,v 1.95 2014/06/03 19:17:27 christos Exp $ +# $File: filesystems,v 1.106 2014/10/23 17:17:09 christos Exp $ # filesystems: file(1) magic for different filesystems # 0 name partid @@ -254,19 +254,13 @@ 30 search/481 \x55\xAA # to display DOS/MBR boot sector (40) before old one (strength=50+21),Syslinux bootloader (71),SYSLINUX MBR (37+36),NetBSD mbr (110),AdvanceMAME mbr (111) # DOS BPB information (70) and after DOS floppy (120) like in previous file version -!:strength +72 +!:strength +65 # for sector sizes < 512 Bytes >11 uleshort <512 >>(11.s-2) uleshort 0xAA55 DOS/MBR boot sector # for sector sizes with 512 or more Bytes >0x1FE leshort 0xAA55 DOS/MBR boot sector -# keep old DOS/MBR boot sector as dummy for mbr and bootloader displaying -# only for sector sizes with 512 or more Bytes -0x1FE leshort 0xAA55 -# -# to display information (50) before DOS BPB (strength=70) and after DOS floppy (120) like in old file version -!:strength +21 ->2 string OSBS \b, OS/BS MBR +>2 string OSBS OS/BS MBR # added by Joerg Jenderek at Feb 2013 according to http://thestarman.pcministry.com/asm/mbr/ # and http://en.wikipedia.org/wiki/Master_Boot_Record # test for nearly all MS-DOS Master Boot Record initial program loader (IPL) is now done by @@ -538,6 +532,8 @@ >>>514 string !HdrS # not BeOS >>>>422 string !Be\ Boot\ Loader +>>>>>32769 string CD001 +>>>>>>0 use cdrom # jump over BPB instruction implies DOS bootsector or AdvanceMAME mbr >>>>>0 ubelong&0xFD000000 =0xE9000000 # AdvanceMAME mbr @@ -1043,7 +1039,7 @@ >>>>>>466 ubyte <0x10 >>>>>>>466 ubyte 0x05 \b, extended partition table >>>>>>>466 ubyte 0x0F \b, extended partition table (LBA) ->>>>>>>466 ubyte 0x0 \b, extended partition table (last) +>>>>>>>466 ubyte 0x0 \b, extended partition table (last) # DOS x86 sector separated and moved from "DOS/MBR boot sector" by Joerg Jenderek at May 2011 @@ -1236,6 +1232,7 @@ >>>>>181 search/166 Error\ \0 # "a: disk" , "Fn: diskn" or "NetBSD MBR boot" >>>>>>&3 string x \b,"%s" +>>>446 use partition-table # Andrea Mazzoleni AdvanceCD mbr loader of http://advancemame.sourceforge.net/boot-readme.html # added by Joerg Jenderek at Nov 2012 for versions 1.3 - 1.4 # assembler instructions: jmp short 0x58;nop;ASCII @@ -1353,18 +1350,19 @@ # minimal short forward jump found 0x29 for bootloaders or 0x0 # maximal short forward jump is 0x7f # OEM-ID is empty or contain readable bytes -0 ulelong&0x804000E9 0x000000E9 +0 ulelong&0x804000E9 0x000000E9 +!:strength +60 # mtools-3.9.8/msdos.h # usual values are marked with comments to get only informations of strange FAT systems # valid sectorsize must be a power of 2 from 32 to 32768 ->11 uleshort&0xf001f 0 +>11 uleshort&0x001f 0 >>11 uleshort <32769 >>>11 uleshort >31 >>>>21 ubyte&0xf0 0xF0 ->>>>>0 ubyte 0xEB +>>>>>0 ubyte 0xEB DOS/MBR boot sector >>>>>>1 ubyte x \b, code offset 0x%x+2 >>>>>0 ubyte 0xE9 ->>>>>>1 uleshort x \b, code offset 0x%x+2 +>>>>>>1 uleshort x \b, code offset 0x%x+3 >>>>>3 string >\0 \b, OEM-ID "%-.8s" #http://mirror.href.com/thestarman/asm/debug/debug2.htm#IHC >>>>>>8 string IHC \b cached by Windows 9M @@ -1373,10 +1371,11 @@ >>>>>11 uleshort <512 \b, Bytes/sector %u >>>>>13 ubyte >1 \b, sectors/cluster %u #>>>>>13 ubyte =1 \b, sectors/cluster %u (usual on Floppies) ->>>>>82 string FAT32 +# for lazy FAT32 implementation like Transcend digital photo frame PF830 +>>>>>82 string/c fat32 >>>>>>14 uleshort !32 \b, reserved sectors %u #>>>>>>14 uleshort =32 \b, reserved sectors %u (usual Fat32) ->>>>>82 string !FAT32 +>>>>>82 string/c !fat32 >>>>>>14 uleshort >1 \b, reserved sectors %u #>>>>>>14 uleshort =1 \b, reserved sectors %u (usual FAT12,FAT16) #>>>>>>14 uleshort 0 \b, reserved sectors %u (usual NTFS) @@ -1399,24 +1398,29 @@ >>>>>26 ubyte =1 \b, heads %u # valid only for sector sizes with more then 32 Bytes >>>>>11 uleshort >32 -# skip for Digital Research DOS (version 3.41) 1440 kB Bootdisk ->>>>>>38 ubyte !0x70 +# http://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#Extended_BIOS_Parameter_Block +# skip for values 2,2Ah,70h,73h,DFh +# and continue for extended boot signature values 0,28h,29h,80h +>>>>>>38 ubyte&0x56 =0 >>>>>>>28 ulelong >0 \b, hidden sectors %u #>>>>>>>28 ulelong =0 \b, hidden sectors %u (usual floppy) >>>>>>>32 ulelong >0 \b, sectors %u (volumes > 32 MB) #>>>>>>>32 ulelong =0 \b, sectors %u (volumes > 32 MB) # FAT<32 bit specific ->>>>>>>82 string !FAT32 +>>>>>>>82 string/c !fat32 #>>>>>>>>36 ubyte 0x80 \b, physical drive 0x%x=0x80 (usual harddisk) #>>>>>>>>36 ubyte 0 \b, physical drive 0x%x=0 (usual floppy) >>>>>>>>36 ubyte !0x80 >>>>>>>>>36 ubyte !0 \b, physical drive 0x%x +# VGA-copy CRC or +# in Windows NT bit 0 is a dirty flag to request chkdsk at boot time. bit 1 requests surface scan too >>>>>>>>37 ubyte >0 \b, reserved 0x%x #>>>>>>>>37 ubyte =0 \b, reserved 0x%x -# value is 0x80 for NTFS +# extended boot signatur value is 0x80 for NTFS, 0x28 or 0x29 for others >>>>>>>>38 ubyte !0x29 \b, dos < 4.0 BootSector (0x%x) ->>>>>>>>38 ubyte =0x29 +>>>>>>>>38 ubyte&0xFE =0x28 >>>>>>>>>39 ulelong x \b, serial number 0x%x +>>>>>>>>38 ubyte =0x29 >>>>>>>>>43 string <NO\ NAME \b, label: "%11.11s" >>>>>>>>>43 string >NO\ NAME \b, label: "%11.11s" >>>>>>>>>43 string =NO\ NAME \b, unlabeled @@ -1426,11 +1430,35 @@ # if it is small enough FAT is 12 bit, if it is too big enough FAT is 32 bit, # otherwise FAT is 16 bit. # http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/determining-fat-widths.html ->>>>>>54 string FAT \b, FAT ->>>>>>>54 string FAT12 \b (12 bit) ->>>>>>>54 string FAT16 \b (16 bit) +>>>>>82 string/c !fat32 +>>>>>>54 string FAT12 \b, FAT (12 bit) +>>>>>>54 string FAT16 \b, FAT (16 bit) +>>>>>>54 default x +# determinate FAT bit size by media descriptor +# small floppies implies FAT12 +>>>>>>>21 ubyte <0xF0 \b, FAT (12 bit by descriptor) +# with media descriptor F0h floppy or maybe superfloppy with FAT16 +>>>>>>>21 ubyte =0xF0 +# superfloppy (many sectors) implies FAT16 +>>>>>>>>32 ulelong >0xFFFF \b, FAT (16 bit by descriptor+sectors) +# no superfloppy with media descriptor F0h implies FAT12 +>>>>>>>>32 default x \b, FAT (12 bit by descriptor+sectors) +# with media descriptor F8h floppy or hard disc with FAT12 or FAT16 +>>>>>>>21 ubyte =0xF8 +# 360 KiB with media descriptor F8h, 9 sectors per track ,single sided floppy implies FAT12 +>>>>>>>>19 ubequad 0xd002f80300090001 \b, FAT (12 bit by descriptor+geometry) +# hard disc with FAT12 or FAT16 +>>>>>>>>19 default x \b, FAT (1Y bit by descriptor) +# with media descriptor FAh floppy, RAM disc with FAT12 or FAT16 or Tandy hard disc +>>>>>>>21 ubyte =0xFA +# 320 KiB with media descriptor FAh, 8 sectors per track ,single sided floppy implies FAT12 +>>>>>>>>19 ubequad 0x8002fa0200080001 \b, FAT (12 bit by descriptor+geometry) +# RAM disc with FAT12 or FAT16 or Tandy hard disc +>>>>>>>>19 default x \b, FAT (1Y bit by descriptor) +# others are floppy +>>>>>>>21 default x \b, FAT (12 bit by descriptor) # FAT32 bit specific ->>>>>82 string FAT32 \b, FAT (32 bit) +>>>>>82 string/c fat32 \b, FAT (32 bit) >>>>>>36 ulelong x \b, sectors/FAT %u # http://technet.microsoft.com/en-us/library/cc977221.aspx >>>>>>40 uleshort >0 \b, extension flags 0x%x @@ -1443,9 +1471,12 @@ >>>>>>48 uleshort >1 \b, infoSector %u #>>>>>>48 uleshort =1 \b, infoSector %u (usual) >>>>>>48 uleshort <1 \b, infoSector %u ->>>>>>50 uleshort >6 \b, Backup boot sector %u +# 0 or 0xFFFF instead of usual 6 means no backup sector +>>>>>>50 uleshort =0xFFFF \b, no Backup boot sector +>>>>>>50 uleshort =0 \b, no Backup boot sector #>>>>>>50 uleshort =6 \b, Backup boot sector %u (usual) ->>>>>>50 uleshort <6 \b, Backup boot sector %u +>>>>>>50 default x +>>>>>>>50 uleshort x \b, Backup boot sector %u # corrected by Joerg Jenderek at Feb 2011 according to http://thestarman.pcministry.com/asm/mbr/MSWIN41.htm#FSINFO >>>>>>52 ulelong >0 \b, reserved1 0x%x >>>>>>56 ulelong >0 \b, reserved2 0x%x @@ -1880,12 +1911,11 @@ # defect IO.SYS+MSDOS.SYS ? #>>>>>0x162 use 2xDOS-filename -# CDROM Filesystems -# Modified for UDF by gerardo.cacciari@gmail.com -32769 string CD001 # -!:mime application/x-iso9660-image +0 name cdrom >38913 string !NSR0 ISO 9660 CD-ROM filesystem data +!:mime application/x-iso9660-image >38913 string NSR0 UDF filesystem data +!:mime application/x-iso9660-image >>38917 string 1 (version 1.0) >>38917 string 2 (version 1.5) >>38917 string 3 (version 2.0) @@ -1898,6 +1928,18 @@ !:mime application/x-iso9660-image 32777 string CDROM High Sierra CD-ROM filesystem data +# CDROM Filesystems +# https://en.wikipedia.org/wiki/ISO_9660 +# Modified for UDF by gerardo.cacciari@gmail.com +32769 string CD001 +# mime line at that position does not work +# to display CD-ROM (70=81-11) after MBR (113=40+72+1), partition-table (71=50+21) and before Apple Driver Map (51) +!:strength -11 +# to display CD-ROM (114=81+33) before MBR (113=40+72+1), partition-table (71=50+21) and Apple Driver Map (51) +# does not work +#!:strength +33 +>0 use cdrom + # .cso files 0 string CISO Compressed ISO CD image @@ -2131,7 +2173,6 @@ # which is mapped to VBN 2 of [000000]INDEXF.SYS;1 - gerardo.cacciari@gmail.com # 1008 string DECFILE11 Files-11 On-Disk Structure ->525 byte x Level %d >525 byte x (ODS-%d); >1017 string A RSX-11, VAX/VMS or OpenVMS VAX file system; >1017 string B @@ -2266,14 +2307,31 @@ # UBIfs # Linux kernel sources: fs/ubifs/ubifs-media.h -0 belong 0x31181006 ->0x16 short 0 UBIfs image ->0x08 lequad x \b, sequence number %llu ->0x10 leshort x \b, length %u ->0x04 lelong x \b, CRC 0x%08x - -0 belong 0x55424923 ->0x04 short <2 ->0x05 string \0\0\0 ->0x1c string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 ->0x04 short x UBI image, version %u +0 lelong 0x06101831 +>0x16 leshort 0 UBIfs image +>0x08 lequad x \b, sequence number %llu +>0x10 leshort x \b, length %u +>0x04 lelong x \b, CRC 0x%08x + +0 lelong 0x23494255 +>0x04 leshort <2 +>0x05 string \0\0\0 +>0x1c string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 +>0x04 leshort x UBI image, version %u + +# NEC PC-88 2D disk image +# From Fabio R. Schmidlin <sd-snatcher@users.sourceforge.net> +0x20 ulelong&0xFFFFFEFF 0x2A0 +>0x10 string \0\0\0\0\0\0\0\0\0\0 +>>0x280 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 +>>>0x1A ubyte&0xEF 0 +>>>>0x1B ubyte&0x8F 0 +>>>>>0x1B ubyte&70 <0x40 +>>>>>>0x1C ulelong >0x21 +>>>>>>>0 regex [[:print:]]* NEC PC-88 disk image, name=%s +>>>>>>>>0x1B ubyte 0 \b, media=2D +>>>>>>>>0x1B ubyte 0x10 \b, media=2DD +>>>>>>>>0x1B ubyte 0x20 \b, media=2HD +>>>>>>>>0x1B ubyte 0x30 \b, media=1D +>>>>>>>>0x1B ubyte 0x40 \b, media=1DD +>>>>>>>>0x1A ubyte 0x10 \b, write-protected Modified: projects/sendfile/contrib/hyperv/tools/hv_kvp_daemon.8 ============================================================================== --- projects/sendfile/contrib/hyperv/tools/hv_kvp_daemon.8 Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/hyperv/tools/hv_kvp_daemon.8 Tue Oct 28 13:38:30 2014 (r273775) @@ -22,41 +22,71 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 10, 2013 -.Dt HYPER-V 4 +.\" $FreeBSD$ +.Dd October 27, 2014 +.Dt HV_KVP_DAEMON 8 .Os .Sh NAME .Nm hv_kvp_daemon .Nd Hyper-V Key Value Pair Daemon .Sh SYNOPSIS -The \fBhv_kvp_daemon\fP daemon provides the ability to store, retrieve, modify and delete -Key Value pairs for FreeBSD guest partitions running on Hyper-V. +.Nm +.Op Fl dn .Sh DESCRIPTION +The +.Nm +daemon provides the ability to store, retrieve, modify and delete +Key Value pairs for +.Fx +guest partitions running on Hyper-V. +.Pp Hyper-V allows administrators to store custom metadata in the form -of Key Value pairs inside the FreeBSD guest partition. Administrators can +of Key Value pairs inside the +.Fx +guest partition. +Administrators can use Windows Powershell scripts to add, read, modify and delete such Key Value pairs. - -The \fBhv_kvp_daemon\fP accepts Key Value pair management requests from the -\fBhv_utils\fP driver and performs the actual metadata management on the file-system. - +.Pp +The +.Nm +accepts Key Value pair management requests from the +.Xr hv_utils 4 +driver and performs the actual metadata management on the file-system. +.Pp The same daemon and driver combination is also used to set and get -IP addresses from a FreeBSD guest. - +IP addresses from a +.Fx +guest. +.Pp The set functionality is particularly -useful when the FreeBSD guest is assigned a static IP address and is failed -over from one Hyper-V host to another. After failover, Hyper-V uses the set IP +useful when the +.Fx +guest is assigned a static IP address and is failed +over from one Hyper-V host to another. +After failover, Hyper-V uses the set IP functionality to automatically -update the FreeBSD guest's IP address to its original static value. - +update the +.Fx +guest's IP address to its original static value. +.Pp On the other hand, the get IP functionality is used to update the guest IP address in the Hyper-V management console window. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl d +Run as regular process instead of a daemon for debugging purpose. +.It Fl n +Generate debugging output. +.El .Sh SEE ALSO .Xr hv_vmbus 4 , .Xr hv_utils 4 , .Xr hv_netvsc 4 , .Xr hv_storvsc 4 , -.Xr hv_ata_pci_disengage 4 +.Xr hv_ata_pci_disengage 4 , +.Xr hv_kvp 4 .Sh HISTORY Support for Hyper-V in the form of ports was first released in September 2013. The daemon was developed through a joint effort between Citrix Inc., @@ -64,5 +94,7 @@ Microsoft Corp. and Network Appliance In .Sh AUTHORS .An -nosplit .Fx -support for \fBhv_kvp_daemon\fP was first added by -.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq Mt bsdic@microsoft.com . Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/gen/t_sleep.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/gen/t_sleep.c Tue Oct 28 13:38:30 2014 (r273775) @@ -49,6 +49,11 @@ #define KEVNT_TIMEOUT 10300 /* measured in milli-seconds */ #define FUZZ (40 * MILLION) /* scheduling fuzz accepted - 40 ms */ +#ifdef __FreeBSD__ +#include <sys/time.h> +#include <inttypes.h> +#endif + /* * Timer notes * @@ -78,7 +83,9 @@ static volatile int sig; int sleeptest(int (*)(struct timespec *, struct timespec *), bool, bool); int do_nanosleep(struct timespec *, struct timespec *); int do_select(struct timespec *, struct timespec *); +#ifdef __NetBSD__ int do_poll(struct timespec *, struct timespec *); +#endif int do_sleep(struct timespec *, struct timespec *); int do_kevent(struct timespec *, struct timespec *); void sigalrm(int); @@ -116,6 +123,7 @@ do_select(struct timespec *delay, struct return ret; } +#ifdef __NetBSD__ int do_poll(struct timespec *delay, struct timespec *remain) { @@ -129,6 +137,7 @@ do_poll(struct timespec *delay, struct t ret = 0; return ret; } +#endif int do_sleep(struct timespec *delay, struct timespec *remain) @@ -210,6 +219,7 @@ ATF_TC_BODY(select, tc) sleeptest(do_select, true, true); } +#ifdef __NetBSD__ ATF_TC(poll); ATF_TC_HEAD(poll, tc) { @@ -223,6 +233,7 @@ ATF_TC_BODY(poll, tc) sleeptest(do_poll, true, true); } +#endif ATF_TC(sleep); ATF_TC_HEAD(sleep, tc) @@ -329,7 +340,9 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, nanosleep); ATF_TP_ADD_TC(tp, select); +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, poll); +#endif ATF_TP_ADD_TC(tp, sleep); ATF_TP_ADD_TC(tp, kevent); Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_clock_gettime.c Tue Oct 28 13:38:30 2014 (r273775) @@ -63,7 +63,9 @@ __RCSID("$NetBSD: t_clock_gettime.c,v 1. #include <sys/param.h> #include <sys/sysctl.h> +#if defined(__NetBSD__) #include <machine/int_limits.h> +#endif #include <atf-c.h> #include <errno.h> @@ -73,7 +75,13 @@ __RCSID("$NetBSD: t_clock_gettime.c,v 1. #include <time.h> #include <unistd.h> +#if defined(__NetBSD__) #include "../../../h_macros.h" +#else +#include <limits.h> +#include <stdint.h> +#include "h_macros.h" +#endif #define MINPOSDIFF 15000000 /* 15 ms for now */ #define TIMEOUT 5 Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_getgroups.c Tue Oct 28 13:38:30 2014 (r273775) @@ -57,6 +57,9 @@ ATF_TC_BODY(getgroups_err, tc) errno = 0; +#if defined(__FreeBSD__) + atf_tc_expect_fail("Reported as kern/189941"); +#endif ATF_REQUIRE(getgroups(-1, gidset) == -1); ATF_REQUIRE(errno == EINVAL); } Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c Tue Oct 28 13:38:30 2014 (r273775) @@ -47,7 +47,11 @@ static void sighandler(int); static const size_t maxiter = 2000; static void +#if defined(__FreeBSD__) +sighandler(int signo __unused) +#else sighandler(int signo) +#endif { /* Nothing. */ } @@ -129,7 +133,9 @@ ATF_TC_BODY(getrusage_utime_back, tc) /* * Test that two consecutive calls are sane. */ +#ifdef __NetBSD__ atf_tc_expect_fail("PR kern/30115"); +#endif for (i = 0; i < maxiter; i++) { @@ -148,7 +154,9 @@ ATF_TC_BODY(getrusage_utime_back, tc) atf_tc_fail("user time went backwards"); } +#ifdef __NetBSD__ atf_tc_fail("anticipated error did not occur"); +#endif } ATF_TC(getrusage_utime_zero); @@ -162,6 +170,11 @@ ATF_TC_BODY(getrusage_utime_zero, tc) struct rusage ru; size_t i; +#ifdef __FreeBSD__ + atf_tc_skip("this testcase passes/fails sporadically on FreeBSD/i386 " + "@ r273153 (at least)"); +#endif + /* * Test that getrusage(2) does not return * zero user time for the calling process. Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_link.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_link.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_link.c Tue Oct 28 13:38:30 2014 (r273775) @@ -41,6 +41,10 @@ __RCSID("$NetBSD: t_link.c,v 1.2 2014/04 #include <string.h> #include <unistd.h> +#ifdef __FreeBSD__ +#include <limits.h> +#endif + static const char *getpath(void); static char path[] = "link"; static const char *pathl; Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_listen.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_listen.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_listen.c Tue Oct 28 13:38:30 2014 (r273775) @@ -36,6 +36,10 @@ #include <arpa/inet.h> #include <netinet/in.h> +#if defined(__FreeBSD__) +#include <sys/socket.h> +#endif + static const char *path = "listen"; ATF_TC_WITH_CLEANUP(listen_err); Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mknod.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mknod.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mknod.c Tue Oct 28 13:38:30 2014 (r273775) @@ -58,8 +58,15 @@ ATF_TC_BODY(mknod_err, tc) (void)memset(buf, 'x', sizeof(buf)); +#ifndef __FreeBSD__ + /* + * As of FreeBSD 6.0 device nodes may be created in regular file systems but + * such nodes cannot be used to access devices. As a result an invalid dev + * argument is unchecked. + */ errno = 0; ATF_REQUIRE_ERRNO(EINVAL, mknod(path, S_IFCHR, -1) == -1); +#endif errno = 0; ATF_REQUIRE_ERRNO(ENAMETOOLONG, mknod(buf, S_IFCHR, 0) == -1); @@ -166,6 +173,9 @@ ATF_TC_BODY(mknod_stat, tc) (void)memset(&st, 0, sizeof(struct stat)); +#ifdef __FreeBSD__ + atf_tc_expect_fail("mknod does not allow S_IFREG"); +#endif ATF_REQUIRE(mknod(path, S_IFREG, 0) == 0); ATF_REQUIRE(stat(path, &st) == 0); Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mlock.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Tue Oct 28 13:38:30 2014 (r273775) @@ -31,6 +31,9 @@ #include <sys/cdefs.h> __RCSID("$NetBSD: t_mlock.c,v 1.5 2014/02/26 20:49:26 martin Exp $"); +#ifdef __FreeBSD__ +#include <sys/types.h> +#endif #include <sys/mman.h> #include <sys/resource.h> #include <sys/sysctl.h> @@ -43,6 +46,11 @@ __RCSID("$NetBSD: t_mlock.c,v 1.5 2014/0 #include <stdlib.h> #include <unistd.h> +#ifdef __FreeBSD__ +#define _KMEMUSER +#include <machine/vmparam.h> +#endif + static long page = 0; ATF_TC(mlock_clip); @@ -79,16 +87,25 @@ ATF_TC_HEAD(mlock_err, tc) ATF_TC_BODY(mlock_err, tc) { +#ifdef __NetBSD__ unsigned long vmin = 0; size_t len = sizeof(vmin); +#endif void *invalid_ptr; int null_errno = ENOMEM; /* error expected for NULL */ +#ifdef __FreeBSD__ +#ifdef VM_MIN_ADDRESS + if ((uintptr_t)VM_MIN_ADDRESS > 0) + null_errno = EINVAL; /* NULL is not inside user VM */ +#endif +#else if (sysctlbyname("vm.minaddress", &vmin, &len, NULL, 0) != 0) atf_tc_fail("failed to read vm.minaddress"); if (vmin > 0) null_errno = EINVAL; /* NULL is not inside user VM */ +#endif errno = 0; ATF_REQUIRE_ERRNO(null_errno, mlock(NULL, page) == -1); @@ -156,7 +173,17 @@ ATF_TC_BODY(mlock_limits, tc) errno = 0; +#ifdef __FreeBSD__ + /* + * NetBSD doesn't conform to POSIX with ENOMEM requirement; + * FreeBSD does. + * + * See: NetBSD PR # kern/48962 for more details. + */ + if (mlock(buf, i) != -1 || errno != ENOMEM) { +#else if (mlock(buf, i) != -1 || errno != EAGAIN) { +#endif (void)munlock(buf, i); _exit(EXIT_FAILURE); } @@ -181,7 +208,11 @@ ATF_TC_HEAD(mlock_mmap, tc) ATF_TC_BODY(mlock_mmap, tc) { +#ifdef __NetBSD__ static const int flags = MAP_ANON | MAP_PRIVATE | MAP_WIRED; +#else + static const int flags = MAP_ANON | MAP_PRIVATE; +#endif void *buf; /* @@ -191,6 +222,13 @@ ATF_TC_BODY(mlock_mmap, tc) buf = mmap(NULL, page, PROT_READ | PROT_WRITE, flags, -1, 0); ATF_REQUIRE(buf != MAP_FAILED); +#ifdef __FreeBSD__ + /* + * The duplicate mlock call is added to ensure that the call works + * as described above without MAP_WIRED support. + */ + ATF_REQUIRE(mlock(buf, page) == 0); +#endif ATF_REQUIRE(mlock(buf, page) == 0); ATF_REQUIRE(munlock(buf, page) == 0); ATF_REQUIRE(munmap(buf, page) == 0); @@ -202,7 +240,11 @@ ATF_TC_BODY(mlock_mmap, tc) buf = mmap(NULL, page, PROT_NONE, flags, -1, 0); ATF_REQUIRE(buf != MAP_FAILED); +#ifdef __FreeBSD__ + ATF_REQUIRE_ERRNO(ENOMEM, mlock(buf, page) != 0); +#else ATF_REQUIRE(mlock(buf, page) != 0); +#endif ATF_REQUIRE(munmap(buf, page) == 0); } Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mmap.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mmap.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mmap.c Tue Oct 28 13:38:30 2014 (r273775) @@ -72,7 +72,15 @@ __RCSID("$NetBSD: t_mmap.c,v 1.7 2012/06 #include <string.h> #include <unistd.h> #include <paths.h> +#ifdef __NetBSD__ #include <machine/disklabel.h> +#endif + +#ifdef __FreeBSD__ +#include <sys/disklabel.h> +#include <sys/stat.h> +#include <stdint.h> +#endif static long page = 0; static char path[] = "mmap"; @@ -155,6 +163,7 @@ map_sighandler(int signo) _exit(signo); } +#ifdef __NetBSD__ ATF_TC(mmap_block); ATF_TC_HEAD(mmap_block, tc) { @@ -199,6 +208,7 @@ ATF_TC_BODY(mmap_block, tc) ATF_REQUIRE(munmap(map, 4096) == 0); } +#endif ATF_TC(mmap_err); ATF_TC_HEAD(mmap_err, tc) @@ -468,8 +478,15 @@ ATF_TC_BODY(mmap_va0, tc) * Make an anonymous fixed mapping at zero address. If the address * is restricted as noted in security(7), the syscall should fail. */ +#ifdef __FreeBSD__ + if (sysctlbyname("security.bsd.map_at_zero", &val, &len, NULL, 0) != 0) + atf_tc_fail("failed to read security.bsd.map_at_zero"); + val = !val; /* 1 == enable map at zero */ +#endif +#ifdef __NetBSD__ if (sysctlbyname("vm.user_va0_disable", &val, &len, NULL, 0) != 0) atf_tc_fail("failed to read vm.user_va0_disable"); +#endif map = mmap(NULL, page, PROT_EXEC, flags, -1, 0); map_check(map, val); @@ -492,7 +509,9 @@ ATF_TP_ADD_TCS(tp) page = sysconf(_SC_PAGESIZE); ATF_REQUIRE(page >= 0); +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, mmap_block); +#endif ATF_TP_ADD_TC(tp, mmap_err); ATF_TP_ADD_TC(tp, mmap_loan); ATF_TP_ADD_TC(tp, mmap_prot_1); Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c Tue Oct 28 13:38:30 2014 (r273775) @@ -44,7 +44,9 @@ __RCSID("$NetBSD: t_mprotect.c,v 1.3 201 #include <atf-c.h> +#ifdef __NetBSD__ #include "../common/exec_prot.h" +#endif static long page = 0; static int pax_global = -1; @@ -160,6 +162,7 @@ ATF_TC_BODY(mprotect_err, tc) ATF_REQUIRE(errno == EINVAL); } +#ifdef __NetBSD__ ATF_TC(mprotect_exec); ATF_TC_HEAD(mprotect_exec, tc) { @@ -242,6 +245,7 @@ ATF_TC_BODY(mprotect_exec, tc) break; } } +#endif ATF_TC(mprotect_pax); ATF_TC_HEAD(mprotect_pax, tc) @@ -351,7 +355,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, mprotect_access); ATF_TP_ADD_TC(tp, mprotect_err); +#ifdef __NetBSD__ ATF_TP_ADD_TC(tp, mprotect_exec); +#endif ATF_TP_ADD_TC(tp, mprotect_pax); ATF_TP_ADD_TC(tp, mprotect_write); Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c Tue Oct 28 13:38:30 2014 (r273775) @@ -46,6 +46,10 @@ __RCSID("$NetBSD: t_msgctl.c,v 1.4 2014/ #include <time.h> #include <unistd.h> +#ifdef __FreeBSD__ +#include <limits.h> +#endif + #define MSG_KEY 12345689 #define MSG_MTYPE_1 0x41 Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c Tue Oct 28 13:38:30 2014 (r273775) @@ -47,6 +47,10 @@ __RCSID("$NetBSD: t_msgrcv.c,v 1.3 2013/ #include <time.h> #include <unistd.h> +#if defined(__FreeBSD__) +#include <limits.h> +#endif + #define MSG_KEY 1234 #define MSG_MTYPE_1 0x41 #define MSG_MTYPE_2 0x42 Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Tue Oct 28 13:38:30 2014 (r273775) @@ -47,6 +47,10 @@ __RCSID("$NetBSD: t_msgsnd.c,v 1.2 2011/ #include <time.h> #include <unistd.h> +#if defined(__FreeBSD__) +#include <limits.h> +#endif + #define MSG_KEY 1234 #define MSG_MTYPE_1 0x41 #define MSG_MTYPE_2 0x42 Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msync.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msync.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_msync.c Tue Oct 28 13:38:30 2014 (r273775) @@ -170,8 +170,15 @@ ATF_TC_BODY(msync_err, tc) /* * Test that invalid flags error out. */ +#ifdef __FreeBSD__ + errno = 0; + ATF_REQUIRE_ERRNO(EINVAL, msync_sync("error", -1) != NULL); + errno = 0; + ATF_REQUIRE_ERRNO(EINVAL, msync_sync("error", INT_MAX) != NULL); +#else ATF_REQUIRE(msync_sync("error", -1) != NULL); ATF_REQUIRE(msync_sync("error", INT_MAX) != NULL); +#endif errno = 0; @@ -185,7 +192,11 @@ ATF_TC_BODY(msync_err, tc) (void)munmap(map, page); ATF_REQUIRE(msync(map, page, MS_SYNC) != 0); +#ifdef __FreeBSD__ + ATF_REQUIRE(errno == ENOMEM); +#else ATF_REQUIRE(errno == EFAULT); +#endif } ATF_TC(msync_invalidate); Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_nanosleep.c Tue Oct 28 13:38:30 2014 (r273775) @@ -45,7 +45,11 @@ __RCSID("$NetBSD: t_nanosleep.c,v 1.3 20 #include <unistd.h> static void +#if defined(__FreeBSD__) +handler(int signo __unused) +#else handler(int signo) +#endif { /* Nothing. */ } Modified: projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c ============================================================================== --- projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c Tue Oct 28 13:38:10 2014 (r273774) +++ projects/sendfile/contrib/netbsd-tests/lib/libc/sys/t_pipe2.c Tue Oct 28 13:38:30 2014 (r273775) @@ -53,7 +53,11 @@ run(int flags) while ((i = open("/", O_RDONLY)) < 3) ATF_REQUIRE(i != -1); +#if defined(__FreeBSD__) *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410281338.s9SDcViO058731>