Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2013 21:01:43 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r246159 - in projects/physbio: . bin/cat contrib/ipfilter/ipsend etc include lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/ia64/sys lib/libc/mips/sys lib/libc/powerpc l...
Message-ID:  <201301312101.r0VL1h4a025128@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Jan 31 21:01:42 2013
New Revision: 246159
URL: http://svnweb.freebsd.org/changeset/base/246159

Log:
  MFH

Added:
  projects/physbio/lib/libc/arm/sys/__vdso_gettc.c
     - copied unchanged from r246158, head/lib/libc/arm/sys/__vdso_gettc.c
  projects/physbio/lib/libc/ia64/sys/__vdso_gettc.c
     - copied unchanged from r246158, head/lib/libc/ia64/sys/__vdso_gettc.c
  projects/physbio/lib/libc/mips/sys/__vdso_gettc.c
     - copied unchanged from r246158, head/lib/libc/mips/sys/__vdso_gettc.c
  projects/physbio/lib/libc/powerpc/sys/__vdso_gettc.c
     - copied unchanged from r246158, head/lib/libc/powerpc/sys/__vdso_gettc.c
  projects/physbio/lib/libc/powerpc64/sys/__vdso_gettc.c
     - copied unchanged from r246158, head/lib/libc/powerpc64/sys/__vdso_gettc.c
  projects/physbio/lib/libc/sparc64/sys/__vdso_gettc.c
     - copied unchanged from r246158, head/lib/libc/sparc64/sys/__vdso_gettc.c
  projects/physbio/lib/libc/stdio/fmemopen.c
     - copied unchanged from r246158, head/lib/libc/stdio/fmemopen.c
  projects/physbio/sys/boot/usb/
     - copied from r246158, head/sys/boot/usb/
  projects/physbio/sys/dev/usb/usb_freebsd_loader.h
     - copied unchanged from r246158, head/sys/dev/usb/usb_freebsd_loader.h
  projects/physbio/tools/regression/lib/libc/stdio/test-fmemopen.c
     - copied unchanged from r246158, head/tools/regression/lib/libc/stdio/test-fmemopen.c
  projects/physbio/tools/regression/lib/libc/stdio/test-fmemopen.t
     - copied unchanged from r246158, head/tools/regression/lib/libc/stdio/test-fmemopen.t
Deleted:
  projects/physbio/lib/libstand/if_ether.h
Modified:
  projects/physbio/Makefile.inc1
  projects/physbio/UPDATING
  projects/physbio/bin/cat/cat.1
  projects/physbio/bin/cat/cat.c
  projects/physbio/contrib/ipfilter/ipsend/44arp.c
  projects/physbio/etc/Makefile
  projects/physbio/include/stdio.h   (contents, props changed)
  projects/physbio/lib/libc/amd64/sys/__vdso_gettc.c
  projects/physbio/lib/libc/arm/sys/Makefile.inc
  projects/physbio/lib/libc/i386/sys/__vdso_gettc.c
  projects/physbio/lib/libc/ia64/sys/Makefile.inc
  projects/physbio/lib/libc/mips/sys/Makefile.inc
  projects/physbio/lib/libc/powerpc/Makefile.inc
  projects/physbio/lib/libc/powerpc64/Makefile.inc
  projects/physbio/lib/libc/sparc64/Makefile.inc
  projects/physbio/lib/libc/stdio/Makefile.inc   (contents, props changed)
  projects/physbio/lib/libc/stdio/Symbol.map   (contents, props changed)
  projects/physbio/lib/libc/stdio/fopen.3   (contents, props changed)
  projects/physbio/lib/libc/sys/__vdso_gettimeofday.c
  projects/physbio/lib/libc/sys/gettimeofday.c
  projects/physbio/libexec/bootpd/rtmsg.c
  projects/physbio/libexec/tftpd/tftp-io.c
  projects/physbio/libexec/tftpd/tftp-options.c
  projects/physbio/libexec/tftpd/tftp-utils.h
  projects/physbio/libexec/tftpd/tftpd.c
  projects/physbio/sbin/devd/devd.8
  projects/physbio/sbin/devd/devd.cc
  projects/physbio/sbin/devd/devd.hh
  projects/physbio/sbin/route/route.c
  projects/physbio/share/man/man7/release.7
  projects/physbio/share/mk/bsd.own.mk
  projects/physbio/sys/amd64/include/vmm_instruction_emul.h   (contents, props changed)
  projects/physbio/sys/amd64/linux32/linux.h
  projects/physbio/sys/amd64/linux32/linux32_sysvec.c
  projects/physbio/sys/amd64/vmm/vmm_instruction_emul.c
  projects/physbio/sys/arm/arm/busdma_machdep.c
  projects/physbio/sys/boot/uboot/common/metadata.c
  projects/physbio/sys/cam/scsi/scsi_all.c
  projects/physbio/sys/compat/linprocfs/linprocfs.c
  projects/physbio/sys/compat/linux/linux_emul.c
  projects/physbio/sys/compat/linux/linux_file.c
  projects/physbio/sys/compat/linux/linux_file.h
  projects/physbio/sys/compat/linux/linux_fork.c
  projects/physbio/sys/compat/linux/linux_ioctl.h
  projects/physbio/sys/compat/linux/linux_ipc.h
  projects/physbio/sys/compat/linux/linux_mib.c
  projects/physbio/sys/compat/linux/linux_misc.h
  projects/physbio/sys/compat/linux/linux_signal.h
  projects/physbio/sys/compat/linux/linux_socket.h
  projects/physbio/sys/compat/linux/linux_sysctl.c
  projects/physbio/sys/compat/linux/linux_time.c
  projects/physbio/sys/dev/acpi_support/acpi_asus_wmi.c
  projects/physbio/sys/dev/acpi_support/acpi_fujitsu.c   (contents, props changed)
  projects/physbio/sys/dev/acpi_support/acpi_hp.c
  projects/physbio/sys/dev/acpi_support/acpi_ibm.c   (contents, props changed)
  projects/physbio/sys/dev/acpi_support/acpi_panasonic.c   (contents, props changed)
  projects/physbio/sys/dev/acpi_support/acpi_sony.c   (contents, props changed)
  projects/physbio/sys/dev/acpi_support/acpi_toshiba.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_acad.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_button.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_cmbat.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_dock.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_ec.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_hpet.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_lid.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_pci.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_pci_link.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_pcib_pci.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_perf.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_resource.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_smbat.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_thermal.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_throttle.c   (contents, props changed)
  projects/physbio/sys/dev/acpica/acpi_timer.c   (contents, props changed)
  projects/physbio/sys/dev/adlink/adlink.c   (contents, props changed)
  projects/physbio/sys/dev/amdsbwd/amdsbwd.c
  projects/physbio/sys/dev/amdtemp/amdtemp.c   (contents, props changed)
  projects/physbio/sys/dev/ath/if_ath_rx.c
  projects/physbio/sys/dev/auxio/auxio.c   (contents, props changed)
  projects/physbio/sys/dev/ce/if_ce.c   (contents, props changed)
  projects/physbio/sys/dev/cfi/cfi_bus_fdt.c
  projects/physbio/sys/dev/cfi/cfi_bus_ixp4xx.c
  projects/physbio/sys/dev/coretemp/coretemp.c   (contents, props changed)
  projects/physbio/sys/dev/cp/if_cp.c   (contents, props changed)
  projects/physbio/sys/dev/cpufreq/ichss.c   (contents, props changed)
  projects/physbio/sys/dev/ctau/if_ct.c   (contents, props changed)
  projects/physbio/sys/dev/cx/if_cx.c   (contents, props changed)
  projects/physbio/sys/dev/cxgbe/t4_main.c
  projects/physbio/sys/dev/cxgbe/t4_sge.c
  projects/physbio/sys/dev/digi/digi_isa.c   (contents, props changed)
  projects/physbio/sys/dev/digi/digi_pci.c   (contents, props changed)
  projects/physbio/sys/dev/e1000/if_em.c   (contents, props changed)
  projects/physbio/sys/dev/e1000/if_igb.c   (contents, props changed)
  projects/physbio/sys/dev/e1000/if_lem.c
  projects/physbio/sys/dev/ep/if_ep_eisa.c   (contents, props changed)
  projects/physbio/sys/dev/ep/if_ep_isa.c   (contents, props changed)
  projects/physbio/sys/dev/ep/if_ep_mca.c   (contents, props changed)
  projects/physbio/sys/dev/ep/if_ep_pccard.c   (contents, props changed)
  projects/physbio/sys/dev/fdc/fdc_acpi.c   (contents, props changed)
  projects/physbio/sys/dev/iicbus/ad7418.c   (contents, props changed)
  projects/physbio/sys/dev/iicbus/ds133x.c   (contents, props changed)
  projects/physbio/sys/dev/iicbus/ds1672.c   (contents, props changed)
  projects/physbio/sys/dev/iicbus/icee.c   (contents, props changed)
  projects/physbio/sys/dev/ixgb/if_ixgb.c   (contents, props changed)
  projects/physbio/sys/dev/ixgbe/ixgbe.c   (contents, props changed)
  projects/physbio/sys/dev/ixgbe/ixv.c
  projects/physbio/sys/dev/mfi/mfi_cam.c   (contents, props changed)
  projects/physbio/sys/dev/mn/if_mn.c   (contents, props changed)
  projects/physbio/sys/dev/mxge/if_mxge.c   (contents, props changed)
  projects/physbio/sys/dev/my/if_my.c   (contents, props changed)
  projects/physbio/sys/dev/nvram2env/nvram2env.c   (contents, props changed)
  projects/physbio/sys/dev/nxge/if_nxge.c   (contents, props changed)
  projects/physbio/sys/dev/oce/oce_if.c   (contents, props changed)
  projects/physbio/sys/dev/sdhci/sdhci_pci.c
  projects/physbio/sys/dev/sound/pci/emu10kx-midi.c   (contents, props changed)
  projects/physbio/sys/dev/sound/pci/emu10kx-pcm.c   (contents, props changed)
  projects/physbio/sys/dev/sound/pci/emu10kx.c   (contents, props changed)
  projects/physbio/sys/dev/sound/sbus/cs4231.c   (contents, props changed)
  projects/physbio/sys/dev/sound/usb/uaudio_pcm.c
  projects/physbio/sys/dev/usb/controller/at91dci.c
  projects/physbio/sys/dev/usb/controller/atmegadci.c
  projects/physbio/sys/dev/usb/controller/avr32dci.c
  projects/physbio/sys/dev/usb/controller/dwc_otg.c
  projects/physbio/sys/dev/usb/controller/ehci.c
  projects/physbio/sys/dev/usb/controller/musb_otg.c
  projects/physbio/sys/dev/usb/controller/ohci.c
  projects/physbio/sys/dev/usb/controller/uhci.c
  projects/physbio/sys/dev/usb/controller/usb_controller.c
  projects/physbio/sys/dev/usb/controller/uss820dci.c
  projects/physbio/sys/dev/usb/controller/xhci.c
  projects/physbio/sys/dev/usb/input/uhid.c
  projects/physbio/sys/dev/usb/input/ukbd.c
  projects/physbio/sys/dev/usb/input/ums.c
  projects/physbio/sys/dev/usb/misc/udbp.c
  projects/physbio/sys/dev/usb/misc/ufm.c
  projects/physbio/sys/dev/usb/net/if_cdce.c
  projects/physbio/sys/dev/usb/net/if_cue.c
  projects/physbio/sys/dev/usb/net/if_ipheth.c
  projects/physbio/sys/dev/usb/net/if_kue.c
  projects/physbio/sys/dev/usb/net/if_smsc.c
  projects/physbio/sys/dev/usb/storage/umass.c
  projects/physbio/sys/dev/usb/storage/urio.c
  projects/physbio/sys/dev/usb/storage/ustorage_fs.c
  projects/physbio/sys/dev/usb/template/usb_template.c
  projects/physbio/sys/dev/usb/template/usb_template_audio.c
  projects/physbio/sys/dev/usb/template/usb_template_cdce.c
  projects/physbio/sys/dev/usb/template/usb_template_kbd.c
  projects/physbio/sys/dev/usb/template/usb_template_modem.c
  projects/physbio/sys/dev/usb/template/usb_template_mouse.c
  projects/physbio/sys/dev/usb/template/usb_template_msc.c
  projects/physbio/sys/dev/usb/template/usb_template_mtp.c
  projects/physbio/sys/dev/usb/ufm_ioctl.h
  projects/physbio/sys/dev/usb/usb.h
  projects/physbio/sys/dev/usb/usb_busdma.c
  projects/physbio/sys/dev/usb/usb_busdma.h
  projects/physbio/sys/dev/usb/usb_compat_linux.c
  projects/physbio/sys/dev/usb/usb_core.c
  projects/physbio/sys/dev/usb/usb_core.h
  projects/physbio/sys/dev/usb/usb_debug.c
  projects/physbio/sys/dev/usb/usb_dev.c
  projects/physbio/sys/dev/usb/usb_dev.h
  projects/physbio/sys/dev/usb/usb_device.c
  projects/physbio/sys/dev/usb/usb_dynamic.c
  projects/physbio/sys/dev/usb/usb_endian.h
  projects/physbio/sys/dev/usb/usb_error.c
  projects/physbio/sys/dev/usb/usb_freebsd.h
  projects/physbio/sys/dev/usb/usb_generic.c
  projects/physbio/sys/dev/usb/usb_handle_request.c
  projects/physbio/sys/dev/usb/usb_hid.c
  projects/physbio/sys/dev/usb/usb_hub.c
  projects/physbio/sys/dev/usb/usb_ioctl.h
  projects/physbio/sys/dev/usb/usb_lookup.c
  projects/physbio/sys/dev/usb/usb_mbuf.c
  projects/physbio/sys/dev/usb/usb_msctest.c
  projects/physbio/sys/dev/usb/usb_parse.c
  projects/physbio/sys/dev/usb/usb_pci.h
  projects/physbio/sys/dev/usb/usb_pf.c
  projects/physbio/sys/dev/usb/usb_process.c
  projects/physbio/sys/dev/usb/usb_process.h
  projects/physbio/sys/dev/usb/usb_request.c
  projects/physbio/sys/dev/usb/usb_transfer.c
  projects/physbio/sys/dev/usb/usb_util.c
  projects/physbio/sys/dev/usb/usbdi.h
  projects/physbio/sys/dev/usb/usbhid.h
  projects/physbio/sys/dev/vx/if_vx_eisa.c   (contents, props changed)
  projects/physbio/sys/dev/vx/if_vx_pci.c   (contents, props changed)
  projects/physbio/sys/dev/vxge/vxge.c   (contents, props changed)
  projects/physbio/sys/dev/xen/console/console.c
  projects/physbio/sys/i386/linux/linux.h
  projects/physbio/sys/i386/linux/linux_ptrace.c
  projects/physbio/sys/i386/linux/linux_sysvec.c
  projects/physbio/sys/kern/kern_exit.c
  projects/physbio/sys/net/if_llatbl.c
  projects/physbio/sys/net/if_llatbl.h
  projects/physbio/sys/netinet/if_ether.h
  projects/physbio/sys/netinet/in.c
  projects/physbio/sys/netinet/libalias/alias.c
  projects/physbio/sys/netinet/libalias/libalias.3
  projects/physbio/sys/sys/param.h
  projects/physbio/sys/sys/vdso.h
  projects/physbio/sys/vm/uma_core.c
  projects/physbio/sys/x86/x86/tsc.c
  projects/physbio/tools/test/pthread_vfork/pthread_vfork_test.c
  projects/physbio/usr.bin/patch/Makefile
  projects/physbio/usr.bin/patch/backupfile.c
  projects/physbio/usr.bin/patch/backupfile.h
  projects/physbio/usr.bin/patch/common.h
  projects/physbio/usr.bin/patch/inp.c
  projects/physbio/usr.bin/patch/inp.h
  projects/physbio/usr.bin/patch/mkpath.c
  projects/physbio/usr.bin/patch/patch.1
  projects/physbio/usr.bin/patch/patch.c
  projects/physbio/usr.bin/patch/pathnames.h
  projects/physbio/usr.bin/patch/pch.c
  projects/physbio/usr.bin/patch/pch.h
  projects/physbio/usr.bin/patch/util.c
  projects/physbio/usr.bin/patch/util.h
  projects/physbio/usr.bin/xinstall/xinstall.c
  projects/physbio/usr.sbin/arp/arp.8
  projects/physbio/usr.sbin/arp/arp.c
  projects/physbio/usr.sbin/bhyve/pci_emul.c
  projects/physbio/usr.sbin/bhyve/pci_emul.h
  projects/physbio/usr.sbin/bhyve/pci_virtio_net.c
  projects/physbio/usr.sbin/bhyve/virtio.h
  projects/physbio/usr.sbin/ndp/ndp.c
  projects/physbio/usr.sbin/ppp/arp.c
  projects/physbio/usr.sbin/rarpd/rarpd.c
  projects/physbio/usr.sbin/tcpdrop/tcpdrop.8
  projects/physbio/usr.sbin/tcpdrop/tcpdrop.c
Directory Properties:
  projects/physbio/   (props changed)
  projects/physbio/lib/libc/   (props changed)
  projects/physbio/sbin/   (props changed)
  projects/physbio/sys/   (props changed)
  projects/physbio/sys/amd64/vmm/   (props changed)
  projects/physbio/sys/boot/   (props changed)
  projects/physbio/usr.sbin/bhyve/   (props changed)

Modified: projects/physbio/Makefile.inc1
==============================================================================
--- projects/physbio/Makefile.inc1	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/Makefile.inc1	Thu Jan 31 21:01:42 2013	(r246159)
@@ -185,7 +185,7 @@ OBJTREE=	${MAKEOBJDIRPREFIX}/${TARGET}.$
 .endif
 WORLDTMP=	${OBJTREE}${.CURDIR}/tmp
 # /usr/games added for fortune which depend on strfile
-BPATH=		${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games
+BPATH=		${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games:${WORLDTMP}/legacy/bin
 XPATH=		${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
 STRICTTMPPATH=	${BPATH}:${XPATH}
 TMPPATH=	${STRICTTMPPATH}:${PATH}
@@ -412,7 +412,7 @@ _worldtmp:
 	rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
 .endif
 .for _dir in \
-    lib usr legacy/usr
+    lib usr legacy/bin legacy/usr
 	mkdir -p ${WORLDTMP}/${_dir}
 .endfor
 	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
@@ -673,8 +673,8 @@ _zoneinfo=	zic tzsetup
 
 ITOOLS=	[ awk cap_mkdb cat chflags chmod chown \
 	date echo egrep find grep id install ${_install-info} \
-	ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
-	test true uname wc ${_zoneinfo}
+	ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \
+	rm sed sh sysctl test true uname wc ${_zoneinfo}
 
 #
 # distributeworld
@@ -964,7 +964,7 @@ reinstallkernel reinstallkernel.debug: i
 	@echo "--------------------------------------------------------------"
 	cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
 	    ${CROSSENV} PATH=${TMPPATH} \
-	    ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
+	    ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
 
 distributekernel distributekernel.debug:
 .if empty(INSTALLKERNEL)
@@ -1132,6 +1132,12 @@ _yacc=		usr.bin/yacc
 .if ${BOOTSTRAPPING} < 1000026
 _nmtree=	lib/libnetbsd \
 		usr.sbin/nmtree
+.else
+_nmtree_itools=	nmtree
+.endif
+
+.if ${BOOTSTRAPPING} < 1000027
+_cat=		bin/cat
 .endif
 
 .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041
@@ -1189,6 +1195,7 @@ bootstrap-tools:
     ${_ar} \
     ${_dtc} \
     ${_awk} \
+    ${_cat} \
     usr.bin/lorder \
     usr.bin/makewhatis \
     ${_mklocale} \

Modified: projects/physbio/UPDATING
==============================================================================
--- projects/physbio/UPDATING	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/UPDATING	Thu Jan 31 21:01:42 2013	(r246159)
@@ -31,7 +31,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
 	as bsdpatch, being the GNU version the default patch.
 	To inverse the logic and use the BSD-licensed one as default,
 	while having the GNU version installed as gnupatch, rebuild
-	ans install world with the WITH_BSD_PATCH knob set.
+	and install world with the WITH_BSD_PATCH knob set.
 
 20130118:
 	The install(1) option -M has changed meaning and now takes an

Modified: projects/physbio/bin/cat/cat.1
==============================================================================
--- projects/physbio/bin/cat/cat.1	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/bin/cat/cat.1	Thu Jan 31 21:01:42 2013	(r246159)
@@ -32,7 +32,7 @@
 .\"     @(#)cat.1	8.3 (Berkeley) 5/2/95
 .\" $FreeBSD$
 .\"
-.Dd March 21, 2004
+.Dd January 29, 2013
 .Dt CAT 1
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Nd concatenate and print files
 .Sh SYNOPSIS
 .Nm
-.Op Fl benstuv
+.Op Fl belnstuv
 .Op Ar
 .Sh DESCRIPTION
 The
@@ -79,6 +79,16 @@ Display non-printing characters (see the
 option), and display a dollar sign
 .Pq Ql \&$
 at the end of each line.
+.It Fl l
+Set an exclusive advisory lock on the standard output file descriptor.
+This lock is set using
+.Xr fcntl 2
+with the
+.Dv F_SETLKW
+command.
+If the output file is already locked,
+.Nm
+will block until the lock is acquired.
 .It Fl n
 Number the output lines, starting at 1.
 .It Fl s
@@ -160,6 +170,7 @@ operand.
 .Xr tail 1 ,
 .Xr vis 1 ,
 .Xr zcat 1 ,
+.Xr fcntl 2 ,
 .Xr setbuf 3
 .Rs
 .%A Rob Pike
@@ -175,7 +186,7 @@ utility is compliant with the
 specification.
 .Pp
 The flags
-.Op Fl benstv
+.Op Fl belnstv
 are extensions to the specification.
 .Sh HISTORY
 A

Modified: projects/physbio/bin/cat/cat.c
==============================================================================
--- projects/physbio/bin/cat/cat.c	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/bin/cat/cat.c	Thu Jan 31 21:01:42 2013	(r246159)
@@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$");
 #include <string.h>
 #include <unistd.h>
 
-static int bflag, eflag, nflag, sflag, tflag, vflag;
+static int bflag, eflag, lflag, nflag, sflag, tflag, vflag;
 static int rval;
 static const char *filename;
 
@@ -96,10 +96,11 @@ int
 main(int argc, char *argv[])
 {
 	int ch;
+	struct flock stdout_lock;
 
 	setlocale(LC_CTYPE, "");
 
-	while ((ch = getopt(argc, argv, "benstuv")) != -1)
+	while ((ch = getopt(argc, argv, "belnstuv")) != -1)
 		switch (ch) {
 		case 'b':
 			bflag = nflag = 1;	/* -b implies -n */
@@ -107,6 +108,9 @@ main(int argc, char *argv[])
 		case 'e':
 			eflag = vflag = 1;	/* -e implies -v */
 			break;
+		case 'l':
+			lflag = 1;
+			break;
 		case 'n':
 			nflag = 1;
 			break;
@@ -127,6 +131,15 @@ main(int argc, char *argv[])
 		}
 	argv += optind;
 
+	if (lflag) {
+		stdout_lock.l_len = 0;
+		stdout_lock.l_start = 0;
+		stdout_lock.l_type = F_WRLCK;
+		stdout_lock.l_whence = SEEK_SET;
+		if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) == -1)
+			err(EXIT_FAILURE, "stdout");
+	}
+
 	if (bflag || eflag || nflag || sflag || tflag || vflag)
 		scanfiles(argv, 1);
 	else
@@ -140,7 +153,7 @@ main(int argc, char *argv[])
 static void
 usage(void)
 {
-	fprintf(stderr, "usage: cat [-benstuv] [file ...]\n");
+	fprintf(stderr, "usage: cat [-belnstuv] [file ...]\n");
 	exit(1);
 	/* NOTREACHED */
 }

Modified: projects/physbio/contrib/ipfilter/ipsend/44arp.c
==============================================================================
--- projects/physbio/contrib/ipfilter/ipsend/44arp.c	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/contrib/ipfilter/ipsend/44arp.c	Thu Jan 31 21:01:42 2013	(r246159)
@@ -72,7 +72,7 @@ char	*addr, *eaddr;
 	size_t	needed;
 	char	*lim, *buf, *next;
 	struct	rt_msghdr	*rtm;
-	struct	sockaddr_inarp	*sin;
+	struct	sockaddr_in	*sin;
 	struct	sockaddr_dl	*sdl;
 
 #ifdef	IPSEND
@@ -113,7 +113,7 @@ char	*addr, *eaddr;
 	for (next = buf; next < lim; next += rtm->rtm_msglen)
 	    {
 		rtm = (struct rt_msghdr *)next;
-		sin = (struct sockaddr_inarp *)(rtm + 1);
+		sin = (struct sockaddr_in *)(rtm + 1);
 		sdl = (struct sockaddr_dl *)(sin + 1);
 		if (!bcmp(addr, (char *)&sin->sin_addr,
 			  sizeof(struct in_addr)))

Modified: projects/physbio/etc/Makefile
==============================================================================
--- projects/physbio/etc/Makefile	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/etc/Makefile	Thu Jan 31 21:01:42 2013	(r246159)
@@ -180,6 +180,10 @@ CAP_MKDB_ENDIAN?=
 PWD_MKDB_ENDIAN?=
 .endif
 
+.if defined(NO_ROOT)
+METALOG.add?=	cat -l >> ${METALOG}
+.endif
+
 distribution:
 .if !defined(DESTDIR)
 	@echo "set DESTDIR before running \"make ${.TARGET}\""
@@ -201,6 +205,14 @@ distribution:
 .endif
 	pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
 	    ${DESTDIR}/etc/master.passwd
+.if defined(NO_ROOT)
+	( \
+		echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
+		echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
+		echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
+		echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
+	) | ${METALOG.add}
+.endif
 .if ${MK_ATF} != "no"
 	${_+_}cd ${.CURDIR}/atf; ${MAKE} install
 .endif
@@ -336,9 +348,10 @@ distrib-dirs:
 		test "$$d" == "/" && d=""; \
 		d=${DISTBASE}$$d; \
 		shift; \
-		${ECHO} "${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# >>" \
-		    "${METALOG}" ; \
-		${MTREE_CMD} -C -f $$m | sed s#^\.#.$$d# >> ${METALOG} ; \
+		${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
+		    "sed s#^\.#.$$d# | ${METALOG.add}" ; \
+		${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
+		    ${METALOG.add} ; \
 	done; true
 .endif
 	${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys

Modified: projects/physbio/include/stdio.h
==============================================================================
--- projects/physbio/include/stdio.h	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/include/stdio.h	Thu Jan 31 21:01:42 2013	(r246159)
@@ -343,6 +343,7 @@ char	*tempnam(const char *, const char *
 #endif
 
 #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809
+FILE	*fmemopen(void * __restrict, size_t, const char * __restrict);
 ssize_t	 getdelim(char ** __restrict, size_t * __restrict, int,
 	    FILE * __restrict);
 int	 renameat(int, const char *, int, const char *);

Modified: projects/physbio/lib/libc/amd64/sys/__vdso_gettc.c
==============================================================================
--- projects/physbio/lib/libc/amd64/sys/__vdso_gettc.c	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/amd64/sys/__vdso_gettc.c	Thu Jan 31 21:01:42 2013	(r246159)
@@ -27,9 +27,11 @@
 __FBSDID("$FreeBSD$");
 
 #include <sys/types.h>
+#include <sys/elf.h>
 #include <sys/time.h>
 #include <sys/vdso.h>
 #include <machine/cpufunc.h>
+#include "libc_private.h"
 
 static u_int
 __vdso_gettc_low(const struct vdso_timehands *th)
@@ -41,9 +43,18 @@ __vdso_gettc_low(const struct vdso_timeh
 	return (rv);
 }
 
+#pragma weak __vdso_gettc
 u_int
 __vdso_gettc(const struct vdso_timehands *th)
 {
 
 	return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : rdtsc32());
 }
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+	return (_elf_aux_info(AT_TIMEKEEP, tk, sizeof(*tk)));
+}

Modified: projects/physbio/lib/libc/arm/sys/Makefile.inc
==============================================================================
--- projects/physbio/lib/libc/arm/sys/Makefile.inc	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/arm/sys/Makefile.inc	Thu Jan 31 21:01:42 2013	(r246159)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+SRCS+=	__vdso_gettc.c
+
 MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S
 
 # Don't generate default code for these syscalls:

Copied: projects/physbio/lib/libc/arm/sys/__vdso_gettc.c (from r246158, head/lib/libc/arm/sys/__vdso_gettc.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/physbio/lib/libc/arm/sys/__vdso_gettc.c	Thu Jan 31 21:01:42 2013	(r246159, copy of r246158, head/lib/libc/arm/sys/__vdso_gettc.c)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
+
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
+
+	return (0);
+}
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+	return (ENOSYS);
+}

Modified: projects/physbio/lib/libc/i386/sys/__vdso_gettc.c
==============================================================================
--- projects/physbio/lib/libc/i386/sys/__vdso_gettc.c	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/i386/sys/__vdso_gettc.c	Thu Jan 31 21:01:42 2013	(r246159)
@@ -27,9 +27,11 @@
 __FBSDID("$FreeBSD$");
 
 #include <sys/types.h>
+#include <sys/elf.h>
 #include <sys/time.h>
 #include <sys/vdso.h>
 #include <machine/cpufunc.h>
+#include "libc_private.h"
 
 static u_int
 __vdso_gettc_low(const struct vdso_timehands *th)
@@ -48,3 +50,11 @@ __vdso_gettc(const struct vdso_timehands
 
 	return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : rdtsc32());
 }
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+	return (_elf_aux_info(AT_TIMEKEEP, tk, sizeof(*tk)));
+}

Modified: projects/physbio/lib/libc/ia64/sys/Makefile.inc
==============================================================================
--- projects/physbio/lib/libc/ia64/sys/Makefile.inc	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/ia64/sys/Makefile.inc	Thu Jan 31 21:01:42 2013	(r246159)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+SRCS+=	__vdso_gettc.c
+
 MDASM+=	Ovfork.S brk.S cerror.S exect.S fork.S getcontext.S pipe.S ptrace.S \
 	sbrk.S setlogin.S sigreturn.S swapcontext.S
 

Copied: projects/physbio/lib/libc/ia64/sys/__vdso_gettc.c (from r246158, head/lib/libc/ia64/sys/__vdso_gettc.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/physbio/lib/libc/ia64/sys/__vdso_gettc.c	Thu Jan 31 21:01:42 2013	(r246159, copy of r246158, head/lib/libc/ia64/sys/__vdso_gettc.c)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
+
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
+
+	return (0);
+}
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+	return (ENOSYS);
+}

Modified: projects/physbio/lib/libc/mips/sys/Makefile.inc
==============================================================================
--- projects/physbio/lib/libc/mips/sys/Makefile.inc	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/mips/sys/Makefile.inc	Thu Jan 31 21:01:42 2013	(r246159)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+SRCS+=	__vdso_gettc.c
+
 MDASM=  Ovfork.S brk.S cerror.S exect.S \
 	fork.S pipe.S ptrace.S sbrk.S syscall.S
 

Copied: projects/physbio/lib/libc/mips/sys/__vdso_gettc.c (from r246158, head/lib/libc/mips/sys/__vdso_gettc.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/physbio/lib/libc/mips/sys/__vdso_gettc.c	Thu Jan 31 21:01:42 2013	(r246159, copy of r246158, head/lib/libc/mips/sys/__vdso_gettc.c)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
+
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
+
+	return (0);
+}
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+	return (ENOSYS);
+}

Modified: projects/physbio/lib/libc/powerpc/Makefile.inc
==============================================================================
--- projects/physbio/lib/libc/powerpc/Makefile.inc	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/powerpc/Makefile.inc	Thu Jan 31 21:01:42 2013	(r246159)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+SRCS+=	__vdso_gettc.c
+
 # Long double is 64-bits
 MDSRCS+=machdep_ldisd.c
 SYM_MAPS+=${.CURDIR}/powerpc/Symbol.map

Copied: projects/physbio/lib/libc/powerpc/sys/__vdso_gettc.c (from r246158, head/lib/libc/powerpc/sys/__vdso_gettc.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/physbio/lib/libc/powerpc/sys/__vdso_gettc.c	Thu Jan 31 21:01:42 2013	(r246159, copy of r246158, head/lib/libc/powerpc/sys/__vdso_gettc.c)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
+
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
+
+	return (0);
+}
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+	return (ENOSYS);
+}

Modified: projects/physbio/lib/libc/powerpc64/Makefile.inc
==============================================================================
--- projects/physbio/lib/libc/powerpc64/Makefile.inc	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/powerpc64/Makefile.inc	Thu Jan 31 21:01:42 2013	(r246159)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+SRCS+=	__vdso_gettc.c
+
 # Long double is 64-bits
 MDSRCS+=machdep_ldisd.c
 SYM_MAPS+=${.CURDIR}/powerpc64/Symbol.map

Copied: projects/physbio/lib/libc/powerpc64/sys/__vdso_gettc.c (from r246158, head/lib/libc/powerpc64/sys/__vdso_gettc.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/physbio/lib/libc/powerpc64/sys/__vdso_gettc.c	Thu Jan 31 21:01:42 2013	(r246159, copy of r246158, head/lib/libc/powerpc64/sys/__vdso_gettc.c)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
+
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
+
+	return (0);
+}
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+	return (ENOSYS);
+}

Modified: projects/physbio/lib/libc/sparc64/Makefile.inc
==============================================================================
--- projects/physbio/lib/libc/sparc64/Makefile.inc	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/sparc64/Makefile.inc	Thu Jan 31 21:01:42 2013	(r246159)
@@ -5,6 +5,8 @@
 
 .include "fpu/Makefile.inc"
 
+SRCS+=	__vdso_gettc.c
+
 # Long double is quad precision
 GDTOASRCS+=strtorQ.c
 MDSRCS+=machdep_ldisQ.c

Copied: projects/physbio/lib/libc/sparc64/sys/__vdso_gettc.c (from r246158, head/lib/libc/sparc64/sys/__vdso_gettc.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/physbio/lib/libc/sparc64/sys/__vdso_gettc.c	Thu Jan 31 21:01:42 2013	(r246159, copy of r246158, head/lib/libc/sparc64/sys/__vdso_gettc.c)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2013 Konstantin Belousov <kib@FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/vdso.h>
+#include <errno.h>
+
+#pragma weak __vdso_gettc
+u_int
+__vdso_gettc(const struct vdso_timehands *th)
+{
+
+	return (0);
+}
+
+#pragma weak __vdso_gettimekeep
+int
+__vdso_gettimekeep(struct vdso_timekeep **tk)
+{
+
+	return (ENOSYS);
+}

Modified: projects/physbio/lib/libc/stdio/Makefile.inc
==============================================================================
--- projects/physbio/lib/libc/stdio/Makefile.inc	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/stdio/Makefile.inc	Thu Jan 31 21:01:42 2013	(r246159)
@@ -8,7 +8,8 @@ SRCS+=	_flock_stub.c asprintf.c clrerr.c
 	fclose.c fcloseall.c fdopen.c \
 	feof.c ferror.c fflush.c fgetc.c fgetln.c fgetpos.c fgets.c fgetwc.c \
 	fgetwln.c fgetws.c \
-	fileno.c findfp.c flags.c fopen.c fprintf.c fpurge.c fputc.c fputs.c \
+	fileno.c findfp.c flags.c fmemopen.c fopen.c fprintf.c fpurge.c \
+	fputc.c fputs.c \
 	fputwc.c fputws.c fread.c freopen.c fscanf.c fseek.c fsetpos.c \
 	ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \
 	fwrite.c getc.c getchar.c getdelim.c getline.c \
@@ -48,7 +49,7 @@ MLINKS+=ferror.3 ferror_unlocked.3 \
 MLINKS+=fflush.3 fpurge.3
 MLINKS+=fgets.3 gets.3
 MLINKS+=flockfile.3 ftrylockfile.3 flockfile.3 funlockfile.3
-MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3
+MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 fopen.3 fmemopen.3
 MLINKS+=fputs.3 puts.3
 MLINKS+=fread.3 fwrite.3
 MLINKS+=fseek.3 fgetpos.3 fseek.3 fseeko.3 fseek.3 fsetpos.3 fseek.3 ftell.3 \

Modified: projects/physbio/lib/libc/stdio/Symbol.map
==============================================================================
--- projects/physbio/lib/libc/stdio/Symbol.map	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/stdio/Symbol.map	Thu Jan 31 21:01:42 2013	(r246159)
@@ -155,6 +155,7 @@ FBSD_1.3 {
 	getwchar_l;
 	putwc_l;
 	putwchar_l;
+	fmemopen;
 };
 
 FBSDprivate_1.0 {

Copied: projects/physbio/lib/libc/stdio/fmemopen.c (from r246158, head/lib/libc/stdio/fmemopen.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/physbio/lib/libc/stdio/fmemopen.c	Thu Jan 31 21:01:42 2013	(r246159, copy of r246158, head/lib/libc/stdio/fmemopen.c)
@@ -0,0 +1,259 @@
+/*-
+Copyright (C) 2013 Pietro Cerutti <gahr@FreeBSD.org>
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include "local.h"
+
+struct fmemopen_cookie
+{
+	char	*buf;	/* pointer to the memory region */
+	char	 own;	/* did we allocate the buffer ourselves? */
+	char     bin;   /* is this a binary buffer? */
+	size_t	 size;	/* buffer length in bytes */
+	size_t	 len;	/* data length in bytes */
+	size_t	 off;	/* current offset into the buffer */
+};
+
+static int	fmemopen_read  (void *cookie, char *buf, int nbytes);
+static int	fmemopen_write (void *cookie, const char *buf, int nbytes);
+static fpos_t	fmemopen_seek  (void *cookie, fpos_t offset, int whence);
+static int	fmemopen_close (void *cookie);
+
+FILE *
+fmemopen (void * __restrict buf, size_t size, const char * __restrict mode)
+{
+	struct fmemopen_cookie *ck;
+	FILE *f;
+	int flags, rc;
+
+	/* 
+	 * Retrieve the flags as used by open(2) from the mode argument, and
+	 * validate them.
+	 * */
+	rc = __sflags (mode, &flags);
+	if (rc == 0) {
+		errno = EINVAL;
+		return (NULL);
+	}
+
+	/* 
+	 * There's no point in requiring an automatically allocated buffer
+	 * in write-only mode.
+	 */
+	if (!(flags & O_RDWR) && buf == NULL) {
+		errno = EINVAL;
+		return (NULL);
+	}
+	
+	/* Allocate a cookie. */
+	ck = malloc (sizeof (struct fmemopen_cookie));
+	if (ck == NULL) {
+		return (NULL);
+	}
+
+	ck->off  = 0;
+	ck->size = size;
+
+	/* Check whether we have to allocate the buffer ourselves. */
+	ck->own = ((ck->buf = buf) == NULL);
+	if (ck->own) {
+		ck->buf = malloc (size);
+		if (ck->buf == NULL) {
+			free (ck);
+			return (NULL);
+		}
+	}
+
+	/*
+	 * POSIX distinguishes between w+ and r+, in that w+ is supposed to
+	 * truncate the buffer.
+	 */
+	if (ck->own || mode[0] == 'w') {
+		ck->buf[0] = '\0';
+	}
+
+	/* Check for binary mode. */
+	ck->bin = strchr(mode, 'b') != NULL;
+
+	/*
+	 * The size of the current buffer contents is set depending on the
+	 * mode:
+	 *
+	 * for append (text-mode), the position of the first NULL byte, or the
+	 * size of the buffer if none is found
+	 *
+	 * for append (binary-mode), the size of the buffer
+	 *
+	 * for read, the size of the buffer
+	 *
+	 * for write, 0
+	 */
+	switch (mode[0]) {
+	case 'a':
+		if (ck->bin) {
+			/* 
+			 * This isn't useful, since the buffer isn't
+			 * allowed to grow.
+			 */
+			ck->off = ck->len = size;
+		} else
+			ck->off = ck->len = strnlen(ck->buf, ck->size);
+		break;
+	case 'r':
+		ck->len = size;
+		break;
+	case 'w':
+		ck->len = 0;
+		break;
+	}
+
+	/* Actuall wrapper. */
+	f = funopen ((void *)ck,
+	    flags & O_WRONLY ? NULL : fmemopen_read, 
+	    flags & O_RDONLY ? NULL : fmemopen_write,
+	    fmemopen_seek, fmemopen_close);
+
+	if (f == NULL) {
+		if (ck->own)
+			free (ck->buf);
+		free (ck);
+		return (NULL);
+	}
+
+	/*
+	 * Turn off buffering, so a write past the end of the buffer
+	 * correctly returns a short object count.
+	 */
+	setvbuf (f, (char *) NULL, _IONBF, 0);
+
+	return (f);
+}
+
+static int
+fmemopen_read (void *cookie, char *buf, int nbytes)
+{
+	struct fmemopen_cookie *ck = cookie;
+
+	if (nbytes > ck->len - ck->off)
+		nbytes = ck->len - ck->off;
+
+	if (nbytes == 0)
+		return (0);
+
+	memcpy (buf, ck->buf + ck->off, nbytes);
+
+	ck->off += nbytes;
+
+	return (nbytes);
+}
+
+static int
+fmemopen_write (void *cookie, const char *buf, int nbytes)
+{
+	struct fmemopen_cookie *ck = cookie;
+
+	if (nbytes > ck->size - ck->off)
+		nbytes = ck->size - ck->off;
+
+	if (nbytes == 0)
+		return (0);
+
+	memcpy (ck->buf + ck->off, buf, nbytes);
+
+	ck->off += nbytes;
+
+	if (ck->off > ck->len)
+		ck->len = ck->off;
+
+	/*
+	 * We append a NULL byte if all these conditions are met:
+	 * - the buffer is not binary
+	 * - the buffer is not full
+	 * - the data just written doesn't already end with a NULL byte
+	 */
+	if (!ck->bin && ck->off < ck->size && ck->buf[ck->off - 1] != '\0')
+		ck->buf[ck->off] = '\0';
+
+	return (nbytes);
+}
+
+static fpos_t
+fmemopen_seek (void *cookie, fpos_t offset, int whence)
+{
+	struct fmemopen_cookie *ck = cookie;
+
+
+	switch (whence) {
+	case SEEK_SET:
+		if (offset > ck->size) {
+			errno = EINVAL;
+			return (-1);
+		}
+		ck->off = offset;
+		break;
+
+	case SEEK_CUR:
+		if (ck->off + offset > ck->size) {
+			errno = EINVAL;
+			return (-1);
+		}
+		ck->off += offset;
+		break;
+
+	case SEEK_END:
+		if (offset > 0 || -offset > ck->len) {
+			errno = EINVAL;
+			return (-1);
+		}
+		ck->off = ck->len + offset;
+		break;
+
+	default:
+		errno = EINVAL;
+		return (-1);
+	}
+
+	return (ck->off);
+}
+
+static int
+fmemopen_close (void *cookie)
+{
+	struct fmemopen_cookie *ck = cookie;
+
+	if (ck->own)
+		free (ck->buf);
+
+	free (ck);
+
+	return (0);
+}

Modified: projects/physbio/lib/libc/stdio/fopen.3
==============================================================================
--- projects/physbio/lib/libc/stdio/fopen.3	Thu Jan 31 20:53:31 2013	(r246158)
+++ projects/physbio/lib/libc/stdio/fopen.3	Thu Jan 31 21:01:42 2013	(r246159)
@@ -32,13 +32,14 @@
 .\"     @(#)fopen.3	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd November 30, 2012
+.Dd January 30, 2013
 .Dt FOPEN 3
 .Os
 .Sh NAME
 .Nm fopen ,
 .Nm fdopen ,
-.Nm freopen
+.Nm freopen ,
+.Nm fmemopen
 .Nd stream open functions
 .Sh LIBRARY
 .Lb libc
@@ -50,6 +51,8 @@
 .Fn fdopen "int fildes" "const char *mode"
 .Ft FILE *
 .Fn freopen "const char *path" "const char *mode" "FILE *stream"
+.Ft FILE *

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301312101.r0VL1h4a025128>