From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 9DB11385800D for ; Tue, 9 Feb 2021 19:00:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9DB11385800D Received: by mail-wr1-x42c.google.com with SMTP id g6so10348278wrs.11 for ; Tue, 09 Feb 2021 11:00:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Sq7veWnskG1bH/So4sPfXAMiGxTI5iAiud4Iyyw6We0=; b=Xi+B14ltOCSSvfBVkc+GlBbrfHNyHVqRtCZEBrJU4khv6EGRczCOlrjaNNpnaVpNku VabWZ3YrW+2OaojDhIpYW0R4+tyLTfyimrL2c9xs4QV/Lgc12zYCBtuqh3YbaqFCpdNh 8jPnGnGfTMRyOa6ets6DjOrbVRXQC2M74CaAgOUkqSm9y3H+jFLRnyjrBmdKHJosOHiB v0sXco2OSquihrkO+swieszqOz3T61gagLK6Lj8GED1Sfr5wNk2vw2g0UCGTvzyBfBvx GWljpiMiVPtvwiX1nKV4c4PH65pRIU5zWI0CSi2F6hU+CMkqPyPheQG48U6jcQcKWNXb z+nA== X-Gm-Message-State: AOAM530o8jDHCwfG1sxg4yaI+W6QHjuDg1PRQL2zvGE79PZNPJtIp5dG 7w8D2sUuFdw0UhF/IhnGLRj5jMBkYsVpPQ== X-Google-Smtp-Source: ABdhPJyhbpSNOCn0NvwIpO4kgXtH1V4jR3YsPRIiIg7wdO7e5d3f/4pglLIncCCKrXPgh6q2j8OD/w== X-Received: by 2002:a5d:5049:: with SMTP id h9mr27944986wrt.404.1612897201500; Tue, 09 Feb 2021 11:00:01 -0800 (PST) Received: from ?IPv6:2001:a61:24ca:4d01:a815:d0d9:f754:e0ef? ([2001:a61:24ca:4d01:a815:d0d9:f754:e0ef]) by smtp.gmail.com with ESMTPSA id 143sm5995959wmb.47.2021.02.09.11.00.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Feb 2021 11:00:00 -0800 (PST) Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, libc-alpha@sourceware.org Subject: Re: [PATCH v2] mlock.2: mlock2(): Fix prototype parameter types To: Alejandro Colomar References: <20210204111732.194599-1-alx.manpages@gmail.com> <20210207124611.201122-1-alx.manpages@gmail.com> From: "Michael Kerrisk (man-pages)" Message-ID: Date: Tue, 9 Feb 2021 20:00:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210207124611.201122-1-alx.manpages@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, 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-List-Received-Date: Tue, 09 Feb 2021 19:00:04 -0000 Hello Alex On 2/7/21 1:46 PM, Alejandro Colomar wrote: > The documented prototype for mlock2() was a mix of the > glibc wrapper prototype and the kernel syscall prototype. > Let's document the glibc wrapper prototype, which is shown below. Thanks. Patch applied. Cheers, Michael > ...... > > .../glibc$ grep_glibc_prototype mlock2 > sysdeps/unix/sysv/linux/bits/mman-shared.h:55: > int mlock2 (const void *__addr, size_t __length, unsigned int __flags) __THROW; > .../glibc$ > > function grep_glibc_prototype() > { > if ! [ -v 1 ]; then > >&2 echo "Usage: ${FUNCNAME[0]} "; > return ${EX_USAGE}; > fi > > find * -type f \ > |grep '\.h$' \ > |sort -V \ > |xargs pcregrep -Mn \ > "(?s)^[^\s#][\w\s]+\s+\**${1}\s*\([\w\s()[\]*,]*?(...)?\)[\w\s()]*;" \ > |sed -E 's/^[^:]+:[0-9]+:/&\n/'; > } > > Signed-off-by: Alejandro Colomar > --- > man2/mlock.2 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/man2/mlock.2 b/man2/mlock.2 > index 2822df7cf..f48d632c4 100644 > --- a/man2/mlock.2 > +++ b/man2/mlock.2 > @@ -31,7 +31,7 @@ mlock, mlock2, munlock, mlockall, munlockall \- lock and unlock memory > .B #include > .PP > .BI "int mlock(const void *" addr ", size_t " len ); > -.BI "int mlock2(const void *" addr ", size_t " len ", int " flags ); > +.BI "int mlock2(const void *" addr ", size_t " len ", unsigned int " flags ); > .BI "int munlock(const void *" addr ", size_t " len ); > .PP > .BI "int mlockall(int " flags ); > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/