Date: Tue, 8 May 2012 19:33:31 +0000 (UTC) From: Jeremie Le Hen <jlh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r235141 - in stable/8: lib lib/libc/stdio lib/libstdbuf usr.bin usr.bin/stdbuf Message-ID: <201205081933.q48JXVHD049061@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jlh Date: Tue May 8 19:33:31 2012 New Revision: 235141 URL: http://svn.freebsd.org/changeset/base/235141 Log: MFC r234772: 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: 166660 Reviewed by: current@, jhb Approved by: kib (mentor) MFC after: 1 week MFC r234773: Fix small documentation mistakes. Submitted by: brueffer Approved by: kib (mentor) MFC r234779: Use standard getopt(3) error message. Submitted by: jilles Approved by: kib (mentor) Added: - copied from r234772, head/lib/libstdbuf/ - copied from r234772, head/usr.bin/stdbuf/ Directory Properties: stable/8/lib/libstdbuf/ (props changed) stable/8/usr.bin/stdbuf/ (props changed) Modified: stable/8/lib/Makefile (contents, props changed) stable/8/lib/libc/stdio/setbuf.3 stable/8/lib/libstdbuf/libstdbuf.3 stable/8/usr.bin/Makefile stable/8/usr.bin/stdbuf/stdbuf.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) stable/8/usr.bin/ (props changed) Modified: stable/8/lib/Makefile ============================================================================== --- stable/8/lib/Makefile Tue May 8 18:56:21 2012 (r235140) +++ stable/8/lib/Makefile Tue May 8 19:33:31 2012 (r235141) @@ -95,6 +95,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libsmdb} \ ${_libsmutil} \ libstand \ + libstdbuf \ ${_libtelnet} \ ${_libthr} \ libthread_db \ Modified: stable/8/lib/libc/stdio/setbuf.3 ============================================================================== --- stable/8/lib/libc/stdio/setbuf.3 Tue May 8 18:56:21 2012 (r235140) +++ stable/8/lib/libc/stdio/setbuf.3 Tue May 8 19:33:31 2012 (r235141) @@ -83,6 +83,9 @@ normally does) it is line buffered. The standard error stream .Dv stderr is always unbuffered. +Note that these defaults may 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 , Modified: stable/8/lib/libstdbuf/libstdbuf.3 ============================================================================== --- head/lib/libstdbuf/libstdbuf.3 Sat Apr 28 20:52:20 2012 (r234772) +++ stable/8/lib/libstdbuf/libstdbuf.3 Tue May 8 19:33:31 2012 (r235141) @@ -43,7 +43,7 @@ an utility, .Xr stdbuf 1 , can be used to run a command with the appropriate environment variables. .Sh ENVIRONMENT -Each stream can be configured indepentently through the following +Each stream can be configured independently through the following environment variables (values are defined below): .Bl -tag -width size -offset indent .It Ev _STDBUF_I Modified: stable/8/usr.bin/Makefile ============================================================================== --- stable/8/usr.bin/Makefile Tue May 8 18:56:21 2012 (r235140) +++ stable/8/usr.bin/Makefile Tue May 8 19:33:31 2012 (r235141) @@ -177,6 +177,7 @@ SUBDIR= alias \ sockstat \ split \ stat \ + stdbuf \ su \ systat \ tabs \ Modified: stable/8/usr.bin/stdbuf/stdbuf.c ============================================================================== --- head/usr.bin/stdbuf/stdbuf.c Sat Apr 28 20:52:20 2012 (r234772) +++ stable/8/usr.bin/stdbuf/stdbuf.c Tue May 8 19:33:31 2012 (r235141) @@ -52,7 +52,7 @@ main(int argc, char *argv[]) int i; ibuf = obuf = ebuf = NULL; - while ((i = getopt(argc, argv, ":e:i:o:")) != -1) { + while ((i = getopt(argc, argv, "e:i:o:")) != -1) { switch (i) { case 'e': ebuf = optarg; @@ -63,13 +63,8 @@ main(int argc, char *argv[]) case 'o': obuf = optarg; break; - case ':': - warnx("Missing argument for option -%c", optopt); - usage(1); - break; case '?': default: - warnx("Unknown option: %c", optopt); usage(1); break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205081933.q48JXVHD049061>