Apple2: implement stat(2) and statvfs(3)

This commit is contained in:
Colin Leroy-Mira
2023-12-28 21:50:13 +01:00
committed by Oliver Schmidt
parent 4343eebe67
commit 75461e1319
23 changed files with 999 additions and 124 deletions

View File

@@ -2,7 +2,7 @@
/* */
/* stat.h */
/* */
/* Constants for the mode argument of open and creat */
/* stat(2) definition */
/* */
/* */
/* */
@@ -11,6 +11,9 @@
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* (C) 2023 Colin Leroy-Mira */
/* EMail: colin@colino.net */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
@@ -36,6 +39,10 @@
#ifndef _STAT_H
#define _STAT_H
#include <time.h>
#include <target.h>
#include <sys/types.h>
/*****************************************************************************/
@@ -47,6 +54,30 @@
#define S_IREAD 0x01
#define S_IWRITE 0x02
#define S_IFMT 0x03
struct stat {
dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
off_t st_size;
struct timespec st_atim;
struct timespec st_ctim;
struct timespec st_mtim;
#ifdef __APPLE2__
unsigned char st_access;
unsigned char st_type;
unsigned int st_auxtype;
unsigned char st_storagetype;
unsigned int st_blocks;
struct datetime st_mtime;
struct datetime st_ctime;
#endif
};
/*****************************************************************************/
@@ -55,5 +86,9 @@
int __fastcall__ stat (const char* pathname, struct stat* statbuf);
/* End of stat.h */
#endif