Skip to contentSkip to conversation

SLIST_REMOVAL number of arguments

PATCH In review Solomon Tan 2 participants 6 messages Apr 20, 2025 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

Hi!

Kindly forgive me if I'm mistaken, but might there be an error in the man pages on the number of arguments in SLIST_REMOVE?

The SYNOPSIS in https://man7.org/linux/man-pages/man3/slist.3.html states that there are three arguments.

```
       void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm,
                               SLIST_ENTRY NAME);
```

However, the EXAMPLE and the source indicate that there should be four. Quoting the source:

```
#define    SLIST_REMOVE(head, elm, type, field) do {            \
```

Should the SYNOPSIS be the following instead?

```
       void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm, TYPE,
                               SLIST_ENTRY NAME);
```

Thank you.

Cheers,
Solomon

#1 lore raw

Hi Solomon!

Quoted 9 lines · Solomon Tan

Kindly forgive me if I'm mistaken, but might there be an error in the man pages on the number of arguments in SLIST_REMOVE?

The SYNOPSIS in https://man7.org/linux/man-pages/man3/slist.3.html states that there are three arguments.

```
       void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm,
                               SLIST_ENTRY NAME);
```
Quoted 5 lines

However, the EXAMPLE and the source indicate that there should be four. Quoting the source:

```
#define    SLIST_REMOVE(head, elm, type, field) do {            \
```
	alx@debian:~/src/gnu/glibc/master$ grepc SLIST_REMOVE .
	./misc/sys/queue.h:#define	SLIST_REMOVE(head, elm, type, field) do {	\
		if ((head)->slh_first == (elm)) {				\
			SLIST_REMOVE_HEAD((head), field);			\
		}								\
		else {								\
			struct type *curelm = (head)->slh_first;		\
			while(curelm->field.sle_next != (elm))			\
				curelm = curelm->field.sle_next;		\
			curelm->field.sle_next =				\
			    curelm->field.sle_next->field.sle_next;		\
		}								\
	} while (/*CONSTCOND*/0)
Quoted 5 lines

Should the SYNOPSIS be the following instead?

```
       void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm, TYPE,
                               SLIST_ENTRY NAME);
```

Yep, this seems a mistake I made in 2020. A fix should include the following tag:

Fixes bb8164dec0c4 (2020-10-22; "slist.3: ffix: Use man markup")

Do you want to send a patch, or should I do it?

Have a lovely day!
Alex

Signature · 1 line
<https://www.alejandro-colomar.es/>
#2 lore raw
Quoted 42 lines · Alejandro Colomar

Hi Solomon!

Quoted 9 lines · Solomon Tan

Kindly forgive me if I'm mistaken, but might there be an error in the man pages on the number of arguments in SLIST_REMOVE?

The SYNOPSIS in https://man7.org/linux/man-pages/man3/slist.3.html states that there are three arguments.

```
      void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm,
                              SLIST_ENTRY NAME);
```
Quoted 5 lines

However, the EXAMPLE and the source indicate that there should be four. Quoting the source:

```
#define    SLIST_REMOVE(head, elm, type, field) do {            \
```
	alx@debian:~/src/gnu/glibc/master$ grepc SLIST_REMOVE .
	./misc/sys/queue.h:#define	SLIST_REMOVE(head, elm, type, field) do {	\
		if ((head)->slh_first == (elm)) {				\
			SLIST_REMOVE_HEAD((head), field);			\
		}								\
		else {								\
			struct type *curelm = (head)->slh_first;		\
			while(curelm->field.sle_next != (elm))			\
				curelm = curelm->field.sle_next;		\
			curelm->field.sle_next =				\
			    curelm->field.sle_next->field.sle_next;		\
		}								\
	} while (/*CONSTCOND*/0)
Quoted 5 lines

Should the SYNOPSIS be the following instead?

```
      void SLIST_REMOVE(SLIST_HEAD *head, struct TYPE *elm, TYPE,
                              SLIST_ENTRY NAME);
```
Quoted 8 lines

Yep, this seems a mistake I made in 2020. A fix should include the following tag:

Fixes bb8164dec0c4 (2020-10-22; "slist.3: ffix: Use man markup")

Do you want to send a patch, or should I do it?

I would like to send a patch, please. :D I will do it in another email.

Quoted 6 lines

Have a lovely day!
Alex

Signature · 1 line
<https://www.alejandro-colomar.es/>
#3 lore raw

Hi Solomon,

Quoted 4 lines · Solomon Tan
Quoted 2 lines

Do you want to send a patch, or should I do it?

I would like to send a patch, please. :D I will do it in another email.

Great! Please send the patch with this header field, so that it's threaded under this conversation.

	In-Reply-To: <[email protected]>

Cheers,
Alex

Signature · 1 line
<https://www.alejandro-colomar.es/>
author
#4 lore raw

PATCH 1/1 man/man3/slist.3: Add missing argument

In reply to Solomon Tan

SLIST_REMOVAL has four arguments. This commit adds in the missing argument.

Fixes bb8164dec0c4 (2020-10-22; "slist.3: ffix: Use man markup")
---
 man/man3/slist.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man/man3/slist.3 +1 -1
index 50cd1d452..ff68e72d6 100644
@@ -57,7 +57,7 @@ Standard C library
 .\" .BI "SLIST_FOREACH_FROM_SAFE(struct TYPE *" var ", SLIST_HEAD *" head ,
 .\" .BI "                        SLIST_ENTRY " NAME ", struct TYPE *" temp_var );
 .P
-.BI "void SLIST_REMOVE(SLIST_HEAD *" head ", struct TYPE *" elm ,
+.BI "void SLIST_REMOVE(SLIST_HEAD *" head ", struct TYPE *" elm ", TYPE,
 .BI "                        SLIST_ENTRY " NAME );
 .BI "void SLIST_REMOVE_HEAD(SLIST_HEAD *" head ,
 .BI "                        SLIST_ENTRY " NAME );
Signature · 1 line
2.43.0
#5 lore raw

Re: [PATCH] man/man3/slist.3: Add missing argument

Hi Solomon,

Quoted 5 lines · Solomon T

SLIST_REMOVAL has four arguments. This commit adds in the missing argument.

Fixes bb8164dec0c4 (2020-10-22; "slist.3: ffix: Use man markup")

Patch applied. Thanks!

Cheers,
Alex

Quoted 21 lines
---
 man/man3/slist.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man/man3/slist.3 +1 -1
index 50cd1d452..ff68e72d6 100644
@@ -57,7 +57,7 @@ Standard C library
 .\" .BI "SLIST_FOREACH_FROM_SAFE(struct TYPE *" var ", SLIST_HEAD *" head ,
 .\" .BI "                        SLIST_ENTRY " NAME ", struct TYPE *" temp_var );
 .P
-.BI "void SLIST_REMOVE(SLIST_HEAD *" head ", struct TYPE *" elm ,
+.BI "void SLIST_REMOVE(SLIST_HEAD *" head ", struct TYPE *" elm ", TYPE,
 .BI "                        SLIST_ENTRY " NAME );
 .BI "void SLIST_REMOVE_HEAD(SLIST_HEAD *" head ,
 .BI "                        SLIST_ENTRY " NAME );
Signature · 1 line
2.43.0
Signature · 1 line
<https://www.alejandro-colomar.es/>