MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / fgetc

Function fgetc

components/libc/compilers/armlibc/syscalls.c:373–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373int fgetc(FILE *f)
374{
375#ifdef RT_USING_POSIX_STDIO
376 char ch;
377
378 if (rt_posix_stdio_get_console() < 0)
379 {
380 LOG_W("Do not invoke standard output before initializing Compiler");
381 return 0;
382 }
383
384 if (read(STDIN_FILENO, &ch, 1) == 1)
385 return ch;
386#endif /* RT_USING_POSIX_STDIO */
387 LOG_W("%s: %s", __func__, _WARNING_WITHOUT_STDIO);
388 return 0; /* error */
389}
390
391#endif /* __MICROLIB */

Callers 1

libc_fseekFunction · 0.50

Calls 2

readFunction · 0.50

Tested by

no test coverage detected