public static Int32 FromFcntlCommand(FcntlCommand value) { Int32 rval; if (FromFcntlCommand (value, out rval) == -1) ThrowArgumentException (value); return rval; }
public int _OnLockHandle(string file, IntPtr fi, int cmd, IntPtr lockp) { Errno errno; try { PathInfo info = new PathInfo(); PathInfo.CopyFromPtr(fi, info); FcntlCommand _cmd = NativeConvert.ToFcntlCommand(cmd); Flock @lock; Interop.CopyFlock(lockp, out @lock); errno = _filesystem.OnLockHandle(file, info, _cmd, ref @lock); if (errno == 0) { Interop.CopyFlock(ref @lock, lockp); PathInfo.CopyToPtr(info, fi); } } catch (Exception e) { Trace.WriteLine(e.ToString()); errno = Errno.EIO; } return(Interop.ConvertErrno(errno)); }
protected override Errno OnLockHandle(string file, OpenedPathInfo info, FcntlCommand cmd, ref Flock @lock) { Flock _lock = @lock; Errno e = ProcessFile(basedir + file, info.OpenFlags, fd => Syscall.fcntl(fd, cmd, ref _lock)); @lock = _lock; return(e); }
protected override Errno OnLockHandle(string path, OpenedPathInfo info, FcntlCommand cmd, ref Flock @lock) { logger.Info($"OnLockHandle({path}, {info}, {cmd}, {@lock.l_type})..."); var error = OnOpenHandle(path, info); logger.Info($"OnLockHandle({path}, {info}, {cmd}, {@lock.l_type}) -> {error}"); return(error); }
protected override Errno OnLockHandle(string file, OpenedPathInfo info, FcntlCommand cmd, ref Flock @lock) { int r = Syscall.fcntl((int)info.Handle, cmd, ref @lock); if (r == -1) { return(Stdlib.GetLastError()); } return(0); }
public static Int32 FromFcntlCommand(FcntlCommand value) { Int32 rval; if (FromFcntlCommand(value, out rval) == -1) { ThrowArgumentException(value); } return(rval); }
public override Errno OnLockHandle(string file, PathInfo info, FcntlCommand cmd, ref Flock @lock) { Trace.WriteLine($"OnLockHandle {file}"); int fd = info.Handle.ToInt32(); int r = Syscall.fcntl(fd, cmd, ref @lock); if (r < 0) { return(GetLastError()); } return(0); }
public Errno Lock(string path, OpenFlags openFlags, FcntlCommand cmd, ref Flock @lock) { { #if DEBUG new CrazyFsRequest(CrazyFsRequestName.Lock, new[] { new KeyValuePair <string, string>("path", path) }).Log(); #endif // ReSharper disable once InconsistentNaming var _lock = @lock; var e = ProcessFile(path, openFlags, fd => Syscall.fcntl(fd, cmd, ref _lock)); @lock = _lock; return(e); } }
private static extern int FromFcntlCommand(FcntlCommand value, out Int32 rval);
public static bool TryFromFcntlCommand(FcntlCommand value, out Int32 rval) { return(FromFcntlCommand(value, out rval) == 0); }
protected override Errno OnLockHandle(string file, OpenedPathInfo info, FcntlCommand cmd, ref Flock @lock) => Errno.EOPNOTSUPP;
public static int fcntl(int fd, FcntlCommand cmd, ref Flock @lock) { throw new System.NotImplementedException(); }
protected override Errno OnLockHandle(string file, OpenedPathInfo info, FcntlCommand cmd, ref Flock @lock) { Flock _lock = @lock; Errno e = ProcessFile (basedir+file, info.OpenFlags, fd => Syscall.fcntl (fd, cmd, ref _lock)); @lock = _lock; return e; }
public static extern int fcntl (int fd, FcntlCommand cmd, long arg);
public static bool TryFromFcntlCommand (FcntlCommand value, out Int32 rval) { return FromFcntlCommand (value, out rval) == 0; }
public static int fcntl(int fd, FcntlCommand cmd, long arg) { throw new System.NotImplementedException(); }
public static extern int fcntl (int fd, FcntlCommand cmd);
public static bool TryToFcntlCommand(Int32 value, out FcntlCommand rval) { return(ToFcntlCommand(value, out rval) == 0); }
public static int fcntl (int fd, FcntlCommand cmd, ref Flock @lock) { throw new System.NotImplementedException(); }
public static int fcntl (int fd, FcntlCommand cmd, long arg) { throw new System.NotImplementedException(); }
public static extern int fcntl (int fd, FcntlCommand cmd, ref Flock @lock);
public static int fcntl (int fd, FcntlCommand cmd, DirectoryNotifyFlags arg) { if (cmd != FcntlCommand.F_NOTIFY) { SetLastError (Error.EINVAL); return -1; } long _arg = UnixConvert.FromDirectoryNotifyFlags (arg); return fcntl (fd, FcntlCommand.F_NOTIFY, _arg); }
private static extern int ToFcntlCommand(Int32 value, out FcntlCommand rval);
public static bool TryToFcntlCommand (Int32 value, out FcntlCommand rval) { return ToFcntlCommand (value, out rval) == 0; }
private static extern int FromFcntlCommand (FcntlCommand value, out Int32 rval);
private static int FromFcntlCommand(FcntlCommand value, out Int32 rval) { throw new System.NotImplementedException(); }
private static extern int ToFcntlCommand (Int32 value, out FcntlCommand rval);
public virtual Errno OnLockHandle( string file, PathInfo info, FcntlCommand cmd, ref Flock @lock) { return(Errno.ENOSYS); }
protected override Errno OnLockHandle(string file, OpenedPathInfo info, FcntlCommand cmd, ref Flock @lock) { int r = Syscall.fcntl((int)info.Handle, cmd, ref @lock); return(GetResult(r)); }
protected override Errno OnLockHandle(string file, OpenedPathInfo info, FcntlCommand cmd, ref Flock @lock) { int r = Syscall.fcntl ((int) info.Handle, cmd, ref @lock); if (r == -1) return Stdlib.GetLastError (); return 0; }
protected override Errno OnLockHandle(string file, OpenedPathInfo info, FcntlCommand cmd, ref Flock @lock) { return(_fileSystem.Lock(file, (OpenFlags)info.OpenFlags, cmd, ref @lock)); }
private static int ToFcntlCommand(Int32 value, out FcntlCommand rval) { throw new System.NotImplementedException(); }
private static int FromFcntlCommand (FcntlCommand value, out Int32 rval) { throw new System.NotImplementedException(); }
private static int ToFcntlCommand (Int32 value, out FcntlCommand rval) { throw new System.NotImplementedException(); }