public int ArchFStat64(Thread current, UserPtr buf) { var ret = IPCStubs.linux_sys_fstat64(current.Parent.helperPid, Fd); if (ret < 0) { return(ret); } if (buf.Write(current, new Pointer(Globals.LinuxIPCBuffer.Location), GenericINode.SIZE_OF_STAT64) != 0) { return(-ErrorCode.EFAULT); } return(0); }
public static ArchINode Open(int helperPid, ASCIIString fileName, int flag, int mode, out ErrorCode ec) { var fd = OpenAndReturnLinuxFd(helperPid, fileName, flag, mode); if (fd < 0) { ec.Code = -fd; return(null); } var ret = IPCStubs.linux_sys_fstat64(helperPid, fd); uint size = 0; if (ret >= 0) { size = (uint)FileSystem.GetSizeFromStat64(Globals.LinuxIPCBuffer); } ec.Code = ErrorCode.NoError; return(new ArchINode(fd, size, helperPid)); }