aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-20 15:00:51 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-20 15:00:51 +0100
commit2d4d64189501c253ed6a5b5ff5e27da1cb34407a (patch)
tree488ed008de322f0ffbfd1efdaec2041811b41a1c /src/lib
parent13db03fcc4a476c8881ccafe0852e72410c67b3a (diff)
downloadkogata-2d4d64189501c253ed6a5b5ff5e27da1cb34407a.tar.gz
kogata-2d4d64189501c253ed6a5b5ff5e27da1cb34407a.zip
Think a bit ; ioctls only on open file descriptors.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/include/syscall.h3
-rw-r--r--src/lib/libkogata/syscall.c7
2 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/include/syscall.h b/src/lib/include/syscall.h
index fb82c33..991b081 100644
--- a/src/lib/include/syscall.h
+++ b/src/lib/include/syscall.h
@@ -26,7 +26,6 @@ bool create(const char* name, int type);
bool delete(const char* name);
bool move(const char* oldname, const char* newname);
bool stat(const char* name, stat_t *s);
-int ioctl(const char* filename, int command, void* data);
fd_t open(const char* name, int mode);
void close(fd_t file);
@@ -34,7 +33,7 @@ size_t read(fd_t file, size_t offset, size_t len, char *buf);
size_t write(fd_t file, size_t offset, size_t len, const char* buf);
bool readdir(fd_t file, dirent_t *d);
bool stat_open(fd_t file, stat_t *s);
-int ioctl_open(fd_t file, int command, void* data);
+int ioctl(fd_t file, int command, void* data);
int get_mode(fd_t file);
// more todo
diff --git a/src/lib/libkogata/syscall.c b/src/lib/libkogata/syscall.c
index afda7c7..52e320c 100644
--- a/src/lib/libkogata/syscall.c
+++ b/src/lib/libkogata/syscall.c
@@ -64,9 +64,6 @@ bool move(const char* oldname, const char* newname) {
bool stat(const char* name, stat_t *s) {
return call(SC_STAT, (uint32_t)name, strlen(name), (uint32_t)s, 0, 0);
}
-int ioctl(const char* filename, int command, void* data) {
- return call(SC_IOCTL, (uint32_t)filename, strlen(filename), command, (uint32_t)data, 0);
-}
fd_t open(const char* name, int mode) {
return call(SC_OPEN, (uint32_t)name, strlen(name), mode, 0, 0);
@@ -86,8 +83,8 @@ bool readdir(fd_t file, dirent_t *d) {
bool stat_open(fd_t file, stat_t *s) {
return call(SC_STAT_OPEN, file, (uint32_t)s, 0, 0, 0);
}
-int ioctl_open(fd_t file, int command, void* data) {
- return call(SC_IOCTL_OPEN, file, command, (uint32_t)data, 0, 0);
+int ioctl(fd_t file, int command, void* data) {
+ return call(SC_IOCTL, file, command, (uint32_t)data, 0, 0);
}
int get_mode(fd_t file) {
return call(SC_GET_MODE, file, 0, 0, 0, 0);