- Added basic support for dirent.h;
- Added memory.h for compatibility;
- Added ftruncate() function;
- Fixed date and time structures in ksys_file_info_t.

git-svn-id: svn://kolibrios.org@9954 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat
2024-01-12 23:01:16 +00:00
parent d91cb7946f
commit 6e3276cb4b
8 changed files with 175 additions and 24 deletions

View File

@@ -27,7 +27,6 @@ _DEFUN (stat, (path, buf),
const char *path _AND
struct stat *buf)
{
ksys_file_info_t info;
struct tm time;
@@ -41,11 +40,11 @@ _DEFUN (stat, (path, buf),
buf->st_size = info.size;
if (info.attr & 0x10)
if (info.attr & (KSYS_FILE_ATTR_DIR | KSYS_FILE_ATTR_VOL_LABEL))
buf->st_mode = S_IFDIR;
else
{
if (info.attr & 0x07)
if (info.attr & (KSYS_FILE_ATTR_SYS | KSYS_FILE_ATTR_HIDDEN | KSYS_FILE_ATTR_RO))
buf->st_mode = S_IFREG|S_IRUSR|S_IXUSR;
else
buf->st_mode = S_IFREG|S_IRUSR|S_IWUSR|S_IXUSR;