From patchwork Fri Apr 9 15:53:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42937 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0E0DC398EC05; Fri, 9 Apr 2021 15:53:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E0DC398EC05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1617983635; bh=hyQ5knVSBCt2m0RZ+9y43uvM2jIJrNf/R1oUS9Xtqmc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=bDvOo67MEl8XGGVmJiIC0DGTt9XXi4/ddxiWzS+7jFayeVAcp3gQtStFTx6MmQg9i Zse6UFnb75yqpd2zSYzE0Tr+Hz51XLAnlIL7uzt7o1mcq6VUGw9VWOWBW2gUiB/D4q wn3J8+wQoszzOW59eiP4amwlOt5WSD1udFsyvYEI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by sourceware.org (Postfix) with ESMTPS id EC139385DC14 for ; Fri, 9 Apr 2021 15:53:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EC139385DC14 Received: by mail-qt1-x82c.google.com with SMTP id g24so4503744qts.6 for ; Fri, 09 Apr 2021 08:53:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=hyQ5knVSBCt2m0RZ+9y43uvM2jIJrNf/R1oUS9Xtqmc=; b=ZvLnF3EAMg075QMUP/BvMapCjQSZPn28pFicDtpIJ66/HZ6qJ6jVIYkh7WmmcDn42R MC7PDWmqVOoXzF0+hsmruvw9zYn/23cAhpPWVGpSIVs7XO+K6I3UL1BkERgKHt9l69rg gW5tNM0gEL9m/W31qaylfx5v8+Us/hDAwqn724J4HqlLh9OeKTcexOaweheZU7MMbrOB 1TcyV2ULXIMqH+WhfxOOUXickrfeifbw828BY0zbN8jVta551vHL7Y8mD2fRp4h7oRDm e5hUdSl58rBtmE/XGNX182e9tP2Hf9pr82bvxyKoQCRep2GxJ2RSivnUf37MonxTRFB/ ZoIg== X-Gm-Message-State: AOAM533kg/EDHCj4e3dGy89Xq/U7GHQ9b6O90cZAX2cHV16oWk2TP7CY pvEvbgQidt2QgAIcFSYPPxKoU0CCwHqk8ZlY X-Google-Smtp-Source: ABdhPJz/1ndH0ii2EpATIm9CED3JnV3RTR2xOMrgkaZBVKbNhSB4z+3zadWwmJHbAHlIvf1I/pyGQQ== X-Received: by 2002:ac8:d0b:: with SMTP id q11mr12962777qti.353.1617983631162; Fri, 09 Apr 2021 08:53:51 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id 79sm2087632qki.37.2021.04.09.08.53.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 08:53:50 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v3 1/4] libsupport: Add support_select_modifies_timeout Date: Fri, 9 Apr 2021 12:53:43 -0300 Message-Id: <20210409155346.1357023-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It will be used on a select() test. --- support/Makefile | 1 + support/support.h | 4 ++++ support/support_select_modifies_timeout.c | 29 +++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 support/support_select_modifies_timeout.c diff --git a/support/Makefile b/support/Makefile index 900e17f94f..91457d8613 100644 --- a/support/Makefile +++ b/support/Makefile @@ -68,6 +68,7 @@ libsupport-routines = \ support_quote_string \ support_record_failure \ support_run_diff \ + support_select_modifies_timeout \ support_set_small_thread_stack_size \ support_shared_allocate \ support_small_stack_thread_attribute \ diff --git a/support/support.h b/support/support.h index e023d00857..f730611841 100644 --- a/support/support.h +++ b/support/support.h @@ -144,6 +144,10 @@ static __inline bool support_path_support_time64 (const char *path) /* Return true if stat supports nanoseconds resolution. */ extern bool support_stat_nanoseconds (const char *path); +/* Return true if select modify the timeout to reflect the amount of time + no slept. */ +extern bool support_select_modifies_timeout (void); + __END_DECLS #endif /* SUPPORT_H */ diff --git a/support/support_select_modifies_timeout.c b/support/support_select_modifies_timeout.c new file mode 100644 index 0000000000..a4f3bf145c --- /dev/null +++ b/support/support_select_modifies_timeout.c @@ -0,0 +1,29 @@ +/* Return whether select modify the timeout. + Copyright (C) 2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +bool +support_select_modifies_timeout (void) +{ +#ifdef __linux__ + return true; +#else + return false; +#endif +}