28 lines
474 B
C
28 lines
474 B
C
#ifndef IO_H_
|
|
#define IO_H_
|
|
|
|
#define MAX_FDS 1024
|
|
|
|
#include <stdlib.h>
|
|
#include <sys/types.h>
|
|
|
|
#include "inode.h"
|
|
|
|
struct file_descriptor {
|
|
Inode *inode;
|
|
off_t offset;
|
|
int flags;
|
|
int ref_count;
|
|
};
|
|
|
|
struct Process {
|
|
struct file_descriptor fd_table[MAX_FDS];
|
|
};
|
|
|
|
int allocate_fd(struct Process proc, Inode inode, int flags);
|
|
int emmafs_open(char name[]);
|
|
int emmafs_close(char name[]);
|
|
//int emmafs_read(int fd)
|
|
//int emmafs_write(int fd)
|
|
|
|
#endif // IO_H_
|