37 lines
854 B
C
37 lines
854 B
C
#ifndef _SYS_STAT_H
|
|
#define _SYS_STAT_H
|
|
|
|
#include <luna/vfs.h>
|
|
#include <sys/types.h>
|
|
|
|
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.
|
|
};
|
|
|
|
#define S_ISDIR(mode) (((mode)&0xf) == __VFS_DIRECTORY)
|
|
#define S_ISREG(mode) (((mode)&0xf) == __VFS_FILE)
|
|
#define S_ISDEV(mode) (((mode)&0xf) == __VFS_DEVICE)
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
/* Creates a new directory at the path pathname. FIXME: For now, mode is ignored. */
|
|
int mkdir(const char* pathname, mode_t mode);
|
|
|
|
/* Returns information about the file pointed to by fd in buf. */
|
|
int fstat(int fd, struct stat* buf);
|
|
|
|
/* Returns information about the file pointed at path in buf. */
|
|
int stat(const char* pathname, struct stat* buf);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif |