The following reply was made to PR bin/10; it has been noted by GNATS.
From: dfil...@freebsd.org (dfilter service)
To: bug-follo...@freebsd.org
Cc:
Subject: Re: bin/10: commit references a PR
Date: Sat, 28 Apr 2012 20:52:30 + (UTC)
Author: jlh
Date: Sat Apr 28 20:52:20 2012
New Revision: 234772
URL: http://svn.freebsd.org/changeset/base/234772
Log:
Import stdbuf(1) and the shared library it relies on.
This tool changes the default buffering behaviour of standard
stdio streams.
It only works on dynamic binaries. To make it work for static
ones it would require cluttering stdio because there no single
entry point.
PR: 10
Reviewed by: current@, jhb
Approved by: kib (mentor)
MFC after: 1 week
Added:
head/lib/libstdbuf/
head/lib/libstdbuf/Makefile (contents, props changed)
head/lib/libstdbuf/libstdbuf.3 (contents, props changed)
head/lib/libstdbuf/stdbuf.c (contents, props changed)
head/usr.bin/stdbuf/
head/usr.bin/stdbuf/Makefile (contents, props changed)
head/usr.bin/stdbuf/stdbuf.1 (contents, props changed)
head/usr.bin/stdbuf/stdbuf.c (contents, props changed)
Modified:
head/lib/Makefile
head/lib/libc/stdio/setbuf.3
head/usr.bin/Makefile
Modified: head/lib/Makefile
==
--- head/lib/Makefile Sat Apr 28 20:34:14 2012(r234771)
+++ head/lib/Makefile Sat Apr 28 20:52:20 2012(r234772)
@@ -104,6 +104,7 @@ SUBDIR=${SUBDIR_ORDERED} \
${_libsmdb} \
${_libsmutil} \
libstand \
+ libstdbuf \
libstdthreads \
${_libtelnet} \
${_libthr} \
Modified: head/lib/libc/stdio/setbuf.3
==
--- head/lib/libc/stdio/setbuf.3 Sat Apr 28 20:34:14 2012
(r234771)
+++ head/lib/libc/stdio/setbuf.3 Sat Apr 28 20:52:20 2012
(r234772)
@@ -83,6 +83,9 @@ normally does) it is line buffered.
The standard error stream
.Dv stderr
is always unbuffered.
+Note that these defaults maybe be altered using the
+.Xr stdbuf 1
+utility.
.Pp
The
.Fn setvbuf
@@ -177,6 +180,7 @@ function returns what the equivalent
.Fn setvbuf
would have returned.
.Sh SEE ALSO
+.Xr stdbuf 1 ,
.Xr fclose 3 ,
.Xr fopen 3 ,
.Xr fread 3 ,
Added: head/lib/libstdbuf/Makefile
==
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/lib/libstdbuf/MakefileSat Apr 28 20:52:20 2012
(r234772)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+.include
+
+LIB= stdbuf
+SRCS= stdbuf.c
+SHLIB_MAJOR= 1
+MAN= libstdbuf.3
+
+WARNS?= 6
+
+.include
Added: head/lib/libstdbuf/libstdbuf.3
==
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/lib/libstdbuf/libstdbuf.3 Sat Apr 28 20:52:20 2012
(r234772)
@@ -0,0 +1,102 @@
+.\" Copyright (c) 2012 Jeremie Le Hen
+.\" All rights reserved.
+.\"
+.\" 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 and documentation 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd April 28, 2012
+.Dt LIBSTDBUF 3
+.Os
+.Sh NAME
+.Nm libstdbuf
+.Nd preloaded library to change standard streams initial buffering
+.Sh DESCRIPTION
+The
+.Nm
+library is meant to be preloaded with the
+.Ev LD_PRELOAD
+environment variable to as to change the initial buffering
+of standard input, standard output and standard error streams.
+.Pp