19 lines
328 B
C
19 lines
328 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <__fio.h>
|
|
|
|
FILE *fdopen(int fd, const char *mode)
|
|
{
|
|
struct __io_file *fp = malloc(sizeof(*fp));
|
|
memset(fp, 0x0, sizeof(*fp));
|
|
|
|
int res = __fio_fdopen(fd, mode, fp);
|
|
if (res != 0) {
|
|
free(fp);
|
|
return NULL;
|
|
}
|
|
|
|
return fp;
|
|
}
|