Changeset 12fdd28 in mainline
- Timestamp:
- 2006-05-29T17:08:19Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ad37437
- Parents:
- a449065
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/syscall/syscall.c
ra449065 r12fdd28 48 48 #include <sysinfo/sysinfo.h> 49 49 50 /** Print using kernel facility 51 * 52 * Some simulators can print only through kernel. Userspace can use 53 * this syscall to facilitate it. 54 */ 50 55 static __native sys_io(int fd, const void * buf, size_t count) 51 56 { 52 // return count; /*Syscall deprecated*/ 53 // TODO: buf sanity checks and a lot of other stuff ... 57 size_t i; 58 char *data; 59 int rc; 54 60 55 size_t i; 61 if (count > PAGE_SIZE) 62 return ELIMIT; 63 64 data = malloc(count, 0); 65 if (!data) 66 return ENOMEM; 56 67 68 rc = copy_from_uspace(data, buf, count); 69 if (rc) { 70 free(data); 71 return rc; 72 } 73 57 74 for (i = 0; i < count; i++) 58 putchar(((char *) buf)[i]); 75 putchar(data[i]); 76 free(data); 59 77 60 78 return count;
Note:
See TracChangeset
for help on using the changeset viewer.