37,6 → 37,10 |
{ |
size_t count; |
|
if (str == NULL) { |
return putnchars("(NULL)",6 ); |
} |
|
for (count = 0; str[count] != 0; count++); |
if (write(1, (void * ) str, count) == count) { |
if (write(1, &nl, 1) == 1) |
47,7 → 51,7 |
} |
|
/** Put count chars from buffer to stdout without adding newline |
* @param buf Buffer with size at least count bytes |
* @param buf Buffer with size at least count bytes - NULL pointer NOT allowed! |
* @param count |
* @return 0 on succes, EOF on fail |
*/ |
79,6 → 83,16 |
return EOF; |
} |
|
int putchar(int c) |
{ |
unsigned char ch = c; |
if (write(1, (void *)&ch , 1) == 1) { |
return c; |
} |
|
return EOF; |
} |
|
ssize_t write(int fd, const void * buf, size_t count) |
{ |
return (ssize_t) __SYSCALL3(SYS_IO, (sysarg_t) fd, (sysarg_t) buf, (sysarg_t) count); |