1io_uring_prep_fsync(3)          liburing Manual         io_uring_prep_fsync(3)
2
3
4

NAME

6       io_uring_prep_fsync - prepare an fsync request
7

SYNOPSIS

9       #include <liburing.h>
10
11       void io_uring_prep_fsync(struct io_uring_sqe *sqe,
12                                int fd,
13                                unsigned flags);
14

DESCRIPTION

16       The io_uring_prep_fsync(3) function prepares an fsync request. The sub‐
17       mission queue entry sqe is setup to use the  file  descriptor  fd  that
18       should get synced, with the modifier flags indicated by the flags argu‐
19       ment.
20
21       This function prepares an fsync request. It  can  act  either  like  an
22       fsync(2)   operation,   which   is   the   default  behavior.  If  IOR‐
23       ING_FSYNC_DATASYNC is set in the flags argument, then it  behaves  like
24       fdatasync(2).   If  no range is specified, the fd will be synced from 0
25       to end-of-file.
26
27       It's possible to specify a range to sync, if one is desired. If the off
28       field  of the SQE is set to non-zero, then that indicates the offset to
29       start syncing at. If len is set in the SQE,  then  that  indicates  the
30       size  in  bytes to sync from the offset. Note that these fields are not
31       accepted by this helper, so they have to be set manually in the SQE af‐
32       ter calling this prep helper.
33
34

RETURN VALUE

36       None
37

ERRORS

39       The CQE res field will contain the result of the operation. See the re‐
40       lated man page for details on possible values. Note that where synchro‐
41       nous system calls will return -1 on failure and set errno to the actual
42       error value, io_uring never uses errno.  Instead it returns the negated
43       errno directly in the CQE res field.
44

SEE ALSO

46       io_uring_get_sqe(3), io_uring_submit(3), fsync(2), fdatasync(2)
47
48
49
50liburing-2.2                    March 12, 2022          io_uring_prep_fsync(3)
Impressum