Hi Jim, There is an abstraction violation in lib/acl.h: While the functions declared in this file have a platform independent API, and coreutils (copy.c, cp.c, ls.c) uses only this platform independent API, it also includes part of the platform dependent include files: <sys/acl.h> (on Linux, this is not all of the API), and defines GETACLCNT (a Solaris specific hack).
IMO there's no reason for this code to be in "acl.h". I propose to move it to "acl-internal.h". OK to commit? 2008-05-22 Bruno Haible <[EMAIL PROTECTED]> * lib/acl.h: Don't include <sys/acl.h>. (GETACLCNT): Move fallback to lib/acl-internal.h. * lib/acl-internal.h: Include <sys/acl.h> here. (GETACLCNT): New macro fallback, moved here from lib/acl.h. *** lib/acl.h.bak 2008-01-08 00:26:45.000000000 +0100 --- lib/acl.h 2008-05-22 20:04:25.000000000 +0200 *************** *** 1,6 **** /* acl.c - access control lists ! Copyright (C) 2002 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,6 ---- /* acl.c - access control lists ! Copyright (C) 2002, 2008 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 18,31 **** Written by Paul Eggert. */ #include <sys/types.h> - - #if HAVE_SYS_ACL_H - # include <sys/acl.h> - #endif - #if defined HAVE_ACL && ! defined GETACLCNT && defined ACL_CNT - # define GETACLCNT ACL_CNT - #endif - #include <sys/stat.h> int file_has_acl (char const *, struct stat const *); --- 18,23 ---- *** lib/acl-internal.h.bak 2007-11-02 12:53:39.000000000 +0100 --- lib/acl-internal.h 2008-05-22 20:07:27.000000000 +0200 *************** *** 1,6 **** /* Internal implementation of access control lists. ! Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,6 ---- /* Internal implementation of access control lists. ! Copyright (C) 2002-2003, 2005-2008 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 22,27 **** --- 22,36 ---- #include <stdbool.h> #include <stdlib.h> + /* All systems define the ACL related API in <sys/acl.h>. */ + #if HAVE_SYS_ACL_H + # include <sys/acl.h> + #endif + #if defined HAVE_ACL && ! defined GETACLCNT && defined ACL_CNT + # define GETACLCNT ACL_CNT + #endif + + /* On Linux, additional ACL related API is available in <acl/libacl.h>. */ #ifdef HAVE_ACL_LIBACL_H # include <acl/libacl.h> #endif