e09283ada5a6265d1402e2a36b5db554729ba20b
[oota-llvm.git] / runtime / GCCLibraries / libc / io.c
1 //===-- io.c - IO routines for LLVM libc Library ------------------*- C -*-===//
2 // 
3 // A lot of this code is ripped gratuitously from glibc and libiberty.
4 //
5 //===----------------------------------------------------------------------===//
6
7 int putchar(int);
8
9 // The puts() function writes the string pointed to by s, followed by a 
10 // NEWLINE character, to the standard output stream stdout. On success the 
11 // number of characters written is returned; otherwise they return EOF.
12 //
13 int puts(const char *S) {
14   const char *Str = S;
15   while (*Str) putchar(*Str++);
16   putchar('\n');
17   return Str+1-S;
18 }