From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 97BB13858028 for ; Fri, 26 Mar 2021 09:24:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 97BB13858028 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12Q94pN0038970 for ; Fri, 26 Mar 2021 05:24:46 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 37h8kved63-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Mar 2021 05:24:46 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 12Q9OhIp004247 for ; Fri, 26 Mar 2021 09:24:43 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06fra.de.ibm.com with ESMTP id 37h15a88u7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Mar 2021 09:24:43 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 12Q9Ofjw35586312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 26 Mar 2021 09:24:41 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3449DA4053 for ; Fri, 26 Mar 2021 09:24:41 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 13DB9A4051 for ; Fri, 26 Mar 2021 09:24:41 +0000 (GMT) Received: from li-ab9d22cc-354d-11b2-a85c-e984af76f811.ibm.com (unknown [9.171.2.19]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP for ; Fri, 26 Mar 2021 09:24:41 +0000 (GMT) From: Stefan Liebler Subject: Re: [PATCH 4/5] support: Add support_path_support_time64_value To: libc-alpha@sourceware.org References: <20210319183121.2252064-1-adhemerval.zanella@linaro.org> <20210319183121.2252064-5-adhemerval.zanella@linaro.org> Message-ID: <65d9d404-4def-436d-bd80-0a7af75df1c9@linux.ibm.com> Date: Fri, 26 Mar 2021 10:24:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210319183121.2252064-5-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 2xZEIjiqKru1yZFh-9GJXBaRWlPVGf1x X-Proofpoint-GUID: 2xZEIjiqKru1yZFh-9GJXBaRWlPVGf1x X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-26_02:2021-03-26, 2021-03-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 bulkscore=0 phishscore=0 clxscore=1015 adultscore=0 spamscore=0 impostorscore=0 mlxscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103250000 definitions=main-2103260067 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 09:24:49 -0000 On 19/03/2021 19:31, Adhemerval Zanella via Libc-alpha wrote: > It allows to check for support on arbitrary timestamp values. > --- > support/support.h | 11 +++++++++-- > support/support_path_support_time64.c | 10 +++------- > 2 files changed, 12 insertions(+), 9 deletions(-) > > diff --git a/support/support.h b/support/support.h > index 2e477c9e7c..5757c40833 100644 > --- a/support/support.h > +++ b/support/support.h > @@ -130,9 +130,16 @@ extern void support_copy_file (const char *from, const char *to); > extern ssize_t support_copy_file_range (int, off64_t *, int, off64_t *, > size_t, unsigned int); > > -/* Return true is PATH supports 64-bit time_t interfaces for file > +/* Return true if PATH supports 64-bit time_t interfaces for file > operations (such as fstatat or utimensat). */ > -extern bool support_path_support_time64 (const char *path); > +extern bool support_path_support_time64_value (const char *path, int64_t at, > + int64_t mt); > +static __inline bool support_path_support_time64 (const char *path) > +{ > + /* 1s and 2s after y2038 limit. */ > + return support_path_support_time64_value (path, 0x80000001ULL, > + 0x80000002ULL); > +} > > __END_DECLS > > diff --git a/support/support_path_support_time64.c b/support/support_path_support_time64.c > index 452fedcde5..33b2bdff66 100644 > --- a/support/support_path_support_time64.c > +++ b/support/support_path_support_time64.c > @@ -36,19 +36,15 @@ utimesat_call (const char *path, const struct __timespec64 tsp[2]) > #endif > > bool > -support_path_support_time64 (const char *path) > +support_path_support_time64_value (const char *path, int64_t at, int64_t mt) > { > #ifdef __linux__ > /* Obtain the original timestamps to restore at the end. */ > struct statx ostx; > TEST_VERIFY_EXIT (statx (AT_FDCWD, path, 0, STATX_BASIC_STATS, &ostx) == 0); > > - const struct __timespec64 tsp[] = > - { > - /* 1s and 2s after y2038 limit. */ > - { 0x80000001ULL, 0 }, > - { 0x80000002ULL, 0 } > - }; > + const struct __timespec64 tsp[] = { { at, 0 }, { mt, 0 } }; > + > /* Return is kernel does not support __NR_utimensat_time64. */ > if (utimesat_call (path, tsp) == -1) > return false; > OK