Ignore:
Timestamp:
Dec 15, 2015, 4:19:16 PM (9 years ago)
Author:
alain
Message:

Improve the _fat_lseek() function to support
the SEEK_END value for the <whence> argument.

Location:
soft/giet_vm/giet_fat32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_fat32/fat32.c

    r744 r746  
    36303630// the "seek" and "whence" arguments.
    36313631// It has the same semantic as the UNIX lseek() function.
    3632 // Accepted values for whence are SEEK_SET and SEEK_CUR.
     3632// Accepted values for whence are SEEK_SET / SEEK_CUR / SEEK_END.
    36333633/////////////////////////////////////////////////////////////////////////////////
    36343634// Returns new seek value (in bytes) on success.
     
    36793679    if      ( whence == SEEK_CUR ) new_seek = _fat.fd[fd_id].seek + seek;
    36803680    else if ( whence == SEEK_SET ) new_seek = seek;
     3681    else if ( whence == SEEK_END ) new_seek = _fat.fd[fd_id].inode->size + seek;
    36813682    else
    36823683    {
  • soft/giet_vm/giet_fat32/fat32_shared.h

    r664 r746  
    4646#define SEEK_SET                0
    4747#define SEEK_CUR                1
     48#define SEEK_END                2
    4849
    4950/********************************************************************************
Note: See TracChangeset for help on using the changeset viewer.