da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
575bd8a230f2c20b1878ebb473c30a12f0eb1b2emarks * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#pragma ident "%Z%%M% %I% %E% SMI"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Returns the status of attempting to obtain the extended system
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * attributes in the specified view.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Note: If obtaining status for an extended attribute file, the caller must
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * chdir into the hidden directory prior to calling sysattr_status().
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Returns 1 if the extended system attributes were obtained, otherwise
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * returns 0.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (status == 0);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Returns the type of the specified in file. If the file name matches
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the name of either a read-only or read-write extended system attribute
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file then sysattr_type() returns the type of file:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * return value file type
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ------------ ---------
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * _RO_SATTR read-only extended system attribute file
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * _RW_SATTR read-write extended system attribute file
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * _NOT_SATTR neither a read-only or read-write extended system
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * attribute file.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Call sysattr_support() instead of pathconf(file, _PC_SATTR_ENABLED) or
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * pathconf(file, _PC_SATTR_EXISTS) so that if pathconf() fails over NFS, we
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * can still try to figure out if extended system attributes are supported by
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * testing for a valid extended system attribute file.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 'name' can have the values _PC_SATTR_ENABLED or _PC_SATTR_EXISTS.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Returns 1 if the underlying file system supports extended system attributes,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * otherwise, returns -1.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (-1);