From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by sourceware.org (Postfix) with ESMTPS id 028A83955412 for ; Tue, 13 Apr 2021 21:04:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 028A83955412 Received: by mail-qk1-x734.google.com with SMTP id h13so711615qka.2 for ; Tue, 13 Apr 2021 14:04:12 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ljszdkdlm8xLzfNc2XxPRoJMZskyiSclJ7ce1EWPzeI=; b=KNuvSzqdfmxlewzTzId1oxwirsMf9cLAbZCHvziV0EKT90yH8IcMQwrTwTNrZznwBz rqc7uQDFfocwRzlCBzQc3J/jg5JPaWUwRPZ/jPDtYwSyG0Dwuu8tjKUOr25O2AAU52Vv SqKJoxsLeKPkFfeGiKHrl1M56iYLHDFyG+8eBH42CbWU5d1USA7kSaexXmuT+5kQMi4x agjszvnfYFdh4FBxLgcvrLC6IPAM9IOj6ahoi+LwR3iK8ax3x4QhZtZhFerCxWKvJBKh CTxE3am5y1L/gZY++yak/O/Gsy8JFAshr2bg1Fg996fykv1ERwBQKGVgg5vVwMDgvnVj P0GA== X-Gm-Message-State: AOAM531M1nWf62LmEOnIcyCjbtxBbMvMkwT6Txq9LQXh59jaKV2fSPge EXkVw2tcumADF9k6gVWyJNczFwA5nYtlPS2n X-Google-Smtp-Source: ABdhPJwCQ4biY+YfYE0/hqD3K2MuCc7ihpz/0s6icQpWAwHxS2DrEmOFtoM9sGsS8Un4ebia24gU2w== X-Received: by 2002:a05:620a:755:: with SMTP id i21mr15620585qki.130.1618347852453; Tue, 13 Apr 2021 14:04:12 -0700 (PDT) Received: from localhost.localdomain ([177.194.41.149]) by smtp.googlemail.com with ESMTPSA id g8sm10003383qtm.29.2021.04.13.14.04.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 14:04:12 -0700 (PDT) From: Adhemerval Zanella To: libc-stable@sourceware.org Subject: [PATCH 2.33 COMMITTED 3/6] libsupport: Add support_select_modifies_timeout Date: Tue, 13 Apr 2021 18:04:02 -0300 Message-Id: <20210413210405.913196-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210413210405.913196-1-adhemerval.zanella@linaro.org> References: <20210413210405.913196-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-stable@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-stable mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2021 21:04:14 -0000 It will be used on a select() test. (cherry picked from commit 5628f103f5937611730845390928cb43ef716012) --- support/Makefile | 1 + support/support.h | 5 ++++ support/support_select_modifies_timeout.c | 29 +++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 support/support_select_modifies_timeout.c diff --git a/support/Makefile b/support/Makefile index bb9889efb4..4fd76b0e5e 100644 --- a/support/Makefile +++ b/support/Makefile @@ -67,6 +67,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 9cbc455720..9c9612644a 100644 --- a/support/support.h +++ b/support/support.h @@ -23,6 +23,7 @@ #ifndef SUPPORT_H #define SUPPORT_H +#include #include #include /* For mode_t. */ @@ -129,6 +130,10 @@ 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 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..653ea2cc98 --- /dev/null +++ b/support/support_select_modifies_timeout.c @@ -0,0 +1,29 @@ +/* Return whether select modifies 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 +} -- 2.27.0