forked from Bananymous/banan-os
Kernel: fix stat command and device numbers
This commit is contained in:
@@ -104,13 +104,13 @@ namespace Kernel
|
||||
TRY(validate_fd(fd));
|
||||
const auto& open_fd = open_file_description(fd);
|
||||
|
||||
out->st_dev = 0;
|
||||
out->st_dev = open_fd.inode->dev();
|
||||
out->st_ino = open_fd.inode->ino();
|
||||
out->st_mode = open_fd.inode->mode();
|
||||
out->st_nlink = open_fd.inode->nlink();
|
||||
out->st_uid = open_fd.inode->uid();
|
||||
out->st_gid = open_fd.inode->gid();
|
||||
out->st_rdev = 0;
|
||||
out->st_rdev = open_fd.inode->rdev();
|
||||
out->st_size = open_fd.inode->size();
|
||||
out->st_atim = open_fd.inode->atime();
|
||||
out->st_mtim = open_fd.inode->mtime();
|
||||
|
||||
@@ -447,8 +447,11 @@ argument_done:
|
||||
|
||||
TTY_PRINTLN(" File: {}", arguments[1]);
|
||||
TTY_PRINTLN(" Size: {}\tBlocks: {}\tIO Block: {}\t {}", st.st_size, st.st_blocks, st.st_blksize, type);
|
||||
TTY_PRINTLN("Device: {},{}\tInode: {}\tLinks: {}", st.st_dev, st.st_rdev, st.st_ino, st.st_nlink);
|
||||
TTY_PRINTLN("Access: ({}/{})\tUid: {}\tGid: {}", st.st_mode, mode_string(st.st_mode), st.st_uid, st.st_gid);
|
||||
TTY_PRINT("Device: {},{}\tInode: {}\tLinks: {}", st.st_dev >> 8, st.st_dev & 0xFF, st.st_ino, st.st_nlink);
|
||||
if (st.st_rdev)
|
||||
TTY_PRINT("\tDevice type: {},{}", st.st_rdev >> 8, st.st_rdev & 0xFF);
|
||||
TTY_PRINTLN("");
|
||||
TTY_PRINTLN("Access: ({4O}/{})\tUid: {}\tGid: {}", st.st_mode & 0777, mode_string(st.st_mode), st.st_uid, st.st_gid);
|
||||
TTY_PRINTLN("Access: {}", BAN::from_unix_time(st.st_atime));
|
||||
TTY_PRINTLN("Modify: {}", BAN::from_unix_time(st.st_mtime));
|
||||
TTY_PRINTLN("Change: {}", BAN::from_unix_time(st.st_ctime));
|
||||
|
||||
Reference in New Issue
Block a user