* [PATCH] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
@ 2022-11-16 21:50 Thomas Voss
2022-11-16 22:06 ` Alejandro Colomar
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Voss @ 2022-11-16 21:50 UTC (permalink / raw)
To: linux-man; +Cc: Alejandro Colomar, mtk.manpages, Thomas Voss
I see we have manuals for constants, types, and more now! That sure brings a
smile to my face :). I guess I might help out a bit will filling out some of
the missing manuals.
Signed-off-by: Thomas Voss <mail@thomasvoss.com>
---
man3const/EXIT_FAILURE.3const | 1 +
man3const/EXIT_SUCCESS.3const | 58 +++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+)
create mode 100644 man3const/EXIT_FAILURE.3const
create mode 100644 man3const/EXIT_SUCCESS.3const
diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
new file mode 100644
index 000000000..ba0d62df9
--- /dev/null
+++ b/man3const/EXIT_FAILURE.3const
@@ -0,0 +1 @@
+.so man3const/EXIT_SUCCESS.3const
diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
new file mode 100644
index 000000000..dd6f908e5
--- /dev/null
+++ b/man3const/EXIT_SUCCESS.3const
@@ -0,0 +1,58 @@
+.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.\"
+.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
+.SH NAME
+EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
+.SH LIBRARY
+Standard C library
+.RI ( libc )
+.SH SYNOPSIS
+.nf
+.B #include <stdlib.h>
+.PP
+.B "#define EXIT_SUCCESS /* ... */"
+.B "#define EXIT_FAILURE /* ... */"
+.fi
+.SH DESCRIPTION
+.BR EXIT_SUCCESS " and " EXIT_FAILURE
+represent a successful and unsuccessful exit status respectively.
+Both macros are constant expressions of type
+.I int
+which can be used as arguments to the
+.BR exit ()
+function.
+.SH CONFORMING TO
+C99 and later;
+POSIX.1-2001 and later.
+.SH EXAMPLES
+.\" SRC BEGIN (EXIT_SUCCESS.c)
+.EX
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ FILE *fp;
+
+ if (argc != 2) {
+ fprintf(stderr, "Usage: %s <file>\en", argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((fp = fopen(argv[1], "r")) == NULL) {
+ perror(argv[1]);
+ exit(EXIT_FAILURE);
+ }
+
+ /* Other code omitted */
+
+ exit(EXIT_SUCCESS);
+}
+.EE
+.\" SRC END
+.SH SEE ALSO
+.BR exit (3)
--
2.38.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
2022-11-16 21:50 [PATCH] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages Thomas Voss
@ 2022-11-16 22:06 ` Alejandro Colomar
2022-11-16 22:11 ` Alejandro Colomar
0 siblings, 1 reply; 11+ messages in thread
From: Alejandro Colomar @ 2022-11-16 22:06 UTC (permalink / raw)
To: Thomas Voss, linux-man; +Cc: mtk.manpages
[-- Attachment #1.1: Type: text/plain, Size: 3400 bytes --]
Hi Thomas,
On 11/16/22 22:50, Thomas Voss wrote:
> I see we have manuals for constants, types, and more now! That sure brings a
> smile to my face :).
It's good to see that there's audience that likes these. :)
> I guess I might help out a bit will filling out some of
> the missing manuals.
Sure.
>
> Signed-off-by: Thomas Voss <mail@thomasvoss.com>
> ---
> man3const/EXIT_FAILURE.3const | 1 +
> man3const/EXIT_SUCCESS.3const | 58 +++++++++++++++++++++++++++++++++++
> 2 files changed, 59 insertions(+)
> create mode 100644 man3const/EXIT_FAILURE.3const
> create mode 100644 man3const/EXIT_SUCCESS.3const
>
> diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
> new file mode 100644
> index 000000000..ba0d62df9
> --- /dev/null
> +++ b/man3const/EXIT_FAILURE.3const
> @@ -0,0 +1 @@
> +.so man3const/EXIT_SUCCESS.3const
> diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
> new file mode 100644
> index 000000000..dd6f908e5
> --- /dev/null
> +++ b/man3const/EXIT_SUCCESS.3const
> @@ -0,0 +1,58 @@
> +.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
> +.\"
> +.\" SPDX-License-Identifier: Linux-man-pages-copyleft
> +.\"
> +.\"
> +.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
> +.SH NAME
> +EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
> +.SH LIBRARY
> +Standard C library
> +.RI ( libc )
> +.SH SYNOPSIS
> +.nf
> +.B #include <stdlib.h>
> +.PP
> +.B "#define EXIT_SUCCESS /* ... */"
Although ISO C leaves the value unspecified, POSIX guarantees it is 0, so I'd
document it as such.
The exact definition in glibc is (in my system):
$ grepc EXIT_SUCCESS /usr/include/stdlib.h
/usr/include/stdlib.h:93:
#define EXIT_SUCCESS 0 /* Successful exit status. */
So I'd document it as:
.B "#define EXIT_SUCCESS 0"
> +.B "#define EXIT_FAILURE /* ... */"
The /* ... */ should not be in bold (which makes me realize I did it wrong in
EOF.3const, sorry). Also, POSIX specifies that it should be a non-zero value,
so I'd document it as:
.BR "#define EXIT_FAILURE" " /* non-zero */"
> +.fi
> +.SH DESCRIPTION
> +.BR EXIT_SUCCESS " and " EXIT_FAILURE
We use separate lines for separate identifiers:
.B EXIT_SUCCESS
and
.B EXIT_FAILURE
> +represent a successful and unsuccessful exit status respectively.
> +Both macros are constant expressions of type
> +.I int
Being "constant expressions of type int" is is true of most constants in C, so I
think I'd skip it.
> +which can be used as arguments to the
> +.BR exit ()
> +function.
> +.SH CONFORMING TO
> +C99 and later;
> +POSIX.1-2001 and later.
> +.SH EXAMPLES
> +.\" SRC BEGIN (EXIT_SUCCESS.c)
> +.EX
> +#include <stdio.h>
> +#include <stdlib.h>
> +
> +int
> +main(int argc, char *argv[])
> +{
> + FILE *fp;
> +
> + if (argc != 2) {
> + fprintf(stderr, "Usage: %s <file>\en", argv[0]);
> + exit(EXIT_FAILURE);
> + }
> +
> + if ((fp = fopen(argv[1], "r")) == NULL) {
> + perror(argv[1]);
> + exit(EXIT_FAILURE);
> + }
> +
> + /* Other code omitted */
But please don't omit fclose(3).
> +
> + exit(EXIT_SUCCESS);
> +}
> +.EE
> +.\" SRC END
> +.SH SEE ALSO
> +.BR exit (3)
Thanks!
Alex
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
2022-11-16 22:06 ` Alejandro Colomar
@ 2022-11-16 22:11 ` Alejandro Colomar
2022-11-17 0:14 ` [PATCH v2] " Thomas Voss
0 siblings, 1 reply; 11+ messages in thread
From: Alejandro Colomar @ 2022-11-16 22:11 UTC (permalink / raw)
To: Thomas Voss, linux-man; +Cc: mtk.manpages
[-- Attachment #1.1: Type: text/plain, Size: 2533 bytes --]
On 11/16/22 23:06, Alejandro Colomar wrote:
> Hi Thomas,
>
> On 11/16/22 22:50, Thomas Voss wrote:
>> I see we have manuals for constants, types, and more now! That sure brings a
>> smile to my face :).
>
> It's good to see that there's audience that likes these. :)
>
>
>> I guess I might help out a bit will filling out some of
>> the missing manuals.
>
> Sure.
>
>>
>> Signed-off-by: Thomas Voss <mail@thomasvoss.com>
>> ---
>> man3const/EXIT_FAILURE.3const | 1 +
>> man3const/EXIT_SUCCESS.3const | 58 +++++++++++++++++++++++++++++++++++
>> 2 files changed, 59 insertions(+)
>> create mode 100644 man3const/EXIT_FAILURE.3const
>> create mode 100644 man3const/EXIT_SUCCESS.3const
>>
>> diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
>> new file mode 100644
>> index 000000000..ba0d62df9
>> --- /dev/null
>> +++ b/man3const/EXIT_FAILURE.3const
>> @@ -0,0 +1 @@
>> +.so man3const/EXIT_SUCCESS.3const
>> diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
>> new file mode 100644
>> index 000000000..dd6f908e5
>> --- /dev/null
>> +++ b/man3const/EXIT_SUCCESS.3const
>> @@ -0,0 +1,58 @@
>> +.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
>> +.\"
>> +.\" SPDX-License-Identifier: Linux-man-pages-copyleft
>> +.\"
>> +.\"
>> +.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
>> +.SH NAME
>> +EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
>> +.SH LIBRARY
>> +Standard C library
>> +.RI ( libc )
>> +.SH SYNOPSIS
>> +.nf
>> +.B #include <stdlib.h>
>> +.PP
>> +.B "#define EXIT_SUCCESS /* ... */"
>
> Although ISO C leaves the value unspecified, POSIX guarantees it is 0, so I'd
> document it as such.
>
> The exact definition in glibc is (in my system):
>
> $ grepc EXIT_SUCCESS /usr/include/stdlib.h
> /usr/include/stdlib.h:93:
> #define EXIT_SUCCESS 0 /* Successful exit status. */
>
> So I'd document it as:
>
> .B "#define EXIT_SUCCESS 0"
>
>> +.B "#define EXIT_FAILURE /* ... */"
>
> The /* ... */ should not be in bold (which makes me realize I did it wrong in
> EOF.3const, sorry). Also, POSIX specifies that it should be a non-zero value,
> so I'd document it as:
>
> .BR "#define EXIT_FAILURE" " /* non-zero */"
Quick self-correction:
In man-pages(7), our guide style says we should use nonzero rather than non-zero.
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
2022-11-16 22:11 ` Alejandro Colomar
@ 2022-11-17 0:14 ` Thomas Voss
2022-11-17 0:19 ` Alejandro Colomar
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Voss @ 2022-11-17 0:14 UTC (permalink / raw)
To: alx.manpages; +Cc: linux-man, mail, mtk.manpages
Signed-off-by: Thomas Voss <mail@thomasvoss.com>
---
> Being "constant expressions of type int" is is true of most constants in C, so
> I think I'd skip it.
I think it's pretty obvious to most people, but the manual doesn't have too much
to say so it's not exactly taking up any space and I don't think it hurts to
mention, but it also doesn't matter too much :P. Here's a v2 with the changes
you pointed out.
man3const/EXIT_FAILURE.3const | 1 +
man3const/EXIT_SUCCESS.3const | 59 +++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
create mode 100644 man3const/EXIT_FAILURE.3const
create mode 100644 man3const/EXIT_SUCCESS.3const
diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
new file mode 100644
index 000000000..ba0d62df9
--- /dev/null
+++ b/man3const/EXIT_FAILURE.3const
@@ -0,0 +1 @@
+.so man3const/EXIT_SUCCESS.3const
diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
new file mode 100644
index 000000000..f125afb32
--- /dev/null
+++ b/man3const/EXIT_SUCCESS.3const
@@ -0,0 +1,59 @@
+.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.\"
+.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
+.SH NAME
+EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
+.SH LIBRARY
+Standard C library
+.RI ( libc )
+.SH SYNOPSIS
+.nf
+.B #include <stdlib.h>
+.PP
+.BR "#define EXIT_SUCCESS " 0
+.BR "#define EXIT_FAILURE " /* nonzero */
+.fi
+.SH DESCRIPTION
+.B EXIT_SUCCESS
+and
+.B EXIT_FAILURE
+represent a successful and unsuccessful exit status respectively and can be used
+as arguments to the
+.BR exit ()
+function.
+.SH CONFORMING TO
+C99 and later;
+POSIX.1-2001 and later.
+.SH EXAMPLES
+.\" SRC BEGIN (EXIT_SUCCESS.c)
+.EX
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ FILE *fp;
+
+ if (argc != 2) {
+ fprintf(stderr, "Usage: %s <file>\en", argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((fp = fopen(argv[1], "r")) == NULL) {
+ perror(argv[1]);
+ exit(EXIT_FAILURE);
+ }
+
+ /* Other code omitted */
+
+ fclose(fp);
+ exit(EXIT_SUCCESS);
+}
+.EE
+.\" SRC END
+.SH SEE ALSO
+.BR exit (3)
--
2.38.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
2022-11-17 0:14 ` [PATCH v2] " Thomas Voss
@ 2022-11-17 0:19 ` Alejandro Colomar
2022-11-17 0:25 ` [PATCH v3] " Thomas Voss
2022-11-17 0:26 ` [PATCH v2] " Alejandro Colomar
0 siblings, 2 replies; 11+ messages in thread
From: Alejandro Colomar @ 2022-11-17 0:19 UTC (permalink / raw)
To: Thomas Voss; +Cc: linux-man, mtk.manpages
[-- Attachment #1.1: Type: text/plain, Size: 2859 bytes --]
Hi Thomas,
On 11/17/22 01:14, Thomas Voss wrote:
> Signed-off-by: Thomas Voss <mail@thomasvoss.com>
> ---
>> Being "constant expressions of type int" is is true of most constants in C, so
>> I think I'd skip it.
>
> I think it's pretty obvious to most people, but the manual doesn't have too much
> to say so it's not exactly taking up any space and I don't think it hurts to
> mention, but it also doesn't matter too much :P. Here's a v2 with the changes
> you pointed out.
>
> man3const/EXIT_FAILURE.3const | 1 +
> man3const/EXIT_SUCCESS.3const | 59 +++++++++++++++++++++++++++++++++++
> 2 files changed, 60 insertions(+)
> create mode 100644 man3const/EXIT_FAILURE.3const
> create mode 100644 man3const/EXIT_SUCCESS.3const
>
> diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
> new file mode 100644
> index 000000000..ba0d62df9
> --- /dev/null
> +++ b/man3const/EXIT_FAILURE.3const
> @@ -0,0 +1 @@
> +.so man3const/EXIT_SUCCESS.3const
> diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
> new file mode 100644
> index 000000000..f125afb32
> --- /dev/null
> +++ b/man3const/EXIT_SUCCESS.3const
> @@ -0,0 +1,59 @@
> +.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
> +.\"
> +.\" SPDX-License-Identifier: Linux-man-pages-copyleft
> +.\"
> +.\"
> +.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
> +.SH NAME
> +EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
> +.SH LIBRARY
> +Standard C library
> +.RI ( libc )
> +.SH SYNOPSIS
> +.nf
> +.B #include <stdlib.h>
> +.PP
> +.BR "#define EXIT_SUCCESS " 0
I prefer 2 spaces between the macro name and the expansion, so please one more
space before the quote.
> +.BR "#define EXIT_FAILURE " /* nonzero */
"/* nonzero */" needs to be quoted too.
> +.fi
> +.SH DESCRIPTION
> +.B EXIT_SUCCESS
> +and
> +.B EXIT_FAILURE
> +represent a successful and unsuccessful exit status respectively and can be used
> +as arguments to the
> +.BR exit ()
.BR exit (3)
> +function.
> +.SH CONFORMING TO
> +C99 and later;
> +POSIX.1-2001 and later.
> +.SH EXAMPLES
> +.\" SRC BEGIN (EXIT_SUCCESS.c)
> +.EX
> +#include <stdio.h>
> +#include <stdlib.h>
> +
> +int
> +main(int argc, char *argv[])
> +{
> + FILE *fp;
> +
> + if (argc != 2) {
> + fprintf(stderr, "Usage: %s <file>\en", argv[0]);
> + exit(EXIT_FAILURE);
> + }
> +
> + if ((fp = fopen(argv[1], "r")) == NULL) {
> + perror(argv[1]);
> + exit(EXIT_FAILURE);
> + }
> +
> + /* Other code omitted */
> +
> + fclose(fp);
> + exit(EXIT_SUCCESS);
> +}
> +.EE
> +.\" SRC END
> +.SH SEE ALSO
> +.BR exit (3)
Also interesting:
.BR sysexits.h (3head)
Cheers,
Alex
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
2022-11-17 0:19 ` Alejandro Colomar
@ 2022-11-17 0:25 ` Thomas Voss
2022-11-17 0:26 ` [PATCH v2] " Alejandro Colomar
1 sibling, 0 replies; 11+ messages in thread
From: Thomas Voss @ 2022-11-17 0:25 UTC (permalink / raw)
To: alx.manpages; +Cc: linux-man, mail, mtk.manpages
Signed-off-by: Thomas Voss <mail@thomasvoss.com>
---
man3const/EXIT_FAILURE.3const | 1 +
man3const/EXIT_SUCCESS.3const | 60 +++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
create mode 100644 man3const/EXIT_FAILURE.3const
create mode 100644 man3const/EXIT_SUCCESS.3const
diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
new file mode 100644
index 000000000..ba0d62df9
--- /dev/null
+++ b/man3const/EXIT_FAILURE.3const
@@ -0,0 +1 @@
+.so man3const/EXIT_SUCCESS.3const
diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
new file mode 100644
index 000000000..61842686c
--- /dev/null
+++ b/man3const/EXIT_SUCCESS.3const
@@ -0,0 +1,60 @@
+.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.\"
+.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
+.SH NAME
+EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
+.SH LIBRARY
+Standard C library
+.RI ( libc )
+.SH SYNOPSIS
+.nf
+.B #include <stdlib.h>
+.PP
+.BR "#define EXIT_SUCCESS " 0
+.BR "#define EXIT_FAILURE " /* nonzero */
+.fi
+.SH DESCRIPTION
+.B EXIT_SUCCESS
+and
+.B EXIT_FAILURE
+represent a successful and unsuccessful exit status respectively and can be used
+as arguments to the
+.BR exit ()
+function.
+.SH CONFORMING TO
+C99 and later;
+POSIX.1-2001 and later.
+.SH EXAMPLES
+.\" SRC BEGIN (EXIT_SUCCESS.c)
+.EX
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ FILE *fp;
+
+ if (argc != 2) {
+ fprintf(stderr, "Usage: %s <file>\en", argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((fp = fopen(argv[1], "r")) == NULL) {
+ perror(argv[1]);
+ exit(EXIT_FAILURE);
+ }
+
+ /* Other code omitted */
+
+ fclose(fp);
+ exit(EXIT_SUCCESS);
+}
+.EE
+.\" SRC END
+.SH SEE ALSO
+.BR exit (3),
+.BR sysexits.h (3head)
--
2.38.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
2022-11-17 0:19 ` Alejandro Colomar
2022-11-17 0:25 ` [PATCH v3] " Thomas Voss
@ 2022-11-17 0:26 ` Alejandro Colomar
2022-11-17 0:36 ` [PATCH] " Thomas Voss
1 sibling, 1 reply; 11+ messages in thread
From: Alejandro Colomar @ 2022-11-17 0:26 UTC (permalink / raw)
To: Thomas Voss; +Cc: linux-man, mtk.manpages
[-- Attachment #1.1: Type: text/plain, Size: 2451 bytes --]
Hi Thomas,
You missed a few comments in v3. Please check below.
But mostly looks good.
Cheers,
Alex
On 11/17/22 01:19, Alejandro Colomar wrote:
>> diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
>> new file mode 100644
>> index 000000000..ba0d62df9
>> --- /dev/null
>> +++ b/man3const/EXIT_FAILURE.3const
>> @@ -0,0 +1 @@
>> +.so man3const/EXIT_SUCCESS.3const
>> diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
>> new file mode 100644
>> index 000000000..f125afb32
>> --- /dev/null
>> +++ b/man3const/EXIT_SUCCESS.3const
>> @@ -0,0 +1,59 @@
>> +.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
>> +.\"
>> +.\" SPDX-License-Identifier: Linux-man-pages-copyleft
>> +.\"
>> +.\"
>> +.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
>> +.SH NAME
>> +EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
>> +.SH LIBRARY
>> +Standard C library
>> +.RI ( libc )
>> +.SH SYNOPSIS
>> +.nf
>> +.B #include <stdlib.h>
>> +.PP
>> +.BR "#define EXIT_SUCCESS " 0
>
> I prefer 2 spaces between the macro name and the expansion, so please one more
> space before the quote.
this
>
>> +.BR "#define EXIT_FAILURE " /* nonzero */
>
> "/* nonzero */" needs to be quoted too.
this
>
>> +.fi
>> +.SH DESCRIPTION
>> +.B EXIT_SUCCESS
>> +and
>> +.B EXIT_FAILURE
>> +represent a successful and unsuccessful exit status respectively and can be used
>> +as arguments to the
>> +.BR exit ()
>
> .BR exit (3)
this
>
>> +function.
>> +.SH CONFORMING TO
>> +C99 and later;
>> +POSIX.1-2001 and later.
>> +.SH EXAMPLES
>> +.\" SRC BEGIN (EXIT_SUCCESS.c)
>> +.EX
>> +#include <stdio.h>
>> +#include <stdlib.h>
>> +
>> +int
>> +main(int argc, char *argv[])
>> +{
>> + FILE *fp;
>> +
>> + if (argc != 2) {
>> + fprintf(stderr, "Usage: %s <file>\en", argv[0]);
>> + exit(EXIT_FAILURE);
>> + }
>> +
>> + if ((fp = fopen(argv[1], "r")) == NULL) {
>> + perror(argv[1]);
>> + exit(EXIT_FAILURE);
>> + }
>> +
>> + /* Other code omitted */
>> +
>> + fclose(fp);
>> + exit(EXIT_SUCCESS);
>> +}
>> +.EE
>> +.\" SRC END
>> +.SH SEE ALSO
>> +.BR exit (3)
>
> Also interesting:
>
> .BR sysexits.h (3head)
>
> Cheers,
>
> Alex
>
>
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
2022-11-17 0:26 ` [PATCH v2] " Alejandro Colomar
@ 2022-11-17 0:36 ` Thomas Voss
2022-11-17 0:45 ` Alejandro Colomar
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Voss @ 2022-11-17 0:36 UTC (permalink / raw)
To: alx.manpages; +Cc: linux-man, mail, mtk.manpages
Signed-off-by: Thomas Voss <mail@thomasvoss.com>
---
Alright, hopefully this is it. Feels a bit weird not using mdoc(7) for once :P.
man3const/EXIT_FAILURE.3const | 1 +
man3const/EXIT_SUCCESS.3const | 60 +++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
create mode 100644 man3const/EXIT_FAILURE.3const
create mode 100644 man3const/EXIT_SUCCESS.3const
diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
new file mode 100644
index 000000000..ba0d62df9
--- /dev/null
+++ b/man3const/EXIT_FAILURE.3const
@@ -0,0 +1 @@
+.so man3const/EXIT_SUCCESS.3const
diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
new file mode 100644
index 000000000..c0b478e89
--- /dev/null
+++ b/man3const/EXIT_SUCCESS.3const
@@ -0,0 +1,60 @@
+.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.\"
+.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
+.SH NAME
+EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
+.SH LIBRARY
+Standard C library
+.RI ( libc )
+.SH SYNOPSIS
+.nf
+.B #include <stdlib.h>
+.PP
+.BR "#define EXIT_SUCCESS " 0
+.BR "#define EXIT_FAILURE " "/* nonzero */"
+.fi
+.SH DESCRIPTION
+.B EXIT_SUCCESS
+and
+.B EXIT_FAILURE
+represent a successful and unsuccessful exit status respectively and can be used
+as arguments to the
+.BR exit (3)
+function.
+.SH CONFORMING TO
+C99 and later;
+POSIX.1-2001 and later.
+.SH EXAMPLES
+.\" SRC BEGIN (EXIT_SUCCESS.c)
+.EX
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ FILE *fp;
+
+ if (argc != 2) {
+ fprintf(stderr, "Usage: %s <file>\en", argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((fp = fopen(argv[1], "r")) == NULL) {
+ perror(argv[1]);
+ exit(EXIT_FAILURE);
+ }
+
+ /* Other code omitted */
+
+ fclose(fp);
+ exit(EXIT_SUCCESS);
+}
+.EE
+.\" SRC END
+.SH SEE ALSO
+.BR exit (3),
+.BR sysexits.h (3head)
--
2.38.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
2022-11-17 0:36 ` [PATCH] " Thomas Voss
@ 2022-11-17 0:45 ` Alejandro Colomar
2022-11-17 0:53 ` [PATCH v5] " Thomas Voss
0 siblings, 1 reply; 11+ messages in thread
From: Alejandro Colomar @ 2022-11-17 0:45 UTC (permalink / raw)
To: Thomas Voss; +Cc: linux-man, mtk.manpages
[-- Attachment #1.1: Type: text/plain, Size: 3092 bytes --]
On 11/17/22 01:36, Thomas Voss wrote:
> Signed-off-by: Thomas Voss <mail@thomasvoss.com>
> ---
> Alright, hopefully this is it. Feels a bit weird not using mdoc(7) for once :P.
Heh. One last minor nitpick.
>
> man3const/EXIT_FAILURE.3const | 1 +
> man3const/EXIT_SUCCESS.3const | 60 +++++++++++++++++++++++++++++++++++
> 2 files changed, 61 insertions(+)
> create mode 100644 man3const/EXIT_FAILURE.3const
> create mode 100644 man3const/EXIT_SUCCESS.3const
>
> diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
> new file mode 100644
> index 000000000..ba0d62df9
> --- /dev/null
> +++ b/man3const/EXIT_FAILURE.3const
> @@ -0,0 +1 @@
> +.so man3const/EXIT_SUCCESS.3const
> diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
> new file mode 100644
> index 000000000..c0b478e89
> --- /dev/null
> +++ b/man3const/EXIT_SUCCESS.3const
> @@ -0,0 +1,60 @@
> +.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
> +.\"
> +.\" SPDX-License-Identifier: Linux-man-pages-copyleft
> +.\"
> +.\"
> +.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
> +.SH NAME
> +EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
> +.SH LIBRARY
> +Standard C library
> +.RI ( libc )
> +.SH SYNOPSIS
> +.nf
> +.B #include <stdlib.h>
> +.PP
> +.BR "#define EXIT_SUCCESS " 0
> +.BR "#define EXIT_FAILURE " "/* nonzero */"
> +.fi
> +.SH DESCRIPTION
> +.B EXIT_SUCCESS
> +and
> +.B EXIT_FAILURE
> +represent a successful and unsuccessful exit status respectively and can be used
> +as arguments to the
I'd add a comma: s/respectively and/respectively, and/
After that, I'd break the line after the comma (and un-break it after "used").
See man-pages(7):
Use semantic newlines
In the source of a manual page, new sentences should be
started on new lines, long sentences should be split into
lines at clause breaks (commas, semicolons, colons, and
so on), and long clauses should be split at phrase bound‐
aries. This convention, sometimes known as "semantic
newlines", makes it easier to see the effect of patches,
which often operate at the level of individual sentences,
clauses, or phrases.
Cheers,
Alex
> +.BR exit (3)
> +function.
> +.SH CONFORMING TO
> +C99 and later;
> +POSIX.1-2001 and later.
> +.SH EXAMPLES
> +.\" SRC BEGIN (EXIT_SUCCESS.c)
> +.EX
> +#include <stdio.h>
> +#include <stdlib.h>
> +
> +int
> +main(int argc, char *argv[])
> +{
> + FILE *fp;
> +
> + if (argc != 2) {
> + fprintf(stderr, "Usage: %s <file>\en", argv[0]);
> + exit(EXIT_FAILURE);
> + }
> +
> + if ((fp = fopen(argv[1], "r")) == NULL) {
> + perror(argv[1]);
> + exit(EXIT_FAILURE);
> + }
> +
> + /* Other code omitted */
> +
> + fclose(fp);
> + exit(EXIT_SUCCESS);
> +}
> +.EE
> +.\" SRC END
> +.SH SEE ALSO
> +.BR exit (3),
> +.BR sysexits.h (3head)
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v5] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
2022-11-17 0:45 ` Alejandro Colomar
@ 2022-11-17 0:53 ` Thomas Voss
2022-11-17 9:30 ` Alejandro Colomar
0 siblings, 1 reply; 11+ messages in thread
From: Thomas Voss @ 2022-11-17 0:53 UTC (permalink / raw)
To: alx.manpages; +Cc: linux-man, mail, mtk.manpages
Signed-off-by: Thomas Voss <mail@thomasvoss.com>
---
Ok, surely this is the last one! Time to read man-pages(7).
man3const/EXIT_FAILURE.3const | 1 +
man3const/EXIT_SUCCESS.3const | 60 +++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
create mode 100644 man3const/EXIT_FAILURE.3const
create mode 100644 man3const/EXIT_SUCCESS.3const
diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
new file mode 100644
index 000000000..ba0d62df9
--- /dev/null
+++ b/man3const/EXIT_FAILURE.3const
@@ -0,0 +1 @@
+.so man3const/EXIT_SUCCESS.3const
diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
new file mode 100644
index 000000000..fd3595f83
--- /dev/null
+++ b/man3const/EXIT_SUCCESS.3const
@@ -0,0 +1,60 @@
+.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.\"
+.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
+.SH NAME
+EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
+.SH LIBRARY
+Standard C library
+.RI ( libc )
+.SH SYNOPSIS
+.nf
+.B #include <stdlib.h>
+.PP
+.BR "#define EXIT_SUCCESS " 0
+.BR "#define EXIT_FAILURE " "/* nonzero */"
+.fi
+.SH DESCRIPTION
+.B EXIT_SUCCESS
+and
+.B EXIT_FAILURE
+represent a successful and unsuccessful exit status respectively,
+and can be used as arguments to the
+.BR exit (3)
+function.
+.SH CONFORMING TO
+C99 and later;
+POSIX.1-2001 and later.
+.SH EXAMPLES
+.\" SRC BEGIN (EXIT_SUCCESS.c)
+.EX
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main(int argc, char *argv[])
+{
+ FILE *fp;
+
+ if (argc != 2) {
+ fprintf(stderr, "Usage: %s <file>\en", argv[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ if ((fp = fopen(argv[1], "r")) == NULL) {
+ perror(argv[1]);
+ exit(EXIT_FAILURE);
+ }
+
+ /* Other code omitted */
+
+ fclose(fp);
+ exit(EXIT_SUCCESS);
+}
+.EE
+.\" SRC END
+.SH SEE ALSO
+.BR exit (3),
+.BR sysexits.h (3head)
--
2.38.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v5] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages
2022-11-17 0:53 ` [PATCH v5] " Thomas Voss
@ 2022-11-17 9:30 ` Alejandro Colomar
0 siblings, 0 replies; 11+ messages in thread
From: Alejandro Colomar @ 2022-11-17 9:30 UTC (permalink / raw)
To: Thomas Voss; +Cc: linux-man, mtk.manpages
[-- Attachment #1.1: Type: text/plain, Size: 2399 bytes --]
Hi Thomas,
On 11/17/22 01:53, Thomas Voss wrote:
> Signed-off-by: Thomas Voss <mail@thomasvoss.com>
> ---
> Ok, surely this is the last one!
Patch applied. Thanks!
> Time to read man-pages(7).
:)
Cheers,
Alex
>
> man3const/EXIT_FAILURE.3const | 1 +
> man3const/EXIT_SUCCESS.3const | 60 +++++++++++++++++++++++++++++++++++
> 2 files changed, 61 insertions(+)
> create mode 100644 man3const/EXIT_FAILURE.3const
> create mode 100644 man3const/EXIT_SUCCESS.3const
>
> diff --git a/man3const/EXIT_FAILURE.3const b/man3const/EXIT_FAILURE.3const
> new file mode 100644
> index 000000000..ba0d62df9
> --- /dev/null
> +++ b/man3const/EXIT_FAILURE.3const
> @@ -0,0 +1 @@
> +.so man3const/EXIT_SUCCESS.3const
> diff --git a/man3const/EXIT_SUCCESS.3const b/man3const/EXIT_SUCCESS.3const
> new file mode 100644
> index 000000000..fd3595f83
> --- /dev/null
> +++ b/man3const/EXIT_SUCCESS.3const
> @@ -0,0 +1,60 @@
> +.\" Copyright (c) 2022 by Thomas Voss <mail@thomasvoss.com>
> +.\"
> +.\" SPDX-License-Identifier: Linux-man-pages-copyleft
> +.\"
> +.\"
> +.TH EXIT_SUCCESS 3const (date) "Linux man-pages (unreleased)"
> +.SH NAME
> +EXIT_SUCCESS, EXIT_FAILURE \- termination status constants
> +.SH LIBRARY
> +Standard C library
> +.RI ( libc )
> +.SH SYNOPSIS
> +.nf
> +.B #include <stdlib.h>
> +.PP
> +.BR "#define EXIT_SUCCESS " 0
> +.BR "#define EXIT_FAILURE " "/* nonzero */"
> +.fi
> +.SH DESCRIPTION
> +.B EXIT_SUCCESS
> +and
> +.B EXIT_FAILURE
> +represent a successful and unsuccessful exit status respectively,
> +and can be used as arguments to the
> +.BR exit (3)
> +function.
> +.SH CONFORMING TO
> +C99 and later;
> +POSIX.1-2001 and later.
> +.SH EXAMPLES
> +.\" SRC BEGIN (EXIT_SUCCESS.c)
> +.EX
> +#include <stdio.h>
> +#include <stdlib.h>
> +
> +int
> +main(int argc, char *argv[])
> +{
> + FILE *fp;
> +
> + if (argc != 2) {
> + fprintf(stderr, "Usage: %s <file>\en", argv[0]);
> + exit(EXIT_FAILURE);
> + }
> +
> + if ((fp = fopen(argv[1], "r")) == NULL) {
> + perror(argv[1]);
> + exit(EXIT_FAILURE);
> + }
> +
> + /* Other code omitted */
> +
> + fclose(fp);
> + exit(EXIT_SUCCESS);
> +}
> +.EE
> +.\" SRC END
> +.SH SEE ALSO
> +.BR exit (3),
> +.BR sysexits.h (3head)
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2022-11-17 9:31 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-16 21:50 [PATCH] EXIT_SUCCESS.3const EXIT_FAILURE.3const: Add pages Thomas Voss
2022-11-16 22:06 ` Alejandro Colomar
2022-11-16 22:11 ` Alejandro Colomar
2022-11-17 0:14 ` [PATCH v2] " Thomas Voss
2022-11-17 0:19 ` Alejandro Colomar
2022-11-17 0:25 ` [PATCH v3] " Thomas Voss
2022-11-17 0:26 ` [PATCH v2] " Alejandro Colomar
2022-11-17 0:36 ` [PATCH] " Thomas Voss
2022-11-17 0:45 ` Alejandro Colomar
2022-11-17 0:53 ` [PATCH v5] " Thomas Voss
2022-11-17 9:30 ` Alejandro Colomar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox