Changes between Version 143 and Version 144 of library_stdio


Ignore:
Timestamp:
Dec 24, 2015, 12:29:15 PM (8 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • library_stdio

    v143 v144  
    277277Returns a negative value if error.
    278278
    279 
    280  === 5) int '''giet_fat_write'''( unsigned int fd_id , void* buffer, unsigned int count ) ===
     279=== 5) int '''giet_fat_pread'''( unsigned int fd_id , void* buffer , unsigned int count , unsigned int offset ) ===
     280This function has the same semantic as the UNIX pread() function. It transfers <count> bytes from the kernel File_Cache associated to the file identified by <fd_id>, to the user <buffer>, starting from the <offset> argument. The ''offset'' field in the file descriptor is not modified.
     281In case of miss in the File_Cache, it loads all involved clusters into cache.
     282
     283Returns number of bytes actually transferred if success.
     284Returns 0 if (offset + count) is larger than the file size.
     285Returns a negative value if error.
     286
     287 === 6) int '''giet_fat_write'''( unsigned int fd_id , void* buffer, unsigned int count ) ===
    281288This function has the same semantic as the UNIX <write()> function. It transfers <count> bytes from the user <buffer> to the kernel File_Cache associated to the file identified by <fd_id>, starting from the current file offset. The offset value is incremented by count. It increases the file size and allocate new clusters if (count + offset) is larger than the current file size. Then it loads and updates all involved clusters in the cache.
    282289The FAT region on block device is updated if new clusters are allocated, but the block device DATA region is NOT updated.
     
    285292Returns a negative value if error.
    286293
    287 === 6) int '''giet_fat_lseek'''( unsigned int fd_id , unsigned int offset , unsigned int whence ) ===
     294=== 7) int '''giet_fat_lseek'''( unsigned int fd_id , unsigned int offset , unsigned int whence ) ===
    288295This function has the same semantic as the UNIX lseek() function.
    289296It repositions the offset in the file descriptor <fd_id>, according to the <offset> and <whence> arguments.
     
    296303Returns a negative value if error.
    297304
    298 === 7) int '''giet_fat_remove'''( char* pathname , unsigned int should_be_dir ) ===
     305=== 8) int '''giet_fat_remove'''( char* pathname , unsigned int should_be_dir ) ===
    299306This function has the same semantic as the UNIX unlink() function.
    300307It deletes a file identified by the absolute "pathname" argument from the sile system.
     
    308315Returns a negative value if error.
    309316
    310 === 8) int '''get_fat_rename'''( char* old_path , char* new_path )===
     317=== 9) int '''get_fat_rename'''( char* old_path , char* new_path )===
    311318This function has the same semantic as the UNIX rename() function.
    312319It  causes the node identified by <old_path> to be renamed as <new_path>.  If <new_path>  exists, it is first removed.
     
    316323Returns a negative value if error.
    317324
    318 === 9) int '''giet_fat_mkdir'''( char* pathname ) ===
     325=== 10) int '''giet_fat_mkdir'''( char* pathname ) ===
    319326This function has the same semantic as the UNIX mkdir() function.
    320327It creates in the file system the directory specified by the absolute "pathname" argument. 
     
    328335Returns a negative value if error.
    329336
    330 === 10) int '''giet_fat_opendir'''( char* pathname ) ===
     337=== 11) int '''giet_fat_opendir'''( char* pathname ) ===
    331338This function allocates a file descriptor to the calling thread, for the directory identified by its absolute <pathname>.
    332339
     
    334341Returns a negative value if error.
    335342
    336 === 11) int '''giet_fat_closedir'''( unsigned int fd_id ) ===
     343=== 12) int '''giet_fat_closedir'''( unsigned int fd_id ) ===
    337344Close a directory identified by the <fd_id> file descriptor.
    338345It decrements the reference count in the inode associated to the directory,
     
    342349Returns a negative value if error.
    343350
    344 === 12) int '''giet_fat_readdir'''( unsigned int fd_id , fat_dirent_t* entry ) ===
     351=== 13) int '''giet_fat_readdir'''( unsigned int fd_id , fat_dirent_t* entry ) ===
    345352This function access one directory entry identified by the  <fd_id> argument (obtained by the
    346353giet_fat_opendir() function), and writes the relevant informations to the <entry> argument.
     
    350357Returns a negative value if error.
    351358
    352 === 13) int '''get_fat_fprintf'''( unsigned int fd_id , char* format , ... ) ===
    353 This function has the same semantic as the UNIX <fprintf()> function. It transfers all contained in the string defined by the <format> argument to the kernel File_Cache associated to the file identified by <fd_id>, starting from the current file offset. The offset value is incremented by the string length. It increases the file size and allocate new clusters if (count + offset) is larger than the current file size. Then it loads and updates all involved clusters in the cache.
     359=== 14) int '''giet_fat_fprintf'''( unsigned int fd_id , char* format , ... ) ===
     360This function has the same semantic as the UNIX <fprintf()> function. It transfers all bytes contained in the string defined by the <format> argument to the kernel File_Cache associated to the file identified by <fd_id>, starting from the current file offset. The offset value is incremented by the string length. It increases the file size and allocate new clusters if (count + offset) is larger than the current file size. Then it loads and updates all involved clusters in the cache.
    354361The FAT region on block device is updated if new clusters are allocated, but the block device DATA region is NOT updated.
     362
     363Returns number of bytes actually transferred if success.
     364Returns a negative value if error.
    355365
    356366 == __Network related system call__ ==