From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7137 Path: news.gmane.org!not-for-mail From: William Ahern Newsgroups: gmane.linux.lib.musl.general Subject: getenv_r Date: Wed, 4 Mar 2015 15:09:20 -0800 Message-ID: <20150304230920.GA21838@wilbur.25thandClement.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1425510583 10250 80.91.229.3 (4 Mar 2015 23:09:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Mar 2015 23:09:43 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7150-gllmg-musl=m.gmane.org@lists.openwall.com Thu Mar 05 00:09:40 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YTIQ7-0001bf-9b for gllmg-musl@m.gmane.org; Thu, 05 Mar 2015 00:09:39 +0100 Original-Received: (qmail 9420 invoked by uid 550); 4 Mar 2015 23:09:37 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 9385 invoked from network); 4 Mar 2015 23:09:32 -0000 Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Xref: news.gmane.org gmane.linux.lib.musl.general:7137 Archived-At: I noticed that getenv is not thread-safe. Would there be any interest in accepting a patch to implement getenv_r (a NetBSD function) and internal locking? Other than leaving getenv, setenv, and putenv unsafe in threaded environments, the only other alternative is the ugliness that glibc, Solaris, and some others implement, which is basically to leak environ memory.