streamlined code
This commit is contained in:
		
							parent
							
								
									c32f7e22ec
								
							
						
					
					
						commit
						095d4452e5
					
				
					 1 changed files with 10 additions and 4 deletions
				
			
		
							
								
								
									
										14
									
								
								io.h
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								io.h
									
									
									
									
									
								
							| 
						 | 
					@ -3,11 +3,16 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MAX_FDS 1024
 | 
					#define MAX_FDS 1024
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdarg.h>
 | 
				
			||||||
#include <sys/types.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "inode.h"
 | 
					#include "inode.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					enum Flags {
 | 
				
			||||||
 | 
					    O_READ = 1,
 | 
				
			||||||
 | 
					    O_WRITE = 2,
 | 
				
			||||||
 | 
					    O_APPEND = 4,
 | 
				
			||||||
 | 
					    O_CREATE = 8
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct file_descriptor {
 | 
					struct file_descriptor {
 | 
				
			||||||
    Inode *inode;
 | 
					    Inode *inode;
 | 
				
			||||||
    off_t offset;
 | 
					    off_t offset;
 | 
				
			||||||
| 
						 | 
					@ -19,7 +24,8 @@ struct Process {
 | 
				
			||||||
    struct file_descriptor fd_table[MAX_FDS];
 | 
					    struct file_descriptor fd_table[MAX_FDS];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int allocate_fd(struct Process proc, Inode inode, int flags);
 | 
					struct Process* initialize_process();
 | 
				
			||||||
 | 
					int allocate_fd(struct Process proc, Inode inode, int flags, ...);
 | 
				
			||||||
int emmafs_open(char name[]);
 | 
					int emmafs_open(char name[]);
 | 
				
			||||||
int emmafs_close(char name[]);
 | 
					int emmafs_close(char name[]);
 | 
				
			||||||
//int emmafs_read(int fd)
 | 
					//int emmafs_read(int fd)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue