| 1 |
#include <stdio.h> |
| 2 |
#include <stddef.h> |
| 3 |
extern void abort (void); |
| 4 |
extern int inside_main; |
| 5 |
extern size_t strlen(const char *); |
| 6 |
int |
| 7 |
fputs(const char *string, FILE *stream) |
| 8 |
{ |
| 9 |
size_t n = strlen(string); |
| 10 |
size_t r; |
| 11 |
#if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ |
| 12 |
if (inside_main) |
| 13 |
abort(); |
| 14 |
#endif |
| 15 |
r = fwrite (string, 1, n, stream); |
| 16 |
return n > r ? EOF : 0; |
| 17 |
} |
| 18 |
|
| 19 |
/* Locking stdio doesn't matter for the purposes of this test. */ |
| 20 |
int |
| 21 |
fputs_unlocked(const char *string, FILE *stream) |
| 22 |
{ |
| 23 |
return fputs (string, stream); |
| 24 |
} |