Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 08232ee in mainline for uspace/app/mkfat/mkfat.c


Ignore:
Timestamp:
2010-01-09T21:52:07Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
9245413
Parents:
dccf721
Message:

Obtain block device size automatically, if possible. Implement ftell(). Fix seek implementation in VFS if whence == SEEK_END.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkfat/mkfat.c

    rdccf721 r08232ee  
    9393        size_t block_size;
    9494        char *endptr;
     95        bn_t dev_nblocks;
    9596
    9697        cfg.total_sectors = 0;
     
    144145                printf(NAME ": Error determining device block size.\n");
    145146                return 2;
     147        }
     148
     149        rc = block_get_nblocks(handle, &dev_nblocks);
     150        if (rc != EOK) {
     151                printf(NAME ": Warning, failed to obtain block device size.\n");
     152        } else {
     153                printf(NAME ": Block device has %llu blocks.\n", dev_nblocks);
     154                cfg.total_sectors = dev_nblocks;
    146155        }
    147156
     
    240249        }
    241250
    242         printf("fat_sectors=%d\n", par->fat_sectors);
    243251        /* File allocation tables */
    244252        for (i = 0; i < fat_count; ++i) {
Note: See TracChangeset for help on using the changeset viewer.