Ignore:
Timestamp:
Oct 22, 2019, 1:48:51 PM (3 years ago)
Author:
alain
Message:

...miscelaneous...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libs/mini-libc/stdio.c

    r643 r647  
    412412
    413413    // compute nbytes
    414     unsigned int nbytes = size * nitems;
     414    int nbytes = size * nitems;
    415415
    416416    if( hal_user_syscall( SYS_READ,
     
    435435
    436436    // compute nbytes
    437     unsigned int nbytes = size * nitems;
     437    int nbytes = size * nitems;
    438438
    439439    if( hal_user_syscall( SYS_WRITE,
     
    444444
    445445}  // end fwrite()
     446
     447//////////////////////////////////////////
     448unsigned int fseek( FILE         * stream,
     449                    unsigned int   offset,
     450                    int            whence )
     451{
     452    // check stream valid
     453    if( stream->key != VALID_OPEN_FILE ) return -1;
     454
     455    // get file descriptor from stream pointer
     456    int fd = stream->fd;
     457
     458    return( hal_user_syscall( SYS_LSEEK,
     459                              (reg_t)fd,
     460                              (reg_t)offset,
     461                              (reg_t)whence, 0 ) );
     462}  // end fseek()
    446463
    447464/////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.