libc: Add unimplemented st_nlink field

This commit is contained in:
apio 2022-11-09 11:36:21 +01:00
parent 033c41cbd7
commit accf7ee417
2 changed files with 10 additions and 2 deletions

View File

@ -13,7 +13,8 @@ struct stat // FIXME: This struct is quite stubbed out.
ino_t st_ino;
mode_t st_mode;
off_t st_size;
int st_dev; // FIXME: Implement this.
int st_dev; // FIXME: Implement this.
int st_nlink; // FIXME: Implement this.
uid_t st_uid;
gid_t st_gid;
time_t st_atime;
@ -37,6 +38,8 @@ void do_stat(Context* context, VFS::Node* node, struct stat* buf)
kstat->st_atime = node->atime;
kstat->st_ctime = node->ctime;
kstat->st_mtime = node->mtime;
kstat->st_dev = 0;
kstat->st_nlink = 0;
release_user_ref(kstat);
context->rax = 0;
}

View File

@ -9,7 +9,8 @@ struct stat // FIXME: This struct is quite stubbed out.
ino_t st_ino;
mode_t st_mode;
off_t st_size;
int st_dev; // Not implemented.
int st_dev; // Not implemented.
int st_nlink; // Not implemented.
uid_t st_uid;
gid_t st_gid;
time_t st_atime;
@ -35,6 +36,10 @@ struct stat // FIXME: This struct is quite stubbed out.
/* Is it a character device? */
#define S_ISCHR(mode) (__S_IFCMP((mode), S_IFCHR))
// Not implemented.
#define S_ISBLK(mode) ((mode)&0)
#define S_ISFIFO(mode) ((mode)&0)
#define S_IRWXU 0700
#define S_IRUSR 0400
#define S_IWUSR 0200