From owner-svn-src-head@freebsd.org Tue Dec 8 04:16:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B68DB47163A; Tue, 8 Dec 2020 04:16:05 +0000 (UTC) (envelope-from ngie@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cqn114jDGz4n33; Tue, 8 Dec 2020 04:16:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9446E601D; Tue, 8 Dec 2020 04:16:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0B84G5LD048394; Tue, 8 Dec 2020 04:16:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0B84G5kJ048393; Tue, 8 Dec 2020 04:16:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <202012080416.0B84G5kJ048393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 8 Dec 2020 04:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368435 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 368435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2020 04:16:05 -0000 Author: ngie Date: Tue Dec 8 04:16:05 2020 New Revision: 368435 URL: https://svnweb.freebsd.org/changeset/base/368435 Log: extattr_get_file(2): clarify RETURN VALUES While some of the syscalls' behavior were documented and implied in the RETURN VALUES section by earlier, e.g., the DESCRIPTION sections, as having behavior of the other calls (`*_fd` vs `*_file` vs `*_link`), there was a lot of implied return value behavior in the section prior to this change. Explicitly document the syscall behavior per the current implementation in sys/kern/vfs_extattr.c so others can better develop based on its explicit documented behavior instead of having to digest the context of the manpage to understand the appropriate behavior. MFC after: 1 week MFC with: r368431, r368433, r368434 Sponsored by: DellEMC Isilon Modified: head/lib/libc/sys/extattr_get_file.2 Modified: head/lib/libc/sys/extattr_get_file.2 ============================================================================== --- head/lib/libc/sys/extattr_get_file.2 Tue Dec 8 04:05:19 2020 (r368434) +++ head/lib/libc/sys/extattr_get_file.2 Tue Dec 8 04:16:05 2020 (r368435) @@ -169,21 +169,32 @@ For more information on named extended attributes, ple .Xr extattr 9 . .Sh RETURN VALUES If successful, the +.Fn extattr_get_fd , .Fn extattr_get_file , +.Fn extattr_get_link , +.Fn extattr_list_fd , +.Fn extattr_list_file , +.Fn extattr_list_link , +.Fn extattr_set_fd , .Fn extattr_set_file , and -.Fn extattr_list_file +.Fn extattr_set_link calls return the number of bytes that were read or written from the .Fa data , -respectively, or if +respectively. +If .Fa data was .Dv NULL , then -.Fn extattr_get_file +.Fn extattr_get_fd , +.Fn extattr_get_file , +.Fn extattr_get_link , +.Fn extattr_list_fd , +.Fn extattr_list_file , and -.Fn extattr_list_file +.Fn extattr_list_link return the number of bytes available to read. If any of the calls are unsuccessful, the value \-1 is returned and the global variable