From owner-freebsd-hackers Sun Sep 14 21:22:34 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id VAA26681 for hackers-outgoing; Sun, 14 Sep 1997 21:22:34 -0700 (PDT) Received: from hwcn.org (main.hwcn.org [199.212.94.65]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id VAA26676 for ; Sun, 14 Sep 1997 21:22:30 -0700 (PDT) Received: from james.freenet.hamilton.on.ca (ac199@james.hwcn.org [199.212.94.66]) by hwcn.org (8.8.7/8.8.7) with ESMTP id AAA26873; Mon, 15 Sep 1997 00:22:51 -0400 (EDT) Received: from localhost (ac199@localhost) by james.freenet.hamilton.on.ca (8.8.7/8.8.7) with SMTP id AAA14204; Mon, 15 Sep 1997 00:23:10 -0400 (EDT) X-Authentication-Warning: james.freenet.hamilton.on.ca: ac199 owned process doing -bs Date: Mon, 15 Sep 1997 00:23:09 -0400 (EDT) From: Tim Vanderhoek X-Sender: ac199@james.freenet.hamilton.on.ca Reply-To: Tim Vanderhoek To: Mikael Karpberg cc: Terry Lambert , hackers@FreeBSD.ORG Subject: Re: Memory leak in getservbyXXX? In-Reply-To: <199709150337.FAA01640@ocean.campus.luth.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Mon, 15 Sep 1997, Mikael Karpberg wrote: > [Example showing that you should not use "static" in MT programs. Obvious.] I think he meant, "wouldn't it be nice if I could do" signal_handler () { ... pcopy = not_static_copy ("string", global_buffer_i_happen_to_keep_always_lying_around_especially_\ for_use_in_my_signal_handlers); ... } Or maybe he meant, "wouldn't it be nice if I could do" printf ("%s%s", unstatic ("ab", buf1), unstatic ("bb", buf2)); Of course, if I happen to pass NULL as the buffer, then it will use its own static buffer. -- Outnumbered? Maybe. Outspoken? Never! tIM...HOEk