From patchwork Mon Mar 8 18:53:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1449350 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=lKOwyHsv; 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 4DvSG05Zv4z9sWR for ; Tue, 9 Mar 2021 05:55:20 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 059A8395541C; Mon, 8 Mar 2021 18:54:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 059A8395541C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615229670; bh=ZfZTkSy2d0t1QxgQZV+5fOk7Mjr7noWTh+/ZrecrUvY=; 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=lKOwyHsvVUdTwVDf8m9WpMvWQwkalRd5J6ZvCRyoNV/gz+TD2eKxA3zZ6a0LR8G6k NS9CrIu4WFZOSXkbBFiz0tcSpQrQvKoODyJX0tVKaRl3WM1Z0r5GW1LFEflWaXzYor WptE/eVCyQsEAQX4x5dY9By0qw4xt9RKnSExQoOQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id CC0083955413 for ; Mon, 8 Mar 2021 18:54:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CC0083955413 Received: by mail-wr1-x42f.google.com with SMTP id u16so12584368wrt.1 for ; Mon, 08 Mar 2021 10:54:25 -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=ZfZTkSy2d0t1QxgQZV+5fOk7Mjr7noWTh+/ZrecrUvY=; b=HbLuOB+iBabi5RJ6+W5WeIpblbKMSM4y/E0WUr7gB7J+u6GdLp8bQATEs8lBZ4cvIA LUguqM1S+h1gJu14YolP6O5xc70J370B2fWy6xaa8CivBdGnZJbdjr7KOcBHyCqFIHkp hbx0DpqcW7SyG3Ojh3NDS2c2H0YTnGHwAz50b7fAA+TsVB5LARDtzZBOsQV+XmZkbiGJ AgRmhj9L+UNpyTuGpFkkj5H58cq88dBGnqZaSSCyc8H7lRdjfc7wpK27XRvOsVq+drcM UZcLkriGmXBydoGIfHOduEspYZLyyA3kAgc+6F9hzcNV0XE0g/ZU+9lKY5kGrTpf8anM 0PWQ== X-Gm-Message-State: AOAM532d3seNkp43V2SW4qoqHxalLLmJbbsHjYSG/d7Uq8eF9P+jinq6 GDDm0HVvXfZO6Mmi++ddKaA= X-Google-Smtp-Source: ABdhPJxNg46CmKJ/ZzLQ/HOVs5zuqet5mOGhfO2WCY2M6AgJxIq0tt4P+najbPZMedBBVlgW+TEZ9Q== X-Received: by 2002:a5d:4ac4:: with SMTP id y4mr23848618wrs.86.1615229665039; Mon, 08 Mar 2021 10:54:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 10:54:24 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH 17/23] rcmd.3: SYNOPSIS: Use 'restrict' in prototypes Date: Mon, 8 Mar 2021 19:53:26 +0100 Message-Id: <20210308185331.242176-18-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=-12.0 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" glibc uses 'restrict' in rcmd(), rcmd_af(), iruserok_af(). Let's use it here too. .../glibc$ grep_glibc_prototype rcmd resolv/netdb.h:449: extern int rcmd (char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p); .../glibc$ grep_glibc_prototype rcmd_af resolv/netdb.h:461: extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport, const char *__restrict __locuser, const char *__restrict __remuser, const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af); .../glibc$ grep_glibc_prototype iruserok_af resolv/netdb.h:537: extern int iruserok_af (const void *__raddr, int __suser, const char *__remuser, const char *__locuser, sa_family_t __af); .../glibc$ Signed-off-by: Alejandro Colomar --- man3/rcmd.3 | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/man3/rcmd.3 b/man3/rcmd.3 index 0349646c7..d2df6b629 100644 --- a/man3/rcmd.3 +++ b/man3/rcmd.3 @@ -49,28 +49,30 @@ stream to a remote command .nf .BR "#include " "/* Or on some systems */" .PP -.BI "int rcmd(char **" ahost ", unsigned short " inport ", const char *" locuser , -.BI " const char *" remuser ", const char *" cmd ", int *" fd2p ); +.BI "int rcmd(char **restrict " ahost ", unsigned short " inport , +.BI " const char *restrict " locuser ", const char *restrict " remuser , +.BI " const char *restrict " cmd ", int *restrict " fd2p ); .PP .BI "int rresvport(int *" port ); .PP .BI "int iruserok(uint32_t " raddr ", int " superuser , -.BI " const char *" ruser ", const char *" luser ); +.BI " const char *" ruser ", const char *" luser ); .BI "int ruserok(const char *" rhost ", int " superuser , -.BI " const char *" ruser ", const char *" luser ); +.BI " const char *" ruser ", const char *" luser ); .PP -.BI "int rcmd_af(char **" ahost ", unsigned short " inport ", const char *" locuser , -.BI " const char *" remuser ", const char *" cmd ", int *" fd2p , -.BI " sa_family_t " af ); +.BI "int rcmd_af(char **restrict " ahost ", unsigned short " inport , +.BI " const char *restrict " locuser ", const char *restrict " remuser , +.BI " const char *restrict " cmd ", int *restrict " fd2p , +.BI " sa_family_t " af ); .PP .BI "int rresvport_af(int *" port ", sa_family_t " af ); .PP -.BI "int iruserok_af(const void *" raddr ", int " superuser , -.BI " const char *" ruser ", const char *" luser \ -", sa_family_t " af ); +.BI "int iruserok_af(const void *restrict " raddr ", int " superuser , +.BI " const char *restrict " ruser ", const char *restrict " luser , +.BI " sa_family_t " af ); .BI "int ruserok_af(const char *" rhost ", int " superuser , -.BI " const char *" ruser ", const char *" luser \ -", sa_family_t " af ); +.BI " const char *" ruser ", const char *" luser , +.BI " sa_family_t " af ); .fi .PP .RS -4