4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or https://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Portions Copyright 2020 iXsystems, Inc.
27 * Test a corner case : a "doall" send without children datasets.
31 #include <libzfs_core.h>
41 usage(const char *name
)
43 fprintf(stderr
, "usage: %s snap\n", name
);
48 main(int argc
, char const * const argv
[])
50 sendflags_t flags
= { 0 };
51 libzfs_handle_t
*zhdl
;
53 const char *tofull
, *fsname
, *tosnap
, *p
;
61 p
= strchr(tofull
, '@');
66 fsname
= strndup(tofull
, p
- tofull
);
70 errx(EX_OSERR
, "libzfs_init(): %s", libzfs_error_init(errno
));
72 zhp
= zfs_open(zhdl
, fsname
, ZFS_TYPE_FILESYSTEM
);
74 err(EX_OSERR
, "zfs_open(\"%s\")", fsname
);
78 error
= zfs_send(zhp
, NULL
, tosnap
, &flags
,
79 STDOUT_FILENO
, NULL
, NULL
, NULL
);