Skip to content

Commit

Permalink
LibC: Move struct stat to sys/stat.h
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs authored and awesomekling committed Feb 5, 2020
1 parent dc93ed4 commit 868b1a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 16 additions & 0 deletions Libraries/LibC/sys/stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ __BEGIN_DECLS
#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK)
#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)

struct stat {
dev_t st_dev; /* ID of device containing file */
ino_t st_ino; /* inode number */
mode_t st_mode; /* protection */
nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of owner */
gid_t st_gid; /* group ID of owner */
dev_t st_rdev; /* device ID (if special file) */
off_t st_size; /* total size, in bytes */
blksize_t st_blksize; /* blocksize for file system I/O */
blkcnt_t st_blocks; /* number of 512B blocks allocated */
time_t st_atime; /* time of last access */
time_t st_mtime; /* time of last modification */
time_t st_ctime; /* time of last status change */
};

mode_t umask(mode_t);
int chmod(const char* pathname, mode_t);
int fchmod(int fd, mode_t);
Expand Down
16 changes: 0 additions & 16 deletions Libraries/LibC/sys/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,6 @@ typedef uint32_t clock_t;
#define __socklen_t uint32_t
typedef __socklen_t socklen_t;

struct stat {
dev_t st_dev; /* ID of device containing file */
ino_t st_ino; /* inode number */
mode_t st_mode; /* protection */
nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of owner */
gid_t st_gid; /* group ID of owner */
dev_t st_rdev; /* device ID (if special file) */
off_t st_size; /* total size, in bytes */
blksize_t st_blksize; /* blocksize for file system I/O */
blkcnt_t st_blocks; /* number of 512B blocks allocated */
time_t st_atime; /* time of last access */
time_t st_mtime; /* time of last modification */
time_t st_ctime; /* time of last status change */
};

struct utimbuf {
time_t actime;
time_t modtime;
Expand Down

0 comments on commit 868b1a2

Please sign in to comment.