You are not logged in.

#1 2025-07-08 09:03:22

etreas
Member
From: near Munich
Registered: 2025-07-08
Posts: 4

[SOLVED] man-pages 6.14.1 -- 2 write

i just had a look into `man 2 write` and the signature of the c equivalent to the syscall seem to be a bit off.

```
SYNOPSIS
       #include <unistd.h>

       ssize_t write(size_t count;
                     int fd, const void buf[count], size_t count);
```

is just my copy corrupted or is this a actual thing?

Last edited by etreas (2025-07-09 02:02:39)

Offline

#2 2025-07-08 09:53:36

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,435
Website

Re: [SOLVED] man-pages 6.14.1 -- 2 write

This bug seems to have been introduced upstream in man-pages 6.14.

~/Downloads> diff -Naur man-pages-6.13/man2/write.2 man-pages-6.14/man2/write.2
--- man-pages-6.13/man2/write.2	2025-03-06 23:49:09.000000000 +0100
+++ man-pages-6.14/man2/write.2	2025-05-09 00:32:30.000000000 +0200
@@ -1,22 +1,8 @@
-.\" This manpage is Copyright (C) 1992 Drew Eckhardt;
-.\"             and Copyright (C) 1993 Michael Haardt, Ian Jackson.
-.\" and Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Copyright, The contributors to the Linux man-pages project
 .\"
 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
 .\"
-.\" Modified Sat Jul 24 13:35:59 1993 by Rik Faith <faith@cs.unc.edu>
-.\" Modified Sun Nov 28 17:19:01 1993 by Rik Faith <faith@cs.unc.edu>
-.\" Modified Sat Jan 13 12:58:08 1996 by Michael Haardt
-.\"   <michael@cantor.informatik.rwth-aachen.de>
-.\" Modified Sun Jul 21 18:59:33 1996 by Andries Brouwer <aeb@cwi.nl>
-.\" 2001-12-13 added remark by Zack Weinberg
-.\" 2007-06-18 mtk:
-.\"    	Added details about seekable files and file offset.
-.\"	Noted that write() may write less than 'count' bytes, and
-.\"	gave some examples of why this might occur.
-.\"	Noted what happens if write() is interrupted by a signal.
-.\"
-.TH write 2 2024-07-23 "Linux man-pages (unreleased)"
+.TH write 2 2025-05-06 "Linux man-pages (unreleased)"
 .SH NAME
 write \- write to a file descriptor
 .SH LIBRARY
@@ -26,7 +12,8 @@
 .nf
 .B #include <unistd.h>
 .P
-.BI "ssize_t write(int " fd ", const void " buf [. count "], size_t " count );
+.BI "ssize_t write(size_t " count ;
+.BI "              int " fd ", const void " buf [ count "], size_t " count );
 .fi
 .SH DESCRIPTION
 .BR write ()
@@ -80,7 +67,9 @@
 see NOTES for the upper limit on Linux.
 .SH RETURN VALUE
 On success, the number of bytes written is returned.
-On error, \-1 is returned, and \fIerrno\fP is set
+On error, \-1 is returned, and
+.I errno
+is set
 to indicate the error.
 .P
 Note that a successful
@@ -101,7 +90,9 @@
 The subsequent call will either transfer further bytes or
 may result in an error (e.g., if the disk is now full).
 .P
-If \fIcount\fP is zero and
+If
+.I count
+is zero and
 .I fd
 refers to a regular file, then
 .BR write ()
@@ -109,7 +100,8 @@
 If no errors are detected, or error detection is not performed,
 0 is returned without causing any other effect.
 If
-\fIcount\fP is zero and
+.I count
+is zero and
 .I fd
 refers to a file other than a regular file,
 the results are not specified.
~/Downloads>                                                                                                                                                                                                                                                                                      1 2025-07-08T11:52:25

Commit 8eea66b827a11bc8983da517499cc236c6cd97ba seems to have f'cked things up. smile

Last edited by schard (2025-07-08 10:15:07)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#3 2025-07-08 10:10:22

etreas
Member
From: near Munich
Registered: 2025-07-08
Posts: 4

Re: [SOLVED] man-pages 6.14.1 -- 2 write

thanks for checking it.. much appreciated.

Last edited by etreas (2025-07-08 10:20:19)

Offline

#4 2025-07-08 10:15:42

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,435
Website

Re: [SOLVED] man-pages 6.14.1 -- 2 write

Update: This appears to have been an intentional change in d2c2db8830f8fcbb736bdea52b398257447bef6b:

commit d2c2db8830f8fcbb736bdea52b398257447bef6b (HEAD)
Author: Alejandro Colomar <alx@kernel.org>
Date:   Fri Mar 14 18:33:41 2025 +0100

    man/: SYNOPSIS: Use GNU forward-declarations of parameters for sizes of array parameters
    
    This syntax has been proposed for standardization in N3433.
    
    Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3433.pdf>
    Cc: Christopher Bazley <chris.bazley.wg14@gmail.com>
    Cc: Martin Uecker <uecker@tugraz.at>
    Cc: Joseph Myers <josmyers@redhat.com>
    Signed-off-by: Alejandro Colomar <alx@kernel.org>

https://www.open-std.org/jtc1/sc22/wg14 … /n3433.pdf

Last edited by schard (2025-07-08 10:17:58)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#5 2025-07-08 10:20:58

etreas
Member
From: near Munich
Registered: 2025-07-08
Posts: 4

Re: [SOLVED] man-pages 6.14.1 -- 2 write

oh, now it's getting interesting. thanks again, for adding this info. very, very much appreciated.

Offline

#6 2025-07-08 15:28:38

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 69,754

Re: [SOLVED] man-pages 6.14.1 -- 2 write

Also https://bbs.archlinux.org/viewtopic.php?id=305970
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#7 2025-07-09 02:03:34

etreas
Member
From: near Munich
Registered: 2025-07-08
Posts: 4

Re: [SOLVED] man-pages 6.14.1 -- 2 write

of course, thanks for the reminder, seth.

Last edited by etreas (2025-07-09 02:04:16)

Offline

Board footer

Powered by FluxBB