Changeset 37675 in vbox for trunk/src/recompiler/cutils.c
- Timestamp:
- Jun 29, 2011 7:07:14 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/cutils.c
r36175 r37675 26 26 27 27 #ifdef VBOX 28 # include "osdep.h"28 # include "osdep.h" 29 29 30 30 … … 612 612 613 613 #ifndef VBOX 614 /* 615 * Make sure data goes on disk, but if possible do not bother to 616 * write out the inode just for timestamp updates. 617 * 618 * Unfortunately even in 2009 many operating systems do not support 619 * fdatasync and have to fall back to fsync. 620 */ 621 int qemu_fdatasync(int fd) 622 { 623 #ifdef CONFIG_FDATASYNC 624 return fdatasync(fd); 625 #else 626 return fsync(fd); 627 #endif 628 } 629 614 630 /* io vectors */ 615 631 … … 646 662 qiov->size += len; 647 663 ++qiov->niov; 664 } 665 666 /* 667 * Copies iovecs from src to the end dst until src is completely copied or the 668 * total size of the copied iovec reaches size. The size of the last copied 669 * iovec is changed in order to fit the specified total size if it isn't a 670 * perfect fit already. 671 */ 672 void qemu_iovec_concat(QEMUIOVector *dst, QEMUIOVector *src, size_t size) 673 { 674 int i; 675 size_t done; 676 677 assert(dst->nalloc != -1); 678 679 done = 0; 680 for (i = 0; (i < src->niov) && (done != size); i++) { 681 if (done + src->iov[i].iov_len > size) { 682 qemu_iovec_add(dst, src->iov[i].iov_base, size - done); 683 break; 684 } else { 685 qemu_iovec_add(dst, src->iov[i].iov_base, src->iov[i].iov_len); 686 } 687 done += src->iov[i].iov_len; 688 } 648 689 } 649 690
Note:
See TracChangeset
for help on using the changeset viewer.