meta: move photon/libc to root
This commit is contained in:
18
libc/stdio/fdopen.c
Normal file
18
libc/stdio/fdopen.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user