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
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwstatic int (*nvpacker)(nvlist_t *, char **, size_t *, int, int);
d8ac9b2d669163fee52330a52017528035cacb4emarksstatic int (*nvlookupint64)(nvlist_t *, const char *, uint64_t *);
8fd04b8338ed5093ec2d1e668fa620b7de44c177Roger A. Faulkner return (syscall(SYS_openat, fd, name, FXATTRDIROPEN, 0));
8cd45542f2a452ca0dab13d8b2d5cfa876ccbebcraf (looker = dlsym(handle, "nvlist_lookup_uint64")) == NULL) {
8cd45542f2a452ca0dab13d8b2d5cfa876ccbebcraf return (-1);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (0);
8cd45542f2a452ca0dab13d8b2d5cfa876ccbebcraf nvpacker = (int (*)(nvlist_t *, char **, size_t *, int, int))
8cd45542f2a452ca0dab13d8b2d5cfa876ccbebcraf nvlookupint64 = (int (*)(nvlist_t *, const char *, uint64_t *))
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (0);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwattr_nv_pack(nvlist_t *request, void **nv_request, size_t *nv_requestlen)
575bd8a230f2c20b1878ebb473c30a12f0eb1b2emarks return (-1);
575bd8a230f2c20b1878ebb473c30a12f0eb1b2emarks return (-1);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if (nvpacker(request, &packbuf, &bufsize, NV_ENCODE_XDR, 0) != 0) {
575bd8a230f2c20b1878ebb473c30a12f0eb1b2emarks return (-1);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (0);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwstatic const char *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw switch (view) {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (-1);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /* Don't cache sysattr info (advisory) */
575bd8a230f2c20b1878ebb473c30a12f0eb1b2emarks return (-1);
575bd8a230f2c20b1878ebb473c30a12f0eb1b2emarks return (-1);
575bd8a230f2c20b1878ebb473c30a12f0eb1b2emarks if (nvunpacker(nv_response, nv_responselen, response)) {
575bd8a230f2c20b1878ebb473c30a12f0eb1b2emarks return (-1);
575bd8a230f2c20b1878ebb473c30a12f0eb1b2emarks return (0);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if ((error = attr_nv_pack(request, &nv_request, &nv_requestlen)) != 0)
575bd8a230f2c20b1878ebb473c30a12f0eb1b2emarks return (-1);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return (0);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwfgetattr(int basefd, xattr_view_t view, nvlist_t **response)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if ((xattrfd = xattr_openat(basefd, view, O_XATTR)) < 0)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwfsetattr(int basefd, xattr_view_t view, nvlist_t *request)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if ((xattrfd = xattr_openat(basefd, view, O_RDWR | O_XATTR)) < 0)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwgetattrat(int basefd, xattr_view_t view, const char *name, nvlist_t **response)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwsetattrat(int basefd, xattr_view_t view, const char *name, nvlist_t *request)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if ((xattrfd = xattr_openat(namefd, view, O_RDWR)) < 0) {