2000-05-28 13:40:48 +00:00
|
|
|
/*
|
|
|
|
* puts.c
|
|
|
|
*
|
|
|
|
* Ullrich von Bassewitz, 11.08.1998
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2003-06-12 18:08:23 +00:00
|
|
|
#include <unistd.h>
|
2000-05-28 13:40:48 +00:00
|
|
|
#include "_file.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-11-06 18:04:07 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* Code */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int __fastcall__ puts (const char* s)
|
2000-05-28 13:40:48 +00:00
|
|
|
{
|
|
|
|
static char nl = '\n';
|
|
|
|
|
|
|
|
/* Assume stdout is always open */
|
|
|
|
if (write (stdout->f_fd, s, strlen (s)) < 0 ||
|
|
|
|
write (stdout->f_fd, &nl, 1) < 0) {
|
|
|
|
stdout->f_flags |= _FERROR;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Done */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|