From owner-freebsd-standards@FreeBSD.ORG Mon Nov 17 11:02:43 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C29B116A4CE for ; Mon, 17 Nov 2003 11:02:43 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1961043F93 for ; Mon, 17 Nov 2003 11:02:42 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id hAHJ2fFY006615 for ; Mon, 17 Nov 2003 11:02:41 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id hAHJ2eDw006609 for freebsd-standards@freebsd.org; Mon, 17 Nov 2003 11:02:40 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 17 Nov 2003 11:02:40 -0800 (PST) Message-Id: <200311171902.hAHJ2eDw006609@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-standards@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2003 19:02:43 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- s [2001/01/23] misc/24590 standards timezone function not compatible witn Sin o [2002/02/25] bin/35307 standards standard include files are not standard c o [2003/03/05] bin/48958 standards The type 'bool' has different sizes for C o [2003/04/21] standards/51209standards [PATCH] add a64l()/l64a/l64a_r functions p [2003/06/05] standards/52972standards /bin/sh arithmetic not POSIX compliant o [2003/06/20] standards/53554standards interval timers not cleared in fork() o [2003/07/12] standards/54410standards one-true-awk not POSIX compliant (no exte o [2003/09/15] standards/56906standards Several math(3) functions fail to set err 8 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/01/16] bin/24390 standards Replacing old dir-symlinks when using /bi o [2001/11/20] standards/32126standards getopt(3) not Unix-98 conformant s [2002/03/18] standards/36076standards Implementation of POSIX fuser command o [2002/06/13] standards/39256standards [v]snprintf aren't POSIX-conformant for s o [2002/07/09] misc/40378 standards stdlib.h gives needless warnings with -an p [2002/08/12] standards/41576standards POSIX compliance of ln(1) o [2002/10/23] standards/44425standards getcwd() succeeds even if current dir has o [2002/12/09] standards/46119standards Priority problems for SCHED_OTHER using p o [2002/12/23] standards/46504standards Warnings in headers o [2003/04/22] standards/51292standards [PATCH] add ecvt()/fcvt()/gcvt() function o [2003/06/22] standards/53613standards FreeBSD doesn't define EPROTO o [2003/06/24] bin/53682 standards [PATCH] add fuser(1) utitity o [2003/07/24] standards/54809standards pcvt deficits o [2003/07/24] standards/54833standards more pcvt deficits o [2003/07/25] standards/54839standards pcvt deficits o [2003/09/04] standards/56476standards cd9660 unicode support simple hack o [2003/09/27] standards/57295standards [patch] make does not include cmd line va o [2003/10/12] standards/57911standards fnmatch ("[[:alpha:]]","x", FNM_PATHNAME) o [2003/10/29] standards/58676standards grantpt(3) alters storage used by ptsname 19 problems total. From owner-freebsd-standards@FreeBSD.ORG Mon Nov 17 11:05:55 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 576F716A4CE for ; Mon, 17 Nov 2003 11:05:55 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0D494408E for ; Mon, 17 Nov 2003 11:04:52 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id hAHJ4qFY008884 for ; Mon, 17 Nov 2003 11:04:52 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id hAHJ4pFv008878 for standards@freebsd.org; Mon, 17 Nov 2003 11:04:51 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 17 Nov 2003 11:04:51 -0800 (PST) Message-Id: <200311171904.hAHJ4pFv008878@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: standards@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2003 19:05:55 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/08/18] kern/29844 standards [PATCH] setpgrp does not behave as manual 1 problem total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/03/05] bin/25542 standards /bin/sh: null char in quoted string 1 problem total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- f [1995/01/11] i386/105 standards Distributed libm (msun) has non-standard o [2000/09/24] bin/21519 standards sys/dir.h should be deprecated some more o [2000/12/05] kern/23304 standards POSIX clock_gettime, clock_getres return s [2001/06/18] kern/28260 standards UIO_MAXIOV needs to be made public 4 problems total. From owner-freebsd-standards@FreeBSD.ORG Fri Nov 21 11:15:31 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F53A16A4CE for ; Fri, 21 Nov 2003 11:15:31 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A4C743FB1 for ; Fri, 21 Nov 2003 11:15:30 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id hALJFTJo064838 for freebsd-standards@freebsd.org; Fri, 21 Nov 2003 13:15:29 -0600 (CST) (envelope-from dan) Date: Fri, 21 Nov 2003 13:15:29 -0600 From: Dan Nelson To: freebsd-standards@freebsd.org Message-ID: <20031121191529.GD2146@dan.emsphone.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline X-OS: FreeBSD 5.1-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.5.1i Subject: mktime and tm_isdst X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2003 19:15:31 -0000 --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I've got a question about mktime and FreeBSD's use of the tm_isdst flag. POSIX says: http://www.opengroup.org/onlinepubs/007904975/functions/mktime.html A positive or 0 value for tm_isdst shall cause mktime() to presume initially that Daylight Savings Time, respectively, is or is not in effect for the specified time. "presume initially" I guess is a euphamism for "implementation defined", since it allows the implementation to override the value if it happens to determine the correct value. A defect reported posted for C99 asks the question: http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/dr_280.htm Q3 In a general case, what should we do in case tm_isdst is different from -1? A3 It is implementation defined. One possibility would be to consider any two struct tm values as being exactly one hour apart if all members have the same value except that one struct tm value has tm_isdst=1 and the other has tm_isdst=0 (regardless of the date stored in the struct tm values). FreeBSD seems to ignore the value of tm_isdst except for the duplicate fall-back hour. Unfortunately, every other OS I've tested (Linux, TRU64 5.1b, AIX 5.2, Solaris 9) trusts the user's tz_isdst value if isn't not -1. Would it be a good idea to change our behaviour to match everyone else's, even though it's in "undefined" territory according to the spec? I've attached a test program to show what I'm talking about. It converts three dates using tm_isdst values of 0, -1, and 1, and prints the time_t generated. -- Dan Nelson dnelson@allantgroup.com --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mktimetest.c" #include #include #include #include int main(int argc, char *argv[]) { struct tm tm; time_t t; putenv("TZ=America/Chicago"); printf("Testing 1994-10-29 01:00:00 (DST)\n"); memset(&t, 0, sizeof(t)); tm.tm_year = 94; tm.tm_mon = 9; tm.tm_mday = 29; tm.tm_hour = 1; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = 0; t = mktime(&tm); printf("isdst=0 -> %d, isdst=%d\n", t, tm.tm_isdst); memset(&t, 0, sizeof(t)); tm.tm_year = 94; tm.tm_mon = 9; tm.tm_mday = 29; tm.tm_hour = 1; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; t = mktime(&tm); printf("isdst=-1 -> %d, isdst=%d\n", t, tm.tm_isdst); memset(&t, 0, sizeof(t)); tm.tm_year = 94; tm.tm_mon = 9; tm.tm_mday = 29; tm.tm_hour = 1; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = 1; t = mktime(&tm); printf("isdst=1 -> %d, isdst=%d\n", t, tm.tm_isdst); printf("Testing 1994-10-30 01:00:00 (could be either)\n"); memset(&t, 0, sizeof(t)); tm.tm_year = 94; tm.tm_mon = 9; tm.tm_mday = 30; tm.tm_hour = 1; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = 0; t = mktime(&tm); printf("isdst=0 -> %d, isdst=%d\n", t, tm.tm_isdst); memset(&t, 0, sizeof(t)); tm.tm_year = 94; tm.tm_mon = 9; tm.tm_mday = 30; tm.tm_hour = 1; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; t = mktime(&tm); printf("isdst=-1 -> %d, isdst=%d\n", t, tm.tm_isdst); memset(&t, 0, sizeof(t)); tm.tm_year = 94; tm.tm_mon = 9; tm.tm_mday = 30; tm.tm_hour = 1; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = 1; t = mktime(&tm); printf("isdst=1 -> %d, isdst=%d\n", t, tm.tm_isdst); printf("Testing 1994-11-01 01:00:00 (not DST)\n"); memset(&t, 0, sizeof(t)); tm.tm_year = 94; tm.tm_mon = 10; tm.tm_mday = 01; tm.tm_hour = 1; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = 0; t = mktime(&tm); printf("isdst=0 -> %d, isdst=%d\n", t, tm.tm_isdst); memset(&t, 0, sizeof(t)); tm.tm_year = 94; tm.tm_mon = 10; tm.tm_mday = 01; tm.tm_hour = 1; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; t = mktime(&tm); printf("isdst=-1 -> %d, isdst=%d\n", t, tm.tm_isdst); memset(&t, 0, sizeof(t)); tm.tm_year = 94; tm.tm_mon = 10; tm.tm_mday = 01; tm.tm_hour = 1; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = 1; t = mktime(&tm); printf("isdst=1 -> %d, isdst=%d\n", t, tm.tm_isdst); return 0; } --1yeeQ81UyVL57Vl7-- From owner-freebsd-standards@FreeBSD.ORG Fri Nov 21 20:40:45 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B1CA216A4CE for ; Fri, 21 Nov 2003 20:40:45 -0800 (PST) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDA4C43F93 for ; Fri, 21 Nov 2003 20:40:44 -0800 (PST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id hAM4ecDa011680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK CN=khavrinen.lcs.mit.edu issuer=SSL+20Client+20CA); Fri, 21 Nov 2003 23:40:38 -0500 (EST) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.9/8.12.9/Submit) id hAM4eckQ011677; Fri, 21 Nov 2003 23:40:38 -0500 (EST) (envelope-from wollman) Date: Fri, 21 Nov 2003 23:40:38 -0500 (EST) From: Garrett Wollman Message-Id: <200311220440.hAM4eckQ011677@khavrinen.lcs.mit.edu> To: Dan Nelson In-Reply-To: <20031121191529.GD2146@dan.emsphone.com> References: <20031121191529.GD2146@dan.emsphone.com> X-Spam-Score: -19.8 () IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES X-Scanned-By: MIMEDefang 2.37 cc: freebsd-standards@freebsd.org Subject: mktime and tm_isdst X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2003 04:40:45 -0000 < said: > I've got a question about mktime and FreeBSD's use of the tm_isdst > flag. Suggest you compare with the original code at and bring up any unresolved issues on the tz@elsie.nci.nih.gov list. While the two codebases have evolved in somewhat different directions, the basic implementation should still be the same (and ours is probably wrong to the extent that it isn't). -GAWollman