delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/02/20/06:16:56

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7E023858C5F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1708427813;
bh=AKmiQ53uqf405cdjdM98S86/qPSXP0Qyc9WGuiXkRBs=;
h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:From;
b=eg4gLtFVY05UvsWCZF/ctPquABSIfaLsuQbtaWoZh8V16zF4g45OpaMwhlEHuPGgl
k9sJh42rtTuFExMtAFzsV9ZxYZMFyQHvzUUbYcHceBXdPykH4mBTQMJWcRuGG+nfkV
BUBfJZmwcjtvv0SCzLiZpxjZku9Q7uqmiFJTy3oI=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 341973858D28
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 341973858D28
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708427750; cv=none;
b=mGHWYWtQEHRPsUyiJ/7PDsdj6J1Sdj7HChHzuw+M6A31ZmvFF/nh4FFkfUpjRO89efV98r0iGcLQnl3oPITtuwOc4uo4qKoSN1spc/rIohArcipl/FBshalmwDp6UzZePDr1tvaChYVVYWnAYJqo3FoJuya2Q7aD5vPSve8GarQ=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1708427750; c=relaxed/simple;
bh=5M6hi8m2ELNGMQSEgOHh+JTQKP1TEskv2Y12MXoxm9o=;
h=DKIM-Signature:From:To:Subject:Mime-Version:Date:Message-ID;
b=LUH6ExgZ6l34mhy31Up8p8pwkX52A6YTQufdZpvBuWzTrsI5KqPZocz7gv6XGpPaF4UfgmRkku7MIRnSGYtV8kcEQ13hHHzyUZOxq4ZeBOPxz5hrVipQUE4yn3ifEzEd2sa1o/2/0iHZAsmA2belaCMosyif0+0N0Z7B3LwfmfY=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-QQ-FEAT: oHWrrGTW1dBb+UxNigngcsxl2Eod61Vg
X-QQ-SSF: 00000000000000F0000000000000
X-QQ-XMRINFO: NS+P29fieYNw95Bth2bWPxk=
X-QQ-XMAILINFO: OPUECps6P3mBHnnizbaJ+tMtc6fAz9DwiCQQs+ytS6H1TX3thWT17irN9mEK3C
zY2tjhDUkt7hQr1s3/7U9FZG2u+veBqbrzhvIgaP2N9LlPOlk28Tn10FEyHXQYiPr4ZMiOMc6mQ+5
SniXfKI/oprg/2w88Or7RbmWPI53Hh77SjhZSI2W6crjLgFHvta3w4oA8CwYXnjwBOlM4Ets3fY7d
MSNjDefgjh4itzCO57/aBVsPjuQbtVbyiHz57tsZi+ZKxvWro1gL+B8agEiezrh2pXkN/WMLW4ycm
E7LEUbjwl0k55TL6Geu80gV2FveYkmv2bYWJvk85gVmCusfS5hwuNxYBA1mo8BClUcQw0LO8FfzN5
QZzLZlEptw28RuROWhtl2/0IHqqEe60peiMLrtYCdFBfO6GnE0hvo7l7D8eDS5M2spv5ura/XLri5
EyM37h1MYGgrp6SyIV8476pLLotTF2xtZupsp2mdGHzxnuDv/DKlHGERC4Y86Q3e/jtvrjjKlwzwP
44k4yGYMWtooAnAjVmDMsyA8xayvo3a4aj5N8h1QUbTmzGnNZhiEQHUU0RMwP/aY0PGDeVphWrw61
+8mTFfEdVEYVhWeas0UBJ7p654e1avNBgOQT0sJS1Edn+hbM6UWFy58xjdkjMXJJNC1AIuTf2wYQo
oHby+OeIHuEHcsiPJOyEAKPu9ERdAL+zBBevh81cLg/2FmaDsrkwjb7wdK3XOHjMaIdnNI7QHoKCZ
FCr44eV5DxgWA4ruvG6PacDEEpI/HGrUSfxPP4BiiVkQQ5JIaey33RbRWEAT0ZkGzHKq0BvfhTxnN
WWDKhx+yt2gX0D7VXFijl53znHMruOS2YQFrDFb1Y3T0eUQWigxUReqL7myUqXs1Xv0g08euVKwkr
MOpN5ycSD9sLsUX+UyoqrOpdVWUoiCI
X-HAS-ATTACH: no
X-QQ-BUSINESS-ORIGIN: 2
X-Originating-IP: 223.65.197.169
X-QQ-STYLE:
X-QQ-mid: webmail545t1708427735t151215
To: "=?ISO-8859-1?B?Y3lnd2lu?=" <cygwin AT cygwin DOT com>
Subject: BUG: gettimeofday() didn't handle first argument being NULL
Mime-Version: 1.0
Date: Tue, 20 Feb 2024 19:15:34 +0800
X-Priority: 3
Message-ID: <tencent_ADE1F2996E16CBB6F3A2956A2044485DD105@qq.com>
X-QQ-MIME: TCMime 1.0 by Tencent
X-Mailer: QQMail 2.x
X-QQ-Mailer: QQMail 2.x
X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT,
FREEMAIL_FROM, FROM_EXCESS_BASE64, HELO_DYNAMIC_IPADDR, NO_FM_NAME_IP_HOSTN,
RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RDNS_DYNAMIC, SPF_HELO_NONE, SPF_PASS,
TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: 109224573 via Cygwin <cygwin AT cygwin DOT com>
Reply-To: =?ISO-8859-1?B?MTA5MjI0NTcz?= <109224573 AT qq DOT com>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

this code works on Linux, but not msys2:

#include<stdio.h>
#include<sys time.h="">
int main() {
&nbsp;&nbsp;&nbsp; struct timezone tz;
&nbsp;&nbsp;&nbsp; puts("a");
&nbsp;&nbsp;&nbsp; gettimeofday(NULL, &amp;tz);
&nbsp;&nbsp;&nbsp; puts("b");
}


I guess the reason would be
winsup/cygwin/times.cc

extern "C" int
gettimeofday (struct timeval *__restrict tv, void *__restrict tzvp)
{
  struct timezone *tz = (struct timezone *) tzvp;
  static bool tzflag;
  LONGLONG now = get_clock (CLOCK_REALTIME)-&gt;usecs ();

  tv-&gt;tv_sec = now / USPERSEC;
  tv-&gt;tv_usec = now % USPERSEC;


If so, the fix should be add if (tv != NULL)

I found this issue due to https://github.com/redis/redis/issues/12719</sys></stdio.h>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019