Skip to content
Snippets Groups Projects
Verified Commit 257040e1 authored by jD91mZM2's avatar jD91mZM2
Browse files

Fix a few stat-related things

parent ad324a0e
No related branches found
No related tags found
1 merge request!146Add the few last things to get gcc_complete working
#ifndef _BITS_INTTYPE_H
#define _BITS_INTTYPE_H
#define PRId8 "i"
#define PRId16 "i"
#define PRId32 "i"
......@@ -188,3 +191,5 @@
#define SCNoPTR "to"
#define SCNuPTR "tu"
#define SCNxPTR "tx"
#endif
#ifndef _BITS_STAT_H
#define _BITS_STAT_H
#define S_ISDIR(mode) mode & S_IFMT == S_IFDIR
#define S_ISCHR(mode) mode & S_IFMT == S_IFCHR
#define S_ISBLK(mode) mode & S_IFMT == S_IFBLK
#define S_ISREG(mode) mode & S_IFMT == S_IFREG
#define S_ISIFO(mode) mode & S_IFMT == S_IFIFO
#define S_ISLNK(mode) mode & S_IFMT == S_IFLNK
#endif
sys_includes = ["sys/types.h"]
include_guard = "_SYS_STAT_H"
trailer = "#include <bits/stat.h>"
language = "C"
style = "Tag"
......
......@@ -6,31 +6,31 @@ extern crate platform;
use platform::types::*;
pub const S_IFMT: c_int = 00170000;
pub const S_IFBLK: c_int = 0060000;
pub const S_IFCHR: c_int = 0020000;
pub const S_IFIFO: c_int = 0010000;
pub const S_IFREG: c_int = 0100000;
pub const S_IFDIR: c_int = 0040000;
pub const S_IFLNK: c_int = 0120000;
pub const S_IRWXU: c_int = 00700;
pub const S_IRUSR: c_int = 00400;
pub const S_IWUSR: c_int = 00200;
pub const S_IXUSR: c_int = 00100;
pub const S_IRWXG: c_int = 00070;
pub const S_IRGRP: c_int = 00040;
pub const S_IWGRP: c_int = 00020;
pub const S_IXGRP: c_int = 00010;
pub const S_IRWXO: c_int = 00007;
pub const S_IROTH: c_int = 00004;
pub const S_IWOTH: c_int = 00002;
pub const S_IXOTH: c_int = 00001;
pub const S_ISUID: c_int = 04000;
pub const S_ISGID: c_int = 02000;
pub const S_ISVTX: c_int = 01000;
pub const S_IFMT: c_int = 0o0170000;
pub const S_IFBLK: c_int = 0o060000;
pub const S_IFCHR: c_int = 0o020000;
pub const S_IFIFO: c_int = 0o010000;
pub const S_IFREG: c_int = 0o100000;
pub const S_IFDIR: c_int = 0o040000;
pub const S_IFLNK: c_int = 0o120000;
pub const S_IRWXU: c_int = 0o0700;
pub const S_IRUSR: c_int = 0o0400;
pub const S_IWUSR: c_int = 0o0200;
pub const S_IXUSR: c_int = 0o0100;
pub const S_IRWXG: c_int = 0o0070;
pub const S_IRGRP: c_int = 0o0040;
pub const S_IWGRP: c_int = 0o0020;
pub const S_IXGRP: c_int = 0o0010;
pub const S_IRWXO: c_int = 0o0007;
pub const S_IROTH: c_int = 0o0004;
pub const S_IWOTH: c_int = 0o0002;
pub const S_IXOTH: c_int = 0o0001;
pub const S_ISUID: c_int = 0o4000;
pub const S_ISGID: c_int = 0o2000;
pub const S_ISVTX: c_int = 0o1000;
#[repr(C)]
pub struct stat {
......@@ -43,9 +43,9 @@ pub struct stat {
pub st_rdev: dev_t,
pub st_size: off_t,
pub st_blksize: blksize_t,
pub st_atim: time_t,
pub st_mtim: time_t,
pub st_ctim: time_t,
pub st_atime: time_t,
pub st_mtime: time_t,
pub st_ctime: time_t,
pub st_blocks: blkcnt_t,
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment