From owner-freebsd-doc@FreeBSD.ORG Thu Jan 14 05:30:03 2010 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BE7C1065670 for ; Thu, 14 Jan 2010 05:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C2E018FC0A for ; Thu, 14 Jan 2010 05:30:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o0E5U2jk076474 for ; Thu, 14 Jan 2010 05:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o0E5U2HQ076471; Thu, 14 Jan 2010 05:30:02 GMT (envelope-from gnats) Resent-Date: Thu, 14 Jan 2010 05:30:02 GMT Resent-Message-Id: <201001140530.o0E5U2HQ076471@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Lachlan Kang Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80EEF106566B for ; Thu, 14 Jan 2010 05:20:54 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 565638FC19 for ; Thu, 14 Jan 2010 05:20:54 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o0E5KsmT030633 for ; Thu, 14 Jan 2010 05:20:54 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o0E5KsgU030632; Thu, 14 Jan 2010 05:20:54 GMT (envelope-from nobody) Message-Id: <201001140520.o0E5KsgU030632@www.freebsd.org> Date: Thu, 14 Jan 2010 05:20:54 GMT From: Lachlan Kang To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: docs/142816: [patch] namei(9) return values X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 05:30:03 -0000 >Number: 142816 >Category: docs >Synopsis: [patch] namei(9) return values >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 14 05:30:02 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Lachlan Kang >Release: FreeBSD 8.0-RELEASE >Organization: >Environment: >Description: The manpage namei(9) does not specify the return value of the function namei(). The function namei() returns 0 on success, or errno on failure. I skimmed through the namei() source code (src/sys/kern/vfs_lookup.c) and added a simple RETURN VALUES and ERRORS section to the namei(9) manpage. The error code descriptions were simply copied from intro(2). >How-To-Repeat: man 9 namei >Fix: Add a RETURN VALUES and ERRORS section to namei(9). Patch attached with submission follows: Index: head/share/man/man9/namei.9 =================================================================== --- head/share/man/man9/namei.9 (revision 202273) +++ head/share/man/man9/namei.9 (working copy) @@ -315,6 +315,30 @@ .Fn NDFREE function. .El +.Sh RETURN VALUES +If successful, +.Fn namei +will return 0, otherwise it will return an error. +.Sh ERRORS +Errors which +.Fn namei +may return: +.Bl -tag -width Er +.It Bq Er ENOENT +No such file or directory. A component of a specified pathname did not exist, or the pathname was an empty string. +.It Bq Er ACCES +Permission denied. An attempt was made to access a file in a way forbidden by its file access permissions. +.It Bq Er ENOTDIR +Not a directory. A component of the specified pathname existed, but it was not a directory, when a directory was expected. +.It Bq Er EISDIR +Is a directory. An attempt was made to open a directory with write mode specified. +.It Bq Er EROFS +Read-only file system. An attempt was made to modify a file or directory on a file system that was read-only at the time. +.It Bq Er ELOOP +Too many levels of symbolic links. A path name lookup involved more than 32 (MAXSYMLINKS) symbolic links. +.It Bq Er ENAMETOOLONG +File name too long. A component of a path name exceeded {NAME_MAX} characters, or an entire path name exceeded {PATH_MAX} characters. +.El .Sh FILES .Bl -tag .It Pa src/sys/kern/vfs_lookup.c >Release-Note: >Audit-Trail: >Unformatted: