From patchwork Mon Mar 8 18:53:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1449339 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=HKCmjvwt; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvSF86YPCz9sW1 for ; Tue, 9 Mar 2021 05:54:36 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF4F0395442E; Mon, 8 Mar 2021 18:54:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF4F0395442E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615229655; bh=y7oQEJLoqF0ep/Q8ZyAoTWWiXwJHlzm0VkHdwByue50=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=HKCmjvwtXoOlSdctEDyrBU78ZS2aW9K2A7O+9F/7EWt8s+gnv6KWaJzGO9YojFMlY 8uWuc8/zk7muUsUbKolzjxbN+nqZNpgrngL9BdvSczkYXLNv/H3iIPVvwVrnn9bJ+y eSfE7cxiwMTnlejZU8kUdr7OpU58lCl7vWULnwYw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 14B303954419 for ; Mon, 8 Mar 2021 18:54:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 14B303954419 Received: by mail-wm1-x32d.google.com with SMTP id t5-20020a1c77050000b029010e62cea9deso4442987wmi.0 for ; Mon, 08 Mar 2021 10:54:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y7oQEJLoqF0ep/Q8ZyAoTWWiXwJHlzm0VkHdwByue50=; b=Lnt4KwjmaSTJMs1FLWckRBVW+RJNXAyiLqp+vNKPULEhasKI7D1huclVeq0tjHhVlJ n3BNSXlYExCU2IeuNXSGdgySOzB3NWOS4OssnaMes0TsePU7XFRO6vpzBMUtNN9wbQdr fBI5lhUl1Z055cRSYpEfWR6nClEl+vEqQbzmaQTUrVrB8IANhjkGqbMzizOqXMPR9ml8 9UCp90wLVqcY4hgKP9DFGHu8UivYLNpOtO7ZoVCr1GJderpG2C2sCUMPwqcRcnBmi3I9 K8E0nikMv+aZKTpsld/dINK3hO0V2gHxljZev74YE/EOWBKrbfoeCAAtCuTaR/qcqalK W7aQ== X-Gm-Message-State: AOAM531SqE2iFvWtmKMjKtxfX639zyHmdiFoZxtQU4e5ULdMWza222Qx 9oPeABhE8V/Jt25MDdvdEG4= X-Google-Smtp-Source: ABdhPJzCdzgglPS8LyYDcVYKxeK89KlO4dzHAoMK97LpPhKuDr9av3MaIaF+Tq+UasTTfpSj6IWK8Q== X-Received: by 2002:a05:600c:4a18:: with SMTP id c24mr165053wmp.173.1615229652308; Mon, 08 Mar 2021 10:54:12 -0800 (PST) Received: from sqli.sqli.com ([195.53.121.100]) by smtp.googlemail.com with ESMTPSA id i11sm19889921wro.53.2021.03.08.10.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 10:54:12 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH 06/23] pthread_create.3: SYNOPSIS: Use 'restrict' in prototypes Date: Mon, 8 Mar 2021 19:53:15 +0100 Message-Id: <20210308185331.242176-7-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210308185331.242176-1-alx.manpages@gmail.com> References: <20210308185331.242176-1-alx.manpages@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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: Alejandro Colomar via Libc-alpha From: Alejandro Colomar Reply-To: Alejandro Colomar Cc: Alejandro Colomar , linux-man@vger.kernel.org, libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Both POSIX and glibc use 'restrict' in pthread_create(). Let's use it here too. .../glibc$ grep_glibc_prototype pthread_create sysdeps/htl/pthread.h:212: extern int pthread_create (pthread_t *__restrict __threadp, __const pthread_attr_t *__restrict __attr, void *(*__start_routine)(void *), void *__restrict __arg) __THROWNL __nonnull ((1, 3)); sysdeps/nptl/pthread.h:200: extern int pthread_create (pthread_t *__restrict __newthread, const pthread_attr_t *__restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg) __THROWNL __nonnull ((1, 3)); .../glibc$ Signed-off-by: Alejandro Colomar --- man3/pthread_create.3 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/man3/pthread_create.3 b/man3/pthread_create.3 index a1ede6e96..14fd37220 100644 --- a/man3/pthread_create.3 +++ b/man3/pthread_create.3 @@ -30,8 +30,10 @@ pthread_create \- create a new thread .nf .B #include .PP -.BI "int pthread_create(pthread_t *" thread ", const pthread_attr_t *" attr , -.BI " void *(*" start_routine ")(void *), void *" arg ); +.BI "int pthread_create(pthread_t *restrict " thread , +.BI " const pthread_attr_t *restrict " attr , +.BI " void *(*" start_routine ")(void *)," +.BI " void *restrict " arg ); .fi .PP Compile and link with \fI\-pthread\fP.