1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Return the number of entries in an ACL.
5 Copyright (C) 2002-2003, 2005-2013 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 Written by Paul Eggert and Andreas Gruenbacher. */
24 #include "acl-internal.h"
26 /* This file assumes POSIX-draft like ACLs
27 (Linux, FreeBSD, Mac OS X, IRIX, Tru64). */
29 /* Return the number of entries in ACL.
30 Return -1 and set errno upon failure to determine it. */
33 acl_entries (acl_t acl)
39 #if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, Mac OS X */
40 # if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */
41 /* acl_get_entry returns 0 when it successfully fetches an entry,
42 and -1/EINVAL at the end. */
46 for (got_one = acl_get_entry (acl, ACL_FIRST_ENTRY, &ace);
48 got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace))
50 # else /* Linux, FreeBSD */
51 /* acl_get_entry returns 1 when it successfully fetches an entry,
56 for (got_one = acl_get_entry (acl, ACL_FIRST_ENTRY, &ace);
58 got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace))
63 #else /* IRIX, Tru64 */
64 # if HAVE_ACL_TO_SHORT_TEXT /* IRIX */
65 /* Don't use acl_get_entry: it is undocumented. */
68 # if HAVE_ACL_FREE_TEXT /* Tru64 */
69 /* Don't use acl_get_entry: it takes only one argument and does not