UbixOS V2 2.0

Data Structures | Macros | Typedefs | Functions
descrip.h File Reference
`#include <sys/thread.h>`
`#include <sys/sysproto_posix.h>`
`#include <vfs/file.h>`
`#include <vfs/stat.h>`
`#include <sys/fcntl.h>`
Include dependency graph for descrip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | file
struct | fileOps
struct | ucred
struct | uio

## Macros
#define | MAX_FILES 256

## Typedefs
typedef int | fo_close_t(struct file *fp, struct thread *td)
typedef int | fo_rdwr_t(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td)
typedef int | fo_stat_t(struct file *fp, struct stat *sb, struct ucred *active_cred, struct thread *td)
typedef __mode_t | mode_t
typedef __nlink_t | nlink_t

## Functions
int | close (struct thread *, struct close_args *)
int | falloc (struct thread *, struct file **, int *)
int | fcntl (struct thread *, struct sys_fcntl_args *)
int | fstat (struct thread *, struct sys_fstat_args *)
int | getdtablesize (struct thread *, struct getdtablesize_args *)
| return data table size More...
int | getfd (struct thread *td, struct file **fp, int fd)
| get pointer to file fd in specified thread More...
| int_kern_openat (struct thread *, int, char *, int)
int | ioctl (struct thread *, struct ioctl_args *)
| ioctl functionality not implimented yet More...

## Macro Definition Documentation

## ◆ MAX_FILES

#define MAX_FILES 256

Definition at line 42 of file descrip.h.

## Typedef Documentation

## ◆ fo_close_t

typedef int fo_close_t(struct file *fp, struct thread *td)

Definition at line 57 of file descrip.h.

## ◆ fo_rdwr_t

typedef int fo_rdwr_t(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td)

Definition at line 55 of file descrip.h.

## ◆ fo_stat_t

typedef int fo_stat_t(struct file *fp, struct stat *sb, struct ucred *active_cred, struct thread *td)

Definition at line 56 of file descrip.h.

## ◆ mode_t

typedef __mode_t mode_t

Definition at line 44 of file descrip.h.

## ◆ nlink_t

typedef __nlink_t nlink_t

Definition at line 45 of file descrip.h.

## Function Documentation

## ◆ close()

int close | ( | struct thread * | ,
|  | struct close_args * |
| ) |  |

Definition at line 162 of file descrip.c.

References close_args::fd, kfree(), kprintf(), thread::o_files, and thread::td_retval.

Here is the call graph for this function:

## ◆ falloc()

int falloc | ( | struct thread * | ,
|  | struct file ** | ,
|  | int * |
| ) |  |

Definition at line 96 of file descrip.c.

References kfree(), kmalloc(), MAX_FILES, and thread::o_files.

Referenced by kern_openat(), pipe(), sys_openat(), sys_pipe2(), and sys_socket().

Here is the call graph for this function:

## ◆ fcntl()

int fcntl | ( | struct thread * | ,
|  | struct sys_fcntl_args * |
| ) |  |

Definition at line 40 of file descrip.c.

References sys_fcntl_args::arg, sys_fcntl_args::cmd, file::f_flag, fclose(), FCNTLFLAGS, sys_fcntl_args::fd, fdestroy(), FFLAGS, kmalloc(), kprintf(), MAX_FILES, memcpy(), O_ACCMODE, thread::o_files, and thread::td_retval.

Referenced by sys_fcntl().

Here is the call graph for this function:

## ◆ fstat()

int fstat | ( | struct thread * | ,
|  | struct sys_fstat_args * |
| ) |  |

Definition at line 185 of file descrip.c.

References _current, sys_fstat_args::fd, kprintf(), thread::o_files, sys_fstat_args::sb, stat::st_blksize, stat::st_mode, and taskStruct::td.

Here is the call graph for this function:

## ◆ getdtablesize()

int getdtablesize | ( | struct thread * | ,
|  | struct getdtablesize_args * |
| ) |  |

return data table size

Definition at line 176 of file descrip.c.

References kprintf(), O_FILES, and thread::td_retval.

Here is the call graph for this function:

## ◆ getfd()

int getfd | ( | struct thread * | td,
|  | struct file ** | fp,
|  | int | fd
| ) |  |

get pointer to file fd in specified thread

Returns
  returns fp

Definition at line 214 of file descrip.c.

References file::fd, kprintf(), and thread::o_files.

Referenced by read(), sys_close(), sys_fchdir(), sys_fstat(), sys_fstatat(), sys_fstatfs(), sys_getdirentries(), sys_lseek(), sys_mmap(), sys_pread(), sys_read(), sys_sendto(), sys_setsockopt(), and sys_write().

Here is the call graph for this function:

## ◆ int_kern_openat()

int_kern_openat | ( | struct thread * | ,
|  | int | ,
|  | char * | ,
|  | int |
| ) |  |

## ◆ ioctl()

int ioctl | ( | struct thread * | td,
|  | struct ioctl_args * | uap
| ) |  |

ioctl functionality not implimented yet

Returns
  NULL for now

Definition at line 204 of file descrip.c.

References thread::td_retval.