diff options
Diffstat (limited to 'roms/skiboot/libc/stdio/fputc.c')
-rw-r--r-- | roms/skiboot/libc/stdio/fputc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/roms/skiboot/libc/stdio/fputc.c b/roms/skiboot/libc/stdio/fputc.c new file mode 100644 index 000000000..6e9e7c9c0 --- /dev/null +++ b/roms/skiboot/libc/stdio/fputc.c @@ -0,0 +1,24 @@ +/****************************************************************************** + * Copyright (c) 2004, 2008 IBM Corporation + * All rights reserved. + * This program and the accompanying materials + * are made available under the terms of the BSD License + * which accompanies this distribution, and is available at + * http://www.opensource.org/licenses/bsd-license.php + * + * Contributors: + * IBM Corporation - initial implementation + *****************************************************************************/ + +#include "stdio.h" +#include "unistd.h" + +int fputc(int ch, FILE *stream) +{ + unsigned char outchar = ch; + + if (write(stream->fd, &outchar, 1) == 1) + return outchar; + else + return EOF; +} |