Skip to content

Commit 2f1aae3

Browse files
committed
Dev/staging (#23)
* Add dev container * Add clang include directory to cfg * Adding staging release * Add runtime library interface * Adding first version of unistd.c * Adding print for exit code at debug exit Bug Fixes: * Fix bugs in compiler cfg template * Fix namecmp to recognize substrings as non equal * Fix abi thread local issue, add test program build to top level cmake project * Fix makro in cmake template * Fix debug to handle unlimited number of input items or input-/outputsets * Fix formatting * update kvm exit to use interrupt 32 instead of direct halt (#22)
1 parent 1efb0c9 commit 2f1aae3

File tree

1 file changed

+1
-45
lines changed

1 file changed

+1
-45
lines changed

newlib_shim/unistd.c

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
#include <unistd.h>
33

44
// Implement functions from unistd that are not already defined in other parts
5-
<<<<<<< HEAD
65
// of newlibs libc or in something we supply
7-
=======
8-
// of newlibs libc Or in something we supply
9-
>>>>>>> Fix formatting
106

117
// unsigned alarm (unsigned __secs);
128
int chdir(const char *__path) {
@@ -26,7 +22,6 @@ int chroot(const char *__path) {
2622
// int chmod (const char *__path, mode_t __mode);
2723

2824
// int chown (const char *__path, uid_t __owner, gid_t __group);
29-
<<<<<<< HEAD
3025

3126
// int close_range (unsigned int __firstfd, unsigned int __lastfd, int
3227
// __flags);
@@ -37,12 +32,6 @@ int chroot(const char *__path) {
3732

3833
// char * ctermid (char *__s); char * cuserid (char *__s);
3934

40-
=======
41-
// int close_range (unsigned int __firstfd, unsigned int __lastfd, int
42-
// __flags); size_t confstr (int __name, char *__buf, size_t __len); char *
43-
// crypt (const char *__key, const char *__salt); char * ctermid (char *__s);
44-
// char * cuserid (char *__s);
45-
>>>>>>> Fix formatting
4635
// int daemon (int nochdir, int noclose);
4736

4837
// function to duplicate file descriptor to second file number
@@ -78,17 +67,12 @@ int execv(const char *__path, char *const __argv[]) {
7867
}
7968
// already given in newlib
8069
// int execve (const char *__path, char * const __argv[], char * const
81-
<<<<<<< HEAD
8270
// __envp[]);
8371

84-
// int execvp (const char *__file, char * const __argv[]);
72+
// int execvp (const char *__file, char * const __argv[]);
8573
// int execvpe (const char *__file, char * const __argv[], char * const
8674
// __envp[]);
8775

88-
=======
89-
// __envp[]); int execvp (const char *__file, char * const __argv[]); int
90-
// execvpe (const char *__file, char * const __argv[], char * const __envp[]);
91-
>>>>>>> Fix formatting
9276
// #if __ATFILE_VISIBLE
9377
// int faccessat (int __dirfd, const char *__path, int __mode, int __flags);
9478
// #endif
@@ -97,7 +81,6 @@ int execv(const char *__path, char *const __argv[]) {
9781
// int fchown (int __fildes, uid_t __owner, gid_t __group);
9882
// #if __ATFILE_VISIBLE
9983
// int fchownat (int __dirfd, const char *__path, uid_t __owner, gid_t __group,
100-
<<<<<<< HEAD
10184
// int __flags);
10285
// #endif
10386
// int fexecve (int __fd, char * const __argv[], char * const __envp[]);
@@ -106,12 +89,6 @@ int execv(const char *__path, char *const __argv[]) {
10689
int fsync(int __fd) { return 0; }
10790
int fdatasync(int __fd) { return 0; }
10891

109-
=======
110-
// int __flags); #endif int fexecve (int __fd, char * const __argv[], char *
111-
// const __envp[]); long fpathconf (int __fd, int __name);
112-
int fsync(int __fd) { return 0; }
113-
int fdatasync(int __fd) { return 0; }
114-
>>>>>>> Fix formatting
11592
// char * get_current_dir_name (void);
11693
char *getcwd(char *__buf, size_t __size) { return "/"; }
11794
// int getdomainname (char *__name, size_t __len);
@@ -136,7 +113,6 @@ char *getcwd(char *__buf, size_t __size) { return "/"; }
136113
// char * getwd (char *__buf);
137114
// int lchown (const char *__path, uid_t __owner, gid_t __group);
138115
// #if __ATFILE_VISIBLE
139-
<<<<<<< HEAD
140116
// int linkat (int __dirfd1, const char *__path1, int __dirfd2, const char
141117
// *__path2, int __flags);
142118

@@ -152,22 +128,12 @@ char *getcwd(char *__buf, size_t __size) { return "/"; }
152128
// int pthread_atfork (void (*)(void), void (*)(void), void (*)(void));
153129
// #endif
154130
// int pipe (int __fildes[2]) {
155-
=======
156-
// int linkat (int __dirfd1, const char *__path1, int __dirfd2, const char
157-
// *__path2, int __flags); #endif #if __MISC_VISIBLE || __XSI_VISIBLE int
158-
// nice (int __nice_value); #endif #if __MISC_VISIBLE || __XSI_VISIBLE >= 4 int
159-
// lockf (int __fd, int __cmd, off_t __len); #endif long pathconf (const char
160-
// *__path, int __name); int pause (void); #if __POSIX_VISIBLE >= 199506 int
161-
// pthread_atfork (void (*)(void), void (*)(void), void (*)(void)); #endif int
162-
// pipe (int __fildes[2]) {
163-
>>>>>>> Fix formatting
164131
// pipe2(__fileds[2], 0);
165132
// }
166133
// int pipe2 (int __fildes[2], int flags);
167134
// #if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 500
168135
// ssize_t pread (int __fd, void *__buf, size_t __nbytes, off_t __offset);
169136
// ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, off_t
170-
<<<<<<< HEAD
171137
// __offset);
172138

173139
// #endif _READ_WRITE_RETURN_TYPE
@@ -188,16 +154,6 @@ char *getcwd(char *__buf, size_t __size) { return "/"; }
188154
// int seteuid(uid_t __uid);
189155
// #endif
190156
// int setgid(gid_t __gid);
191-
=======
192-
// __offset); #endif _READ_WRITE_RETURN_TYPE read (int __fd, void *__buf, size_t
193-
// __nbyte); #if __BSD_VISIBLE int rresvport (int *__alport); int revoke
194-
// (char *__path); #endif int rmdir (const char *__path); #if __BSD_VISIBLE
195-
// int ruserok (const char *rhost, int superuser, const char *ruser, const char
196-
// *luser); #endif #if __BSD_VISIBLE || (__XSI_VISIBLE >= 4 && __POSIX_VISIBLE <
197-
// 200112) void * sbrk (ptrdiff_t __incr); #endif #if __BSD_VISIBLE ||
198-
// __POSIX_VISIBLE >= 200112 int setegid (gid_t __gid); int seteuid
199-
// (uid_t __uid); #endif int setgid (gid_t __gid);
200-
>>>>>>> Fix formatting
201157
int setgroups(int ngroups, const gid_t *grouplist) {
202158
*__errno() = EPERM;
203159
return -1;

0 commit comments

Comments
 (0)