Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1029291pxb; Thu, 4 Feb 2021 03:22:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxM1toWH0eL3NduGTYEeL9wHl+d21/dycdNqQ7TGTm6Z/quZNSaSpI/PXQEZ7u9J5EzV4JC X-Received: by 2002:a17:906:b106:: with SMTP id u6mr7386960ejy.313.1612437727845; Thu, 04 Feb 2021 03:22:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612437727; cv=none; d=google.com; s=arc-20160816; b=hT1Bx2tYHKeKwFrQqsGyQlBQ8Vd34ZOMaS+nspZRFUBgq7Oo8UWW82oa+S1wxUwFdz 8yUllrQDhsMvxsAov1kINf+KpgFcadSzdo3UlhwLOAy95h5x5C9THsqNpQFvJq190v+2 wzzBSk7zk1NHQtwy/RrnNHuLYs1KgN2w3y4UUKg1KgAPUB586zPN8Swdhtv1HazOXeqR L697ColUMsHQ0J6QR8SQPAYvAmTQ37Hm5XsE4OEA+ED67XQXCOoknluSrB5lhJAG0rFu z3NpwRUqVIN8v4pQFmnmGnsJMLkTVnVaVsuMMCOpO09pCxc0hwA3oYRN51mQD7Jxmqlv GPBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+NQNsmgLjymyzoU3Zkfr8Kgi3bLWvqv+FhgdKhN/wd8=; b=OQKMhoMvbe2QftV6D7sMWIqh7AvYL5klAvVNfKnaKSO7d7RL6YiRqlvFWm9h/vn1Ai ZyU5VaIR5ktcQFCypDM6pyzRuRN0u9SCrgqxTCLpFHG55zwiyOZikWT8zrWkeYAhMVuS lBzKDZb9I+phKF9m590D0GHXSyDSTEmHOAvNbB3DZ9L1h9q3aMfOwdSDUx0fSbBHuxnm jMBBRbLm3AUTuMnnEHTItQgEOQsgsfonIja122e9l965ZD5E+xls6ooT/GWo4sWBEuC+ XexoQ46bjWOBA+F8QdjzkZTk1PlA0AaSq5gj4uXQ1cDkKjtjV7nNypggy99N7vLMhzfi lwcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Z4wbM/Ze"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si2922226ejz.642.2021.02.04.03.21.41; Thu, 04 Feb 2021 03:22:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Z4wbM/Ze"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235578AbhBDLUe (ORCPT + 99 others); Thu, 4 Feb 2021 06:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235551AbhBDLUc (ORCPT ); Thu, 4 Feb 2021 06:20:32 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75B2DC0613D6; Thu, 4 Feb 2021 03:19:52 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id y187so2658262wmd.3; Thu, 04 Feb 2021 03:19:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+NQNsmgLjymyzoU3Zkfr8Kgi3bLWvqv+FhgdKhN/wd8=; b=Z4wbM/ZesE9e2jKkCM9CV63YrTCrSmXNRukY0KlRSHHUJM/MUBKgHelpTdSaRZz6A9 jic7/GxbnfRJcCvA2e+SvwIi00u/JIVSY7oMkK6NFDMqT0FqQcK4K3SZgz4M8U0JEauB poBo/8lflLlKztlSr6qZ7JHhuc5ciY7Ajhah9dpmq69/NL4JcGppgYGHoE/ZECBR+Uk0 k3p3tNDXvTyByr2CmzIoUQtRkmqKNoKBeQ9OGreHRbCls3rY8VibZ9mT2v6QJWcmwXSy LLbL0pTMs805ue4O9FrZmbjZ4SeTpi0jt4W3yy9QDnE5JrBtUzcP+I/SILff9XjGO09q kutA== 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:mime-version :content-transfer-encoding; bh=+NQNsmgLjymyzoU3Zkfr8Kgi3bLWvqv+FhgdKhN/wd8=; b=mRw8mhCRAHDIZxixuZgEB1PKejYND3WiLNWCw8IuH1OLNUAsKM0IMbBgFAY8+t9eaa FBJLqO3vOXVLG7H/6zQjS1g1w0imrDLizhoFZ2h0V6w5jksPzutvsjswl+KBK7lf3Cg2 EyO297Qnqa+5+AgmaHtrF8GM4ODEP45WwOBvpPSQOCCm3OT+hgRTGUgci/hIWHRISFA5 oBqqIT9jrkzcBrre+w5pFe9gzXadka05AsMUnPpBZiIwnhq0Lp4NAaADEUPSlAEGyNkM QCygM+RintZRDtHe4TjmADWUwlIc9hod/harxuB2GvihSNifR0LU5VB818xLamqaBqnS MSsg== X-Gm-Message-State: AOAM533Va3vMjLDlEzhEZmlGvFcf+d4a/NwqNf0bC5K/aG+KL3dsvXn0 QjqYIjAQAAW+ftrhRs4e+xoRk1CODrw= X-Received: by 2002:a05:600c:4f8b:: with SMTP id n11mr6940730wmq.160.1612437591270; Thu, 04 Feb 2021 03:19:51 -0800 (PST) Received: from debian.vlc ([170.253.51.130]) by smtp.gmail.com with ESMTPSA id c62sm5849770wmd.43.2021.02.04.03.19.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 03:19:50 -0800 (PST) From: Alejandro Colomar To: mtk.manpages@gmail.com Cc: Alejandro Colomar , linux-man@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mmap2.2: Fix prototype parameter types Date: Thu, 4 Feb 2021 12:19:26 +0100 Message-Id: <20210204111925.194705-1-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are many slightly different prototypes for this syscall, but none of them is like the documented one. Of all the different prototypes, let's document the asm-generic one. ...... .../linux$ grep_syscall mmap2 arch/csky/kernel/syscall.c:17: SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, unsigned long, prot, unsigned long, flags, unsigned long, fd, off_t, offset) arch/microblaze/kernel/sys_microblaze.c:46: SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, unsigned long, prot, unsigned long, flags, unsigned long, fd, unsigned long, pgoff) arch/nds32/kernel/sys_nds32.c:12: SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, unsigned long, prot, unsigned long, flags, unsigned long, fd, unsigned long, pgoff) arch/powerpc/kernel/syscalls.c:60: SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len, unsigned long, prot, unsigned long, flags, unsigned long, fd, unsigned long, pgoff) arch/riscv/kernel/sys_riscv.c:37: SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, unsigned long, prot, unsigned long, flags, unsigned long, fd, off_t, offset) arch/s390/kernel/sys_s390.c:49: SYSCALL_DEFINE1(mmap2, struct s390_mmap_arg_struct __user *, arg) arch/sparc/kernel/sys_sparc_32.c:101: SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, unsigned long, prot, unsigned long, flags, unsigned long, fd, unsigned long, pgoff) arch/ia64/include/asm/unistd.h:30: asmlinkage unsigned long sys_mmap2( unsigned long addr, unsigned long len, int prot, int flags, int fd, long pgoff); arch/ia64/kernel/sys_ia64.c:139: asmlinkage unsigned long sys_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, long pgoff) arch/m68k/kernel/sys_m68k.c:40: asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) arch/parisc/kernel/sys_parisc.c:275: asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) arch/powerpc/include/asm/syscalls.h:15: asmlinkage long sys_mmap2(unsigned long addr, size_t len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff); arch/sh/include/asm/syscalls.h:8: asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff); arch/sh/kernel/sys_sh.c:41: asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) arch/sparc/kernel/systbls.h:23: asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff); include/asm-generic/syscalls.h:14: asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff); .../linux$ function grep_syscall() { if ! [ -v 1 ]; then >&2 echo "Usage: ${FUNCNAME[0]} "; return ${EX_USAGE}; fi find * -type f \ |grep '\.c$' \ |sort -V \ |xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \ |sed -E 's/^[^:]+:[0-9]+:/&\n/'; find * -type f \ |grep '\.[ch]$' \ |sort -V \ |xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \ |sed -E 's/^[^:]+:[0-9]+:/&\n/'; } Signed-off-by: Alejandro Colomar --- man2/mmap2.2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/man2/mmap2.2 b/man2/mmap2.2 index 349ee45e5..f9f9e91cb 100644 --- a/man2/mmap2.2 +++ b/man2/mmap2.2 @@ -33,8 +33,9 @@ mmap2 \- map files or devices into memory .nf .B #include .PP -.BI "void *mmap2(void *" addr ", size_t " length ", int " prot , -.BI " int " flags ", int " fd ", off_t " pgoffset ); +.BI "void *mmap2(unsigned long " addr ", unsigned long " length , +.BI " unsigned long " prot ", unsigned long " flags , +.BI " unsigned long " fd ", unsigned long " pgoffset ); .fi .SH DESCRIPTION This is probably not the system call that you are interested in; instead, see -- 2.30.0