added some useless shell commands
This commit is contained in:
@@ -13,13 +13,14 @@
|
||||
#define SYS_FORK 21
|
||||
#define SYS_EXEC 22
|
||||
#define SYS_DUP2 23
|
||||
#define SYS_LSEEK 24
|
||||
|
||||
int open(const char* path);
|
||||
int write(int fd, const void *buf, size_t count);
|
||||
int read(int fd, void *buf, size_t count);
|
||||
int close(int fd);
|
||||
|
||||
size_t lseek(int fd, size_t offset, int whence);
|
||||
int lseek(int fd, size_t offset, int whence);
|
||||
|
||||
void exit(int status) __attribute__((noreturn));
|
||||
|
||||
|
||||
@@ -39,6 +39,10 @@ int read(int fd, void* buf, size_t cnt) {
|
||||
return syscall3(SYS_READ, (uint32_t)fd, (uint32_t)buf, (uint32_t)cnt);
|
||||
}
|
||||
|
||||
int lseek(int fd, size_t offset, int whence) {
|
||||
return syscall3(SYS_LSEEK, (uint32_t)fd, offset, whence);
|
||||
}
|
||||
|
||||
int close(int fd) {
|
||||
return syscall1(SYS_CLOSE, fd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user