9 mono_wrapper_seek (int fd, gint64 offset, gint32 whence)
11 if (offset > INT_MAX || offset < INT_MIN)
14 return lseek (fd, offset, whence);
18 mono_wrapper_read (int fd, void* buf, gint32 count)
20 return read (fd, buf, count);
24 mono_wrapper_write (int fd, void* buf, gint32 count)
26 return write (fd, buf, count);
30 mono_wrapper_fstat (int fd, MonoWrapperStat* buf)
34 if (fstat (fd, &fs) != 0)
37 buf->st_dev = fs.st_dev;
38 buf->st_mode = fs.st_mode;
39 buf->st_nlink = fs.st_nlink;
40 buf->st_uid = fs.st_uid;
41 buf->st_gid = fs.st_gid;
42 buf->st_size = fs.st_size;
43 buf->st_atime = fs.st_atime;
44 buf->st_mtime = fs.st_ctime;
45 buf->st_ctime = fs.st_ctime;
51 mono_wrapper_ftruncate (int fd, gint64 length)
53 if (length > INT_MAX || length < INT_MIN)
56 return ftruncate (fd, length);
60 mono_wrapper_open (const char * path, gint32 flags, gint32 mode)
62 return open (path, flags, mode);
66 mono_wrapper_close (int fd)
72 mono_wrapper_stat (const char * path, MonoWrapperStat* buf)
76 if (stat (path, &fs) != 0)
79 buf->st_dev = fs.st_dev;
80 buf->st_mode = fs.st_mode;
81 buf->st_nlink = fs.st_nlink;
82 buf->st_uid = fs.st_uid;
83 buf->st_gid = fs.st_gid;
84 buf->st_size = fs.st_size;
85 buf->st_atime = fs.st_atime;
86 buf->st_mtime = fs.st_ctime;
87 buf->st_ctime = fs.st_ctime;
93 mono_wrapper_unlink (const char * path)
99 mono_wrapper_opendir (const char * path)
\r
101 return (int)opendir(path);
\r
105 mono_wrapper_readdir (int dir)
\r
107 struct dirent* p = readdir((DIR*)dir);
\r
108 return p != NULL ? p->d_name : NULL;
\r
112 mono_wrapper_closedir (int dir)
\r
114 return closedir((DIR*)dir);
\r
118 mono_wrapper_getenv (const char * variable)
\r
120 return (int)getenv(variable);
\r
124 mono_wrapper_environ ()
\r
126 return (int)environ;
\r