source:
patches/yaboot-1.3.17-stubfuncs-1.patch@
d4f9e43
Last change on this file since d4f9e43 was 5c734c5, checked in by , 12 years ago | |
---|---|
|
|
File size: 4.2 KB |
-
lib/malloc.c
Submitted By: William Harrington kb0iic at cross-lfs dot org Date: 2013-01-13 Initial Package Version: 1.3.17 Upstream Status: Unknown Origin: Gentoo x86 sys-boot yaboot files Description: Adds more stub functions for newer e2fsprogs. diff -Naur yaboot-1.3.17.orig/lib/malloc.c yaboot-1.3.17/lib/malloc.c
old new 64 64 return caddr; 65 65 } 66 66 67 /* Calloc wrapper for malloc */ 68 void *memset(void *s, int c, size_t n); 69 void *calloc(size_t nmemb, size_t size) { 70 void *caddr; 71 caddr = malloc(nmemb * size); 72 memset(caddr, 0, nmemb * size); 73 return caddr; 74 } 75 67 76 /* Do not fall back to the malloc above as posix_memalign is needed by 68 77 * external libraries not yaboot */ 69 78 int posix_memalign(void **memptr, size_t alignment, size_t size) -
lib/nonstd.c
diff -Naur yaboot-1.3.17.orig/lib/nonstd.c yaboot-1.3.17/lib/nonstd.c
old new 65 65 { 66 66 return NULL; 67 67 } 68 69 // I tried to use prom functions for these... 70 int open(const char *pathname, int flags) { 71 return (int) prom_open((char *)pathname); 72 } 73 74 int open64(const char *pathname, int flags) { 75 return (int) prom_open((char *)pathname); 76 } 77 78 int __open64_2 (__const char *__path, int __oflag) { 79 return (int) prom_open((char *)__path); 80 } 81 82 int read(int fd, void *buf, size_t count) { 83 return prom_read((void *)fd, buf, count); 84 } 85 86 int write(int fd, void *buf, size_t count) { 87 return prom_write((void *)fd, buf, count); 88 } 89 90 int close(int fd) { 91 prom_close((void *)fd); 92 return 0; 93 } 94 95 // No fsync, just assume we've sync'd 96 int fsync(int fd) { 97 return 0; 98 } 99 100 void exit(int status) { 101 prom_exit(); 102 } 103 104 int __printf_chk(int flag, const char *format, ...) { 105 va_list ap; 106 va_start (ap, format); 107 prom_vfprintf (prom_stdout, format, ap); 108 va_end (ap); 109 110 return 0; 111 } 112 113 int __sprintf_chk(char * str, int flag, size_t strlen, const char * format, ...) { 114 va_list ap; 115 va_start(ap, format); 116 // No sprintf? :( 117 va_end(ap); 118 return 0; 119 120 } 121 122 int __fprintf_chk(FILE *stream, int flag, const char *format, ...) { 123 va_list ap; 124 va_start (ap, format); 125 prom_vfprintf (prom_stdout, format, ap); 126 va_end (ap); 127 128 return 0; 129 } 130 131 void *memcpy(void *dest, const void *src, size_t n); 132 void *__memcpy_chk(void *dest, const void *src, size_t n, size_t destlen) { 133 return memcpy(dest, src, n); 134 } 135 136 // But these are all dummy functions 137 int __xstat64 (int __ver, const char *__filename, void *__stat_buf) { 138 return 0; 139 } 140 141 int stat64(const char *path, void *stat_buf) { 142 return 0; 143 } 144 145 int fstat64(int fildes, void *stat_buf) { 146 return 0; 147 } 148 149 int __fxstat64 (int __ver, int __filedesc, void *__stat_buf) { 150 return 0; 151 } 152 153 signed int random(void) { 154 return 0; 155 } 156 157 void srandom(unsigned int seed) { 158 return; 159 } 160 161 int rand(void) { 162 return 0; 163 } 164 165 void srand(unsigned int seed) { 166 return; 167 } 168 169 unsigned int sleep(unsigned int seconds) { 170 return 0; 171 } 172 173 int gettimeofday(void *tv, void *tz) { 174 return 0; 175 } 176 177 long sysconf(int name) { 178 return 0; 179 } 180 181 int getpagesize(void) { 182 return 0; 183 } 184 185 int gethostname(char *name, size_t len) { 186 return 0; 187 } 188 189 int getpid(void) { 190 return 0; 191 } 192 193 int getuid(void) { 194 return 0; 195 } 196 197 void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)) { 198 return; 199 } 200 201 int * __errno_location(void) { 202 return 0; 203 } 204 205 int lseek(int fd, int offset, int whence) { 206 return prom_lseek ((void *)fd, whence + offset); 207 } 208 209 int lseek64(int fd, int offset, int whence) { 210 return prom_lseek ((void *)fd, whence + offset); 211 } 212 213 size_t fwrite(const void *ptr, size_t size, size_t nmemb, void *stream) { 214 return 0; 215 } 216 217 int ioctl(int d, int request, ...) { 218 return 0; 219 } 220 221 int fallocate(int fd, int mode, unsigned int offset, unsigned int len) { 222 return 0; 223 } 224 225 int uname(void *buf) { 226 return 0; 227 } 228 229 int setrlimit(int resource, void *rlim) { 230 return 0; 231 } 232 233 unsigned long long int strtoull(const char *nptr, char **endptr, int base) { 234 return 0; 235 } 236 237 int getrlimit(int resource, void *rlim) { 238 return 0; 239 } 240 241 int stderr = 0; 242 int perror = 0;
Note:
See TracBrowser
for help on using the repository browser.