From owner-cvs-include Mon May 27 03:49:54 1996 Return-Path: owner-cvs-include Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id DAA03260 for cvs-include-outgoing; Mon, 27 May 1996 03:49:54 -0700 (PDT) Received: (from peter@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id DAA03239; Mon, 27 May 1996 03:49:45 -0700 (PDT) Date: Mon, 27 May 1996 03:49:45 -0700 (PDT) From: Peter Wemm Message-Id: <199605271049.DAA03239@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-lib, cvs-include Subject: cvs commit: src/include stdio.h src/lib/libc/stdio asprintf.c vasprintf.c Makefile.inc printf.3 Sender: owner-cvs-include@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk peter 96/05/27 03:49:44 Modified: include stdio.h lib/libc/stdio Makefile.inc printf.3 Added: lib/libc/stdio asprintf.c vasprintf.c Log: Add an implementation of the gnu-ish asprintf() and vasprintf(). They are not based on gpl'ed code, just prototype and usage. I'm not 100% certain they behave the same while the system is in trouble (eg: malloc() failing) but in those circumstances all bets would be off anyway. These routines work like sprintf() and vsprintf(), except that instead of using a fixed buffer, they allocate memory and return it to the user and it's the user's responsibility to free() it. They have allocate as much memory as they need (and can get), so the size of strings it can deal with is limited only by the amount of memory it can malloc() on your behalf. There are a few gpl'ed programs starting to use this interface, and it's becoming more common with the scares about security risks with sprintf(). I dont like the look of the code that the various programs (including cvs, gdb, libg++, etc) provide if configure can't find it on the system. It should be possible to modify the stdio core code to provide this interface more efficiently, I was more worried about having something that worked and was secure. :-) (I noticed that there was once intended to be a smprintf() routine when our stdio was written for 4.4BSD, but it looks pretty stillborn, and it's intended interface is not clear). Since Linux and gnu libc have this interface, it seemed silly to bring yet another one onto the scene. Revision Changes Path 1.6 +2 -0 src/include/stdio.h 1.4 +5 -5 src/lib/libc/stdio/Makefile.inc 1.4 +47 -33 src/lib/libc/stdio/printf.3 From owner-cvs-include Thu May 30 09:32:01 1996 Return-Path: owner-cvs-include Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA23246 for cvs-include-outgoing; Thu, 30 May 1996 09:32:01 -0700 (PDT) Received: (from wollman@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA23211; Thu, 30 May 1996 09:31:50 -0700 (PDT) Date: Thu, 30 May 1996 09:31:50 -0700 (PDT) From: Garrett Wollman Message-Id: <199605301631.JAA23211@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-include, cvs-usrsbin Subject: cvs commit: src/include/protocols routed.h src/usr.sbin/routed Makefile defs.h if.c input.c main.c output.c pathnames.h routed.8 trace.c Sender: owner-cvs-include@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk wollman 96/05/30 09:31:50 Modified: include/protocols routed.h Log: Protocol definitions for RIPv2. Obtained from: Vernon Schryver Revision Changes Path 1.4 +88 -21 src/include/protocols/routed.h Modified: usr.sbin/routed Makefile defs.h if.c input.c main.c output.c pathnames.h routed.8 trace.c Log: Copy SGI routed onto head. Revision Changes Path 1.4 +2 -6 src/usr.sbin/routed/Makefile 1.3 +499 -60 src/usr.sbin/routed/defs.h 1.3 +1003 -76 src/usr.sbin/routed/if.c 1.3 +614 -270 src/usr.sbin/routed/input.c 1.3 +722 -256 src/usr.sbin/routed/main.c 1.2 +686 -110 src/usr.sbin/routed/output.c 1.2 +5 -0 src/usr.sbin/routed/pathnames.h 1.5 +375 -206 src/usr.sbin/routed/routed.8 1.2 +598 -311 src/usr.sbin/routed/trace.c