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