Skip to contentSkip to conversation

setpgid.2: ERRORS: add EPERM for nonexisting process group

PATCH In review Guy Shefy 2 participants 5 messages Feb 20, 2023 – Feb 25, 2023 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore

Guy Shefy

author
#0 lore raw

PATCH 1/1 setpgid.2: ERRORS: add EPERM for nonexisting process group

---
 man2/setpgid.2 | 5 +++++
 1 file changed, 5 insertions(+)
man2/setpgid.2 +5 -0
index 52c5bd5fc..0b0182eb9 100644
@@ -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 ():
Signature · 1 line
2.34.1
#1 lore raw

Hello Guy,

Quoted 10 lines · Guy Shefy
---
  man2/setpgid.2 | 5 +++++
  1 file changed, 5 insertions(+)
man2/setpgid.2 +0 -0
index 52c5bd5fc..0b0182eb9 100644

man2/setpgid.2 a session leader · line 221

Quoted 8 lines
man2/setpgid.2 +5 -0
@@ -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

Quoted 3 lines
man2/setpgid.2 +0 -0
  .B ESRCH
  For
  .BR getpgid ():
Signature · 2 lines
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
author
#2 lore raw

From d2da0c74521195f4211bdc25089bbd6b420010c0 Mon Sep 17 00:00:00 2001
From: Guy Shefy <[email protected]>
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;
}
---
 man2/setpgid.2 | 5 +++++
 1 file changed, 5 insertions(+)
man2/setpgid.2 +5 -0
index 52c5bd5fc..0b0182eb9 100644
@@ -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 ():
Signature · 1 line
2.34.1
Quoted 36 lines · Alex Colomar

Hello Guy,

Quoted 10 lines · Guy Shefy
---
  man2/setpgid.2 | 5 +++++
  1 file changed, 5 insertions(+)
man2/setpgid.2 +0 -0
index 52c5bd5fc..0b0182eb9 100644

man2/setpgid.2 a session leader · line 221

Quoted 8 lines
man2/setpgid.2 +5 -0
@@ -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

Quoted 3 lines
man2/setpgid.2 +0 -0
  .B ESRCH
  For
  .BR getpgid ():
Signature · 2 lines
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
author
#3 lore raw

From 961b64515b805caadb5a77e3592eb3e883c57e0d Mon Sep 17 00:00:00 2001
From: Guy Shefy <[email protected]>
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;
}
---
 man2/setpgid.2 | 5 +++++
 1 file changed, 5 insertions(+)
man2/setpgid.2 +5 -0
index 52c5bd5fc..0b0182eb9 100644
@@ -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 ():
Signature · 1 line
2.34.1
Quoted 87 lines · Guy Shefy
Quoted 1 line

From d2da0c74521195f4211bdc25089bbd6b420010c0 Mon Sep 17 00:00:00 2001

From: Guy Shefy <[email protected]>
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;
}
---
 man2/setpgid.2 | 5 +++++
 1 file changed, 5 insertions(+)
man2/setpgid.2 +5 -0
index 52c5bd5fc..0b0182eb9 100644
@@ -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 ():
Signature · 1 line
2.34.1
Quoted 36 lines · Alex Colomar

Hello Guy,

Quoted 10 lines · Guy Shefy
---
  man2/setpgid.2 | 5 +++++
  1 file changed, 5 insertions(+)
man2/setpgid.2 +0 -0
index 52c5bd5fc..0b0182eb9 100644

man2/setpgid.2 a session leader · line 221

Quoted 8 lines
man2/setpgid.2 +5 -0
@@ -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

Quoted 3 lines
man2/setpgid.2 +0 -0
  .B ESRCH
  For
  .BR getpgid ():
Signature · 2 lines
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
#4 lore raw

Hi Guy,

Quoted 27 lines · Guy Shefy

From 961b64515b805caadb5a77e3592eb3e883c57e0d Mon Sep 17 00:00:00 2001
From: Guy Shefy <[email protected]>
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;
}
Quoted 1 line

Patch applied. Thanks very much for the example program!

Alex

Quoted 20 lines
---
  man2/setpgid.2 | 5 +++++
  1 file changed, 5 insertions(+)
man2/setpgid.2 +5 -0
index 52c5bd5fc..0b0182eb9 100644
@@ -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 ():
Signature · 2 lines
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5