Changeset ed903174 in mainline for uspace/lib/libc/generic
- Timestamp:
- 2010-02-10T23:51:23Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e70edd1
- Parents:
- b32c604f
- Location:
- uspace/lib/libc/generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/io/io.c
rb32c604f red903174 541 541 } 542 542 543 int fseek(FILE *stream, long offset, int origin)544 { 545 off _t rc = lseek(stream->fd, offset, origin);546 if (rc == (off _t) (-1)) {547 /* errno has been set by lseek . */543 int fseek(FILE *stream, off64_t offset, int whence) 544 { 545 off64_t rc = lseek(stream->fd, offset, whence); 546 if (rc == (off64_t) (-1)) { 547 /* errno has been set by lseek64. */ 548 548 return -1; 549 549 } … … 554 554 } 555 555 556 int ftell(FILE *stream) 557 { 558 off_t rc = lseek(stream->fd, 0, SEEK_CUR); 559 if (rc == (off_t) (-1)) { 560 /* errno has been set by lseek. */ 561 return -1; 562 } 563 564 return rc; 556 off64_t ftell(FILE *stream) 557 { 558 return lseek(stream->fd, 0, SEEK_CUR); 565 559 } 566 560 -
uspace/lib/libc/generic/mman.c
rb32c604f red903174 39 39 40 40 void *mmap(void *start, size_t length, int prot, int flags, int fd, 41 off_t offset)41 aoff64_t offset) 42 42 { 43 43 if (!start) -
uspace/lib/libc/generic/vfs/vfs.c
rb32c604f red903174 35 35 #include <vfs/vfs.h> 36 36 #include <vfs/canonify.h> 37 #include <macros.h> 37 38 #include <stdlib.h> 38 39 #include <unistd.h> … … 434 435 } 435 436 436 off _t lseek(int fildes, off_t offset, int whence)437 { 438 ipcarg_t rc;439 440 futex_down(&vfs_phone_futex);441 async_serialize_start();442 vfs_connect();443 444 ipcarg_t newoffs;445 rc = async_req_3_1(vfs_phone, VFS_IN_SEEK, fildes, offset, whence,446 &newoff s);447 448 async_serialize_end(); 449 futex_up(&vfs_phone_futex); 450 437 off64_t lseek(int fildes, off64_t offset, int whence) 438 { 439 futex_down(&vfs_phone_futex); 440 async_serialize_start(); 441 vfs_connect(); 442 443 ipcarg_t newoff_lo; 444 ipcarg_t newoff_hi; 445 ipcarg_t rc = async_req_4_2(vfs_phone, VFS_IN_SEEK, fildes, 446 LOWER32(offset), UPPER32(offset), whence, 447 &newoff_lo, &newoff_hi); 448 449 async_serialize_end(); 450 futex_up(&vfs_phone_futex); 451 451 452 if (rc != EOK) 452 return (off_t) -1; 453 454 return (off_t) newoffs; 455 } 456 457 int ftruncate(int fildes, off_t length) 458 { 459 ipcarg_t rc; 460 461 futex_down(&vfs_phone_futex); 462 async_serialize_start(); 463 vfs_connect(); 464 465 rc = async_req_2_0(vfs_phone, VFS_IN_TRUNCATE, fildes, length); 466 async_serialize_end(); 467 futex_up(&vfs_phone_futex); 453 return (off64_t) -1; 454 455 return (off64_t) MERGE_LOUP32(newoff_lo, newoff_hi); 456 } 457 458 int ftruncate(int fildes, aoff64_t length) 459 { 460 ipcarg_t rc; 461 462 futex_down(&vfs_phone_futex); 463 async_serialize_start(); 464 vfs_connect(); 465 466 rc = async_req_3_0(vfs_phone, VFS_IN_TRUNCATE, fildes, 467 LOWER32(length), UPPER32(length)); 468 async_serialize_end(); 469 futex_up(&vfs_phone_futex); 470 468 471 return (int) rc; 469 472 } … … 479 482 480 483 req = async_send_1(vfs_phone, VFS_IN_FSTAT, fildes, NULL); 481 rc = async_data_read_start(vfs_phone, (void *) stat, sizeof(struct stat));484 rc = async_data_read_start(vfs_phone, (void *) stat, sizeof(struct stat)); 482 485 if (rc != EOK) { 483 486 ipcarg_t rc_orig; … … 553 556 if (!abs) { 554 557 free(dirp); 555 return ENOMEM;558 return NULL; 556 559 } 557 560
Note:
See TracChangeset
for help on using the changeset viewer.
