コード例 #1
0
ファイル: Syscalls.cs プロジェクト: valentinbreiz/Sharpen
        /// <summary>
        /// Gets the file status of a path
        /// </summary>
        /// <param name="path">The path</param>
        /// <param name="st">The stat structure</param>
        /// <returns>The errorcode</returns>
        public static unsafe ErrorCode Stat(string path, Stat *st)
        {
            Node node = VFS.GetByPath(path);

            if (node == null)
            {
                return(ErrorCode.ENOENT);
            }

            node.Stat(st);
            Heap.Free(node);
            return(ErrorCode.SUCCESS);
        }
コード例 #2
0
ファイル: Syscalls.cs プロジェクト: valentinbreiz/Sharpen
        /// <summary>
        /// Gets the file status of a descriptor
        /// </summary>
        /// <param name="descriptor">The descriptor ID</param>
        /// <param name="st">The stat structure</param>
        /// <returns>The errorcode</returns>
        public static unsafe ErrorCode FStat(int descriptor, Stat *st)
        {
            FileDescriptors descriptors = Tasking.CurrentTask.FileDescriptors;

            Node node = descriptors.GetNode(descriptor);

            if (node == null)
            {
                return(ErrorCode.EBADF);
            }

            node.Stat(st);
            return(ErrorCode.SUCCESS);
        }
コード例 #3
0
ファイル: Node.cs プロジェクト: valentinbreiz/Sharpen
        /// <summary>
        /// Creates the stat structure
        /// </summary>
        /// <param name="st"></param>
        public unsafe void Stat(Stat *st)
        {
            st->st_dev  = 0;
            st->st_rdev = 0;
            st->st_ino  = 0;
            st->st_size = VFS.GetSize(this);

            st->st_mode = 0;
            st->st_uid  = 0;
            st->st_gid  = 0;

            st->st_atime = 0;
            st->st_mtime = 0;
            st->st_ctime = 0;

            st->st_nlink   = 1;
            st->st_blksize = 0;
            st->st_blkcnt  = 0;
        }
コード例 #4
0
 private static extern unsafe int fstatInternal(int fd, Stat *st);