Changeset 67e881c in mainline for uspace/lib/c/generic/vfs/vfs.c


Ignore:
Timestamp:
2017-03-30T20:59:36Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a56cef9
Parents:
79ea5af
Message:

Rename ftruncate() to vfs_resize()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/vfs/vfs.c

    r79ea5af r67e881c  
    408408                assert(!(oflag & O_APPEND));
    409409               
    410                 (void) ftruncate(fd, 0);
     410                (void) vfs_resize(fd, 0);
    411411        }
    412412
     
    620620 * @param length Length
    621621 *
    622  * @return 0 on success, -1 on error and sets errno.
    623  */
    624 int ftruncate(int fildes, aoff64_t length)
     622 * @return 0 on success or a negative erroc code otherwise.
     623 */
     624int vfs_resize(int file, aoff64_t length)
    625625{
    626626        sysarg_t rc;
    627627       
    628628        async_exch_t *exch = vfs_exchange_begin();
    629         rc = async_req_3_0(exch, VFS_IN_TRUNCATE, fildes,
    630             LOWER32(length), UPPER32(length));
    631         vfs_exchange_end(exch);
    632        
    633         if (rc != EOK) {
    634                 errno = rc;
    635                 return -1;
    636         }
    637        
    638         return 0;
     629        rc = async_req_3_0(exch, VFS_IN_RESIZE, file, LOWER32(length),
     630            UPPER32(length));
     631        vfs_exchange_end(exch);
     632       
     633        return rc;
    639634}
    640635
Note: See TracChangeset for help on using the changeset viewer.