1#include "linux/types.h" 2#include "linux/module.h" 3 4/* Some of this are builtin function (some are not but could in the future), 5 * so I *must* declare good prototypes for them and then EXPORT them. 6 * The kernel code uses the macro defined by include/linux/string.h, 7 * so I undef macros; the userspace code does not include that and I 8 * add an EXPORT for the glibc one. 9 */ 10 11#undef strlen 12#undef strstr 13#undef memcpy 14#undef memset 15 16extern size_t strlen(const char *); 17extern void *memmove(void *, const void *, size_t); 18extern void *memset(void *, int, size_t); 19extern int printf(const char *, ...); 20 21/* If it's not defined, the export is included in lib/string.c.*/ 22#ifdef __HAVE_ARCH_STRSTR 23EXPORT_SYMBOL(strstr); 24#endif 25 26#ifndef __x86_64__ 27extern void *memcpy(void *, const void *, size_t); 28EXPORT_SYMBOL(memcpy); 29#endif 30 31EXPORT_SYMBOL(memmove); 32EXPORT_SYMBOL(memset); 33EXPORT_SYMBOL(printf); 34 35/* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms. 36 * However, the modules will use the CRC defined *here*, no matter if it is 37 * good; so the versions of these symbols will always match 38 */ 39#define EXPORT_SYMBOL_PROTO(sym) \ 40 int sym(void); \ 41 EXPORT_SYMBOL(sym); 42 43extern void readdir64(void) __attribute__((weak)); 44EXPORT_SYMBOL(readdir64); 45extern void truncate64(void) __attribute__((weak)); 46EXPORT_SYMBOL(truncate64); 47 48#ifdef SUBARCH_i386 49EXPORT_SYMBOL(vsyscall_ehdr); 50EXPORT_SYMBOL(vsyscall_end); 51#endif 52 53EXPORT_SYMBOL_PROTO(__errno_location); 54 55EXPORT_SYMBOL_PROTO(access); 56EXPORT_SYMBOL_PROTO(open); 57EXPORT_SYMBOL_PROTO(open64); 58EXPORT_SYMBOL_PROTO(close); 59EXPORT_SYMBOL_PROTO(read); 60EXPORT_SYMBOL_PROTO(write); 61EXPORT_SYMBOL_PROTO(dup2); 62EXPORT_SYMBOL_PROTO(__xstat); 63EXPORT_SYMBOL_PROTO(__lxstat); 64EXPORT_SYMBOL_PROTO(__lxstat64); 65EXPORT_SYMBOL_PROTO(__fxstat64); 66EXPORT_SYMBOL_PROTO(lseek); 67EXPORT_SYMBOL_PROTO(lseek64); 68EXPORT_SYMBOL_PROTO(chown); 69EXPORT_SYMBOL_PROTO(fchown); 70EXPORT_SYMBOL_PROTO(truncate); 71EXPORT_SYMBOL_PROTO(ftruncate64); 72EXPORT_SYMBOL_PROTO(utime); 73EXPORT_SYMBOL_PROTO(utimes); 74EXPORT_SYMBOL_PROTO(futimes); 75EXPORT_SYMBOL_PROTO(chmod); 76EXPORT_SYMBOL_PROTO(fchmod); 77EXPORT_SYMBOL_PROTO(rename); 78EXPORT_SYMBOL_PROTO(__xmknod); 79 80EXPORT_SYMBOL_PROTO(symlink); 81EXPORT_SYMBOL_PROTO(link); 82EXPORT_SYMBOL_PROTO(unlink); 83EXPORT_SYMBOL_PROTO(readlink); 84 85EXPORT_SYMBOL_PROTO(mkdir); 86EXPORT_SYMBOL_PROTO(rmdir); 87EXPORT_SYMBOL_PROTO(opendir); 88EXPORT_SYMBOL_PROTO(readdir); 89EXPORT_SYMBOL_PROTO(closedir); 90EXPORT_SYMBOL_PROTO(seekdir); 91EXPORT_SYMBOL_PROTO(telldir); 92 93EXPORT_SYMBOL_PROTO(ioctl); 94 95EXPORT_SYMBOL_PROTO(pread64); 96EXPORT_SYMBOL_PROTO(pwrite64); 97 98EXPORT_SYMBOL_PROTO(statfs); 99EXPORT_SYMBOL_PROTO(statfs64); 100 101EXPORT_SYMBOL_PROTO(getuid); 102 103EXPORT_SYMBOL_PROTO(fsync); 104EXPORT_SYMBOL_PROTO(fdatasync); 105 106EXPORT_SYMBOL_PROTO(lstat64); 107EXPORT_SYMBOL_PROTO(fstat64); 108EXPORT_SYMBOL_PROTO(mknod); 109 110/* Export symbols used by GCC for the stack protector. */ 111extern void __stack_smash_handler(void *) __attribute__((weak)); 112EXPORT_SYMBOL(__stack_smash_handler); 113 114extern long __guard __attribute__((weak)); 115EXPORT_SYMBOL(__guard); 116