source: trunk/sys/dietlibc/fdopen.c @ 8

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

First import

File size: 401 bytes
Line 
1#include <errno.h>
2#include "dietfeatures.h"
3#include "dietstdio.h"
4#include <unistd.h>
5
6FILE *fdopen_unlocked(int filedes, const char *mode) {
7  int f=0;      /* O_RDONLY, O_WRONLY or O_RDWR */
8
9  f=__stdio_parse_mode(mode);
10  if (filedes<0) { errno=EBADF; return 0; }
11  return __stdio_init_file(filedes,0,f);
12}
13
14FILE *fdopen(int filedes, const char *mode) __attribute__((weak,alias("fdopen_unlocked")));
Note: See TracBrowser for help on using the repository browser.