From owner-freebsd-chat Tue Aug 8 12:19: 0 2000 Delivered-To: freebsd-chat@freebsd.org Received: from mta03-svc.ntlworld.com (mta03-svc.ntlworld.com [62.253.162.43]) by hub.freebsd.org (Postfix) with ESMTP id E08E337C0E2 for ; Tue, 8 Aug 2000 12:18:47 -0700 (PDT) (envelope-from mark@ukug.uk.freebsd.org) Received: from parish.my.domain ([62.253.88.85]) by mta03-svc.ntlworld.com (InterMail vM.4.01.02.27 201-229-119-110) with ESMTP id <20000808191840.XALJ16423.mta03-svc.ntlworld.com@parish.my.domain> for ; Tue, 8 Aug 2000 20:18:40 +0100 Received: (from mark@localhost) by parish.my.domain (8.9.3/8.9.3) id UAA03191 for chat@freebsd.org; Tue, 8 Aug 2000 20:18:07 +0100 (BST) (envelope-from mark) Date: Tue, 8 Aug 2000 20:18:07 +0100 From: Mark Ovens To: chat@freebsd.org Subject: C time functions - problem Message-ID: <20000808201807.H250@parish> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i Organization: Total lack of Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Can anyone tell me why the call to localtime() in the code below should segfault in tzset()? Running it in the debugger shows that ``t'' is set to a sensible value. Program received signal SIGSEGV, Segmentation fault. 0x280be4c8 in tzset () from /usr/lib/libc.so.4 #include #include int main() { struct tm *timeptr; char buf[BUFSIZ]; size_t size; time_t t; tzset; t = time((time_t *)0); timeptr = localtime((time_t *)t); ..... -- 4.4 - The number of the Beastie ________________________________________________________________ 51.44°N FreeBSD - The Power To Serve http://www.freebsd.org 2.057°W My Webpage http://ukug.uk.freebsd.org/~mark mailto:marko@freebsd.org http://www.radan.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message