// SPDX-License-Identifier: CDDL-1.0 /* * This file and its contents are supplied under the terms of the * Common Development and Distribution License ("CDDL"), version 1.0. * You may only use this file in accordance with the terms of version * 1.0 of the CDDL. * * A full copy of the text of the CDDL should have accompanied this * source. A copy of the CDDL is also available via the Internet at * https://opensource.org/license/CDDL-1.0. */ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Copyright 2006 Ricardo Correia. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ #include #include #include #include #include #include #include #include #include int getextmntent(const char *path, struct mnttab *entry, struct stat64 *statbuf) { struct statfs sfs; if (strlen(path) >= MAXPATHLEN) { (void) fprintf(stderr, "invalid object; pathname too long\n"); return (-1); } if (stat64(path, statbuf) != 0) { (void) fprintf(stderr, "cannot open '%s': %s\n", path, zfs_strerror(errno)); return (-1); } if (statfs(path, &sfs) != 0) { (void) fprintf(stderr, "%s: %s\n", path, zfs_strerror(errno)); return (-1); } statfs2mnttab(&sfs, entry); return (0); }