UbixOS  2.0
file.h File Reference
#include <sys/types.h>
#include <ubixfs/dirCache.h>
#include <sys/thread.h>
#include <vfs/inode.h>
#include <vfs/mount.h>
#include <ufs/ufs.h>
Include dependency graph for file.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dmadat
 
struct  fileDescriptor
 
struct  sys_fwrite_args
 
struct  userFileDescriptorStruct
 

Macros

#define DEV_BSHIFT   9 /* log2(DEV_BSIZE) */
 
#define DEV_BSIZE   (1<<DEV_BSHIFT)
 
#define MAX_OFILES   256
 
#define SBLOCKSIZE   8192
 
#define SEEK_CUR   1
 
#define SEEK_END   2
 
#define SEEK_SET   0
 
#define VBLKSHIFT   12
 
#define VBLKSIZE   (1 << VBLKSHIFT)
 

Typedefs

typedef struct fileDescriptor fileDescriptor_t
 
typedef struct userFileDescriptorStruct userFileDescriptor
 

Functions

int fclose (fileDescriptor_t *)
 
int feof (fileDescriptor_t *fd)
 
int fgetc (fileDescriptor_t *fd)
 
fileDescriptor_tfopen (const char *, const char *)
 
size_t fread (void *ptr, size_t size, size_t nmemb, fileDescriptor_t *fd)
 
int fseek (fileDescriptor_t *, long, int)
 
size_t fwrite (void *ptr, int size, int nmemb, fileDescriptor_t *fd)
 
int getchar ()
 
int sys_fwrite (struct thread *, struct sys_fwrite_args *)
 
int sysFseek (userFileDescriptor *, long, int)
 
int unlink (const char *path)
 
char * verifyDir (const char *path)
 

Variables

fileDescriptor_tfdTable
 

Macro Definition Documentation

◆ DEV_BSHIFT

#define DEV_BSHIFT   9 /* log2(DEV_BSIZE) */

Definition at line 50 of file file.h.

◆ DEV_BSIZE

#define DEV_BSIZE   (1<<DEV_BSHIFT)

Definition at line 51 of file file.h.

◆ MAX_OFILES

#define MAX_OFILES   256

Definition at line 53 of file file.h.

◆ SBLOCKSIZE

#define SBLOCKSIZE   8192

Definition at line 49 of file file.h.

◆ SEEK_CUR

#define SEEK_CUR   1

Definition at line 44 of file file.h.

◆ SEEK_END

#define SEEK_END   2

Definition at line 45 of file file.h.

◆ SEEK_SET

#define SEEK_SET   0

Definition at line 43 of file file.h.

◆ VBLKSHIFT

#define VBLKSHIFT   12

Definition at line 47 of file file.h.

◆ VBLKSIZE

#define VBLKSIZE   (1 << VBLKSHIFT)

Definition at line 48 of file file.h.

Typedef Documentation

◆ fileDescriptor_t

◆ userFileDescriptor

Function Documentation

◆ fclose()

int fclose ( fileDescriptor_t )

Definition at line 533 of file file.c.

References file::fd, and spinLock().

Referenced by _sys_stat(), dup2(), elf_load_file(), execFile(), fcntl(), kmod_load(), ldEnable(), sys_close(), sys_fclose(), sys_fstatat(), sysExec(), sysMkDir(), and systemTask().

Here is the call graph for this function:

◆ feof()

int feof ( fileDescriptor_t fd)

Definition at line 343 of file file.c.

References file::fd, fdEof, and fileDescriptor::status.

◆ fgetc()

int fgetc ( fileDescriptor_t fd)

Definition at line 372 of file file.c.

References file::fd, vfs_mountPoint::fs, kprintf(), fileDescriptor::mp, fileDescriptor::offset, and fileSystem::vfsRead.

Referenced by sys_fgetc().

Here is the call graph for this function:

◆ fopen()

◆ fread()

◆ fseek()

int fseek ( fileDescriptor_t ,
long  ,
int   
)

Definition at line 332 of file file.c.

Referenced by elf_load_file(), execFile(), kmod_load(), ldEnable(), sys_mmap(), and sysExec().

◆ fwrite()

size_t fwrite ( void *  ptr,
int  size,
int  nmemb,
fileDescriptor_t fd 
)

Definition at line 317 of file file.c.

Referenced by sys_fwrite(), sys_write(), and sysFwrite().

◆ getchar()

int getchar ( )

Definition at line 343 of file atkbd.c.

References tty_foreground.

Referenced by sys_fgetc(), sys_pread(), and sys_read().

◆ sys_fwrite()

int sys_fwrite ( struct thread ,
struct sys_fwrite_args  
)

◆ sysFseek()

int sysFseek ( userFileDescriptor ,
long  ,
int   
)

◆ unlink()

int unlink ( const char *  path)

Definition at line 629 of file file.c.

◆ verifyDir()

char* verifyDir ( const char *  path)

Variable Documentation

◆ fdTable

fileDescriptor_t* fdTable

Definition at line 45 of file file.c.