@need 3200

@node VU Native File System Access
@chapter VU Native File System Access

These functions define a trivial file-system implementation in
which all functions call their system-call equivalents.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_make_closure}@fuindex vu_sys_make_closure
@*
@example
@group
void * vu_sys_make_closure (void * closure);
@end group
@group
@end group
@end example

Return @code{closure}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_free_closure}@fuindex vu_sys_free_closure
@*
@example
@group
void vu_sys_free_closure (void * closure);
@end group
@group
@end group
@end example

A noop.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_access}@fuindex vu_sys_access
@*
@example
@group
int vu_sys_access (int * errn, char * path, int mode, void * closure);
@end group
@group
@end group
@end example

Call @code{access}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_chdir}@fuindex vu_sys_chdir
@*
@example
@group
int vu_sys_chdir (int * errn, char * path, void * closure);
@end group
@group
@end group
@end example

Call @code{chdir}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_chmod}@fuindex vu_sys_chmod
@*
@example
@group
int vu_sys_chmod (int * errn, char * path, int mode, void * closure);
@end group
@group
@end group
@end example

Call @code{chmod}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_chown}@fuindex vu_sys_chown
@*
@example
@group
int vu_sys_chown (int * errn,
                  char * path,
                  int owner,
                  int group,
                  void * closure);
@end group
@group
@end group
@end example

Call @code{chown}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_chroot}@fuindex vu_sys_chroot
@*
@example
@group
int vu_sys_chroot (int * errn, char * path, void * closure);
@end group
@group
@end group
@end example

Call @code{chroot}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_closedir}@fuindex vu_sys_closedir
@*
@example
@group
int vu_sys_closedir (int * errn, DIR * dir, void * closure);
@end group
@group
@end group
@end example

Call @code{closedir}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_close}@fuindex vu_sys_close
@*
@example
@group
int vu_sys_close (int * errn, int fd, void * closure);
@end group
@group
@end group
@end example

Call @code{close}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_fchdir}@fuindex vu_sys_fchdir
@*
@example
@group
int vu_sys_fchdir (int * errn, int fd, void * closure);
@end group
@group
@end group
@end example

Call @code{fchdir}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_fchmod}@fuindex vu_sys_fchmod
@*
@example
@group
int vu_sys_fchmod (int * errn, int fd, int mode, void * closure);
@end group
@group
@end group
@end example

Call @code{fchmod}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_fchown}@fuindex vu_sys_fchown
@*
@example
@group
int vu_sys_fchown (int * errn,
                   int fd,
                   int owner,
                   int group,
                   void * closure);
@end group
@group
@end group
@end example

Call @code{fchown}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_fstat}@fuindex vu_sys_fstat
@*
@example
@group
int vu_sys_fstat (int * errn,
                  int fd,
                  struct stat * buf,
                  void * closure);
@end group
@group
@end group
@end example

Call @code{fstat}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_fsync}@fuindex vu_sys_fsync
@*
@example
@group
int vu_sys_fsync (int * errn, int fd, void * closure);
@end group
@group
@end group
@end example

Call @code{fsync}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_ftruncate}@fuindex vu_sys_ftruncate
@*
@example
@group
int vu_sys_ftruncate (int * errn, int fd, off_t where, void * closure);
@end group
@group
@end group
@end example

Call @code{ftruncate}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_link}@fuindex vu_sys_link
@*
@example
@group
int vu_sys_link (int * errn, char * from, char * to, void * closure);
@end group
@group
@end group
@end example

Call @code{link}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_lseek}@fuindex vu_sys_lseek
@*
@example
@group
off_t vu_sys_lseek (int * errn,
                    int fd,
                    off_t offset,
                    int whence,
                    void * closure);
@end group
@group
@end group
@end example

Call @code{lseek}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_lstat}@fuindex vu_sys_lstat
@*
@example
@group
int vu_sys_lstat (int * errn,
                  char * path,
                  struct stat * buf,
                  void * closure);
@end group
@group
@end group
@end example

Call @code{lstat}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_mkdir}@fuindex vu_sys_mkdir
@*
@example
@group
int vu_sys_mkdir (int * errn, char * path, int mode, void * closure);
@end group
@group
@end group
@end example

Call @code{mkdir}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_open}@fuindex vu_sys_open
@*
@example
@group
int vu_sys_open (int * errn,
                 char * path,
                 int flags,
                 int mode,
                 void * closure);
@end group
@group
@end group
@end example

Call @code{open}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_opendir}@fuindex vu_sys_opendir
@*
@example
@group
int vu_sys_opendir (int * errn,
                    DIR ** retv,
                    char * path,
                    void * closure);
@end group
@group
@end group
@end example

Call @code{opendir}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_read}@fuindex vu_sys_read
@*
@example
@group
ssize_t vu_sys_read (int * errn,
                     int fd,
                     char * buf,
                     size_t count,
                     void * closure);
@end group
@group
@end group
@end example

Call @code{read}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_readdir}@fuindex vu_sys_readdir
@*
@example
@group
int vu_sys_readdir (int * errn,
                    struct alloc_limits * limits,
                    char ** file_ret,
                    DIR * dir,
                    void * closure);
@end group
@group
@end group
@end example

Call @code{readdir}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_readlink}@fuindex vu_sys_readlink
@*
@example
@group
int vu_sys_readlink (int * errn,
                     char * path,
                     char * buf,
                     int bufsize,
                     void * closure);
@end group
@group
@end group
@end example

Call @code{readlink}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_rename}@fuindex vu_sys_rename
@*
@example
@group
int vu_sys_rename (int * errn, char * from, char * to, void * closure);
@end group
@group
@end group
@end example

Call @code{rename}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_rmdir}@fuindex vu_sys_rmdir
@*
@example
@group
int vu_sys_rmdir (int * errn, char * path, void * closure);
@end group
@group
@end group
@end example

Call @code{rmdir}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_stat}@fuindex vu_sys_stat
@*
@example
@group
int vu_sys_stat (int * errn,
                 char * path,
                 struct stat * buf,
                 void * closure);
@end group
@group
@end group
@end example

Call @code{stat}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_symlink}@fuindex vu_sys_symlink
@*
@example
@group
int vu_sys_symlink (int * errn, char * from, char * to, void * closure);
@end group
@group
@end group
@end example

Call @code{symlink}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_truncate}@fuindex vu_sys_truncate
@*
@example
@group
int vu_sys_truncate (int * errn,
                     char * path,
                     off_t where,
                     void * closure);
@end group
@group
@end group
@end example

Call @code{truncate}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_unlink}@fuindex vu_sys_unlink
@*
@example
@group
int vu_sys_unlink (int * errn, char * path, void * closure);
@end group
@group
@end group
@end example

Call @code{unlink}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_utime}@fuindex vu_sys_utime
@*
@example
@group
int vu_sys_utime (int * errn,
                  char * path,
                  struct utimbuf * times,
                  void * closure);
@end group
@group
@end group
@end example

Call @code{utime}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_write}@fuindex vu_sys_write
@*
@example
@group
ssize_t vu_sys_write (int * errn,
                      int fd,
                      char * buf,
                      size_t count,
                      void * closure);
@end group
@group
@end group
@end example

Call @code{write}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_fcntl}@fuindex vu_sys_fcntl
@*
@example
@group
int vu_sys_fcntl (int * errn,
                  int fd,
                  int cmd,
                  long arg,
                  void * closure);
@end group
@group
@end group
@end example

Call @code{fcntl}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_dup}@fuindex vu_sys_dup
@*
@example
@group
int vu_sys_dup (int * errn, int fd, void * closure);
@end group
@group
@end group
@end example

Call @code{dup}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_dup2}@fuindex vu_sys_dup2
@*
@example
@group
int vu_sys_dup2 (int * errn, int fd, int newfd, void * closure);
@end group
@group
@end group
@end example

Call @code{dup2}.

@sp 1
@need 1750
@noindent
@b{* Function} @code{vu_sys_move_state}@fuindex vu_sys_move_state
@*
@example
@group
int vu_sys_move_state (int * errn, int fd, int newfd, void * closure);
@end group
@group
@end group
@end example

A noop (return @code{0}).




