public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group
@ 2023-02-20 15:50 Guy Shefy
  2023-02-20 15:51 ` Alex Colomar
  0 siblings, 1 reply; 5+ messages in thread
From: Guy Shefy @ 2023-02-20 15:50 UTC (permalink / raw)
  To: alx.manpages; +Cc: linux-man

Signed-off-by: Guy Shefy <guyshefyb@gmail.com>
---
 man2/setpgid.2 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/man2/setpgid.2 b/man2/setpgid.2
index 52c5bd5fc..0b0182eb9 100644
--- a/man2/setpgid.2
+++ b/man2/setpgid.2
@@ -214,6 +214,11 @@ a session leader
 .RB ( setpgid (),
 .BR setpgrp ()).
 .TP
+.B EPERM
+The target process group does not exists.
+.RB ( setpgid (),
+.BR setpgrp ()).
+.TP
 .B ESRCH
 For
 .BR getpgid ():
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group
  2023-02-20 15:50 [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group Guy Shefy
@ 2023-02-20 15:51 ` Alex Colomar
  2023-02-20 16:01   ` Guy Shefy
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Colomar @ 2023-02-20 15:51 UTC (permalink / raw)
  To: Guy Shefy; +Cc: linux-man


[-- Attachment #1.1: Type: text/plain, Size: 760 bytes --]

Hello Guy,

On 2/20/23 16:50, Guy Shefy wrote:
> Signed-off-by: Guy Shefy <guyshefyb@gmail.com>
> ---
>   man2/setpgid.2 | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/man2/setpgid.2 b/man2/setpgid.2
> index 52c5bd5fc..0b0182eb9 100644
> --- a/man2/setpgid.2
> +++ b/man2/setpgid.2
> @@ -214,6 +214,11 @@ a session leader
>   .RB ( setpgid (),
>   .BR setpgrp ()).
>   .TP
> +.B EPERM
> +The target process group does not exists.
> +.RB ( setpgid (),
> +.BR setpgrp ()).
> +.TP

Could you please document how you found this in the commit message?

Thanks,

Alex

>   .B ESRCH
>   For
>   .BR getpgid ():

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group
  2023-02-20 15:51 ` Alex Colomar
@ 2023-02-20 16:01   ` Guy Shefy
  2023-02-20 16:08     ` Guy Shefy
  0 siblings, 1 reply; 5+ messages in thread
From: Guy Shefy @ 2023-02-20 16:01 UTC (permalink / raw)
  To: Alex Colomar; +Cc: linux-man

From d2da0c74521195f4211bdc25089bbd6b420010c0 Mon Sep 17 00:00:00 2001
From: Guy Shefy <guyshefyb@gmail.com>
Date: Mon, 20 Feb 2023 17:54:40 +0200
Subject: [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group

found using test program:

int main() {
	pid_t pid_a = fork();
	if (!pid_a) {
		// pid_a is not a valid process group
		sleep(1); // stay alive
		return 0;
	}
	if (!fork()) {
		setpgid(0, pid_a);
		perror("setpgid");
		return 0;
	}
	sleep(1); // stay alive
	return 0;
}

Signed-off-by: Guy Shefy <guyshefyb@gmail.com>
---
 man2/setpgid.2 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/man2/setpgid.2 b/man2/setpgid.2
index 52c5bd5fc..0b0182eb9 100644
--- a/man2/setpgid.2
+++ b/man2/setpgid.2
@@ -214,6 +214,11 @@ a session leader
 .RB ( setpgid (),
 .BR setpgrp ()).
 .TP
+.B EPERM
+The target process group does not exists.
+.RB ( setpgid (),
+.BR setpgrp ()).
+.TP
 .B ESRCH
 For
 .BR getpgid ():
-- 
2.34.1

On Mon, Feb 20, 2023 at 04:51:53PM +0100, Alex Colomar wrote:
> Hello Guy,
> 
> On 2/20/23 16:50, Guy Shefy wrote:
> > Signed-off-by: Guy Shefy <guyshefyb@gmail.com>
> > ---
> >   man2/setpgid.2 | 5 +++++
> >   1 file changed, 5 insertions(+)
> > 
> > diff --git a/man2/setpgid.2 b/man2/setpgid.2
> > index 52c5bd5fc..0b0182eb9 100644
> > --- a/man2/setpgid.2
> > +++ b/man2/setpgid.2
> > @@ -214,6 +214,11 @@ a session leader
> >   .RB ( setpgid (),
> >   .BR setpgrp ()).
> >   .TP
> > +.B EPERM
> > +The target process group does not exists.
> > +.RB ( setpgid (),
> > +.BR setpgrp ()).
> > +.TP
> 
> Could you please document how you found this in the commit message?
> 
> Thanks,
> 
> Alex
> 
> >   .B ESRCH
> >   For
> >   .BR getpgid ():
> 
> -- 
> <http://www.alejandro-colomar.es/>
> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
> 




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group
  2023-02-20 16:01   ` Guy Shefy
@ 2023-02-20 16:08     ` Guy Shefy
  2023-02-25  1:01       ` Alex Colomar
  0 siblings, 1 reply; 5+ messages in thread
From: Guy Shefy @ 2023-02-20 16:08 UTC (permalink / raw)
  To: Alex Colomar; +Cc: linux-man

From 961b64515b805caadb5a77e3592eb3e883c57e0d Mon Sep 17 00:00:00 2001
From: Guy Shefy <guyshefyb@gmail.com>
Date: Mon, 20 Feb 2023 17:54:40 +0200
Subject: [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group

found using test program:

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int main() {
	pid_t pid_a = fork();
	if (!pid_a) {
		// pid_a is not a valid process group
		sleep(1); // stay alive
		return 0;
	}
	if (!fork()) {
		setpgid(0, pid_a);
		perror("setpgid");
		return 0;
	}
	sleep(1); // stay alive
	return 0;
}

Signed-off-by: Guy Shefy <guyshefyb@gmail.com>
---
 man2/setpgid.2 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/man2/setpgid.2 b/man2/setpgid.2
index 52c5bd5fc..0b0182eb9 100644
--- a/man2/setpgid.2
+++ b/man2/setpgid.2
@@ -214,6 +214,11 @@ a session leader
 .RB ( setpgid (),
 .BR setpgrp ()).
 .TP
+.B EPERM
+The target process group does not exists.
+.RB ( setpgid (),
+.BR setpgrp ()).
+.TP
 .B ESRCH
 For
 .BR getpgid ():
-- 
2.34.1

On Mon, Feb 20, 2023 at 06:01:48PM +0200, Guy Shefy wrote:
> >From d2da0c74521195f4211bdc25089bbd6b420010c0 Mon Sep 17 00:00:00 2001
> From: Guy Shefy <guyshefyb@gmail.com>
> Date: Mon, 20 Feb 2023 17:54:40 +0200
> Subject: [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group
> 
> found using test program:
> 
> int main() {
> 	pid_t pid_a = fork();
> 	if (!pid_a) {
> 		// pid_a is not a valid process group
> 		sleep(1); // stay alive
> 		return 0;
> 	}
> 	if (!fork()) {
> 		setpgid(0, pid_a);
> 		perror("setpgid");
> 		return 0;
> 	}
> 	sleep(1); // stay alive
> 	return 0;
> }
> 
> Signed-off-by: Guy Shefy <guyshefyb@gmail.com>
> ---
>  man2/setpgid.2 | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/man2/setpgid.2 b/man2/setpgid.2
> index 52c5bd5fc..0b0182eb9 100644
> --- a/man2/setpgid.2
> +++ b/man2/setpgid.2
> @@ -214,6 +214,11 @@ a session leader
>  .RB ( setpgid (),
>  .BR setpgrp ()).
>  .TP
> +.B EPERM
> +The target process group does not exists.
> +.RB ( setpgid (),
> +.BR setpgrp ()).
> +.TP
>  .B ESRCH
>  For
>  .BR getpgid ():
> -- 
> 2.34.1
> 
> On Mon, Feb 20, 2023 at 04:51:53PM +0100, Alex Colomar wrote:
> > Hello Guy,
> > 
> > On 2/20/23 16:50, Guy Shefy wrote:
> > > Signed-off-by: Guy Shefy <guyshefyb@gmail.com>
> > > ---
> > >   man2/setpgid.2 | 5 +++++
> > >   1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/man2/setpgid.2 b/man2/setpgid.2
> > > index 52c5bd5fc..0b0182eb9 100644
> > > --- a/man2/setpgid.2
> > > +++ b/man2/setpgid.2
> > > @@ -214,6 +214,11 @@ a session leader
> > >   .RB ( setpgid (),
> > >   .BR setpgrp ()).
> > >   .TP
> > > +.B EPERM
> > > +The target process group does not exists.
> > > +.RB ( setpgid (),
> > > +.BR setpgrp ()).
> > > +.TP
> > 
> > Could you please document how you found this in the commit message?
> > 
> > Thanks,
> > 
> > Alex
> > 
> > >   .B ESRCH
> > >   For
> > >   .BR getpgid ():
> > 
> > -- 
> > <http://www.alejandro-colomar.es/>
> > GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
> > 
> 
> 
> 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group
  2023-02-20 16:08     ` Guy Shefy
@ 2023-02-25  1:01       ` Alex Colomar
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Colomar @ 2023-02-25  1:01 UTC (permalink / raw)
  To: Guy Shefy; +Cc: linux-man


[-- Attachment #1.1: Type: text/plain, Size: 1376 bytes --]

Hi Guy,

On 2/20/23 17:08, Guy Shefy wrote:
>  From 961b64515b805caadb5a77e3592eb3e883c57e0d Mon Sep 17 00:00:00 2001
> From: Guy Shefy <guyshefyb@gmail.com>
> Date: Mon, 20 Feb 2023 17:54:40 +0200
> Subject: [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group
> 
> found using test program:
> 
> #include <stdio.h>
> #include <sys/types.h>
> #include <unistd.h>
> 
> int main() {
> 	pid_t pid_a = fork();
> 	if (!pid_a) {
> 		// pid_a is not a valid process group
> 		sleep(1); // stay alive
> 		return 0;
> 	}
> 	if (!fork()) {
> 		setpgid(0, pid_a);
> 		perror("setpgid");
> 		return 0;
> 	}
> 	sleep(1); // stay alive
> 	return 0;
> }
> 
> Signed-off-by: Guy Shefy <guyshefyb@gmail.com>

Patch applied.  Thanks very much for the example program!

Alex

> ---
>   man2/setpgid.2 | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/man2/setpgid.2 b/man2/setpgid.2
> index 52c5bd5fc..0b0182eb9 100644
> --- a/man2/setpgid.2
> +++ b/man2/setpgid.2
> @@ -214,6 +214,11 @@ a session leader
>   .RB ( setpgid (),
>   .BR setpgrp ()).
>   .TP
> +.B EPERM
> +The target process group does not exists.
> +.RB ( setpgid (),
> +.BR setpgrp ()).
> +.TP
>   .B ESRCH
>   For
>   .BR getpgid ():

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-25  1:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-20 15:50 [PATCH] setpgid.2: ERRORS: add EPERM for nonexisting process group Guy Shefy
2023-02-20 15:51 ` Alex Colomar
2023-02-20 16:01   ` Guy Shefy
2023-02-20 16:08     ` Guy Shefy
2023-02-25  1:01       ` Alex Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox