From 3a369468f7daae5b3a60feaa50c6050b240be6d4 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Tue, 14 Feb 2023 17:48:12 +0100 Subject: add colors to ls --- lib/sys/getdents.h | 4 ++-- lib/sys/stat.h | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sys/getdents.h b/lib/sys/getdents.h index b5a0c74..5efa3db 100644 --- a/lib/sys/getdents.h +++ b/lib/sys/getdents.h @@ -3,12 +3,12 @@ #include "syscalls.h" -struct dirent { +typedef struct { unsigned long d_ino; unsigned long d_off; unsigned short d_reclen; char d_name[]; -}; +} dirent_t; static int getdents(unsigned int fd, char *buf, unsigned int count) { diff --git a/lib/sys/stat.h b/lib/sys/stat.h index 0e02295..9fc5eda 100644 --- a/lib/sys/stat.h +++ b/lib/sys/stat.h @@ -60,4 +60,17 @@ static int stat(const char * filename, struct stat * statbuf) return syscall(STAT, filename, statbuf); } + +static int fstat(int fd, struct stat * statbuf) +{ + return syscall(FSTAT, fd, statbuf); +} + + +static int fstatat(int dirfd, const char *pathname, struct stat * statbuf, int flags) +{ + return syscall(NEWFSTATAT, dirfd, pathname, statbuf, flags); +} + + #endif -- cgit v1.2.3-70-g09d2