public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Gabriel Krisman Bertazi <krisman@suse.de>
Cc: io-uring@vger.kernel.org, csander@purestorage.com
Subject: Re: [PATCH liburing v2 4/4] man/io_uring_prep_getsockname.3: Add man page
Date: Wed, 26 Nov 2025 13:54:54 -0700	[thread overview]
Message-ID: <8846b174-66df-4a0e-ac83-7a9f86df2bea@kernel.dk> (raw)
In-Reply-To: <20251125212715.2679630-5-krisman@suse.de>

On 11/25/25 2:27 PM, Gabriel Krisman Bertazi wrote:
> Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
> ---
>  man/io_uring_prep_getsockname.3 | 76 +++++++++++++++++++++++++++++++++
>  1 file changed, 76 insertions(+)
>  create mode 100644 man/io_uring_prep_getsockname.3
> 
> diff --git a/man/io_uring_prep_getsockname.3 b/man/io_uring_prep_getsockname.3
> new file mode 100644
> index 00000000..71e65f1d
> --- /dev/null
> +++ b/man/io_uring_prep_getsockname.3
> @@ -0,0 +1,76 @@
> +.\" Copyright (C) 2024 SUSE LLC.
> +.\"
> +.\" SPDX-License-Identifier: LGPL-2.0-or-later
> +.\"
> +.TH io_uring_prep_getsockname 3 "Oct 23, 2025" "liburing-2.11" "liburing Manual"

Should be 2.13 at this point, as that will be the next release.

> +.SH NAME
> +io_uring_prep_getsockname \- prepare a getsockname or getpeername request
> +.SH SYNOPSIS
> +.nf
> +.B #include <sys/socket.h>
> +.B #include <liburing.h>
> +.PP
> +.BI "void io_uring_prep_getsockname(struct io_uring_sqe *" sqe ","
> +.BI "                          int " sockfd ","
> +.BI "                          struct sockaddr *" sockaddr ","
> +.BI "                          socklen_t *" sockaddr_len ","
> +.BI "                          int " peer ");"

Line up the arguments with the first one.

> +.fi
> +.SH DESCRIPTION
> +The
> +.BR io_uring_prep_getsockname (3)
> +function prepares a getsockname/getpeername request.
> +The submission queue entry
> +.I sqe
> +is setup to fetch the locally bound address or peer address of the socket
> +file descriptor pointed by
> +.IR sockfd.

Space after sockfd and before '.'.

> +The parameter
> +.IR sockaddr
> +points to a region of size
> +.IR sockaddr_len
> +where the output is written.
> +.IR sockaddr_len
> +is modified by the kernel to indicate how many bytes were written.
> +The output address is the locally bound address if
> +.IR peer
> +is set to 0

Probably

is set to
.B 0
or the peer address if

> +or the peer address if
> +.IR peer
> +is set to 1.
> +
> +This function prepares an async
> +.BR getsockname (2)
> +or
> +.BR getpeername (2)
> +request. See those man pages for details.
> +
> +.SH RETURN VALUE
> +None
> +.SH ERRORS
> +The CQE
> +.I res
> +field will contain the result of the operation. See the related man page for
> +details on possible values. Note that where synchronous system calls will return
> +.B -1
> +on failure and set
> +.I errno
> +to the actual error value, io_uring never uses
> +.IR errno .
> +Instead it returns the negated
> +.I errno
> +directly in the CQE
> +.I res
> +field.
> +.BR
> +Differently from the equivalent system calls, if the user attempts to
> +use this operation on a non-socket file descriptor, the CQE error result
> +is
> +.IR ENOTSUP
> +instead of
> +.IR ENOSOCK.

cqe->res is always negative, so it'd be -ENOTSUP.

Other than these nits, looks good! Thanks for writing it.

-- 
Jens Axboe

  reply	other threads:[~2025-11-26 20:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25 21:27 [PATCH liburing v2 0/4] liburing: getsockname support Gabriel Krisman Bertazi
2025-11-25 21:27 ` [PATCH liburing v2 1/4] liburing: Introduce getsockname operation Gabriel Krisman Bertazi
2025-11-25 21:27 ` [PATCH liburing v2 2/4] test/bind-listen.t: Use ephemeral port Gabriel Krisman Bertazi
2025-11-26 20:49   ` Jens Axboe
2025-12-02 23:37     ` Gabriel Krisman Bertazi
2025-12-03  2:49       ` Jens Axboe
2025-11-25 21:27 ` [PATCH liburing v2 3/4] bind-listen.t: Add tests for getsockname Gabriel Krisman Bertazi
2025-11-26 20:58   ` Jens Axboe
2025-11-25 21:27 ` [PATCH liburing v2 4/4] man/io_uring_prep_getsockname.3: Add man page Gabriel Krisman Bertazi
2025-11-26 20:54   ` Jens Axboe [this message]
2025-12-02 15:16 ` [PATCH liburing v2 0/4] liburing: getsockname support Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2025-11-20 22:13 Gabriel Krisman Bertazi
2025-11-20 22:13 ` [PATCH liburing v2 4/4] man/io_uring_prep_getsockname.3: Add man page Gabriel Krisman Bertazi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8846b174-66df-4a0e-ac83-7a9f86df2bea@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=io-uring@vger.kernel.org \
    --cc=krisman@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox