mirror of
https://github.com/drasko/codezero.git
synced 2026-03-01 10:13:14 +01:00
More changes
This commit is contained in:
@@ -645,7 +645,9 @@ int sys_write(l4id_t sender, int fd, void *buf, int count)
|
|||||||
* of this change when the file is flushed (e.g. via fflush()
|
* of this change when the file is flushed (e.g. via fflush()
|
||||||
* or close())
|
* or close())
|
||||||
*/
|
*/
|
||||||
vmfile->length += count;
|
if (task->fd[fd].cursor + count > vmfile->length)
|
||||||
|
vmfile->length = task->fd[fd].cursor + count;
|
||||||
|
|
||||||
task->fd[fd].cursor += count;
|
task->fd[fd].cursor += count;
|
||||||
retval = count;
|
retval = count;
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ int file_page_out(struct vm_object *vm_obj, unsigned long page_offset)
|
|||||||
/* Map the page to vfs task */
|
/* Map the page to vfs task */
|
||||||
l4_map(paddr, vaddr, 1, MAP_USR_RW_FLAGS, VFS_TID);
|
l4_map(paddr, vaddr, 1, MAP_USR_RW_FLAGS, VFS_TID);
|
||||||
|
|
||||||
/* Syscall to vfs to read into the page. */
|
/* Syscall to vfs to write page back to file. */
|
||||||
if ((err = vfs_write(vm_file_to_vnum(f), page_offset, 1, vaddr)) < 0)
|
if ((err = vfs_write(vm_file_to_vnum(f), page_offset, 1, vaddr)) < 0)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user