Changeset 4e2cf8b in mainline
- 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
- Location:
- libc
- Files:
-
- 4 added
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
libc/Makefile
rdf50cf6 r4e2cf8b 42 42 GENERIC_SOURCES = \ 43 43 generic/libc.c \ 44 generic/io.c 44 generic/io/io.c \ 45 generic/io/print.c 45 46 46 47 ARCH_SOURCES += \ -
libc/arch/ia32/include/types.h
rdf50cf6 r4e2cf8b 34 34 typedef signed int ssize_t; 35 35 36 typedef char int8_t; 37 typedef short int int16_t; 38 typedef int int32_t; 39 typedef long long int int64_t; 40 41 typedef unsigned char uint8_t; 42 typedef unsigned short int uint16_t; 43 typedef unsigned int uint32_t; 44 typedef unsigned long long int uint64_t; 45 36 46 #endif -
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 -
libc/include/stdio.h
rdf50cf6 r4e2cf8b 32 32 #include <types.h> 33 33 34 #define EOF -134 #define EOF (-1) 35 35 36 36 extern int puts(const char * str); 37 37 38 extern int printf(const char *fmt, ...); 39 38 40 #endif
Note:
See TracChangeset
for help on using the changeset viewer.