Luna/libs/libc/include/sys/stat.h
2022-10-23 18:35:32 +02:00

35 lines
765 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;
};
#define S_ISDIR(mode) (((mode)&0xf) == __VFS_DIRECTORY)
#define S_ISREG(mode) (((mode)&0xf) == __VFS_FILE)
#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