@
SILdoc(`Generate a zfs send stream for the specified snapshot and write it to the specified file descriptor.
Params:
string snapname: the name of the snapshot to send.
string fromsnap: if not empty the name of the starting snapshot for the incremental stream.
int fileDescriptor: the file descriptor to write the send stream to.
SendFlag[] flags: the flags that control what enhanced features can be used in the stream.
Errors:
SnapshotNotFound: if either the starting snapshot is set and does not exist, or if the ending snapshot does not exist.
NameInvalid: if the name of either snapshot is invalid.
NameTooLong: if the name of either snapshot is too long.
SnapshotMismatch: if fromsnap is not an ancestor snapshot of snapname
PoolsDiffer: if the snapshots belong to different pools.
IOError: if an input / output error occurs while writing to fd
UnknownStreamFeature: if the flags contain an unknown flag name.
If fromsnap is empty, a full (non-incremental) stream will be sent.
If fromsnap is not empty, it must be the full name of a snapshot or bookmark to send an incremental from, e.g. :file:{pool}/{fs}@{earlier_snap} or :file:{pool}/{fs}#{earlier_bmark}. The specified snapshot or bookmark must represent an earlier point in the history of snapname. It can be an earlier snapshot in the same filesystem or zvol as snapname, or it can be the origin of snapnames filesystem, or an earlier snapshot in the origin, etc. fromsnap must be strictly an earlier snapshot, specifying the same snapshot as both fromsnap and snapname is an error.
If flags contains *"large_blocks"*, the stream is permitted to contain DRR_WRITE records with drr_length > 128K, and DRR_OBJECT records with drr_blksz > 128K. If flags contains *"embedded_data"*, the stream is permitted to contain DRR_WRITE_EMBEDDED records with drr_etype == BP_EMBEDDED_TYPE_DATA, which the receiving system must support (as indicated by support for the *embedded_data* feature). If flags contains *"compress"*, the stream is generated by using compressed WRITE records for blocks which are compressed on disk and in memory. If the *lz4_compress* feature is active on the sending system, then the receiving system must have that feature enabled as well. If flags contains *"raw"*, the stream is generated, for encrypted datasets, by sending data exactly as it exists on disk. This allows backups to be taken even if encryption keys are not currently loaded.
note:
lzc_send can actually accept a filesystem name as the snapname. In that case lzc_send acts as if a temporary snapshot was created after the start of the call and before the stream starts being produced.
lzc_send does not return until all of the stream is written to fd.
lzc_send does *not* close fd upon returning.
`)