From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30934 invoked from network); 21 Dec 2023 12:12:29 -0000 Received: from minnie.tuhs.org (2600:3c01:e000:146::1) by inbox.vuxu.org with ESMTPUTF8; 21 Dec 2023 12:12:29 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id B8E9C43F1C; Thu, 21 Dec 2023 22:12:22 +1000 (AEST) Received: from freefriends.org (frenzy.freefriends.org [198.99.81.75]) by minnie.tuhs.org (Postfix) with ESMTPS id DE65B43ED1 for ; Thu, 21 Dec 2023 22:12:11 +1000 (AEST) X-Envelope-From: arnold@skeeve.com Received: from freefriends.org (localhost [127.0.0.1]) by freefriends.org (8.14.7/8.14.7) with ESMTP id 3BLCC6lL005474 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Dec 2023 05:12:06 -0700 Received: (from arnold@localhost) by freefriends.org (8.14.7/8.14.7/Submit) id 3BLCC69X005473; Thu, 21 Dec 2023 05:12:06 -0700 From: arnold@skeeve.com Message-Id: <202312211212.3BLCC69X005473@freefriends.org> X-Authentication-Warning: frenzy.freefriends.org: arnold set sender to arnold@skeeve.com using -f Date: Thu, 21 Dec 2023 05:12:06 -0700 To: leah@vuxu.org, chet.ramey@case.edu, arnold@skeeve.com References: <874jgk7r5j.fsf@vuxu.org> In-Reply-To: User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID-Hash: TZVLXEW76DLR6JXLLVS2GKWGNY7FFXFU X-Message-ID-Hash: TZVLXEW76DLR6JXLLVS2GKWGNY7FFXFU X-MailFrom: arnold@skeeve.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: tuhs@tuhs.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: Off topic: BSD timezone function vs. POSIX timezone variable List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Thanks to everyone who responded to my question. The answers were helpful. Arnold Chet Ramey wrote: > On 12/14/23 10:14 AM, Leah Neukirchen wrote: > > Aharon Robbins writes: > > > >> Hi All. > >> > >> This is a bit off-topic, but people here are likely to know the answer. > >> > >> V7 had a timzone function: > >> > >> char *timezone(int zone, int dst); > >> > >> that returned a timezone name. POSIX has a timezone variable which is > >> the offset in seconds from UTC. > >> > >> The man pages for all of {Net,Free,Open}BSD seem to indicate that both > >> are available on those systems. > >> > >> My question is, how? The declarations for both are given as being in . > >> But don't the symbols in libc.a conflict with each other? How does a programmer > >> on *BSD choose which version of timezone they will get? > > > > OpenBSD 7.3 only has "extern long timezone" and no timezone(3) function. > > > > FreeBSD 14.0 only has the timezone(3) function (under _BSD_VISIBLE), > > and doesn't set any variables. > > Darwin (macOS) conditionally defines them. If you want POSIX 2003 > compatibility, define __DARWIN_UNIX03 and get > > extern long timezone __DARWIN_ALIAS(timezone); > > If you don't define that, you get > > char *timezone(int, int); > > -- > ``The lyf so short, the craft so long to lerne.'' - Chaucer > ``Ars longa, vita brevis'' - Hippocrates > Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/