Skip to content

Commit 55fef58

Browse files
authored
Merge pull request #8 from WebAssembly/suseconds_t_and_nlink_t
Add more typedefs and struct stat
2 parents d68aebf + 51d4922 commit 55fef58

18 files changed

+155
-0
lines changed

basics/include/__struct_stat.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#ifndef __wasm_sysroot___struct_stat_h
2+
#define __wasm_sysroot___struct_stat_h
3+
4+
#include <__typedef_dev_t.h>
5+
#include <__typedef_ino_t.h>
6+
#include <__typedef_nlink_t.h>
7+
#include <__typedef_mode_t.h>
8+
#include <__typedef_uid_t.h>
9+
#include <__typedef_gid_t.h>
10+
#include <__typedef_off_t.h>
11+
#include <__typedef_blksize_t.h>
12+
#include <__typedef_blkcnt_t.h>
13+
#include <__struct_timespec.h>
14+
15+
struct stat {
16+
dev_t st_dev;
17+
ino_t st_ino;
18+
nlink_t st_nlink;
19+
20+
mode_t st_mode;
21+
uid_t st_uid;
22+
gid_t st_gid;
23+
unsigned int __pad0;
24+
dev_t st_rdev;
25+
off_t st_size;
26+
blksize_t st_blksize;
27+
blkcnt_t st_blocks;
28+
29+
struct timespec st_atim;
30+
struct timespec st_mtim;
31+
struct timespec st_ctim;
32+
long long __unused[3];
33+
};
34+
35+
#endif

basics/include/__struct_timespec.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#ifndef __wasm_sysroot___struct_timespec_h
2+
#define __wasm_sysroot___struct_timespec_h
3+
4+
#include "__typedef_time_t.h"
5+
6+
/* As specified in POSIX. */
7+
struct timespec {
8+
time_t tv_sec;
9+
long tv_nsec;
10+
};
11+
12+
#endif

basics/include/__typedef_blkcnt_t.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef __wasm_sysroot___typedef_blkcnt_t_h
2+
#define __wasm_sysroot___typedef_blkcnt_t_h
3+
4+
/* Define these as 64-bit signed integers to support files larger than 2 GiB. */
5+
typedef long long blkcnt_t;
6+
7+
#endif

basics/include/__typedef_blksize_t.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef __wasm_sysroot___typedef_blksize_t_h
2+
#define __wasm_sysroot___typedef_blksize_t_h
3+
4+
/* Define these as 64-bit signed integers to support files larger than 2 GiB. */
5+
typedef long long blksize_t;
6+
7+
#endif

basics/include/__typedef_clock_t.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1+
#ifndef __wasm_sysroot___typedef_clock_t_h
2+
#define __wasm_sysroot___typedef_clock_t_h
3+
14
/* Define this as a 64-bit signed integer to avoid wraparounds. */
25
typedef long long clock_t;
6+
7+
#endif

basics/include/__typedef_dev_t.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef __wasm_sysroot___typedef_dev_t_h
2+
#define __wasm_sysroot___typedef_dev_t_h
3+
4+
/* Define these as 64-bit integers to support billions of devices. */
5+
typedef unsigned long long dev_t;
6+
7+
#endif

basics/include/__typedef_gid_t.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef __wasm_sysroot___typedef_gid_t_h
2+
#define __wasm_sysroot___typedef_gid_t_h
3+
4+
typedef unsigned gid_t;
5+
6+
#endif

basics/include/__typedef_ino_t.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef __wasm_sysroot___typedef_ino_t_h
2+
#define __wasm_sysroot___typedef_ino_t_h
3+
4+
/* Define these as 64-bit integers to support billions of inodes. */
5+
typedef unsigned long long ino_t;
6+
7+
#endif

basics/include/__typedef_mode_t.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef __wasm_sysroot___typedef_mode_t_h
2+
#define __wasm_sysroot___typedef_mode_t_h
3+
4+
typedef unsigned mode_t;
5+
6+
#endif

basics/include/__typedef_nlink_t.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef __wasm_sysroot___typedef_nlink_t_h
2+
#define __wasm_sysroot___typedef_nlink_t_h
3+
4+
/* Define these as 64-bit signed integers to support billions of links. */
5+
typedef long long nlink_t;
6+
7+
#endif

0 commit comments

Comments
 (0)