# io_uring_prep_send_zc

## NAME



           io_uring_prep_send_zc - prepare a zerocopy send request
    


## SYNOPSIS



           **#include <liburing.h>**
    
           **void io_uring_prep_send_zc(struct io_uring_sqe ***_sqe_**,**
                                      **int** _sockfd_**,**
                                      **const void ***_buf_**,**
                                      **size_t** _len_**,**
                                      **int** _flags_**,**
                                      **unsigned** _zc_flags_**);**
    
           **void io_uring_prep_send_zc_fixed(struct io_uring_sqe ***_sqe_**,**
                                            **int** _sockfd_**,**
                                            **const void ***_buf_**,**
                                            **size_t** _len_**,**
                                            **int** _flags_**,**
                                            **unsigned** _zc_flags_**);**
                                            **unsigned** _buf_index_**);**
    


## DESCRIPTION



           The io_uring_prep_send_zc(3) function prepares a zerocopy send
           request. The submission queue entry _sqe_ is setup to use the file
           descriptor _sockfd_ to start sending the data from _buf_ of size _len_
           bytes with send modifier flags _flags_ and zerocopy modifier flags
           _zc_flags_.
    
           The io_uring_prep_send_zc_fixed(3) works just like
           io_uring_prep_send_zc(3) except it requires the use of buffers
           that have been registered with io_uring_register_buffers(3).  The
           _buf_ and _len_ arguments must fall within a region specified by
           _buf_index_ in the previously registered buffer. The buffer need not
           be aligned with the start of the registered buffer.
    
           See io_uring_prep_send(3) for a description of flags that can be
           set in the SQE _ioprio_ field. In addition to those, the zero-copy
           send also supports setting **IORING_SEND_ZC_REPORT_USAGE .** If set,
           the notification CQE _res_ field will report the number of bytes
           that were copied rather than sent with zero copy. A value of **0**
           indicates success. If the value is **IORING_NOTIF_USAGE_ZC_COPIED ,**
           then data was copied.
    
           Note that using **IOSQE_IO_LINK** with this request type requires the
           setting of **MSG_WAITALL** in the _flags_ argument, as a short send
           isn't considered an error condition without that being set.
    
           These functions prepare an async zerocopy send(2) request. See
           that man page for details. For details on the zerocopy nature of
           it, see io_uring_enter(2).
    


## RETURN VALUE



           None
    


## ERRORS



           The CQE _res_ field will contain the result of the operation. See
           the related man page for details on possible values. Note that
           where synchronous system calls will return **-1** on failure and set
           _errno_ to the actual error value, io_uring never uses _errno_.
           Instead it returns the negated _errno_ directly in the CQE _res_
           field.
    


* * *