Thread (2 messages) 2 messages, 2 authors, 2024-05-28

Re: [PATCH] write.2: Fix a typo within the `ssize_t write` function argument

From: Alejandro Colomar <alx@kernel.org>
Date: 2024-05-28 10:50:21

On Tue, May 28, 2024 at 12:43:21PM GMT, Lukas Javorsky wrote:
Reference: https://pubs.opengroup.org/onlinepubs/7908799/xsh/write.html

I'm adding the patch to the attachment as well because my last patch was a
bit problematic with the email.
Hi Lukas,
quoted hunk ↗ jump to hunk
---
diff --git a/man/man2/write.2 b/man/man2/write.2
index a24cbdc31..e9b7dd739 100644
--- a/man/man2/write.2
+++ b/man/man2/write.2
@@ -26,7 +26,7 @@ Standard C library
 .nf
 .B #include <unistd.h>
 .P
-.BI "ssize_t write(int " fd ", const void " buf [. count "], size_t "
count );
+.BI "ssize_t write(int " fd ", const void *" buf [. count "], size_t "
No; the current synopsis is intentional:

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

buf is an array of void, that is, a void[].  Of course, that's not legal
C, but I made it so that it's consistent with other functions such as

     char *strncpy(char dst[restrict .dsize], const char *restrict src,
                   size_t dsize);

Where dst is an array of char, that is, char[].

Using array notation let's us document the number of elements in the
array.

Have a lovely day!
Alex
count );
 .fi
 .SH DESCRIPTION
 .BR write ()

-- 
S pozdravom/ Best regards

Lukáš Javorský

Senior Software Engineer, Core service - Databases

Red Hat

Purkyňova 115 (TPB-C)

612 00 Brno - Královo Pole

ljavorsk@redhat.com


-- 
<https://www.alejandro-colomar.es/>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help