All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: mtk.manpages@gmail.com
Cc: Alejandro Colomar <alx.manpages@gmail.com>,
	linux-man@vger.kernel.org, libc-alpha@sourceware.org,
	"G . Branden Robinson" <g.branden.robinson@gmail.com>
Subject: [PATCH 20/22] posix_spawn.3: SYNOPSIS: Use 'restrict' in prototypes
Date: Sat,  6 Mar 2021 00:51:04 +0100	[thread overview]
Message-ID: <20210305235105.177359-21-alx.manpages@gmail.com> (raw)
In-Reply-To: <20210305235105.177359-1-alx.manpages@gmail.com>

POSIX uses 'restrict' in posix_spawnp().
However, glibc doesn't.
Let's document here the more restrictive of them, which is POSIX.
I reported a bug to glibc about this.

$ man 3p posix_spawnp |sed -n '/^SYNOPSIS/,/;/p'
SYNOPSIS
       #include <spawn.h>

       int posix_spawnp(pid_t *restrict pid, const char *restrict file,
           const posix_spawn_file_actions_t *file_actions,
           const posix_spawnattr_t *restrict attrp,
           char *const argv[restrict], char *const envp[restrict]);
$

.../glibc$ grep_glibc_prototype posix_spawnp
posix/spawn.h:85:
extern int posix_spawnp (pid_t *__pid, const char *__file,
			 const posix_spawn_file_actions_t *__file_actions,
			 const posix_spawnattr_t *__attrp,
			 char *const __argv[], char *const __envp[])
    __nonnull ((2, 5));
.../glibc$

I conciously did an exception with respect to the right margin
of the rendered page.  Instead of having the right margin at 78
as usual (per Branden's recommendation), I let it use col 79
this time, to avoid breaking the prototype in an ugly way,
or shifting all of the parameters to the left, unaligned with
respect to the function parentheses.

Bug: glibc <https://sourceware.org/bugzilla/show_bug.cgi?id=27529>
Cc: G. Branden Robinson <g.branden.robinson@gmail.com>
Cc: glibc <libc-alpha@sourceware.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/posix_spawn.3 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/man3/posix_spawn.3 b/man3/posix_spawn.3
index 02f86fddd..df82a81df 100644
--- a/man3/posix_spawn.3
+++ b/man3/posix_spawn.3
@@ -40,10 +40,11 @@ posix_spawn, posix_spawnp \- spawn a process
 .BI "                const posix_spawnattr_t *restrict " attrp ,
 .BI "                char *const " argv [restrict],
 .BI "                char *const " envp [restrict]);
-.BI "int posix_spawnp(pid_t *" pid ", const char *" file ,
-.BI "                 const posix_spawn_file_actions_t *" file_actions ,
-.BI "                 const posix_spawnattr_t *" attrp ,
-.BI "                 char *const " argv[] ", char *const " envp[] );
+.BI "int posix_spawnp(pid_t *restrict " pid ", const char *restrict " file ,
+.BI "                const posix_spawn_file_actions_t *restrict " file_actions ,
+.BI "                const posix_spawnattr_t *restrict " attrp ,
+.BI "                char *const " argv [restrict],
+.BI "                char *const " envp [restrict]);
 .fi
 .SH DESCRIPTION
 The
-- 
2.30.1.721.g45526154a5


  parent reply	other threads:[~2021-03-05 23:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 23:50 [PATCH 00/22] man3: SYNOPSIS: Use 'restrict' in prototypes (batch 3) Alejandro Colomar
2021-03-05 23:50 ` [PATCH 01/22] getservent_r.3: SYNOPSIS: Use 'restrict' in prototypes Alejandro Colomar
2021-03-05 23:50 ` [PATCH 02/22] getsubopt.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 03/22] glob.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 04/22] iconv.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 05/22] inet_ntop.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 06/22] inet_pton.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 07/22] lio_listio.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 08/22] makecontext.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 09/22] malloc_hook.3: SYNOPSIS: Use 'volatile' " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 10/22] mbrlen.3: SYNOPSIS: Use 'restrict' " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 11/22] mbrtowc.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 12/22] mbsnrtowcs.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 13/22] mbsrtowcs.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 14/22] mbstowcs.3: " Alejandro Colomar
2021-03-05 23:50 ` [PATCH 15/22] mbtowc.3: " Alejandro Colomar
2021-03-05 23:51 ` [PATCH 16/22] mempcpy.3: " Alejandro Colomar
2021-03-05 23:51 ` [PATCH 17/22] mq_getattr.3: " Alejandro Colomar
2021-03-05 23:51 ` [PATCH 18/22] mq_receive.3: " Alejandro Colomar
2021-03-05 23:51 ` [PATCH 19/22] posix_spawn.3: " Alejandro Colomar
2021-03-05 23:51 ` Alejandro Colomar [this message]
2021-03-05 23:51 ` [PATCH 21/22] printf.3: SYNOPSIS: Use 'restrict' in prototypes; ffix too Alejandro Colomar
2021-03-05 23:51 ` [PATCH 22/22] pthread_attr_setguardsize.3: SYNOPSIS: Use 'restrict' in prototypes Alejandro Colomar
2021-03-07 10:20 ` [PATCH 00/22] man3: SYNOPSIS: Use 'restrict' in prototypes (batch 3) Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210305235105.177359-21-alx.manpages@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=g.branden.robinson@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.