mirror of https://github.com/WebAssembly/wasi-libc
Dan Gohman
6 years ago
18 changed files with 148 additions and 0 deletions
@ -0,0 +1,35 @@ |
|||
#ifndef __wasm_sysroot___struct_stat_h |
|||
#define __wasm_sysroot___struct_stat_h |
|||
|
|||
#include <__typedef_dev_t.h> |
|||
#include <__typedef_ino_t.h> |
|||
#include <__typedef_nlink_t.h> |
|||
#include <__typedef_mode_t.h> |
|||
#include <__typedef_uid_t.h> |
|||
#include <__typedef_gid_t.h> |
|||
#include <__typedef_off_t.h> |
|||
#include <__typedef_blksize_t.h> |
|||
#include <__typedef_blkcnt_t.h> |
|||
#include <__struct_timespec.h> |
|||
|
|||
struct stat { |
|||
dev_t st_dev; |
|||
ino_t st_ino; |
|||
nlink_t st_nlink; |
|||
|
|||
mode_t st_mode; |
|||
uid_t st_uid; |
|||
gid_t st_gid; |
|||
unsigned int __pad0; |
|||
dev_t st_rdev; |
|||
off_t st_size; |
|||
blksize_t st_blksize; |
|||
blkcnt_t st_blocks; |
|||
|
|||
struct timespec st_atim; |
|||
struct timespec st_mtim; |
|||
struct timespec st_ctim; |
|||
long long __unused[3]; |
|||
}; |
|||
|
|||
#endif |
@ -0,0 +1,12 @@ |
|||
#ifndef __wasm_sysroot___struct_timespec_h |
|||
#define __wasm_sysroot___struct_timespec_h |
|||
|
|||
#include "__typedef_time_t.h" |
|||
|
|||
/* As specified in POSIX. */ |
|||
struct timespec { |
|||
time_t tv_sec; |
|||
long tv_nsec; |
|||
}; |
|||
|
|||
#endif |
@ -0,0 +1,7 @@ |
|||
#ifndef __wasm_sysroot___typedef_blkcnt_t_h |
|||
#define __wasm_sysroot___typedef_blkcnt_t_h |
|||
|
|||
/* Define these as 64-bit signed integers to support files larger than 2 GiB. */ |
|||
typedef long long blkcnt_t; |
|||
|
|||
#endif |
@ -0,0 +1,7 @@ |
|||
#ifndef __wasm_sysroot___typedef_blksize_t_h |
|||
#define __wasm_sysroot___typedef_blksize_t_h |
|||
|
|||
/* Define these as 64-bit signed integers to support files larger than 2 GiB. */ |
|||
typedef long long blksize_t; |
|||
|
|||
#endif |
@ -1,2 +1,7 @@ |
|||
#ifndef __wasm_sysroot___typedef_clock_t_h |
|||
#define __wasm_sysroot___typedef_clock_t_h |
|||
|
|||
/* Define this as a 64-bit signed integer to avoid wraparounds. */ |
|||
typedef long long clock_t; |
|||
|
|||
#endif |
|||
|
@ -0,0 +1,7 @@ |
|||
#ifndef __wasm_sysroot___typedef_dev_t_h |
|||
#define __wasm_sysroot___typedef_dev_t_h |
|||
|
|||
/* Define these as 64-bit integers to support billions of devices. */ |
|||
typedef unsigned long long dev_t; |
|||
|
|||
#endif |
@ -0,0 +1,6 @@ |
|||
#ifndef __wasm_sysroot___typedef_gid_t_h |
|||
#define __wasm_sysroot___typedef_gid_t_h |
|||
|
|||
typedef unsigned gid_t; |
|||
|
|||
#endif |
@ -0,0 +1,7 @@ |
|||
#ifndef __wasm_sysroot___typedef_ino_t_h |
|||
#define __wasm_sysroot___typedef_ino_t_h |
|||
|
|||
/* Define these as 64-bit integers to support billions of inodes. */ |
|||
typedef unsigned long long ino_t; |
|||
|
|||
#endif |
@ -0,0 +1,6 @@ |
|||
#ifndef __wasm_sysroot___typedef_mode_t_h |
|||
#define __wasm_sysroot___typedef_mode_t_h |
|||
|
|||
typedef unsigned mode_t; |
|||
|
|||
#endif |
@ -0,0 +1,7 @@ |
|||
#ifndef __wasm_sysroot___typedef_nlink_t_h |
|||
#define __wasm_sysroot___typedef_nlink_t_h |
|||
|
|||
/* Define these as 64-bit signed integers to support billions of links. */ |
|||
typedef long long nlink_t; |
|||
|
|||
#endif |
@ -0,0 +1,7 @@ |
|||
#ifndef __wasm_sysroot___typedef_off_t_h |
|||
#define __wasm_sysroot___typedef_off_t_h |
|||
|
|||
/* Define these as 64-bit signed integers to support files larger than 2 GiB. */ |
|||
typedef long long off_t; |
|||
|
|||
#endif |
@ -0,0 +1,7 @@ |
|||
#ifndef __wasm_sysroot___typedef_ssize_t_h |
|||
#define __wasm_sysroot___typedef_ssize_t_h |
|||
|
|||
/* This is defined to be the same size as size_t. */ |
|||
typedef long long ssize_t; |
|||
|
|||
#endif |
@ -0,0 +1,8 @@ |
|||
#ifndef __wasm_sysroot___typedef_suseconds_t_h |
|||
#define __wasm_sysroot___typedef_suseconds_t_h |
|||
|
|||
/* Define this to be 64-bit as its main use is in struct timeval where the
|
|||
extra space would otherwise be padding. */ |
|||
typedef long long suseconds_t; |
|||
|
|||
#endif |
@ -1,2 +1,7 @@ |
|||
#ifndef __wasm_sysroot___typedef_time_t_h |
|||
#define __wasm_sysroot___typedef_time_t_h |
|||
|
|||
/* Define this as a 64-bit signed integer to avoid the 2038 bug. */ |
|||
typedef long long time_t; |
|||
|
|||
#endif |
|||
|
@ -0,0 +1,6 @@ |
|||
#ifndef __wasm_sysroot___typedef_uid_t_h |
|||
#define __wasm_sysroot___typedef_uid_t_h |
|||
|
|||
typedef unsigned uid_t; |
|||
|
|||
#endif |
@ -0,0 +1,10 @@ |
|||
#ifndef __wasm_sysroot_sys_stat_h |
|||
#define __wasm_sysroot_sys_stat_h |
|||
|
|||
#include <__struct_stat.h> |
|||
|
|||
#define st_atime st_atim.tv_sec |
|||
#define st_mtime st_mtim.tv_sec |
|||
#define st_ctime st_ctim.tv_sec |
|||
|
|||
#endif |
Loading…
Reference in new issue