Changes between Version 143 and Version 144 of library_stdio
- Timestamp:
- Dec 24, 2015, 12:29:15 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
library_stdio
v143 v144 277 277 Returns a negative value if error. 278 278 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 ) === 280 This 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. 281 In case of miss in the File_Cache, it loads all involved clusters into cache. 282 283 Returns number of bytes actually transferred if success. 284 Returns 0 if (offset + count) is larger than the file size. 285 Returns a negative value if error. 286 287 === 6) int '''giet_fat_write'''( unsigned int fd_id , void* buffer, unsigned int count ) === 281 288 This 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. 282 289 The FAT region on block device is updated if new clusters are allocated, but the block device DATA region is NOT updated. … … 285 292 Returns a negative value if error. 286 293 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 ) === 288 295 This function has the same semantic as the UNIX lseek() function. 289 296 It repositions the offset in the file descriptor <fd_id>, according to the <offset> and <whence> arguments. … … 296 303 Returns a negative value if error. 297 304 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 ) === 299 306 This function has the same semantic as the UNIX unlink() function. 300 307 It deletes a file identified by the absolute "pathname" argument from the sile system. … … 308 315 Returns a negative value if error. 309 316 310 === 8) int '''get_fat_rename'''( char* old_path , char* new_path )===317 === 9) int '''get_fat_rename'''( char* old_path , char* new_path )=== 311 318 This function has the same semantic as the UNIX rename() function. 312 319 It causes the node identified by <old_path> to be renamed as <new_path>. If <new_path> exists, it is first removed. … … 316 323 Returns a negative value if error. 317 324 318 === 9) int '''giet_fat_mkdir'''( char* pathname ) ===325 === 10) int '''giet_fat_mkdir'''( char* pathname ) === 319 326 This function has the same semantic as the UNIX mkdir() function. 320 327 It creates in the file system the directory specified by the absolute "pathname" argument. … … 328 335 Returns a negative value if error. 329 336 330 === 1 0) int '''giet_fat_opendir'''( char* pathname ) ===337 === 11) int '''giet_fat_opendir'''( char* pathname ) === 331 338 This function allocates a file descriptor to the calling thread, for the directory identified by its absolute <pathname>. 332 339 … … 334 341 Returns a negative value if error. 335 342 336 === 1 1) int '''giet_fat_closedir'''( unsigned int fd_id ) ===343 === 12) int '''giet_fat_closedir'''( unsigned int fd_id ) === 337 344 Close a directory identified by the <fd_id> file descriptor. 338 345 It decrements the reference count in the inode associated to the directory, … … 342 349 Returns a negative value if error. 343 350 344 === 1 2) 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 ) === 345 352 This function access one directory entry identified by the <fd_id> argument (obtained by the 346 353 giet_fat_opendir() function), and writes the relevant informations to the <entry> argument. … … 350 357 Returns a negative value if error. 351 358 352 === 1 3) 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 , ... ) === 360 This 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. 354 361 The FAT region on block device is updated if new clusters are allocated, but the block device DATA region is NOT updated. 362 363 Returns number of bytes actually transferred if success. 364 Returns a negative value if error. 355 365 356 366 == __Network related system call__ ==