mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
file: fd_allocate
This commit is contained in:
@@ -38,6 +38,10 @@ static void cleanfile(file_t *file) {
|
||||
slab_free(filecache, file);
|
||||
}
|
||||
|
||||
file_t *fd_allocate() {
|
||||
return newfile();
|
||||
}
|
||||
|
||||
file_t *fd_get(int fd) {
|
||||
proc_t *proc = _cpu()->thread->proc;
|
||||
bool intstatus = interrupt_set(false);
|
||||
|
||||
@@ -18,6 +18,7 @@ typedef struct fd_t {
|
||||
int flags;
|
||||
} fd_t;
|
||||
|
||||
file_t *fd_allocate();
|
||||
file_t *fd_get(int fd);
|
||||
void fd_release(file_t *file);
|
||||
int fd_new(int flags, file_t **file, int *fd);
|
||||
|
||||
Reference in New Issue
Block a user