This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 065e005e593a353e31eda842418b38809f482d1c Author: Marco Casaroli <[email protected]> AuthorDate: Thu Nov 26 17:07:17 2026 +0100 Documentation/socketcan: getsockname() truncates the address. getsockname() of a CAN_RAW socket now truncates the address for a short buffer, and sets the length to that of the whole address. The page said that a short buffer gets EINVAL. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- Documentation/os/networking/socketcan.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/os/networking/socketcan.rst b/Documentation/os/networking/socketcan.rst index dd3410f5c8e..01ba52e051e 100644 --- a/Documentation/os/networking/socketcan.rst +++ b/Documentation/os/networking/socketcan.rst @@ -158,9 +158,10 @@ Socket Address ``getsockname()`` returns a ``struct sockaddr_can`` with ``can_family`` set to ``AF_CAN`` and ``can_ifindex`` set to the index of the interface the -socket is bound to, or 0 if the socket is not bound to an interface. The -address buffer must be at least ``sizeof(struct sockaddr_can)`` bytes, -otherwise ``EINVAL`` is returned. +socket is bound to, or 0 if the socket is not bound to an interface. A +buffer shorter than ``sizeof(struct sockaddr_can)`` gets the first bytes of +the address, and the length is set to ``sizeof(struct sockaddr_can)``, as on +Linux. Features --------
