From patchwork Fri Mar 5 23:51:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 42356 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 3608F399F017; Fri, 5 Mar 2021 23:51:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3608F399F017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614988297; bh=QyD7HAEUxbDPgOVS/RxC+0k7Vr+8IAT+vsKJIPb38tg=; 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=Z15zeP/6sTK8k39U0nuh/Kj0pcDUSY/DeIMGowylJIOUlq5s+XmnBFRPHwgNCFAmv 0CreKEq8ZnxEICFBlO8iKPxImrjcA/Hhy5fMIc/b+WIiM+2dnMC98cHM81B4d1L9mH OI2eIRuPKAtCvBAoHXonr+RUmSAPXYgtAunfCO0g= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id B4597399F00B for ; Fri, 5 Mar 2021 23:51:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B4597399F00B Received: by mail-wm1-x32b.google.com with SMTP id e23so2665376wmh.3 for ; Fri, 05 Mar 2021 15:51:32 -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=QyD7HAEUxbDPgOVS/RxC+0k7Vr+8IAT+vsKJIPb38tg=; b=CQ7nq3Dmwd4gTWcyTkZGHInZgw08awifbZV+MuDCZBhRJyehz5WTDfgTPGhmBSmX9K G7PaR6B0RhBMEB+Ae5HI+O61mcd94BUTpm8e7kTm4uKWdFLAZ27w6b4D5oti8d3t1IBh unlFoDdBpXhA4xSY6xby511ZArilTmaJG6U1ALssP0y+EfTG7e46peNjCsoMSVVVIU9y 6c2RzLxGC0qlSka4EtylrxVHRxbVVxldaWnHLYvSWiYi/gU9hKn8o92r7hxmQpb4ckjT zWNqgFrHSGNFUMvjgo8r8OBR+bHbxNCdowdy6tshxueHL6p0VQ+d5mvT3LKH0DBNdmbu ff8Q== X-Gm-Message-State: AOAM532jDAKH+sLyQOJp3epvYstGs82/uTXz8dyK2Bfxz4vI+XzbzeZJ 8iiBF85l+8baNwnfRKyKjes= X-Google-Smtp-Source: ABdhPJxD7YX+AiCVof59MZCblO8lalFgSEz8XZNLcoCfhJMrnKOFHIrcawnni4xKp1Vs4N+ew0Z1Xg== X-Received: by 2002:a05:600c:4ba2:: with SMTP id e34mr11127848wmp.121.1614988291914; Fri, 05 Mar 2021 15:51:31 -0800 (PST) Received: from localhost.localdomain ([170.253.51.130]) by smtp.googlemail.com with ESMTPSA id f7sm7219835wrm.36.2021.03.05.15.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 15:51:31 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH 20/22] posix_spawn.3: SYNOPSIS: Use 'restrict' in prototypes Date: Sat, 6 Mar 2021 00:51:04 +0100 Message-Id: <20210305235105.177359-21-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.1.721.g45526154a5 In-Reply-To: <20210305235105.177359-1-alx.manpages@gmail.com> References: <20210305235105.177359-1-alx.manpages@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 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, "G . Branden Robinson" , libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" POSIX uses 'restrict' in posix_spawnp(). However, glibc doesn't. Let's document here the more restrictive of them, which is POSIX. I reported a bug to glibc about this. $ man 3p posix_spawnp |sed -n '/^SYNOPSIS/,/;/p' SYNOPSIS #include int posix_spawnp(pid_t *restrict pid, const char *restrict file, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t *restrict attrp, char *const argv[restrict], char *const envp[restrict]); $ .../glibc$ grep_glibc_prototype posix_spawnp posix/spawn.h:85: extern int posix_spawnp (pid_t *__pid, const char *__file, const posix_spawn_file_actions_t *__file_actions, const posix_spawnattr_t *__attrp, char *const __argv[], char *const __envp[]) __nonnull ((2, 5)); .../glibc$ I conciously did an exception with respect to the right margin of the rendered page. Instead of having the right margin at 78 as usual (per Branden's recommendation), I let it use col 79 this time, to avoid breaking the prototype in an ugly way, or shifting all of the parameters to the left, unaligned with respect to the function parentheses. Bug: glibc Cc: G. Branden Robinson Cc: glibc Signed-off-by: Alejandro Colomar --- man3/posix_spawn.3 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/man3/posix_spawn.3 b/man3/posix_spawn.3 index 02f86fddd..df82a81df 100644 --- a/man3/posix_spawn.3 +++ b/man3/posix_spawn.3 @@ -40,10 +40,11 @@ posix_spawn, posix_spawnp \- spawn a process .BI " const posix_spawnattr_t *restrict " attrp , .BI " char *const " argv [restrict], .BI " char *const " envp [restrict]); -.BI "int posix_spawnp(pid_t *" pid ", const char *" file , -.BI " const posix_spawn_file_actions_t *" file_actions , -.BI " const posix_spawnattr_t *" attrp , -.BI " char *const " argv[] ", char *const " envp[] ); +.BI "int posix_spawnp(pid_t *restrict " pid ", const char *restrict " file , +.BI " const posix_spawn_file_actions_t *restrict " file_actions , +.BI " const posix_spawnattr_t *restrict " attrp , +.BI " char *const " argv [restrict], +.BI " char *const " envp [restrict]); .fi .SH DESCRIPTION The