NetBSD Problem Report #58161

From www@netbsd.org  Wed Apr 17 15:40:14 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EB1581A9238
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 17 Apr 2024 15:40:13 +0000 (UTC)
Message-Id: <20240417154012.7C00A1A923A@mollari.NetBSD.org>
Date: Wed, 17 Apr 2024 15:40:12 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: directory(3) man page doesn't list standard error codes in POSIX
X-Send-Pr-Version: www-1.0

>Number:         58161
>Category:       standards
>Synopsis:       directory(3) man page doesn't list standard error codes in POSIX
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 17 15:45:01 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, 8
>Organization:
The NetDir_r Foundation
>Environment:
>Description:
The directory(3) man page has some language similar to the language in POSIX at https://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html, https://pubs.opengroup.org/onlinepubs/9699919799/functions/opendir.html, and https://pubs.opengroup.org/onlinepubs/9699919799/functions/closedir.html, but it is missing the detailed errors sections:

(readdir, readdir_r)
ERRORS

    These functions shall fail if:

    [EOVERFLOW]
        One of the values in the structure to be returned cannot be represented correctly.

    These functions may fail if:

    [EBADF]
        The dirp argument does not refer to an open directory stream.
    [ENOENT]
        The current position of the directory stream is invalid.

(opendir)
ERRORS

    The fdopendir() function shall fail if:

    [EBADF]
        The fd argument is not a valid file descriptor open for reading.
    [ENOTDIR]
        The descriptor fd is not associated with a directory.

    The opendir() function shall fail if:

    [EACCES]
        Search permission is denied for the component of the path prefix of dirname or read permission is denied for dirname.
    [ELOOP]
        A loop exists in symbolic links encountered during resolution of the dirname argument.
    [ENAMETOOLONG]
        The length of a component of a pathname is longer than {NAME_MAX}.
    [ENOENT]
        A component of dirname does not name an existing directory or dirname is an empty string.
    [ENOTDIR]
        A component of dirname names an existing file that is neither a directory nor a symbolic link to a directory.


    The opendir() function may fail if:

    [ELOOP]
        More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the dirname argument.
    [EMFILE]
        All file descriptors available to the process are currently open.
    [ENAMETOOLONG]
        The length of a pathname exceeds {PATH_MAX}, or pathname resolution of a symbolic link produced an intermediate result with a length that exceeds {PATH_MAX}.
    [ENFILE]
        Too many files are currently open in the system.

(closedir)
ERRORS

    The closedir() function may fail if:

    [EBADF]
        The dirp argument does not refer to an open directory stream.
    [EINTR]
        The closedir() function was interrupted by a signal.

>How-To-Repeat:
man 3 directory
>Fix:
Yes, please!

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.