Changeset 0cf3d5f in mainline for uspace/lib/fmgt/src


Ignore:
Timestamp:
2025-10-10T08:45:43Z (3 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
c3db721
Parents:
cfd04c4
git-author:
Jiri Svoboda <jiri@…> (2025-10-09 18:45:33)
git-committer:
Jiri Svoboda <jiri@…> (2025-10-10 08:45:43)
Message:

Allow creating sparse files in Navigator and newfile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fmgt/src/fmgt.c

    rcfd04c4 r0cf3d5f  
    226226 * @param fname File name
    227227 * @param fsize Size of new file (number of zero bytes to fill in)
     228 * @param flags New file flags
    228229 * @return EOK on success or an error code
    229230 */
    230 errno_t fmgt_new_file(fmgt_t *fmgt, const char *fname, uint64_t fsize)
     231errno_t fmgt_new_file(fmgt_t *fmgt, const char *fname, uint64_t fsize,
     232    fmgt_nf_flags_t flags)
    231233{
    232234        int fd;
     
    254256
    255257        fmgt_initial_progress_update(fmgt);
     258
     259        if ((flags & nf_sparse) != 0) {
     260                fmgt->curf_procb = fsize - 1;
     261                pos = fsize - 1;
     262        }
    256263
    257264        while (fmgt->curf_procb < fsize) {
Note: See TracChangeset for help on using the changeset viewer.