Changeset 4e2cf8b in mainline for libc/generic/io/io.c
- Timestamp:
- 2006-03-14T12:14:43Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4ba1db5
- Parents:
- df50cf6
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/io/io.c
rdf50cf6 r4e2cf8b 30 30 #include <unistd.h> 31 31 #include <stdio.h> 32 #include <io/io.h> 32 33 33 34 static char nl = '\n'; … … 46 47 } 47 48 49 /** Put count chars from buffer to stdout without adding newline 50 * @param buf Buffer with size at least count bytes 51 * @param count 52 * @return 0 on succes, EOF on fail 53 */ 54 int putnchars(const char * buf, size_t count) 55 { 56 if (write(1, (void * ) buf, count) == count) { 57 return 0; 58 } 59 60 return EOF; 61 } 62 63 /** Same as puts, but does not print newline at end 64 * 65 */ 66 int putstr(const char * str) 67 { 68 size_t count; 69 70 for (count = 0; str[count] != 0; count++); 71 if (write(1, (void * ) str, count) == count) { 72 return 0; 73 } 74 75 return EOF; 76 } 77 48 78 ssize_t write(int fd, const void * buf, size_t count) 49 79 { 50 80 return (ssize_t) __SYSCALL3(SYS_IO, (sysarg_t) fd, (sysarg_t) buf, (sysarg_t) count); 51 81 } 82 83
Note:
See TracChangeset
for help on using the changeset viewer.