Dash:
[t2.git] / package / boot / yaboot / link_with_new_e2fsprogs2.patch
blobd077604e3d0ae3330c9527d2c610816c4dac33c6
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../yaboot/link_with_new_e2fsprogs2.patch
5 # Copyright (C) 2015 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 diff --git a/include/nonstd.h b/include/nonstd.h
18 index a967380..a23f98e 100644
19 --- a/include/nonstd.h
20 +++ b/include/nonstd.h
21 @@ -26,6 +26,7 @@
22 #define EPERM 1 /* Operation not permitted */
23 #define EBADF 9 /* Bad file number */
24 #define EACCES 13 /* Permission denied */
25 +#define EFAULT 14 /* Bad address */
27 typedef int FILE;
29 @@ -37,8 +38,11 @@ typedef long long off64_t;
30 typedef long off_t;
32 struct stat;
33 +struct stat64;
34 struct timezone;
35 struct timeval;
36 +struct rlimit;
37 +struct utsname;
39 extern FILE *stdout;
40 extern FILE *stderr;
41 @@ -78,4 +82,14 @@ long sysconf(int name);
42 int getpagesize(void);
43 void qsort(void *base, size_t nmemb, size_t size,
44 int(*compar)(const void *, const void *));
45 +ssize_t write(int fd, const void *buf, size_t count);
46 +int fallocate(int fd, int mode, off_t offset, off_t len);
47 +unsigned long long int strtoull(const char *nptr, char **endptr, int base);
48 +int fsync(int fd);
49 +int __open64_2(const char *pathname, int flags);
50 +int __xstat64(int vers, const char *name, struct stat64 *buf);
51 +int uname(struct utsname *buf);
52 +int getrlimit(int resource, struct rlimit *rlim);
53 +int setrlimit(int resource, const struct rlimit *rlim);
54 +int __fxstat64(int vers, int fd, struct stat64 *buf);
55 #endif
56 diff --git a/include/stdlib.h b/include/stdlib.h
57 index 0b5e99a..921fc9b 100644
58 --- a/include/stdlib.h
59 +++ b/include/stdlib.h
60 @@ -19,6 +19,7 @@ extern void release (void *ptr);
61 extern int sprintf(char * buf, const char *fmt, ...);
62 extern int vsprintf(char *buf, const char *fmt, va_list args);
63 extern long simple_strtol(const char *cp,char **endp,unsigned int base);
64 +extern unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base);
65 #define strtol(x,y,z) simple_strtol(x,y,z)
67 #endif
68 diff --git a/lib/nonstd.c b/lib/nonstd.c
69 index 6549283..129d674 100644
70 --- a/lib/nonstd.c
71 +++ b/lib/nonstd.c
72 @@ -115,6 +115,19 @@ int fstat64(int fd __unused, struct stat *buf __unused)
73 return EBADF;
76 +int __xstat64(int vers __unused, const char *name __unused,
77 + struct stat64 *buf __unused)
79 + DEBUG_F("Stub function called");
80 + return EBADF;
83 +int __fxstat64(int vers __unused, int fd __unused, struct stat64 *buf __unused)
85 + DEBUG_F("Stub function called");
86 + return EBADF;
89 int open(const char *pathname, int flags __unused, mode_t mode __unused)
91 return (int) prom_open((char *)pathname);
92 @@ -125,6 +138,11 @@ int open64(const char *pathname, int flags __unused, mode_t mode __unused)
93 return (int) prom_open((char *)pathname);
96 +int __open64_2(const char *pathname, int flags __unused)
98 + return (int) prom_open((char *)pathname);
101 off_t lseek(int fd __unused, off_t offset __unused, int whence __unused)
103 DEBUG_F("Stub function called");
104 @@ -290,3 +308,57 @@ void qsort(void *base __unused, size_t nmemb __unused, size_t size __unused,
105 /* I'm quite nervous about not implementing this. Could we end up with
106 * disk corruption. Couldn't we? */
109 +/* FIXME: I'd like to call prom_write here, but we can't ber certain that
110 + * we'll have "text" so just move along nothing to see here
111 + */
112 +ssize_t write(int fd, const void *buf, size_t count)
114 + DEBUG_F("Stub function called");
115 + return 0;
118 +int fallocate(int fd __unused, int mode __unused, off_t offset __unused,
119 + off_t len __unused)
121 + DEBUG_F("Stub function called");
122 + return 0;
125 +unsigned long long int strtoull(const char *nptr, char **endptr, int base)
127 + return simple_strtoull(nptr, endptr, base);
130 +int fsync(int fd __unused)
132 + DEBUG_F("Stub function called");
133 + return 0;
136 +/* Return EFAULT here as it's too hard in yaboot to know the size of struct
137 + * utsname. If we don't touch it and return 0 bad things might happen.
138 + * Lets hope the caller handles failure
139 + */
140 +int uname(struct utsname *buf __unused)
142 + DEBUG_F("Stub function called");
143 + return EFAULT;
146 +int getrlimit(int resource __unused, struct rlimit *rlim __unused)
148 + DEBUG_F("Stub function called");
149 + return 0;
152 +int setrlimit(int resource __unused, const struct rlimit *rlim __unused)
154 + DEBUG_F("Stub function called");
155 + return 0;
158 +void __stack_chk_fail(void)
160 + DEBUG_F("Stub function called");