From nobody Thu Feb 13 03:57:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YthGK0NzFz5mr8m; Thu, 13 Feb 2025 03:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YthGJ3035z3jt2; Thu, 13 Feb 2025 03:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739419048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nYeMbOwF1Epu1Bqhx4EdjyuxDzTnc5lFsCP4eJ5cg6s=; b=bgUzjatC11FY8blTOxQ6o55I0g22gnal1STFsMz9swqMsmIBzlU89AcRIG7cbnhCo9TQnt 9JYJOp0W+ENpCp4724xmy7LiYSVN9moSlo5Z46SAiDJJ1VjGwMA5bA5HFkusA2mLjm94pE p8+qlseCF7UsyvqxD4YFIMiPpHpEDtU5zPnJyoPyhSP3wH1AyY2Crd72Y9ucNhDrmTMB66 +xK4j4SIK/4vCrSQPjR/cYD0EIlJ5sMW4KvrcEkdiAWTv4Zt4kIR+I8pQsQiR3CYxd1YW6 CAV5pxorghUQvEgq7NP6RK3HIY3symvsc2jPX9ciEvjn+f4p9CaAvshYshUItQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739419048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nYeMbOwF1Epu1Bqhx4EdjyuxDzTnc5lFsCP4eJ5cg6s=; b=Ysz1E3FciLJJW8JKFnc37VwpVZlzYyL2nwTEc5k+ei9NFpoH6TcCOv7eI1pZ6tAWsdCEtM ak5wrTHrsvbKWxLEo9qUfJJauUEAjoNIrxXFUoqapP5F5OIlmGmtSmAF2tTX1SjVOr7OCg dxSdNL4ruisNkYcX+OrZqe+F9/RCjFlMe3CA3ywsizQZFhyoHmsocXAKXdUIC+YrMAb3an tMdqdHDs2zsmNnG7DtuMzVgab72nm0pFfmidyxNhF3qsCk0iHLFgU9ZTMsxrBh8EQUJTrd gAKh1mLlmgLUqnXK0N2/3X2P/yQQCznHBNc+tJkO0xQtctbX7wv1Al/ZAwQFpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739419048; a=rsa-sha256; cv=none; b=YNTWBGrOE+5XaIb6zaSsnAgGmdH1vvXoS8XIyEtPgBpyQCtn/ZODL5qzWdWh9rdM0gAM+K ZacOApsdOnHVnGy9n4+qSorF3pdCdO1hUQCjBPtWnLTPjtwLNU89MnGwzznssTodydqyjC SSD5kzNRVMpkQAcC+VtALseoMl0cQ714Iymm4yC+ro3Dn5Z9dFPFezqZWpFNZPGiw57sjU VM+mhqSAlYsfWVeQXVPm4DfIzX2hHf3XaNgzPVMV1EzoemcTZttz9MGjMxdBszJwbhOb00 /PdO0QtMQVnhhXn7Hv5bxcHKkkzHERgqaBn79f6qKyUnSE7TWwT4xbmQP863eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YthGJ2KzzzC7k; Thu, 13 Feb 2025 03:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51D3vSde098752; Thu, 13 Feb 2025 03:57:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51D3vSD9098749; Thu, 13 Feb 2025 03:57:28 GMT (envelope-from git) Date: Thu, 13 Feb 2025 03:57:28 GMT Message-Id: <202502130357.51D3vSD9098749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 571df2c64a3c - main - recv.2: Explain how recv functions can return 0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 571df2c64a3c1af1fe011303ec08e391e887ecbc Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=571df2c64a3c1af1fe011303ec08e391e887ecbc commit 571df2c64a3c1af1fe011303ec08e391e887ecbc Author: Felix Johnson AuthorDate: 2025-02-13 03:40:59 +0000 Commit: Alexander Ziaee CommitDate: 2025-02-13 03:54:14 +0000 recv.2: Explain how recv functions can return 0 Clarify the RETURN VALUES section with improved structure, the condition of the return value 0, and the setting of errno. PR: 174581 Reviewed by: jhb, ziaee Approved by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48955 --- lib/libsys/recv.2 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/libsys/recv.2 b/lib/libsys/recv.2 index 08df62af3d1c..9dc1f3cc84ca 100644 --- a/lib/libsys/recv.2 +++ b/lib/libsys/recv.2 @@ -316,12 +316,19 @@ On data reception the .Fa msg_len field is updated to the length of the received message. .Sh RETURN VALUES -These calls except -.Fn recvmmsg +On successful completion, +.Fn recv , +.Fn recvfrom , +and +.Fn recvmsg return the number of bytes received. .Fn recvmmsg returns the number of messages received. -A value of -1 is returned if an error occurred. +If no messages are available to be received and the peer has +performed an orderly shutdown, 0 is returned. +Otherwise, -1 is returned and +.Va errno +is set to indicate the error. .Sh ERRORS The calls fail if: .Bl -tag -width Er