Redesign VFS around handles
This commit is contained in:
@@ -43,14 +43,14 @@ int exec (const char* path) { return (int)do_syscall (SYS_EXEC, path); }
|
||||
|
||||
int open (const char* path) { return (int)do_syscall (SYS_OPEN, path); }
|
||||
|
||||
int close (const char* path) { return (int)do_syscall (SYS_CLOSE, path); }
|
||||
int close (int handle) { return (int)do_syscall (SYS_CLOSE, handle); }
|
||||
|
||||
int read (const char* path, size_t off, uint8_t* buffer, size_t size) {
|
||||
return (int)do_syscall (SYS_READ, path, off, buffer, size);
|
||||
int read (int handle, size_t off, uint8_t* buffer, size_t size) {
|
||||
return (int)do_syscall (SYS_READ, handle, off, buffer, size);
|
||||
}
|
||||
|
||||
int describe (const char* path, struct desc* desc) {
|
||||
return (int)do_syscall (SYS_DESCRIBE, path, desc);
|
||||
int describe (int handle, struct desc* desc) {
|
||||
return (int)do_syscall (SYS_DESCRIBE, handle, desc);
|
||||
}
|
||||
|
||||
int mail_send (int pgid, void* mesg, size_t mesg_size) {
|
||||
|
||||
@@ -57,13 +57,13 @@ int exec (const char* path);
|
||||
int open (const char* path);
|
||||
|
||||
/* Close a file */
|
||||
int close (const char* path);
|
||||
int close (int handle);
|
||||
|
||||
/* Read a file */
|
||||
int read (const char* path, size_t off, uint8_t* buffer, size_t size);
|
||||
int read (int handle, size_t off, uint8_t* buffer, size_t size);
|
||||
|
||||
/* describe a file */
|
||||
int describe (const char* path, struct desc* desc);
|
||||
int describe (int handle, struct desc* desc);
|
||||
|
||||
/* send a message to a procgroup's mail */
|
||||
int mail_send (int pgid, void* mesg, size_t mesg_size);
|
||||
|
||||
Reference in New Issue
Block a user