File operations#

syscalls_fileOpen#

GETFROMSTACK(ustack, unsigned int *, h, 0);
GETFROMSTACK(ustack, oid_t *, oid, 1);
GETFROMSTACK(ustack, unsigned int, mode, 2);

Adds file given by oid to process resources. Added process resource is identified by handle returned in h variable. The access mode is set to mode.

syscalls_fileOpen (syscalls_sys_open)#

GETFROMSTACK(ustack, const char *, filename, 0);
GETFROMSTACK(ustack, int, oflag, 1);

syscalls_fileClose#

GETFROMSTACK(ustack, unsigned int, h, 0);

Removes file given by h from resources of calling process.

syscalls_fileRead (syscalls_sys_read)#

GETFROMSTACK(ustack, int, fildes, 0);
GETFROMSTACK(ustack, void *, buf, 1);
GETFROMSTACK(ustack, size_t, nbyte, 2);

syscalls_fileWrite (syscalls_sys_write)#

GETFROMSTACK(ustack, int, fildes, 0);
GETFROMSTACK(ustack, void *, buf, 1);
GETFROMSTACK(ustack, size_t, nbyte, 2);

syscalls_fileClose (syscalls_sys_close)#

GETFROMSTACK(ustack, int, fildes, 0);

syscalls_fileCtl (syscalls_sys_fcntl)#

GETFROMSTACK(ustack, unsigned int, fd, 0);
GETFROMSTACK(ustack, unsigned int, cmd, 1);

syscalls_fileTrunc (syscalls_sys_ftruncate)#

GETFROMSTACK(ustack, int, fildes, 0);
GETFROMSTACK(ustack, off_t, length, 1);

syscalls_fileSeek (syscalls_sys_lseek)#

GETFROMSTACK(ustack, int, fildes, 0);
GETFROMSTACK(ustack, off_t, offset, 1);
GETFROMSTACK(ustack, int, whence, 2);

syscalls_fileDup (syscalls_sys_dup)#

GETFROMSTACK(ustack, int, fildes, 0);

syscalls_fileDup2 (syscalls_sys_dup2)#

GETFROMSTACK(ustack, int, fildes, 0);
GETFROMSTACK(ustack, int, fildes2, 1);

syscalls_filePipe (syscalls_sys_pipe)#

GETFROMSTACK(ustack, int *, fildes, 0);

syscalls_fileMakeFifo (syscalls_sys_mkfifo)#

GETFROMSTACK(ustack, const char *, path, 0);
GETFROMSTACK(ustack, mode_t, mode, 1);

syscalls_fileChangeMode (syscalls_sys_chmod)#

GETFROMSTACK(ustack, const char *, path, 0);
GETFROMSTACK(ustack, mode_t, mode, 1);

syscalls_fileStat (syscalls_sys_fstat)#

GETFROMSTACK(ustack, int, fd, 0);
GETFROMSTACK(ustack, struct stat *, buf, 1);

syscalls_fileIoCtl (syscalls_sys_ioctl)#

GETFROMSTACK(ustack, int, fildes, 0);
GETFROMSTACK(ustack, unsigned long, request, 1);

syscalls_fileTimes (syscalls_sys_utimes)#

GETFROMSTACK(ustack, const char *, filename, 0);
GETFROMSTACK(ustack, const struct timeval *, times, 1);

syscalls_filePoll (syscalls_sys_poll)#

GETFROMSTACK(ustack, struct pollfd *, fds, 0);
GETFROMSTACK(ustack, nfds_t, nfds, 1);
GETFROMSTACK(ustack, int, timeout_ms, 2);

See also#

  1. System calls

  2. Table of Contents