From owner-cvs-src@FreeBSD.ORG Wed Jul 4 00:00:42 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78A5116A41F; Wed, 4 Jul 2007 00:00:42 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 66FE313C455; Wed, 4 Jul 2007 00:00:42 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l6400g7U044776; Wed, 4 Jul 2007 00:00:42 GMT (envelope-from scf@repoman.freebsd.org) Received: (from scf@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l6400gLs044775; Wed, 4 Jul 2007 00:00:42 GMT (envelope-from scf) Message-Id: <200707040000.l6400gLs044775@repoman.freebsd.org> From: Sean Farley Date: Wed, 4 Jul 2007 00:00:41 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/bin/df df.c src/bin/sh var.c src/include stdlib.h src/libexec/pppoed pppoed.c src/sys/sys param.h src/lib/libc/stdlib Makefile.inc getenv.3 getenv.c putenv.c setenv.c src/tools/regression/environ Makefile Makefile.envctl ... X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2007 00:00:42 -0000 scf 2007-07-04 00:00:41 UTC FreeBSD src repository Modified files: bin/df df.c bin/sh var.c include stdlib.h libexec/pppoed pppoed.c sys/sys param.h lib/libc/stdlib Makefile.inc getenv.3 getenv.c usr.bin/du du.c usr.bin/env env.c usr.bin/limits limits.c usr.bin/login login.c usr.bin/su su.c usr.sbin/pstat pstat.c usr.sbin/sade main.c variable.c usr.sbin/sysinstall main.c variable.c Added files: tools/regression/environ Makefile Makefile.envctl Makefile.retention Makefile.timings envctl.c envtest.t retention.c timings.c Removed files: lib/libc/stdlib putenv.c setenv.c Log: Significantly reduce the memory leak as noted in BUGS section for setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value. Convert all calls to POSIX from historic BSD API: - unsetenv returns an int. - putenv takes a char * instead of const char *. - putenv no longer makes a copy of the input string. - errno is set appropriately for POSIX. Exceptions involve bad environ variable and internal initialization code. These both set errno to EFAULT. Several patches to base utilities to handle the POSIX changes from Andrey Chernov's previous commit. A few I re-wrote to use setenv() instead of putenv(). New regression module for tools/regression/environ to test these functions. It also can be used to test the performance. Bump __FreeBSD_version to 700050 due to API change. PR: kern/99826 Approved by: wes Approved by: re (kensmith) Revision Changes Path 1.71 +4 -4 src/bin/df/df.c 1.36 +13 -3 src/bin/sh/var.c 1.65 +2 -2 src/include/stdlib.h 1.54 +4 -4 src/lib/libc/stdlib/Makefile.inc 1.27 +80 -24 src/lib/libc/stdlib/getenv.3 1.9 +539 -60 src/lib/libc/stdlib/getenv.c 1.7 +0 -56 src/lib/libc/stdlib/putenv.c (dead) 1.15 +0 -116 src/lib/libc/stdlib/setenv.c (dead) 1.27 +4 -4 src/libexec/pppoed/pppoed.c 1.305 +1 -1 src/sys/sys/param.h 1.1 +14 -0 src/tools/regression/environ/Makefile (new) 1.1 +16 -0 src/tools/regression/environ/Makefile.envctl (new) 1.1 +16 -0 src/tools/regression/environ/Makefile.retention (new) 1.1 +16 -0 src/tools/regression/environ/Makefile.timings (new) 1.1 +154 -0 src/tools/regression/environ/envctl.c (new) 1.1 +182 -0 src/tools/regression/environ/envtest.t (new) 1.1 +109 -0 src/tools/regression/environ/retention.c (new) 1.1 +195 -0 src/tools/regression/environ/timings.c (new) 1.42 +3 -3 src/usr.bin/du/du.c 1.19 +6 -1 src/usr.bin/env/env.c 1.17 +8 -2 src/usr.bin/limits/limits.c 1.106 +5 -2 src/usr.bin/login/login.c 1.86 +6 -2 src/usr.bin/su/su.c 1.102 +3 -3 src/usr.sbin/pstat/pstat.c 1.80 +1 -1 src/usr.sbin/sade/main.c 1.42 +4 -1 src/usr.sbin/sade/variable.c 1.77 +1 -1 src/usr.sbin/sysinstall/main.c 1.40 +4 -1 src/usr.sbin/sysinstall/variable.c