/* Copyright 2002 Johan Rydberg, jrydberg@rtmk.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Try to open FILENAME. FLAGS is one of O_RDONLY, O_WRONLY or O_RDWR which request opening the file read-only, write-only or read/write, respectively, bitwise-or'd with zero or more of the following: O_CREAT, O_EXCL, ... MODE specifies the permissions to use in case a new file is created. Return the new file descriptor in *FDP. */ int nova_S_io_open (struct proc *p, char *filename, int filename_length, int flags, int mode, int *fdp); /* Write LENGTH bytes from BUF into file FD. Return number of bytes actual written in *ACTUAL. */ int nova_S_io_write (struct proc *p, int fd, char *buf, size_t length, int *actual); /* Read LENGTH bytes into BUF from file FD. Return numerb of bytes actual read in *ACTUALP. ??? use RPC for copy buffer */ int nova_S_io_read (struct proc *p, int fd, char *buf, size_t *length, int *actualp); /* Duplicate file descriptor FD. If ANY_P is true we can select any new file descriptor. If not, *FDP is the file descriptor we want. New file descriptor is returned in *FDP. */ int nova_S_io_dup (struct proc *p, int fd, int any_p, int *fdp); /* Try to map file FD into proc P's address space. Return object for reading in *READOBJ, and object for writing on *WRITEOBJ. They may be the same. */ int nova_S_io_map (struct proc *p, int fd, rtmk_port_t *readobj, rtmk_port_t *writeobj); /* Reposition read/write file offset for file FD. to the argument OFF according to the directive WHENCE. */ int nova_S_io_seek (struct proc *p, int fd, int off, int whence); /* Read directory entries from directory FD. Entries will be put into buffer BUF. BUFSIZE is maximum size of entries. */ int nova_S_io_readdir (struct proc *p, int fd, void *buf, int *bufsize, int *eofp); /* Get information about FILENAME. Put info in BUF. */ int nova_S_io_stat (struct proc *p, char *filename, int filename_length, void *buf, int *buf_length);