Message ID | 20210228004817.122463-9-alx.manpages@gmail.com |
---|---|
State | New |
Headers | show
Return-Path: <libc-alpha-bounces@sourceware.org> 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=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=<UNKNOWN>) 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=ZgtkQBXn; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 4Dp4YN48v9z9sCD for <incoming@patchwork.ozlabs.org>; Sun, 28 Feb 2021 11:50:00 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B909C381DC0D; Sun, 28 Feb 2021 00:49:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B909C381DC0D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614473368; bh=MxkD4a6rylrGp5JIkAA92kF0tWAH9d5pd5HaxqyitoA=; 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=ZgtkQBXn/9dlXo0iHIEWUaaVuErixVSDHmPCAdG/lel5XL6bFiq8uZ3MvvBLN/AJj 5h6XcaYSBhXXfXhn9eAVD69RO+T9LQ/7hinw3SuEyiDEAxB4liQrWkVWZnULAb1dVn Q7B4S4vnLqY0p2AQU6p8DNmFhu9Tbx06UdTX/wks= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 1358538930D3 for <libc-alpha@sourceware.org>; Sun, 28 Feb 2021 00:49:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1358538930D3 Received: by mail-wm1-x332.google.com with SMTP id i9so10031052wml.0 for <libc-alpha@sourceware.org>; Sat, 27 Feb 2021 16:49: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=MxkD4a6rylrGp5JIkAA92kF0tWAH9d5pd5HaxqyitoA=; b=UyBLxlgwe+pkDxNjTJUPMUYqjEUVr0QHEvwkZB/Zjypnl1GbCLfyNr5pAfAnGLwzX/ TywiPyA1vPp48ena+oAlmhZsB6JXYdCnHbgfKFQillhB9Wt+g6zRUsNbWTxGSwpkuSy+ fJRgIQfBJsrQVRRS8MiyNeBfe5kniHXgUf8j5/oX35zMcetf322oEzWw9yVZiz9tiZGF MLqnaGM1qnv3CGS2+rmw5wUVz/hJU7Kunvr2/rnVlQs45jSvFttBH0mmZ98F+52d73IS HDYT/iDprvaHGPqgoX7ruSvxqNPInjIgPRIeAuMD6u91sC3pg75xNZCp4V51lO51b5F9 cEEg== X-Gm-Message-State: AOAM530O3i6AVWrqv+LIyrYR1dpehR8hNPgSYGQavvCHqz88MgHYlfxc CG2SjzCQCUOJuXp8CF60rP7uHZvmLyxn3Q== X-Google-Smtp-Source: ABdhPJz2NIAfHvcT6UIuqXaAxUOAhqUgXLi/oyWfXM/zMr7tDdjolMCMu8k8GeT/+EhXANAkuqlvhQ== X-Received: by 2002:a7b:cb01:: with SMTP id u1mr9319991wmj.149.1614473364274; Sat, 27 Feb 2021 16:49:24 -0800 (PST) Received: from localhost.localdomain ([170.253.51.130]) by smtp.googlemail.com with ESMTPSA id o14sm18212145wri.48.2021.02.27.16.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Feb 2021 16:49:24 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH 08/14] getline.3: SYNOPSIS: Use 'restrict' in prototypes Date: Sun, 28 Feb 2021 01:48:12 +0100 Message-Id: <20210228004817.122463-9-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.1.721.g45526154a5 In-Reply-To: <20210228004817.122463-1-alx.manpages@gmail.com> References: <20210228004817.122463-1-alx.manpages@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.2 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 <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Alejandro Colomar via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Alejandro Colomar <alx.manpages@gmail.com> Cc: Alejandro Colomar <alx.manpages@gmail.com>, linux-man@vger.kernel.org, libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
man3: SYNOPSIS: Use 'restrict' in prototypes (batch 2)
|
expand
|
diff --git a/man3/getline.3 b/man3/getline.3 index 25930dbf9..182a8ca85 100644 --- a/man3/getline.3 +++ b/man3/getline.3 @@ -30,9 +30,10 @@ getline, getdelim \- delimited string input .nf .B #include <stdio.h> .PP -.BI "ssize_t getline(char **" lineptr ", size_t *" n ", FILE *" stream ); -.BI "ssize_t getdelim(char **" lineptr ", size_t *" n ", int " delim \ -", FILE *" stream ); +.BI "ssize_t getline(char **restrict " lineptr ", size_t *restrict " n , +.BI " FILE *restrict " stream ); +.BI "ssize_t getdelim(char **restrict " lineptr ", size_t *restrict " n , +.BI " int " delim ", FILE *restrict " stream ); .fi .PP .RS -4
Both POSIX and glibc use 'restrict' in getline(), getdelim(). Let's use it here too. .../glibc$ grep_glibc_prototype getline libio/stdio.h:621: extern __ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) __wur; .../glibc$ grep_glibc_prototype getdelim libio/stdio.h:611: extern __ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __wur; .../glibc$ Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> --- man3/getline.3 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)