Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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)
 {
 }
Exemplo n.º 3
0
		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);			
		}