You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by rd...@apache.org on 2020/11/12 07:06:16 UTC
[incubator-teaclave-sgx-sdk] branch master updated: Use ported musl
libc headers
This is an automated email from the ASF dual-hosted git repository.
rduan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave-sgx-sdk.git
The following commit(s) were added to refs/heads/master by this push:
new 0fce898 Use ported musl libc headers
new 254368b Merge pull request #284 from volcano0dr/musl-libc-header
0fce898 is described below
commit 0fce898ade2060d8e09d860afc32ca15a6ff42f2
Author: volcano <vo...@163.com>
AuthorDate: Thu Nov 12 14:32:04 2020 +0800
Use ported musl libc headers
---
common/inc/dirent.h | 79 ++++----
common/inc/netdb.h | 56 +++---
common/inc/poll.h | 39 +++-
common/inc/pwd.h | 54 +++---
common/inc/sched.h | 82 +++++---
common/inc/signal.h | 138 ++++++++-----
common/inc/sys/epoll.h | 55 +++---
common/inc/sys/sockaddr.h | 54 +++---
common/inc/sys/socket.h | 74 +++----
common/inc/sys/stat.h | 320 ++++++++++---------------------
common/inc/sys/struct_timespec.h | 44 +++--
common/inc/sys/uio.h | 43 +++--
sgx_edl/common/inc/dirent.h | 79 ++++----
sgx_edl/common/inc/netdb.h | 56 +++---
sgx_edl/common/inc/poll.h | 40 +++-
sgx_edl/common/inc/pwd.h | 54 +++---
sgx_edl/common/inc/sched.h | 82 +++++---
sgx_edl/common/inc/signal.h | 138 ++++++++-----
sgx_edl/common/inc/sys/epoll.h | 55 +++---
sgx_edl/common/inc/sys/sockaddr.h | 54 +++---
sgx_edl/common/inc/sys/socket.h | 74 +++----
sgx_edl/common/inc/sys/stat.h | 320 ++++++++++---------------------
sgx_edl/common/inc/sys/struct_timespec.h | 44 +++--
sgx_edl/common/inc/sys/uio.h | 43 +++--
24 files changed, 1005 insertions(+), 1072 deletions(-)
diff --git a/common/inc/dirent.h b/common/inc/dirent.h
index 49d612a..15ccdce 100644
--- a/common/inc/dirent.h
+++ b/common/inc/dirent.h
@@ -1,59 +1,46 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.s
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _DIRENT_H
#define _DIRENT_H
-struct dirent
-{
-#ifndef __USE_FILE_OFFSET64
+struct dirent {
__ino_t d_ino;
__off_t d_off;
-#else
- __ino64_t d_ino;
- __off64_t d_off;
-#endif
- unsigned short int d_reclen;
+ unsigned short d_reclen;
unsigned char d_type;
- char d_name[256]; /* We must not include limits.h! */
+ char d_name[256];
};
-//#ifdef __USE_LARGEFILE64
-struct dirent64
-{
+struct dirent64 {
__ino64_t d_ino;
__off64_t d_off;
- unsigned short int d_reclen;
+ unsigned short d_reclen;
unsigned char d_type;
- char d_name[256]; /* We must not include limits.h! */
+ char d_name[256];
};
-//#endif
-
-#define d_fileno d_ino /* Backwards compatibility. */
-
-#undef _DIRENT_HAVE_D_NAMLEN
-#define _DIRENT_HAVE_D_RECLEN
-#define _DIRENT_HAVE_D_OFF
-#define _DIRENT_HAVE_D_TYPE
-
-#if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T
-/* Inform libc code that these two types are effectively identical. */
-# define _DIRENT_MATCHES_DIRENT64 1
-#else
-# define _DIRENT_MATCHES_DIRENT64 0
-#endif
-#endif
+
+#define d_fileno d_ino
diff --git a/common/inc/netdb.h b/common/inc/netdb.h
index 5b39fce..264f90f 100644
--- a/common/inc/netdb.h
+++ b/common/inc/netdb.h
@@ -1,37 +1,41 @@
- /* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.s
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
-/* All data returned by the network data base library are supplied in
- host order and returned in network order (suitable for use in
- system calls). */
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _NETDB_H
#define _NETDB_H
-struct addrinfo
-{
- int ai_flags; /* Input flags. */
- int ai_family; /* Protocol family for socket. */
- int ai_socktype; /* Socket type. */
- int ai_protocol; /* Protocol for socket. */
- socklen_t ai_addrlen; /* Length of socket address. */
- struct sockaddr *ai_addr; /* Socket address for socket. */
- char *ai_canonname; /* Canonical name for service location. */
- struct addrinfo *ai_next; /* Pointer to next in list. */
+struct addrinfo {
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+ socklen_t ai_addrlen;
+ struct sockaddr *ai_addr;
+ char *ai_canonname;
+ struct addrinfo *ai_next;
};
#endif
diff --git a/common/inc/poll.h b/common/inc/poll.h
index 1a070e0..fc786fc 100644
--- a/common/inc/poll.h
+++ b/common/inc/poll.h
@@ -1,15 +1,38 @@
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
#ifndef _POLL_H_
#define _POLL_H_
-/* Type used for the number of file descriptors. */
-typedef unsigned long int nfds_t;
+typedef unsigned long nfds_t;
-/* Data structure describing a polling request. */
-struct pollfd
-{
- int fd; /* File descriptor to poll. */
- short int events; /* Types of events poller cares about. */
- short int revents; /* Types of events that actually occurred. */
+struct pollfd {
+ int fd;
+ short int events;
+ short int revents;
};
#endif
diff --git a/common/inc/pwd.h b/common/inc/pwd.h
index fc947d8..a45b145 100644
--- a/common/inc/pwd.h
+++ b/common/inc/pwd.h
@@ -1,36 +1,40 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
-/*
- * POSIX Standard: 9.2.2 User Database Access <pwd.h>
- */
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _PWD_H
#define _PWD_H
-struct passwd
-{
- char *pw_name; /* Username. */
- char *pw_passwd; /* Password. */
- __uid_t pw_uid; /* User ID. */
- __gid_t pw_gid; /* Group ID. */
- char *pw_gecos; /* Real name. */
- char *pw_dir; /* Home directory. */
- char *pw_shell; /* Shell program. */
+struct passwd {
+ char *pw_name;
+ char *pw_passwd;
+ __uid_t pw_uid;
+ __gid_t pw_gid;
+ char *pw_gecos;
+ char *pw_dir;
+ char *pw_shell;
};
#endif
diff --git a/common/inc/sched.h b/common/inc/sched.h
index 5c29893..4d237c4 100644
--- a/common/inc/sched.h
+++ b/common/inc/sched.h
@@ -1,40 +1,62 @@
-/* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993
- scheduling interface.
- Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.s
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SCHED_H
#define _SCHED_H
#include <sys/_types.h>
-/* Size definition for CPU sets. */
-#define __CPU_SETSIZE 1024
-#define __NCPUBITS (8 * sizeof (__cpu_mask))
+typedef struct {
+ unsigned long __bits[128/sizeof(long)];
+} cpu_set_t;
+
+#define __CPU_op_S(i, size, set, op) ( (i)/8U >= (size) ? 0 : \
+ (((unsigned long *)(set))[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) )
-/* Basic access functions. */
-#define __CPUELT(cpu) ((cpu) / __NCPUBITS)
-#define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
+#define CPU_SET_S(i, size, set) __CPU_op_S(i, size, set, |=)
+#define CPU_CLR_S(i, size, set) __CPU_op_S(i, size, set, &=~)
+#define CPU_ISSET_S(i, size, set) __CPU_op_S(i, size, set, &)
-/* Data structure to describe CPU mask. */
-typedef struct
-{
- __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
-} cpu_set_t;
+#define __CPU_op_func_S(func, op) \
+static __inline void __CPU_##func##_S(size_t __size, cpu_set_t *__dest, \
+ const cpu_set_t *__src1, const cpu_set_t *__src2) \
+{ \
+ size_t __i; \
+ for (__i=0; __i<__size/sizeof(long); __i++) \
+ ((unsigned long *)__dest)[__i] = ((unsigned long *)__src1)[__i] \
+ op ((unsigned long *)__src2)[__i] ; \
+}
+
+__CPU_op_func_S(AND, &)
+__CPU_op_func_S(OR, |)
+__CPU_op_func_S(XOR, ^)
+
+#define CPU_AND_S(a,b,c,d) __CPU_AND_S(a,b,c,d)
+#define CPU_OR_S(a,b,c,d) __CPU_OR_S(a,b,c,d)
+#define CPU_XOR_S(a,b,c,d) __CPU_XOR_S(a,b,c,d)
typedef __pid_t pid_t;
-#endif
\ No newline at end of file
+#endif
diff --git a/common/inc/signal.h b/common/inc/signal.h
index 3020226..c0da74f 100644
--- a/common/inc/signal.h
+++ b/common/inc/signal.h
@@ -1,72 +1,104 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.s
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SIGNAL_H
#define _SIGNAL_H
-#define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
-typedef struct
-{
- unsigned long int __val[_SIGSET_NWORDS];
+#include <sys/_types.h>
+
+typedef struct {
+ unsigned long _bits[128/sizeof(long)];
} __sigset_t;
typedef __sigset_t sigset_t;
-struct sigaction
-{
- /* Signal handler. */
-#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
- union
- {
- /* Used if SA_SIGINFO is not set. */
+union sigval {
+ int sival_int;
+ void *sival_ptr;
+};
+
+typedef struct {
+ int si_signo;
+ int si_errno;
+ int si_code;
+ union {
+ char __pad[128 - 2*sizeof(int) - sizeof(long)];
+ struct {
+ union {
+ struct {
+ __pid_t si_pid;
+ __uid_t si_uid;
+ } __piduid;
+ struct {
+ int si_timerid;
+ int si_overrun;
+ } __timer;
+ } __first;
+ union {
+ union sigval si_value;
+ struct {
+ int si_status;
+ __clock_t si_utime, si_stime;
+ } __sigchld;
+ } __second;
+ } __si_common;
+ struct {
+ void *si_addr;
+ short si_addr_lsb;
+ union {
+ struct {
+ void *si_lower;
+ void *si_upper;
+ } __addr_bnd;
+ unsigned si_pkey;
+ } __first;
+ } __sigfault;
+ struct {
+ long si_band;
+ int si_fd;
+ } __sigpoll;
+ struct {
+ void *si_call_addr;
+ int si_syscall;
+ unsigned si_arch;
+ } __sigsys;
+ } __si_fields;
+} siginfo_t;
+
+struct sigaction {
+ union {
void (*sa_handler) (int);
- /* Used if SA_SIGINFO is set. */
void (*sa_sigaction) (int, siginfo_t *, void *);
- }
- __sigaction_handler;
-#define sa_handler __sigaction_handler.sa_handler
-#define sa_sigaction __sigaction_handler.sa_sigaction
-#else
- void (*sa_handler) (int);
-#endif
-
- /* Additional set of signals to be blocked. */
+ } __sa_handler;
__sigset_t sa_mask;
-
- /* Special flags. */
int sa_flags;
-
- /* Restore handler. */
void (*sa_restorer) (void);
};
-#define __SI_MAX_SIZE 128
-#define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
-
-typedef struct
-{
- int si_signo; /* Signal number. */
-
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int si_code; /* Signal code. */
+#define sa_handler __sa_handler.sa_handler
+#define sa_sigaction __sa_handler.sa_sigaction
- int __pad0;
- int _pad[__SI_PAD_SIZE];
-} siginfo_t;
-
-#endif
\ No newline at end of file
+#endif
diff --git a/common/inc/sys/epoll.h b/common/inc/sys/epoll.h
index c07830d..958a4c4 100644
--- a/common/inc/sys/epoll.h
+++ b/common/inc/sys/epoll.h
@@ -1,37 +1,42 @@
-/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_EPOLL_H
#define _SYS_EPOLL_H
-#define __EPOLL_PACKED __attribute__ ((__packed__))
-
-typedef union epoll_data
-{
+typedef union epoll_data {
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} epoll_data_t;
-struct epoll_event
-{
- uint32_t events; /* Epoll events */
- epoll_data_t data; /* User data variable */
-} __EPOLL_PACKED;
+struct epoll_event {
+ uint32_t events;
+ epoll_data_t data;
+} __attribute__ ((__packed__));
#endif
diff --git a/common/inc/sys/sockaddr.h b/common/inc/sys/sockaddr.h
index 94dc548..ba6811c 100644
--- a/common/inc/sys/sockaddr.h
+++ b/common/inc/sys/sockaddr.h
@@ -1,36 +1,32 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_SOCKADDR_H_
#define _SYS_SOCKADDR_H_
-/* POSIX.1g specifies this type name for the `sa_family' member. */
typedef unsigned short int sa_family_t;
-/* This macro is used to declare the initial common members
- of the data types used for socket addresses, `struct sockaddr',
- `struct sockaddr_in', `struct sockaddr_un', etc. */
-
-#define __SOCKADDR_COMMON(sa_prefix) \
- sa_family_t sa_prefix##family
-
-#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
-
-/* Size of struct sockaddr_storage. */
-#define _SS_SIZE 128
-
#endif
diff --git a/common/inc/sys/socket.h b/common/inc/sys/socket.h
index fe19269..0b16699 100644
--- a/common/inc/sys/socket.h
+++ b/common/inc/sys/socket.h
@@ -1,19 +1,28 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_SOCKET_H_
#define _SYS_SOCKET_H_
@@ -22,33 +31,24 @@
#include <sys/sockaddr.h>
#include <sys/uio.h>
-/* Type for length arguments in socket calls. */
-#ifndef __socklen_t_defined
typedef __socklen_t socklen_t;
-# define __socklen_t_defined
-#endif
-/* Structure describing a generic socket address. */
-struct sockaddr
-{
- __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
- char sa_data[14]; /* Address data. */
+struct sockaddr {
+ sa_family_t sa_family;
+ char sa_data[14];
};
-struct msghdr
-{
- void *msg_name; /* Address to send to/receive from. */
- socklen_t msg_namelen; /* Length of address data. */
+struct msghdr {
+ void *msg_name;
+ socklen_t msg_namelen;
+
+ struct iovec *msg_iov;
+ size_t msg_iovlen;
- struct iovec *msg_iov; /* Vector of data to send/receive into. */
- size_t msg_iovlen; /* Number of elements in the vector. */
+ void *msg_control;
+ size_t msg_controllen;
- void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
- size_t msg_controllen; /* Ancillary data buffer length.
- !! The type should be socklen_t but the
- definition of the kernel is incompatible
- with this. */
- int msg_flags; /* Flags on received message. */
+ int msg_flags;
};
#endif
diff --git a/common/inc/sys/stat.h b/common/inc/sys/stat.h
index eeae9b5..2763d54 100644
--- a/common/inc/sys/stat.h
+++ b/common/inc/sys/stat.h
@@ -1,19 +1,28 @@
-/* Copyright (C) 1999-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_STAT_H
@@ -21,226 +30,97 @@
#include <sys/_types.h>
#include <sys/types.h>
-#include <time.h>
-
-/* Versions of the `struct stat' data structure. */
-#ifndef __x86_64__
-# define _STAT_VER_LINUX_OLD 1
-# define _STAT_VER_KERNEL 1
-# define _STAT_VER_SVR4 2
-# define _STAT_VER_LINUX 3
-
-/* i386 versions of the `xmknod' interface. */
-# define _MKNOD_VER_LINUX 1
-# define _MKNOD_VER_SVR4 2
-# define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
-#else
-# define _STAT_VER_KERNEL 0
-# define _STAT_VER_LINUX 1
-
-/* x86-64 versions of the `xmknod' interface. */
-# define _MKNOD_VER_LINUX 0
-#endif
+#include <sys/struct_timespec.h>
-#define _STAT_VER _STAT_VER_LINUX
-
-#ifndef _DEV_T_DEFINED_
-#define _DEV_T_DEFINED_
typedef __dev_t dev_t;
-#endif
-
-#ifndef _INO_T_DEFINED_
-#define _INO_T_DEFINED_
typedef __ino_t ino_t;
typedef __ino64_t ino64_t;
-#endif
-
-#ifndef _MODE_T_DEFINED_
-#define _MODE_T_DEFINED_
typedef __mode_t mode_t;
-#endif
-
-#ifndef _NLINK_T_DEFINED_
-#define _NLINK_T_DEFINED_
typedef __nlink_t nlink_t;
-#endif
-
-#ifndef _UID_T_DEFINED_
-#define _UID_T_DEFINED_
typedef __uid_t uid_t;
-#endif
-
-#ifndef _GID_T_DEFINED_
-#define _GID_T_DEFINED_
typedef __gid_t gid_t;
-#endif
-
-#ifndef _BLKSIZE_T_DEFINED_
-#define _BLKSIZE_T_DEFINED_
typedef __blksize_t blksize_t;
-#endif
-
-#ifndef _BLKCNT_T_DEFINED_
-#define _BLKCNT_T_DEFINED_
typedef __blkcnt_t blkcnt_t;
typedef __blkcnt64_t blkcnt64_t;
-#endif
-
-
-struct stat
-{
- dev_t st_dev; /* Device. */
-#ifndef __x86_64__
- unsigned short int __pad1;
-#endif
-#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
- ino_t st_ino; /* File serial number. */
-#else
- ino_t __st_ino; /* 32bit file serial number. */
-#endif
-#ifndef __x86_64__
- mode_t st_mode; /* File mode. */
- nlink_t st_nlink; /* Link count. */
-#else
- nlink_t st_nlink; /* Link count. */
- mode_t st_mode; /* File mode. */
-#endif
- uid_t st_uid; /* User ID of the file's owner. */
- gid_t st_gid; /* Group ID of the file's group.*/
-#ifdef __x86_64__
- int __pad0;
-#endif
- dev_t st_rdev; /* Device number, if device. */
-#ifndef __x86_64__
- unsigned short int __pad2;
-#endif
-#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
- off_t st_size; /* Size of file, in bytes. */
-#else
- off64_t st_size; /* Size of file, in bytes. */
-#endif
- blksize_t st_blksize; /* Optimal block size for I/O. */
-#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
- blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
-#else
- blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#endif
- time_t st_atime; /* Time of last access. */
- unsigned long int st_atimensec; /* Nscecs of last access. */
- time_t st_mtime; /* Time of last modification. */
- unsigned long int st_mtimensec; /* Nsecs of last modification. */
- time_t st_ctime; /* Time of last status change. */
- unsigned long int st_ctimensec; /* Nsecs of last status change. */
-#ifdef __x86_64__
- long int __glibc_reserved[3];
-#else
-# ifndef __USE_FILE_OFFSET64
- unsigned long int __glibc_reserved4;
- unsigned long int __glibc_reserved5;
-# else
- ino64_t st_ino; /* File serial number. */
-# endif
-#endif
+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 __unused[3];
};
-struct stat64
-{
- dev_t st_dev; /* Device. */
-# ifdef __x86_64__
- ino64_t st_ino; /* File serial number. */
- nlink_t st_nlink; /* Link count. */
- mode_t st_mode; /* File mode. */
-# else
- unsigned int __pad1;
- ino_t __st_ino; /* 32bit file serial number. */
- mode_t st_mode; /* File mode. */
- nlink_t st_nlink; /* Link count. */
-# endif
- uid_t st_uid; /* User ID of the file's owner. */
- gid_t st_gid; /* Group ID of the file's group.*/
-# ifdef __x86_64__
- int __pad0;
- dev_t st_rdev; /* Device number, if device. */
- off_t st_size; /* Size of file, in bytes. */
-# else
- dev_t st_rdev; /* Device number, if device. */
- unsigned int __pad2;
- off64_t st_size; /* Size of file, in bytes. */
-# endif
- blksize_t st_blksize; /* Optimal block size for I/O. */
- blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
-# ifdef __USE_XOPEN2K8
- /* Nanosecond resolution timestamps are stored in a format
- equivalent to 'struct timespec'. This is the type used
- whenever possible but the Unix namespace rules do not allow the
- identifier 'timespec' to appear in the <sys/stat.h> header.
- Therefore we have to handle the use of this header in strictly
- standard-compliant sources special. */
- struct timespec st_atim; /* Time of last access. */
- struct timespec st_mtim; /* Time of last modification. */
- struct timespec st_ctim; /* Time of last status change. */
-# else
- time_t st_atime; /* Time of last access. */
- unsigned long int st_atimensec; /* Nscecs of last access. */
- time_t st_mtime; /* Time of last modification. */
- unsigned long int st_mtimensec; /* Nsecs of last modification. */
- time_t st_ctime; /* Time of last status change. */
- unsigned long int st_ctimensec; /* Nsecs of last status change. */
-# endif
-# ifdef __x86_64__
- long int __glibc_reserved[3];
-# else
- ino64_t st_ino; /* File serial number. */
-# endif
- };
-
-/* Tell code we have these members. */
-#define _STATBUF_ST_BLKSIZE
-#define _STATBUF_ST_RDEV
-/* Nanosecond resolution time values are supported. */
-#define _STATBUF_ST_NSEC
-
-/* Encoding of the file mode. */
-
-#define S_IFMT 0170000 /* These bits determine file type. */
-
-/* File types. */
-#define S_IFDIR 0040000 /* Directory. */
-#define S_IFCHR 0020000 /* Character device. */
-#define S_IFBLK 0060000 /* Block device. */
-#define S_IFREG 0100000 /* Regular file. */
-#define S_IFIFO 0010000 /* FIFO. */
-#define S_IFLNK 0120000 /* Symbolic link. */
-#define S_IFSOCK 0140000 /* Socket. */
-
-/* POSIX.1b objects. Note that these macros always evaluate to zero. But
- they do it by enforcing the correct use of the macros. */
-#define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode)
-#define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
-#define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
-
-/* Protection bits. */
-
-#define S_ISUID 04000 /* Set user ID on execution. */
-#define S_ISGID 02000 /* Set group ID on execution. */
-#define S_ISVTX 01000 /* Save swapped text after use (sticky). */
-#define S_IREAD 0400 /* Read by owner. */
-#define S_IWRITE 0200 /* Write by owner. */
-#define S_IEXEC 0100 /* Execute by owner. */
-
-#ifdef __USE_ATFILE
-# define UTIME_NOW ((1l << 30) - 1l)
-# define UTIME_OMIT ((1l << 30) - 2l)
-#endif
-
-#define S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
+struct stat64 {
+ dev_t st_dev;
+ ino64_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;
+ blkcnt64_t st_blocks;
+
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+ long __unused[3];
+};
-#define S_ISDIR(mode) S_ISTYPE((mode), S_IFDIR)
-#define S_ISCHR(mode) S_ISTYPE((mode), S_IFCHR)
-#define S_ISBLK(mode) S_ISTYPE((mode), S_IFBLK)
-#define S_ISREG(mode) S_ISTYPE((mode), S_IFREG)
-#define S_ISFIFO(mode) S_ISTYPE((mode), S_IFIFO)
-#define S_ISLNK(mode) S_ISTYPE((mode), S_IFLNK)
+#define S_IFMT 0170000
+
+#define S_IFDIR 0040000
+#define S_IFCHR 0020000
+#define S_IFBLK 0060000
+#define S_IFREG 0100000
+#define S_IFIFO 0010000
+#define S_IFLNK 0120000
+#define S_IFSOCK 0140000
+
+#define S_TYPEISMQ(buf) 0
+#define S_TYPEISSEM(buf) 0
+#define S_TYPEISSHM(buf) 0
+#define S_TYPEISTMO(buf) 0
+
+#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_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
+#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
+#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
+
+#ifndef S_IRUSR
+#define S_ISUID 04000
+#define S_ISGID 02000
+#define S_ISVTX 01000
+#define S_IRUSR 0400
+#define S_IWUSR 0200
+#define S_IXUSR 0100
+#define S_IRWXU 0700
+#define S_IRGRP 0040
+#define S_IWGRP 0020
+#define S_IXGRP 0010
+#define S_IRWXG 0070
+#define S_IROTH 0004
+#define S_IWOTH 0002
+#define S_IXOTH 0001
+#define S_IRWXO 0007
-#endif /* bits/stat.h */
+#endif
diff --git a/common/inc/sys/struct_timespec.h b/common/inc/sys/struct_timespec.h
index 3e3f356..bca02c8 100644
--- a/common/inc/sys/struct_timespec.h
+++ b/common/inc/sys/struct_timespec.h
@@ -1,31 +1,37 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_TIMESPEC_H_
#define _SYS_TIMESPEC_H_
#include <sys/_types.h>
-/* POSIX.1b structure for a time value. This is like a `struct timeval' but
- has nanoseconds instead of microseconds. */
-struct timespec
-{
- __time_t tv_sec; /* Seconds. */
- long tv_nsec; /* Nanoseconds. */
+struct timespec {
+ __time_t tv_sec;
+ long tv_nsec;
};
#endif
diff --git a/common/inc/sys/uio.h b/common/inc/sys/uio.h
index 00cd177..2544f06 100644
--- a/common/inc/sys/uio.h
+++ b/common/inc/sys/uio.h
@@ -1,28 +1,35 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_UIO_H_
#define _SYS_UIO_H_
-/* Structure for scatter/gather I/O. */
-struct iovec
-{
- void *iov_base; /* Pointer to data. */
- size_t iov_len; /* Length of data. */
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
};
#endif
diff --git a/sgx_edl/common/inc/dirent.h b/sgx_edl/common/inc/dirent.h
index 49d612a..15ccdce 100644
--- a/sgx_edl/common/inc/dirent.h
+++ b/sgx_edl/common/inc/dirent.h
@@ -1,59 +1,46 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.s
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _DIRENT_H
#define _DIRENT_H
-struct dirent
-{
-#ifndef __USE_FILE_OFFSET64
+struct dirent {
__ino_t d_ino;
__off_t d_off;
-#else
- __ino64_t d_ino;
- __off64_t d_off;
-#endif
- unsigned short int d_reclen;
+ unsigned short d_reclen;
unsigned char d_type;
- char d_name[256]; /* We must not include limits.h! */
+ char d_name[256];
};
-//#ifdef __USE_LARGEFILE64
-struct dirent64
-{
+struct dirent64 {
__ino64_t d_ino;
__off64_t d_off;
- unsigned short int d_reclen;
+ unsigned short d_reclen;
unsigned char d_type;
- char d_name[256]; /* We must not include limits.h! */
+ char d_name[256];
};
-//#endif
-
-#define d_fileno d_ino /* Backwards compatibility. */
-
-#undef _DIRENT_HAVE_D_NAMLEN
-#define _DIRENT_HAVE_D_RECLEN
-#define _DIRENT_HAVE_D_OFF
-#define _DIRENT_HAVE_D_TYPE
-
-#if defined __OFF_T_MATCHES_OFF64_T && defined __INO_T_MATCHES_INO64_T
-/* Inform libc code that these two types are effectively identical. */
-# define _DIRENT_MATCHES_DIRENT64 1
-#else
-# define _DIRENT_MATCHES_DIRENT64 0
-#endif
-#endif
+
+#define d_fileno d_ino
diff --git a/sgx_edl/common/inc/netdb.h b/sgx_edl/common/inc/netdb.h
index 5b39fce..264f90f 100644
--- a/sgx_edl/common/inc/netdb.h
+++ b/sgx_edl/common/inc/netdb.h
@@ -1,37 +1,41 @@
- /* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.s
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
-/* All data returned by the network data base library are supplied in
- host order and returned in network order (suitable for use in
- system calls). */
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _NETDB_H
#define _NETDB_H
-struct addrinfo
-{
- int ai_flags; /* Input flags. */
- int ai_family; /* Protocol family for socket. */
- int ai_socktype; /* Socket type. */
- int ai_protocol; /* Protocol for socket. */
- socklen_t ai_addrlen; /* Length of socket address. */
- struct sockaddr *ai_addr; /* Socket address for socket. */
- char *ai_canonname; /* Canonical name for service location. */
- struct addrinfo *ai_next; /* Pointer to next in list. */
+struct addrinfo {
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+ socklen_t ai_addrlen;
+ struct sockaddr *ai_addr;
+ char *ai_canonname;
+ struct addrinfo *ai_next;
};
#endif
diff --git a/sgx_edl/common/inc/poll.h b/sgx_edl/common/inc/poll.h
index 1a070e0..6c6e723 100644
--- a/sgx_edl/common/inc/poll.h
+++ b/sgx_edl/common/inc/poll.h
@@ -1,15 +1,39 @@
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
#ifndef _POLL_H_
#define _POLL_H_
-/* Type used for the number of file descriptors. */
-typedef unsigned long int nfds_t;
+typedef unsigned long nfds_t;
-/* Data structure describing a polling request. */
-struct pollfd
-{
- int fd; /* File descriptor to poll. */
- short int events; /* Types of events poller cares about. */
- short int revents; /* Types of events that actually occurred. */
+struct pollfd {
+ int fd;
+ short int events;
+ short int revents;
};
#endif
+
diff --git a/sgx_edl/common/inc/pwd.h b/sgx_edl/common/inc/pwd.h
index fc947d8..a45b145 100644
--- a/sgx_edl/common/inc/pwd.h
+++ b/sgx_edl/common/inc/pwd.h
@@ -1,36 +1,40 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
-/*
- * POSIX Standard: 9.2.2 User Database Access <pwd.h>
- */
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _PWD_H
#define _PWD_H
-struct passwd
-{
- char *pw_name; /* Username. */
- char *pw_passwd; /* Password. */
- __uid_t pw_uid; /* User ID. */
- __gid_t pw_gid; /* Group ID. */
- char *pw_gecos; /* Real name. */
- char *pw_dir; /* Home directory. */
- char *pw_shell; /* Shell program. */
+struct passwd {
+ char *pw_name;
+ char *pw_passwd;
+ __uid_t pw_uid;
+ __gid_t pw_gid;
+ char *pw_gecos;
+ char *pw_dir;
+ char *pw_shell;
};
#endif
diff --git a/sgx_edl/common/inc/sched.h b/sgx_edl/common/inc/sched.h
index 5c29893..4d237c4 100644
--- a/sgx_edl/common/inc/sched.h
+++ b/sgx_edl/common/inc/sched.h
@@ -1,40 +1,62 @@
-/* Definition of the cpu_set_t structure used by the POSIX 1003.1b-1993
- scheduling interface.
- Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.s
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SCHED_H
#define _SCHED_H
#include <sys/_types.h>
-/* Size definition for CPU sets. */
-#define __CPU_SETSIZE 1024
-#define __NCPUBITS (8 * sizeof (__cpu_mask))
+typedef struct {
+ unsigned long __bits[128/sizeof(long)];
+} cpu_set_t;
+
+#define __CPU_op_S(i, size, set, op) ( (i)/8U >= (size) ? 0 : \
+ (((unsigned long *)(set))[(i)/8/sizeof(long)] op (1UL<<((i)%(8*sizeof(long))))) )
-/* Basic access functions. */
-#define __CPUELT(cpu) ((cpu) / __NCPUBITS)
-#define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
+#define CPU_SET_S(i, size, set) __CPU_op_S(i, size, set, |=)
+#define CPU_CLR_S(i, size, set) __CPU_op_S(i, size, set, &=~)
+#define CPU_ISSET_S(i, size, set) __CPU_op_S(i, size, set, &)
-/* Data structure to describe CPU mask. */
-typedef struct
-{
- __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
-} cpu_set_t;
+#define __CPU_op_func_S(func, op) \
+static __inline void __CPU_##func##_S(size_t __size, cpu_set_t *__dest, \
+ const cpu_set_t *__src1, const cpu_set_t *__src2) \
+{ \
+ size_t __i; \
+ for (__i=0; __i<__size/sizeof(long); __i++) \
+ ((unsigned long *)__dest)[__i] = ((unsigned long *)__src1)[__i] \
+ op ((unsigned long *)__src2)[__i] ; \
+}
+
+__CPU_op_func_S(AND, &)
+__CPU_op_func_S(OR, |)
+__CPU_op_func_S(XOR, ^)
+
+#define CPU_AND_S(a,b,c,d) __CPU_AND_S(a,b,c,d)
+#define CPU_OR_S(a,b,c,d) __CPU_OR_S(a,b,c,d)
+#define CPU_XOR_S(a,b,c,d) __CPU_XOR_S(a,b,c,d)
typedef __pid_t pid_t;
-#endif
\ No newline at end of file
+#endif
diff --git a/sgx_edl/common/inc/signal.h b/sgx_edl/common/inc/signal.h
index 3020226..c0da74f 100644
--- a/sgx_edl/common/inc/signal.h
+++ b/sgx_edl/common/inc/signal.h
@@ -1,72 +1,104 @@
-/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.s
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SIGNAL_H
#define _SIGNAL_H
-#define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
-typedef struct
-{
- unsigned long int __val[_SIGSET_NWORDS];
+#include <sys/_types.h>
+
+typedef struct {
+ unsigned long _bits[128/sizeof(long)];
} __sigset_t;
typedef __sigset_t sigset_t;
-struct sigaction
-{
- /* Signal handler. */
-#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
- union
- {
- /* Used if SA_SIGINFO is not set. */
+union sigval {
+ int sival_int;
+ void *sival_ptr;
+};
+
+typedef struct {
+ int si_signo;
+ int si_errno;
+ int si_code;
+ union {
+ char __pad[128 - 2*sizeof(int) - sizeof(long)];
+ struct {
+ union {
+ struct {
+ __pid_t si_pid;
+ __uid_t si_uid;
+ } __piduid;
+ struct {
+ int si_timerid;
+ int si_overrun;
+ } __timer;
+ } __first;
+ union {
+ union sigval si_value;
+ struct {
+ int si_status;
+ __clock_t si_utime, si_stime;
+ } __sigchld;
+ } __second;
+ } __si_common;
+ struct {
+ void *si_addr;
+ short si_addr_lsb;
+ union {
+ struct {
+ void *si_lower;
+ void *si_upper;
+ } __addr_bnd;
+ unsigned si_pkey;
+ } __first;
+ } __sigfault;
+ struct {
+ long si_band;
+ int si_fd;
+ } __sigpoll;
+ struct {
+ void *si_call_addr;
+ int si_syscall;
+ unsigned si_arch;
+ } __sigsys;
+ } __si_fields;
+} siginfo_t;
+
+struct sigaction {
+ union {
void (*sa_handler) (int);
- /* Used if SA_SIGINFO is set. */
void (*sa_sigaction) (int, siginfo_t *, void *);
- }
- __sigaction_handler;
-#define sa_handler __sigaction_handler.sa_handler
-#define sa_sigaction __sigaction_handler.sa_sigaction
-#else
- void (*sa_handler) (int);
-#endif
-
- /* Additional set of signals to be blocked. */
+ } __sa_handler;
__sigset_t sa_mask;
-
- /* Special flags. */
int sa_flags;
-
- /* Restore handler. */
void (*sa_restorer) (void);
};
-#define __SI_MAX_SIZE 128
-#define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
-
-typedef struct
-{
- int si_signo; /* Signal number. */
-
- int si_errno; /* If non-zero, an errno value associated with
- this signal, as defined in <errno.h>. */
- int si_code; /* Signal code. */
+#define sa_handler __sa_handler.sa_handler
+#define sa_sigaction __sa_handler.sa_sigaction
- int __pad0;
- int _pad[__SI_PAD_SIZE];
-} siginfo_t;
-
-#endif
\ No newline at end of file
+#endif
diff --git a/sgx_edl/common/inc/sys/epoll.h b/sgx_edl/common/inc/sys/epoll.h
index c07830d..958a4c4 100644
--- a/sgx_edl/common/inc/sys/epoll.h
+++ b/sgx_edl/common/inc/sys/epoll.h
@@ -1,37 +1,42 @@
-/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_EPOLL_H
#define _SYS_EPOLL_H
-#define __EPOLL_PACKED __attribute__ ((__packed__))
-
-typedef union epoll_data
-{
+typedef union epoll_data {
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} epoll_data_t;
-struct epoll_event
-{
- uint32_t events; /* Epoll events */
- epoll_data_t data; /* User data variable */
-} __EPOLL_PACKED;
+struct epoll_event {
+ uint32_t events;
+ epoll_data_t data;
+} __attribute__ ((__packed__));
#endif
diff --git a/sgx_edl/common/inc/sys/sockaddr.h b/sgx_edl/common/inc/sys/sockaddr.h
index 94dc548..ba6811c 100644
--- a/sgx_edl/common/inc/sys/sockaddr.h
+++ b/sgx_edl/common/inc/sys/sockaddr.h
@@ -1,36 +1,32 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_SOCKADDR_H_
#define _SYS_SOCKADDR_H_
-/* POSIX.1g specifies this type name for the `sa_family' member. */
typedef unsigned short int sa_family_t;
-/* This macro is used to declare the initial common members
- of the data types used for socket addresses, `struct sockaddr',
- `struct sockaddr_in', `struct sockaddr_un', etc. */
-
-#define __SOCKADDR_COMMON(sa_prefix) \
- sa_family_t sa_prefix##family
-
-#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
-
-/* Size of struct sockaddr_storage. */
-#define _SS_SIZE 128
-
#endif
diff --git a/sgx_edl/common/inc/sys/socket.h b/sgx_edl/common/inc/sys/socket.h
index fe19269..0b16699 100644
--- a/sgx_edl/common/inc/sys/socket.h
+++ b/sgx_edl/common/inc/sys/socket.h
@@ -1,19 +1,28 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
+
+/* Copyright © 2005-2020 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_SOCKET_H_
#define _SYS_SOCKET_H_
@@ -22,33 +31,24 @@
#include <sys/sockaddr.h>
#include <sys/uio.h>
-/* Type for length arguments in socket calls. */
-#ifndef __socklen_t_defined
typedef __socklen_t socklen_t;
-# define __socklen_t_defined
-#endif
-/* Structure describing a generic socket address. */
-struct sockaddr
-{
- __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
- char sa_data[14]; /* Address data. */
+struct sockaddr {
+ sa_family_t sa_family;
+ char sa_data[14];
};
-struct msghdr
-{
- void *msg_name; /* Address to send to/receive from. */
- socklen_t msg_namelen; /* Length of address data. */
+struct msghdr {
+ void *msg_name;
+ socklen_t msg_namelen;
+
+ struct iovec *msg_iov;
+ size_t msg_iovlen;
- struct iovec *msg_iov; /* Vector of data to send/receive into. */
- size_t msg_iovlen; /* Number of elements in the vector. */
+ void *msg_control;
+ size_t msg_controllen;
- void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
- size_t msg_controllen; /* Ancillary data buffer length.
- !! The type should be socklen_t but the
- definition of the kernel is incompatible
- with this. */
- int msg_flags; /* Flags on received message. */
+ int msg_flags;
};
#endif
diff --git a/sgx_edl/common/inc/sys/stat.h b/sgx_edl/common/inc/sys/stat.h
index eeae9b5..2763d54 100644
--- a/sgx_edl/common/inc/sys/stat.h
+++ b/sgx_edl/common/inc/sys/stat.h
@@ -1,19 +1,28 @@
-/* Copyright (C) 1999-2017 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_STAT_H
@@ -21,226 +30,97 @@
#include <sys/_types.h>
#include <sys/types.h>
-#include <time.h>
-
-/* Versions of the `struct stat' data structure. */
-#ifndef __x86_64__
-# define _STAT_VER_LINUX_OLD 1
-# define _STAT_VER_KERNEL 1
-# define _STAT_VER_SVR4 2
-# define _STAT_VER_LINUX 3
-
-/* i386 versions of the `xmknod' interface. */
-# define _MKNOD_VER_LINUX 1
-# define _MKNOD_VER_SVR4 2
-# define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
-#else
-# define _STAT_VER_KERNEL 0
-# define _STAT_VER_LINUX 1
-
-/* x86-64 versions of the `xmknod' interface. */
-# define _MKNOD_VER_LINUX 0
-#endif
+#include <sys/struct_timespec.h>
-#define _STAT_VER _STAT_VER_LINUX
-
-#ifndef _DEV_T_DEFINED_
-#define _DEV_T_DEFINED_
typedef __dev_t dev_t;
-#endif
-
-#ifndef _INO_T_DEFINED_
-#define _INO_T_DEFINED_
typedef __ino_t ino_t;
typedef __ino64_t ino64_t;
-#endif
-
-#ifndef _MODE_T_DEFINED_
-#define _MODE_T_DEFINED_
typedef __mode_t mode_t;
-#endif
-
-#ifndef _NLINK_T_DEFINED_
-#define _NLINK_T_DEFINED_
typedef __nlink_t nlink_t;
-#endif
-
-#ifndef _UID_T_DEFINED_
-#define _UID_T_DEFINED_
typedef __uid_t uid_t;
-#endif
-
-#ifndef _GID_T_DEFINED_
-#define _GID_T_DEFINED_
typedef __gid_t gid_t;
-#endif
-
-#ifndef _BLKSIZE_T_DEFINED_
-#define _BLKSIZE_T_DEFINED_
typedef __blksize_t blksize_t;
-#endif
-
-#ifndef _BLKCNT_T_DEFINED_
-#define _BLKCNT_T_DEFINED_
typedef __blkcnt_t blkcnt_t;
typedef __blkcnt64_t blkcnt64_t;
-#endif
-
-
-struct stat
-{
- dev_t st_dev; /* Device. */
-#ifndef __x86_64__
- unsigned short int __pad1;
-#endif
-#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
- ino_t st_ino; /* File serial number. */
-#else
- ino_t __st_ino; /* 32bit file serial number. */
-#endif
-#ifndef __x86_64__
- mode_t st_mode; /* File mode. */
- nlink_t st_nlink; /* Link count. */
-#else
- nlink_t st_nlink; /* Link count. */
- mode_t st_mode; /* File mode. */
-#endif
- uid_t st_uid; /* User ID of the file's owner. */
- gid_t st_gid; /* Group ID of the file's group.*/
-#ifdef __x86_64__
- int __pad0;
-#endif
- dev_t st_rdev; /* Device number, if device. */
-#ifndef __x86_64__
- unsigned short int __pad2;
-#endif
-#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
- off_t st_size; /* Size of file, in bytes. */
-#else
- off64_t st_size; /* Size of file, in bytes. */
-#endif
- blksize_t st_blksize; /* Optimal block size for I/O. */
-#if defined __x86_64__ || !defined __USE_FILE_OFFSET64
- blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
-#else
- blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#endif
- time_t st_atime; /* Time of last access. */
- unsigned long int st_atimensec; /* Nscecs of last access. */
- time_t st_mtime; /* Time of last modification. */
- unsigned long int st_mtimensec; /* Nsecs of last modification. */
- time_t st_ctime; /* Time of last status change. */
- unsigned long int st_ctimensec; /* Nsecs of last status change. */
-#ifdef __x86_64__
- long int __glibc_reserved[3];
-#else
-# ifndef __USE_FILE_OFFSET64
- unsigned long int __glibc_reserved4;
- unsigned long int __glibc_reserved5;
-# else
- ino64_t st_ino; /* File serial number. */
-# endif
-#endif
+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 __unused[3];
};
-struct stat64
-{
- dev_t st_dev; /* Device. */
-# ifdef __x86_64__
- ino64_t st_ino; /* File serial number. */
- nlink_t st_nlink; /* Link count. */
- mode_t st_mode; /* File mode. */
-# else
- unsigned int __pad1;
- ino_t __st_ino; /* 32bit file serial number. */
- mode_t st_mode; /* File mode. */
- nlink_t st_nlink; /* Link count. */
-# endif
- uid_t st_uid; /* User ID of the file's owner. */
- gid_t st_gid; /* Group ID of the file's group.*/
-# ifdef __x86_64__
- int __pad0;
- dev_t st_rdev; /* Device number, if device. */
- off_t st_size; /* Size of file, in bytes. */
-# else
- dev_t st_rdev; /* Device number, if device. */
- unsigned int __pad2;
- off64_t st_size; /* Size of file, in bytes. */
-# endif
- blksize_t st_blksize; /* Optimal block size for I/O. */
- blkcnt64_t st_blocks; /* Nr. 512-byte blocks allocated. */
-# ifdef __USE_XOPEN2K8
- /* Nanosecond resolution timestamps are stored in a format
- equivalent to 'struct timespec'. This is the type used
- whenever possible but the Unix namespace rules do not allow the
- identifier 'timespec' to appear in the <sys/stat.h> header.
- Therefore we have to handle the use of this header in strictly
- standard-compliant sources special. */
- struct timespec st_atim; /* Time of last access. */
- struct timespec st_mtim; /* Time of last modification. */
- struct timespec st_ctim; /* Time of last status change. */
-# else
- time_t st_atime; /* Time of last access. */
- unsigned long int st_atimensec; /* Nscecs of last access. */
- time_t st_mtime; /* Time of last modification. */
- unsigned long int st_mtimensec; /* Nsecs of last modification. */
- time_t st_ctime; /* Time of last status change. */
- unsigned long int st_ctimensec; /* Nsecs of last status change. */
-# endif
-# ifdef __x86_64__
- long int __glibc_reserved[3];
-# else
- ino64_t st_ino; /* File serial number. */
-# endif
- };
-
-/* Tell code we have these members. */
-#define _STATBUF_ST_BLKSIZE
-#define _STATBUF_ST_RDEV
-/* Nanosecond resolution time values are supported. */
-#define _STATBUF_ST_NSEC
-
-/* Encoding of the file mode. */
-
-#define S_IFMT 0170000 /* These bits determine file type. */
-
-/* File types. */
-#define S_IFDIR 0040000 /* Directory. */
-#define S_IFCHR 0020000 /* Character device. */
-#define S_IFBLK 0060000 /* Block device. */
-#define S_IFREG 0100000 /* Regular file. */
-#define S_IFIFO 0010000 /* FIFO. */
-#define S_IFLNK 0120000 /* Symbolic link. */
-#define S_IFSOCK 0140000 /* Socket. */
-
-/* POSIX.1b objects. Note that these macros always evaluate to zero. But
- they do it by enforcing the correct use of the macros. */
-#define S_TYPEISMQ(buf) ((buf)->st_mode - (buf)->st_mode)
-#define S_TYPEISSEM(buf) ((buf)->st_mode - (buf)->st_mode)
-#define S_TYPEISSHM(buf) ((buf)->st_mode - (buf)->st_mode)
-
-/* Protection bits. */
-
-#define S_ISUID 04000 /* Set user ID on execution. */
-#define S_ISGID 02000 /* Set group ID on execution. */
-#define S_ISVTX 01000 /* Save swapped text after use (sticky). */
-#define S_IREAD 0400 /* Read by owner. */
-#define S_IWRITE 0200 /* Write by owner. */
-#define S_IEXEC 0100 /* Execute by owner. */
-
-#ifdef __USE_ATFILE
-# define UTIME_NOW ((1l << 30) - 1l)
-# define UTIME_OMIT ((1l << 30) - 2l)
-#endif
-
-#define S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
+struct stat64 {
+ dev_t st_dev;
+ ino64_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;
+ blkcnt64_t st_blocks;
+
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+ long __unused[3];
+};
-#define S_ISDIR(mode) S_ISTYPE((mode), S_IFDIR)
-#define S_ISCHR(mode) S_ISTYPE((mode), S_IFCHR)
-#define S_ISBLK(mode) S_ISTYPE((mode), S_IFBLK)
-#define S_ISREG(mode) S_ISTYPE((mode), S_IFREG)
-#define S_ISFIFO(mode) S_ISTYPE((mode), S_IFIFO)
-#define S_ISLNK(mode) S_ISTYPE((mode), S_IFLNK)
+#define S_IFMT 0170000
+
+#define S_IFDIR 0040000
+#define S_IFCHR 0020000
+#define S_IFBLK 0060000
+#define S_IFREG 0100000
+#define S_IFIFO 0010000
+#define S_IFLNK 0120000
+#define S_IFSOCK 0140000
+
+#define S_TYPEISMQ(buf) 0
+#define S_TYPEISSEM(buf) 0
+#define S_TYPEISSHM(buf) 0
+#define S_TYPEISTMO(buf) 0
+
+#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_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
+#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
+#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
+
+#ifndef S_IRUSR
+#define S_ISUID 04000
+#define S_ISGID 02000
+#define S_ISVTX 01000
+#define S_IRUSR 0400
+#define S_IWUSR 0200
+#define S_IXUSR 0100
+#define S_IRWXU 0700
+#define S_IRGRP 0040
+#define S_IWGRP 0020
+#define S_IXGRP 0010
+#define S_IRWXG 0070
+#define S_IROTH 0004
+#define S_IWOTH 0002
+#define S_IXOTH 0001
+#define S_IRWXO 0007
-#endif /* bits/stat.h */
+#endif
diff --git a/sgx_edl/common/inc/sys/struct_timespec.h b/sgx_edl/common/inc/sys/struct_timespec.h
index 3e3f356..bca02c8 100644
--- a/sgx_edl/common/inc/sys/struct_timespec.h
+++ b/sgx_edl/common/inc/sys/struct_timespec.h
@@ -1,31 +1,37 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_TIMESPEC_H_
#define _SYS_TIMESPEC_H_
#include <sys/_types.h>
-/* POSIX.1b structure for a time value. This is like a `struct timeval' but
- has nanoseconds instead of microseconds. */
-struct timespec
-{
- __time_t tv_sec; /* Seconds. */
- long tv_nsec; /* Nanoseconds. */
+struct timespec {
+ __time_t tv_sec;
+ long tv_nsec;
};
#endif
diff --git a/sgx_edl/common/inc/sys/uio.h b/sgx_edl/common/inc/sys/uio.h
index 00cd177..2544f06 100644
--- a/sgx_edl/common/inc/sys/uio.h
+++ b/sgx_edl/common/inc/sys/uio.h
@@ -1,28 +1,35 @@
-/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
+//
+// Copyright © 2005-2020 Rich Felker, et al.
+// Licensed under the MIT license.
+//
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+/* Copyright © 2005-2020 Rich Felker, et al.
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _SYS_UIO_H_
#define _SYS_UIO_H_
-/* Structure for scatter/gather I/O. */
-struct iovec
-{
- void *iov_base; /* Pointer to data. */
- size_t iov_len; /* Length of data. */
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
};
#endif
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org