diff --git a/conts/libc/include/stdio.h b/conts/libc/include/stdio.h index bbca2a9..a3c544f 100644 --- a/conts/libc/include/stdio.h +++ b/conts/libc/include/stdio.h @@ -136,14 +136,14 @@ typedef long fpos_t; /* same */ #define FILENAME_MAX 37 #define L_tmpnam 37 +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif #ifndef SEEK_CUR -#define SEEK_CUR 0 +#define SEEK_CUR 1 #endif #ifndef SEEK_END -#define SEEK_END 1 -#endif -#ifndef SEEK_SET -#define SEEK_SET 2 +#define SEEK_END 2 #endif #define TMP_MAX 37 diff --git a/src/generic/tcb.c b/src/generic/tcb.c index 67ed17d..cf7cd87 100644 --- a/src/generic/tcb.c +++ b/src/generic/tcb.c @@ -183,7 +183,7 @@ int tcb_check_and_lazy_map_utcb(struct ktcb *task) * There you go: * * if task == current && not mapped, page-in, if not return -EFAULT - * if task != current && not mapped, page-in to task, return -EFAULT + * if task != current && not mapped, return -EFAULT since can't page-in on behalf of it. * if task != current && task mapped, but mapped != current mapped, map it, return 0 * if task != current && task mapped, but mapped == current mapped, return 0 */ @@ -211,18 +211,18 @@ int tcb_check_and_lazy_map_utcb(struct ktcb *task) virt_to_phys_by_pgd(task->utcb_address, TASK_PGD(task))) != virt_to_phys_by_pgd(task->utcb_address, - TASK_PGD(current))) + TASK_PGD(current))) { /* * We have none or an old reference. * Update it with privileged flags, * so that only kernel can access. */ - printk("%s: Caught old utcb mapping.\n", __FUNCTION__); add_mapping_pgd(phys, task->utcb_address, page_align_up(UTCB_SIZE), MAP_SVC_RW_FLAGS, TASK_PGD(current)); - BUG_ON(!phys); + } + BUG_ON(!phys); } } #if 0