public IOItem(int pid, string filename, short fd, AccessType access, AccessRoutine routine, long pos, long length, FDType type) { Pid = pid; Filename = filename; FDNum = fd; FDType = type; Access = access; Routine = routine; Position = pos; Length = length; }
public IOItem(int pid, string filename, short fd, AccessType access, AccessRoutine routine, long pos, long length) : this(pid, filename, fd, access, routine, pos, length, FDType.File) { }
public IOItem OnReadWrite(AccessRoutine routine, string args, long ret) { int fd = GetFirstNumeric(args); FileState fs; if (!curFiles.TryGetValue(fd, out fs)) { fs = new FileState("/Unknown-FD/" + fd.ToString(), FDType.Unknown); curFiles[fd] = fs; } AccessType type = (routine == AccessRoutine.Read || routine == AccessRoutine.Readv || routine == AccessRoutine.Pread) ? AccessType.Read : AccessType.Write; long pos; if (routine == AccessRoutine.Pread || routine == AccessRoutine.Pwrite) { string[] argss = args.Split(argumentSplitter, StringSplitOptions.None); pos = argss[argss.Length - 1].ParseHexLong(); } else { pos = fs.Position; fs.Position += ret; } return new IOItem(pid, fs.Filename, (short)fd, type, routine, pos, ret, fs.FDType); }