* Re: Error in posix_spawn(3) man page
2022-01-07 9:32 ` Corinna Vinschen
@ 2022-01-07 19:03 ` Brian Inglis
2022-01-07 20:02 ` Keith Thompson
2022-01-08 0:01 ` Keith Thompson
2 siblings, 0 replies; 10+ messages in thread
From: Brian Inglis @ 2022-01-07 19:03 UTC (permalink / raw)
To: newlib
On 2022-01-07 02:32, Corinna Vinschen wrote:
> On Jan 5 13:39, Keith Thompson wrote:
>> On Wed, Jan 5, 2022 at 3:47 AM Corinna Vinschen wrote:
>>> On Dec 28 19:24, Keith Thompson wrote:
>>>> The posix_spawn(3) man page has incorrect types for the argv and
>>>> envp parameters for the posix_spawn and posix_spawnp functions.
>>>> They're shown as
>>>> char *const argv, char *const envp
>>>> when they should be
>>>> char *const argv[], char *const envp[]
>>>> Suggested patch (though I'm not 100% sure how the square brackets
>>>> are handled when generating the man page):
>>> Please send a git compatible patch in `git format-patch' format.
>> As requested. Given the way I copy-and-pasted the patch into my
>> email, it might not have treated tabs correctly.
You should attach it as a text attachment, possibly with an empty body,
perhaps using a command line mailer like mail (mailutils), email (email
package), mailx (Heirloom project download), neo/mutt, or X GUIs like
xdg-email (xdg-utils), evolution, the MUA client from some other
desktop, or a text friendly Unix compatible Windows GUI like Thunderbird.
> It's not TABs, it's an incorrect patch format:
> $ git am 0001-Fix-documented-argv-and-envp-params-for-posix_spawn.patch
> Applying: Fix documented argv and envp params for posix_spawn
> error: libc/posix/posix_spawn.c: does not exist in index
> Patch failed at 0001 Fix documented argv and envp params for posix_spawn
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> Did you actually create the patch with `git format-patch'?
Email it with git send-email as the MUA or Gmail may be mangling it!
Set your personal ~/.gitconfig or system global /etc/gitconfig to e.g.
[sendemail]
aliasesFile = /etc/mail/aliases
confirm = always
multiEdit = false
smtpServer = ...
suppressFrom = true
with your own preferences and other settings, or use equivalent git
config --global or --system commands.
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Error in posix_spawn(3) man page
2022-01-07 9:32 ` Corinna Vinschen
2022-01-07 19:03 ` Brian Inglis
@ 2022-01-07 20:02 ` Keith Thompson
2022-01-08 0:01 ` Keith Thompson
2 siblings, 0 replies; 10+ messages in thread
From: Keith Thompson @ 2022-01-07 20:02 UTC (permalink / raw)
To: newlib; +Cc: Keith Thompson
On Fri, Jan 7, 2022 at 1:32 AM Corinna Vinschen <vinschen@redhat.com> wrote:
>
> Hi Keith,
>
> On Jan 5 13:39, Keith Thompson wrote:
> > On Wed, Jan 5, 2022 at 3:47 AM Corinna Vinschen <vinschen@redhat.com> wrote:
> > >
> > > Hi Keith,
> > >
> > > On Dec 28 19:24, Keith Thompson wrote:
> > > > The posix_spawn(3) man page has incorrect types for the argv and
> > > > envp parameters for the posix_spawn and posix_spawnp functions.
> > > >
> > > > They're shown as
> > > > char *const argv, char *const envp
> > > > when they should be
> > > > char *const argv[], char *const envp[]
> > > >
> > > > Suggested patch (though I'm not 100% sure how the square brackets
> > > > are handled when generating the man page):
> > >
> > > Please send a git compatible patch in `git format-patch' format.
> > >
> > >
> > > Thanks,
> > > Corinna
> >
> > As requested. Given the way I copy-and-pasted the patch into my email,
> > it might not have
> > treated tabs correctly.
>
> It's not TABs, it's an incorrect patch format:
>
> $ git am 0001-Fix-documented-argv-and-envp-params-for-posix_spawn.patch
> Applying: Fix documented argv and envp params for posix_spawn
> error: libc/posix/posix_spawn.c: does not exist in index
> Patch failed at 0001 Fix documented argv and envp params for posix_spawn
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> [...]
>
> Did you actually create the patch with `git format-patch'?
>
>
> Thanks,
> Corinna
Yes, I did. Apparently `git format-patch` normally adds `a/` and `b/`
prefixes to the paths. I don't know why it didn't do so in this case.
I'll look into it.
Meanwhile, you should be able to apply the patch by changing these lines:
--- newlib/libc/posix/posix_spawn.c
+++ newlib/libc/posix/posix_spawn.c
to this:
--- a/newlib/libc/posix/posix_spawn.c
+++ b/newlib/libc/posix/posix_spawn.c
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Error in posix_spawn(3) man page
2022-01-07 9:32 ` Corinna Vinschen
2022-01-07 19:03 ` Brian Inglis
2022-01-07 20:02 ` Keith Thompson
@ 2022-01-08 0:01 ` Keith Thompson
2022-01-08 4:30 ` Keith Thompson
2 siblings, 1 reply; 10+ messages in thread
From: Keith Thompson @ 2022-01-08 0:01 UTC (permalink / raw)
To: newlib; +Cc: Keith Thompson
[-- Attachment #1: Type: text/plain, Size: 1835 bytes --]
On Fri, Jan 7, 2022 at 1:32 AM Corinna Vinschen <vinschen@redhat.com> wrote:
>
> Hi Keith,
>
> On Jan 5 13:39, Keith Thompson wrote:
> > On Wed, Jan 5, 2022 at 3:47 AM Corinna Vinschen <vinschen@redhat.com> wrote:
> > >
> > > Hi Keith,
> > >
> > > On Dec 28 19:24, Keith Thompson wrote:
> > > > The posix_spawn(3) man page has incorrect types for the argv and
> > > > envp parameters for the posix_spawn and posix_spawnp functions.
> > > >
> > > > They're shown as
> > > > char *const argv, char *const envp
> > > > when they should be
> > > > char *const argv[], char *const envp[]
> > > >
> > > > Suggested patch (though I'm not 100% sure how the square brackets
> > > > are handled when generating the man page):
> > >
> > > Please send a git compatible patch in `git format-patch' format.
> > >
> > >
> > > Thanks,
> > > Corinna
> >
> > As requested. Given the way I copy-and-pasted the patch into my email,
> > it might not have
> > treated tabs correctly.
>
> It's not TABs, it's an incorrect patch format:
>
> $ git am 0001-Fix-documented-argv-and-envp-params-for-posix_spawn.patch
> Applying: Fix documented argv and envp params for posix_spawn
> error: libc/posix/posix_spawn.c: does not exist in index
> Patch failed at 0001 Fix documented argv and envp params for posix_spawn
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> [...]
>
> Did you actually create the patch with `git format-patch'?
>
>
> Thanks,
> Corinna
The problem was that I had diff.noprefix=true in my $HOME/.gitconfig.
It caused `git format-patch` to omit the `a/` and `b/` prefixes, and `git am`
doesn't appear to have any way to consume a patch with those prefixes missing.
I've attached an updated patch that should apply cleanly.
(I'd argue that this is a git bug, but of course this isn't the place
to report it.)
[-- Attachment #2: 0001-Fix-documented-argv-and-envp-params-for-posix_spawn.patch --]
[-- Type: application/octet-stream, Size: 1150 bytes --]
From 7fdfe8c2549b53ea36d68b879020e0236d6480ac Mon Sep 17 00:00:00 2001
From: Keith Thompson <Keith.S.Thompson@gmail.com>
Date: Wed, 5 Jan 2022 13:30:16 -0800
Subject: [PATCH] Fix documented argv and envp params for posix_spawn
---
newlib/libc/posix/posix_spawn.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/newlib/libc/posix/posix_spawn.c b/newlib/libc/posix/posix_spawn.c
index 005471fde..85bfa6477 100644
--- a/newlib/libc/posix/posix_spawn.c
+++ b/newlib/libc/posix/posix_spawn.c
@@ -39,11 +39,11 @@ SYNOPSIS
int posix_spawn(pid_t *<[pid]>, const char *<[path]>,
const posix_spawn_file_actions_t *<[file_actions]>,
const posix_spawnattr_t *<[attrp]>,
- char *const <[argv]>, char *const <[envp]>);
+ char *const <[argv]>[], char *const <[envp]>[]);
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]>);
+ char *const <[argv]>[], char *const <[envp]>[]);
DESCRIPTION
Use <<posix_spawn>> and <<posix_spawnp>> to create a new child process
--
2.33.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Error in posix_spawn(3) man page
2022-01-08 0:01 ` Keith Thompson
@ 2022-01-08 4:30 ` Keith Thompson
2022-01-10 8:58 ` Corinna Vinschen
0 siblings, 1 reply; 10+ messages in thread
From: Keith Thompson @ 2022-01-08 4:30 UTC (permalink / raw)
To: newlib; +Cc: Keith Thompson
On Fri, Jan 7, 2022 at 4:01 PM Keith Thompson
<Keith.S.Thompson@gmail.com> wrote:
>
> On Fri, Jan 7, 2022 at 1:32 AM Corinna Vinschen <vinschen@redhat.com> wrote:
> >
> > Hi Keith,
> >
> > On Jan 5 13:39, Keith Thompson wrote:
> > > On Wed, Jan 5, 2022 at 3:47 AM Corinna Vinschen <vinschen@redhat.com> wrote:
> > > >
> > > > Hi Keith,
> > > >
> > > > On Dec 28 19:24, Keith Thompson wrote:
> > > > > The posix_spawn(3) man page has incorrect types for the argv and
> > > > > envp parameters for the posix_spawn and posix_spawnp functions.
> > > > >
> > > > > They're shown as
> > > > > char *const argv, char *const envp
> > > > > when they should be
> > > > > char *const argv[], char *const envp[]
> > > > >
> > > > > Suggested patch (though I'm not 100% sure how the square brackets
> > > > > are handled when generating the man page):
> > > >
> > > > Please send a git compatible patch in `git format-patch' format.
> > > >
> > > >
> > > > Thanks,
> > > > Corinna
> > >
> > > As requested. Given the way I copy-and-pasted the patch into my email,
> > > it might not have
> > > treated tabs correctly.
> >
> > It's not TABs, it's an incorrect patch format:
> >
> > $ git am 0001-Fix-documented-argv-and-envp-params-for-posix_spawn.patch
> > Applying: Fix documented argv and envp params for posix_spawn
> > error: libc/posix/posix_spawn.c: does not exist in index
> > Patch failed at 0001 Fix documented argv and envp params for posix_spawn
> > hint: Use 'git am --show-current-patch=diff' to see the failed patch
> > [...]
> >
> > Did you actually create the patch with `git format-patch'?
> >
> >
> > Thanks,
> > Corinna
>
> The problem was that I had diff.noprefix=true in my $HOME/.gitconfig.
> It caused `git format-patch` to omit the `a/` and `b/` prefixes, and `git am`
> doesn't appear to have any way to consume a patch with those prefixes missing.
>
> I've attached an updated patch that should apply cleanly.
>
> (I'd argue that this is a git bug, but of course this isn't the place
> to report it.)
I submitted a Git bug report. The response:
] The -p<num> flag controls how many segments `git am` or `git apply`
] removes. The default is -p1. `git am -p0` should apply the patch
] correctly.
The "-p<n>" option to "git am" is mentioned in the git-am(1) man page,
but explained only by reference to git-apply(1), so it's easy to miss
(I certainly did).
My original patch could have been applied with `git am -p0`. I hope
this is useful if you receive any future patches with the same issue.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Error in posix_spawn(3) man page
2022-01-08 4:30 ` Keith Thompson
@ 2022-01-10 8:58 ` Corinna Vinschen
0 siblings, 0 replies; 10+ messages in thread
From: Corinna Vinschen @ 2022-01-10 8:58 UTC (permalink / raw)
To: newlib
On Jan 7 20:30, Keith Thompson wrote:
> On Fri, Jan 7, 2022 at 4:01 PM Keith Thompson
> <Keith.S.Thompson@gmail.com> wrote:
> > The problem was that I had diff.noprefix=true in my $HOME/.gitconfig.
> > It caused `git format-patch` to omit the `a/` and `b/` prefixes, and `git am`
> > doesn't appear to have any way to consume a patch with those prefixes missing.
> >
> > I've attached an updated patch that should apply cleanly.
> >
> > (I'd argue that this is a git bug, but of course this isn't the place
> > to report it.)
>
> I submitted a Git bug report. The response:
> ] The -p<num> flag controls how many segments `git am` or `git apply`
> ] removes. The default is -p1. `git am -p0` should apply the patch
> ] correctly.
>
> The "-p<n>" option to "git am" is mentioned in the git-am(1) man page,
> but explained only by reference to git-apply(1), so it's easy to miss
> (I certainly did).
>
> My original patch could have been applied with `git am -p0`. I hope
> this is useful if you receive any future patches with the same issue.
D'oh, thanks! I pushed your patch.
Corinna
^ permalink raw reply [flat|nested] 10+ messages in thread