Added close() and proper creat() to x11 emulator

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3179 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2003-01-28 23:14:41 +00:00
parent b82241b970
commit 2ba4fedd64
2 changed files with 9 additions and 1 deletions

View file

@ -21,12 +21,14 @@
#include <sys/types.h> #include <sys/types.h>
int x11_open(char *name, int opts); int x11_open(char *name, int opts);
int x11_close(int fd);
int x11_creat(char *name, int mode); int x11_creat(char *name, int mode);
int x11_remove(char *name); int x11_remove(char *name);
int x11_rename(char *oldpath, char *newpath); int x11_rename(char *oldpath, char *newpath);
#define open(x,y) x11_open(x,y) #define open(x,y) x11_open(x,y)
#define creat(x,y) x11_open(x,y) #define close(x) x11_close(x)
#define creat(x,y) x11_creat(x,y)
#define remove(x) x11_remove(x) #define remove(x) x11_remove(x)
#define rename(x,y) x11_rename(x,y) #define rename(x,y) x11_rename(x,y)

View file

@ -23,6 +23,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/vfs.h> #include <sys/vfs.h>
#include <dirent.h> #include <dirent.h>
#include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include "debug.h" #include "debug.h"
@ -109,6 +110,11 @@ int x11_open(char *name, int opts)
return open(name, opts); return open(name, opts);
} }
int x11_close(int fd)
{
return close(fd);
}
int x11_creat(char *name, int mode) int x11_creat(char *name, int mode)
{ {
char buffer[256]; /* sufficiently big */ char buffer[256]; /* sufficiently big */