public static Int32 FromFcntlCommand(FcntlCommand value)
 {
     Int32 rval;
     if (FromFcntlCommand (value, out rval) == -1)
         ThrowArgumentException (value);
     return rval;
 }
Esempio n. 2
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 8
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);
 }
Esempio n. 11
0
 protected override Errno OnLockHandle(string file, OpenedPathInfo info, FcntlCommand cmd, ref Flock @lock) =>
 Errno.EOPNOTSUPP;
Esempio n. 12
0
 public static int fcntl(int fd, FcntlCommand cmd, ref Flock @lock)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 13
0
 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;
 }
Esempio n. 14
0
		public static extern int fcntl (int fd, FcntlCommand cmd, long arg);
Esempio n. 15
0
		public static bool TryFromFcntlCommand (FcntlCommand value, out Int32 rval)
		{
			return FromFcntlCommand (value, out rval) == 0;
		}
Esempio n. 16
0
 public static int fcntl(int fd, FcntlCommand cmd, long arg)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 17
0
		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();
		}
Esempio n. 21
0
		public static extern int fcntl (int fd, FcntlCommand cmd, ref Flock @lock);
Esempio n. 22
0
		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);
		}
Esempio n. 23
0
		public static extern int fcntl (int fd, FcntlCommand cmd, long arg);
 private static extern int ToFcntlCommand(Int32 value, out FcntlCommand rval);
Esempio n. 25
0
		public static bool TryToFcntlCommand (Int32 value, out FcntlCommand rval)
		{
			return ToFcntlCommand (value, out rval) == 0;
		}
Esempio n. 26
0
		private static extern int FromFcntlCommand (FcntlCommand value, out Int32 rval);
Esempio n. 27
0
 private static int FromFcntlCommand(FcntlCommand value, out Int32 rval)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 28
0
		private static extern int ToFcntlCommand (Int32 value, out FcntlCommand rval);
Esempio n. 29
0
		public static extern int fcntl (int fd, FcntlCommand cmd, ref Flock @lock);
Esempio n. 30
0
 public virtual Errno OnLockHandle(
     string file, PathInfo info, FcntlCommand cmd, ref Flock @lock)
 {
     return(Errno.ENOSYS);
 }
Esempio n. 31
0
        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));
        }
Esempio n. 32
0
 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));
 }
Esempio n. 34
0
 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();
		}
Esempio n. 37
0
		public static extern int fcntl (int fd, FcntlCommand cmd);