-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathocall_types.h
64 lines (56 loc) · 1.61 KB
/
ocall_types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef _OCALL_TYPES_H_
#define _OCALL_TYPES_H_
// Divide system definitions into trusted and untrusted part for ocalls type declarations
#ifdef SGX_UNTRUSTED
// For untrusted part take standard library headers
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#else
// For trusted part copy required standard library declarations from stdlib headers
// For ocall_interface.c do not redefine these types, otherwise define
#ifndef DO_NOT_REDEFINE_FOR_OCALL
typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned int mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;
typedef __off_t off_t;
typedef long int __syscall_slong_t;
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;
int __pad0;
__dev_t st_rdev;
__off_t st_size;
__blksize_t st_blksize;
__blkcnt_t st_blocks;
__time_t st_atim;
__time_t st_mtim;
__time_t st_ctim;
__syscall_slong_t __glibc_reserved[3];
};
#endif // DO_NOT_REDEFINE_FOR_OCALL_INTERFACE
#endif // SGX_UNTRUSTED
#endif // _OCALL_TYPES_H_