source: trunk/sys/dietlibc/stdin.c @ 52

Last change on this file since 52 was 1, checked in by alain, 8 years ago

First import

File size: 530 bytes
Line 
1#include "dietstdio.h"
2#include <unistd.h>
3
4static char __stdin_buf[BUFSIZE];
5static FILE __stdin = {
6  .fd=0,
7  .flags=BUFINPUT|BUFLINEWISE|STATICBUF|CANREAD,
8  .bs=0, .bm=0,
9  .buflen=BUFSIZE,
10  .buf=__stdin_buf,
11  .next=0,
12  .popen_kludge=0,
13  .ungetbuf=0,
14  .ungotten=0,
15#ifdef WANT_THREAD_SAFE
16  .m=PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
17#endif
18};
19
20int __stdin_is_tty() {
21  static int iknow;
22  if (!iknow) iknow=isatty(0)+1;
23  return (iknow-1);
24}
25
26FILE *stdin=&__stdin;
27
28int __fflush_stdin(void) {
29  return fflush(stdin);
30}
Note: See TracBrowser for help on using the repository browser.