Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4298247pxb; Sun, 14 Feb 2021 05:49:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmMBrZyF0jGzvrej/JrBUQjsODAbiT8xUImcYFgzcs+cvYeVadQq6OaNlT67CKJTLLKyL9 X-Received: by 2002:a17:907:75c6:: with SMTP id jl6mr11215767ejc.243.1613310597878; Sun, 14 Feb 2021 05:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613310597; cv=none; d=google.com; s=arc-20160816; b=yZZw9OFFPrNlKjxLbpyQNrEQG9W2zeMoeAtRcbjW+MN1ra4tYZTkjkjyD+GV6s9ASD o7m8fk/KamKD9KIOARY1nNUDrAbQlVQ3QyOh/bv5T2KsttY1jWZvcynProZn3eaQg/hI rShIHf99ygnNrc29tQGQXTebF+yOArWUxAvG/hGp7o0cwmBh7EMLz3xorwlCfugCVpQU djMjCeAA1gKRSHAw9i333goWq+uc0jDBmQzMo7j9HIL60K4MxMkHqxbYp0GtiSRY3Hlb LpKDsCndaTa6mA7A+BbGVd9qU7ZjF7+9MN3HPkMds3oyB0AL+TGBBLiEe4dQQhxvcfUs hJ0A== 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=RbmGRai9khpzA9lGPDc0qiZjCQHwpScfyjwp7gSkoB8=; b=0qhdmgJWeFnoMFs2/95BZ30NWw2Q7uDSqNWa1jqKBX0bE+hf6hpP5HAuPPLus9gSbx FiA0zYvxExxSIIRFGtfXqzwYw0jCH/Lk7dyOUrnSY6oz5aOtkGJBkMiWzHKd8E+mGdtH jVvw4GEMVQf0IiobxDYN1Ir4ji1Ujn7q+b/59aOEKTOiNHlynu5TzZQBI+cz7oGJRaWA EoT49SBJ+lO4wZlSeGbxOwK8FlNxioTBc2OBLDJ5GT5nM3RoLhrNG9kLi3nt4LHhcOfu zDYi11Du/isjty5Lse3XoURAmw5t9LqukMBTxnWjUOjIT2dl2KXnrO4wLEOfO4Te8CEu RkWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MttG9Q4R; 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 i12si10147390edx.217.2021.02.14.05.49.33; Sun, 14 Feb 2021 05:49:57 -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=MttG9Q4R; 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 S229740AbhBNNsm (ORCPT + 99 others); Sun, 14 Feb 2021 08:48:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbhBNNsm (ORCPT ); Sun, 14 Feb 2021 08:48:42 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAC01C061574; Sun, 14 Feb 2021 05:48:01 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id v7so5357060wrr.12; Sun, 14 Feb 2021 05:48:01 -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=RbmGRai9khpzA9lGPDc0qiZjCQHwpScfyjwp7gSkoB8=; b=MttG9Q4RYTaZ6h3CGegxb8ZEkEwgN+o4NFrz6FqPHj1pjv1Awsf9DBqHpIBxvYc5tL H1aMPn76hTsZ2oKDKLlDXmBvFTt8R59vSa9+qvmgtL//MzGAPcNItzNq7bJTcO9KIfvM Q2CL5r0MfaJw2DzIRvQgNfaLMLbhSck5egWgnBLmg6wSF9MG/3fJWfK4FhFsFwpn5OqK Kx5PYUU+2+VwX0k8cEbqYKVbYhW/CVR+Zki3E0R642kKD+moZ8/Jw2ij8a9tp5stIJG1 mtR3Iv/EnQLUyMUDiAapvl/OtpWLya6W6D2zNMNVdE3EGrxxc5wTENJJeFJkgRFVzhGv i2Hg== 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=RbmGRai9khpzA9lGPDc0qiZjCQHwpScfyjwp7gSkoB8=; b=CEvPDbxMPjb2Dr9dXe4ppBcLcXq4FBzt29Rjb7z84nt8HG9sDXoOIC/51Q2u1cWVdy QrLJB5cgo50aQOVz3GJl5vLvLpjyOBq5XHetUmC9lVNx81CD3+boWyr7LHN2Q/RfjZc0 rahHWoVZwaT0dkfv7rCrE74QlYNYIQ3OTj8s7vOtVLsT8HqHBPFsNQDkRQ6gIsC4PFWj W/ZmzSS0IDJUB5kijuxeEeEx1eChC1Oz4pInQiKL7eaqRT0nTpHYZ47wI9OxvbLOlgsd 0THSluOKs/4U3mCrs+6mUbbTighgY3GmYWqVyD2n4clKlcfn8vhfBzZ/OFX6ituSIjbK /nkQ== X-Gm-Message-State: AOAM530LwaCJqzS8BeVm3/OCTAi1lzRtVP9hdCBmvTOguKVV9qOG9b2F AiZPD6dz29QWNPQ3JC5+mLQ= X-Received: by 2002:adf:f6d0:: with SMTP id y16mr14080936wrp.351.1613310480352; Sun, 14 Feb 2021 05:48:00 -0800 (PST) Received: from localhost.localdomain ([170.253.36.171]) by smtp.googlemail.com with ESMTPSA id z8sm18795278wrr.55.2021.02.14.05.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 05:47:59 -0800 (PST) From: Alejandro Colomar To: mtk.manpages@gmail.com Cc: Alejandro Colomar , linux-man@vger.kernel.org, linux-kernel@vger.kernel.org, libc-alpha@sourceware.org, Florian Weimer Subject: [RFC] execve.2: SYNOPSIS: Document both glibc wrapper and kernel sycalls Date: Sun, 14 Feb 2021 14:39:07 +0100 Message-Id: <20210214133907.157320-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 Until now, the manual pages have (usually) documented only either the glibc (or another library) wrapper for a syscall, or the raw syscall (this only when there's not a wrapper). Let's document both prototypes, which many times are slightly different. This will solve a problem where documenting glibc wrappers implied shadowing the documentation for the raw syscall. It will also be much clearer for the reader where the syscall comes from (kernel? glibc? other?), by adding an explicit comment at the beginning of the prototypes. This removes the need of scrolling down to NOTES to see that info. Signed-off-by: Alejandro Colomar --- Hi all, This is a prototype for doing some important changes to the SYNOPSIS of the man-pages. The commit message above explains the idea quite well. A few details that couldn't be shown on this commit are: For cases where the wrapper is provided by a library other than glibc, I'd simply change the comment. For example, for move_pages(2), it would say /* libnuma wrapper function: */. I think this would make the samll notes warning that there's no glibc wrapper function deprecated (but we could keep them for some time and decide that later). While changing this, I'd also make sure that the headers are correct, and clearly differentiate which headers are needed for the raw syscall and for the wrapper function. This change will probably take more than one release of the man-pages to complete. Any thoughts? Thanks, Alex --- man2/execve.2 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/man2/execve.2 b/man2/execve.2 index 639e3b4b9..87ff022ce 100644 --- a/man2/execve.2 +++ b/man2/execve.2 @@ -39,10 +39,18 @@ execve \- execute program .SH SYNOPSIS .nf +/* Glibc wrapper function: */ .B #include .PP -.BI "int execve(const char *" pathname ", char *const " argv [], -.BI " char *const " envp []); +.BI "int execve(const char *" pathname ", +.BI " char *const " argv "[], char *const " envp []); +.PP + /* Raw system call: */ +.B #include +.B #include +.PP +.BI "int syscall(SYS_execve, const char *" pathname , +.BI " const char *const " argv "[], const char *const " envp []); .fi .SH DESCRIPTION .BR execve () -- 2.30.0