{"id":811218,"url":"http://patchwork.ozlabs.org/api/patches/811218/?format=json","web_url":"http://patchwork.ozlabs.org/project/glibc/patch/20170907224219.12483-21-albert.aribaud@3adev.fr/","project":{"id":41,"url":"http://patchwork.ozlabs.org/api/projects/41/?format=json","name":"GNU C Library","link_name":"glibc","list_id":"libc-alpha.sourceware.org","list_email":"libc-alpha@sourceware.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170907224219.12483-21-albert.aribaud@3adev.fr>","list_archive_url":null,"date":"2017-09-07T22:41:47","name":"[RFC,20/52] Y2038: add function __timer_settime64","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"b4d2fe53c98554d9dec408812538c84df9c2aef5","submitter":{"id":65557,"url":"http://patchwork.ozlabs.org/api/people/65557/?format=json","name":"Albert ARIBAUD (3ADEV)","email":"albert.aribaud@3adev.fr"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/glibc/patch/20170907224219.12483-21-albert.aribaud@3adev.fr/mbox/","series":[{"id":2074,"url":"http://patchwork.ozlabs.org/api/series/2074/?format=json","web_url":"http://patchwork.ozlabs.org/project/glibc/list/?series=2074","date":"2017-09-07T22:41:27","name":"Make GLIBC Y2038-proof","version":1,"mbox":"http://patchwork.ozlabs.org/series/2074/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/811218/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/811218/checks/","tags":{},"related":[],"headers":{"Return-Path":"<libc-alpha-return-84338-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84338-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"ujxYVcKX\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xpFtV4tgsz9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  8 Sep 2017 08:46:26 +1000 (AEST)","(qmail 78753 invoked by alias); 7 Sep 2017 22:43:54 -0000","(qmail 78669 invoked by uid 89); 7 Sep 2017 22:43:54 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:cc:subject:date:message-id:in-reply-to\n\t:references; q=dns; s=default; b=Ww/2CL1OTkx3+nX8hDnI9+xkBEEknDu\n\tLNDtCWUoAcO16u6f5Ge0JRe9wtlON14VJidHDjcblrNB5Xy2fRdVUzj47ElGRpKv\n\tw/kSdOvyNABwr2ENdl/W/Id+8B15PxZOl0e8c87qfg3eiQeM83f3REah7cgmD1ol\n\t/ytVQqvhMCXU=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:cc:subject:date:message-id:in-reply-to\n\t:references; s=default; bh=6hUr21ppTpkB2WJlCLwBIeZsl/I=; b=ujxYV\n\tcKXzj9h1s7BpTkH0kyFwu6V1XzRsay9hkgi0iho1VMsKIYqgkAB0zKrNoqTX1tJY\n\tS9ASDDUxzlYr91vWo7hmF44NLXSpyz3anLlCWwDvHQmIEMp4e1GK+XUg23Lrtxkb\n\tT7EWW0i6TFS2C38KvIdueyE41zdojrj5oUrKw4=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-26.6 required=5.0 tests=BAYES_00, GIT_PATCH_0,\n\tGIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tKAM_LAZY_DOMAIN_SECURITY,\n\tRCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2\n\tspammy=Hx-languages-length:2241","X-HELO":"smtp6-g21.free.fr","From":"\"Albert ARIBAUD (3ADEV)\" <albert.aribaud@3adev.fr>","To":"libc-alpha@sourceware.org","Cc":"\"Albert ARIBAUD (3ADEV)\" <albert.aribaud@3adev.fr>","Subject":"[RFC PATCH 20/52] Y2038: add function __timer_settime64","Date":"Fri,  8 Sep 2017 00:41:47 +0200","Message-Id":"<20170907224219.12483-21-albert.aribaud@3adev.fr>","In-Reply-To":"<20170907224219.12483-20-albert.aribaud@3adev.fr>","References":"<20170907224219.12483-1-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-2-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-3-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-4-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-5-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-6-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-7-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-8-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-9-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-10-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-11-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-12-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-13-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-14-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-15-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-16-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-17-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-18-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-19-albert.aribaud@3adev.fr>\n\t<20170907224219.12483-20-albert.aribaud@3adev.fr>"},"content":"Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>\n---\n rt/Versions                             |  1 +\n sysdeps/unix/sysv/linux/timer_settime.c | 49 +++++++++++++++++++++++++++++++++\n 2 files changed, 50 insertions(+)","diff":"diff --git a/rt/Versions b/rt/Versions\nindex f07c8e2b18..4933197aa5 100644\n--- a/rt/Versions\n+++ b/rt/Versions\n@@ -43,5 +43,6 @@ librt {\n \n   GLIBC_Y2038 {\n     __timer_gettime64;\n+    __timer_settime64;\n   }\n }\ndiff --git a/sysdeps/unix/sysv/linux/timer_settime.c b/sysdeps/unix/sysv/linux/timer_settime.c\nindex ba35036355..d75b24ada8 100644\n--- a/sysdeps/unix/sysv/linux/timer_settime.c\n+++ b/sysdeps/unix/sysv/linux/timer_settime.c\n@@ -41,3 +41,52 @@ timer_settime (timer_t timerid, int flags, const struct itimerspec *value,\n \n   return res;\n }\n+\n+/* 64-bit time version */\n+\n+int\n+__timer_settime64 (timer_t timerid, int flags, const struct itimerspec *value,\n+                   struct itimerspec *ovalue)\n+{\n+  struct timer *kt = (struct timer *) timerid;\n+  struct __itimerspec64 value64;\n+  struct itimerspec value32, ovalue32;\n+\n+  if (value == NULL)\n+    return EFAULT;\n+\n+  if (__y2038_kernel_support())\n+    {\n+      value64.it_value.tv_sec = value->it_value.tv_sec;\n+      value64.it_value.tv_nsec = value->it_value.tv_nsec;\n+      value64.it_value.tv_pad = 0;\n+      value64.it_interval.tv_sec = value->it_interval.tv_sec;\n+      value64.it_interval.tv_nsec = value->it_interval.tv_nsec;\n+      value64.it_interval.tv_pad = 0;\n+    \n+      return INLINE_SYSCALL (timer_settime64, 4, kt->ktimerid, flags,\n+  \t\t\t    &value64, ovalue);\n+    }\n+\n+  if (value->it_value.tv_sec > INT_MAX\n+      || value->it_interval.tv_sec > INT_MAX)\n+    return EOVERFLOW;\n+\n+  value32.it_value.tv_sec = value->it_value.tv_sec;\n+  value32.it_value.tv_nsec = value->it_value.tv_nsec;\n+  value32.it_interval.tv_sec = value->it_interval.tv_sec;\n+  value32.it_interval.tv_nsec = value->it_interval.tv_nsec;\n+\n+  int res = INLINE_SYSCALL (timer_settime, 4, kt->ktimerid, flags,\n+        &value32, &ovalue32);\n+\n+  if (res == 0 && ovalue != NULL)\n+    {\n+      ovalue->it_value.tv_sec = ovalue32.it_value.tv_sec;\n+      ovalue->it_value.tv_nsec = ovalue32.it_value.tv_nsec;\n+      ovalue->it_interval.tv_sec = ovalue32.it_interval.tv_sec;\n+      ovalue->it_interval.tv_nsec = ovalue32.it_interval.tv_nsec;\n+    }\n+\n+  return res;\n+}\n","prefixes":["RFC","20/52"]}