57,7 → 57,7 |
* Print to kernel log. |
* |
*/ |
static unative_t sys_io(int fd, const void * buf, size_t count) |
static unative_t sys_klog(int fd, const void * buf, size_t count) |
{ |
size_t i; |
char *data; |
65,20 → 65,23 |
|
if (count > PAGE_SIZE) |
return ELIMIT; |
|
data = (char *) malloc(count, 0); |
if (!data) |
return ENOMEM; |
|
rc = copy_from_uspace(data, buf, count); |
if (rc) { |
if (count > 0) { |
data = (char *) malloc(count, 0); |
if (!data) |
return ENOMEM; |
|
rc = copy_from_uspace(data, buf, count); |
if (rc) { |
free(data); |
return rc; |
} |
|
for (i = 0; i < count; i++) |
putchar(data[i]); |
free(data); |
return rc; |
} |
|
for (i = 0; i < count; i++) |
putchar(data[i]); |
free(data); |
} else |
klog_update(); |
|
return count; |
} |
118,7 → 121,7 |
} |
|
syshandler_t syscall_table[SYSCALL_END] = { |
(syshandler_t) sys_io, |
(syshandler_t) sys_klog, |
(syshandler_t) sys_tls_set, |
|
/* Thread and task related syscalls. */ |