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#undef strlen 11#undef strstr 12#undef memcpy 13#undef memset 14 15extern size_t strlen(const char *); 16extern void *memcpy(void *, const void *, size_t); 17extern void *memmove(void *, const void *, size_t); 18extern void *memset(void *, int, size_t); 19extern int printf(const char *, ...); 20 21/* If they're not defined, the export is included in lib/string.c.*/ 22#ifdef __HAVE_ARCH_STRLEN 23EXPORT_SYMBOL(strlen); 24#endif 25#ifdef __HAVE_ARCH_STRSTR 26EXPORT_SYMBOL(strstr); 27#endif 28 29EXPORT_SYMBOL(memcpy); 30EXPORT_SYMBOL(memmove); 31EXPORT_SYMBOL(memset); 32EXPORT_SYMBOL(printf); 33 34/* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms. 35 * However, the modules will use the CRC defined *here*, no matter if it is 36 * good; so the versions of these symbols will always match 37 */ 38#define EXPORT_SYMBOL_PROTO(sym) \ 39 int sym(void); \ 40 EXPORT_SYMBOL(sym); 41 42extern void readdir64(void) __attribute__((weak)); 43EXPORT_SYMBOL(readdir64); 44extern void truncate64(void) __attribute__((weak)); 45EXPORT_SYMBOL(truncate64); 46 47#ifdef SUBARCH_i386 48EXPORT_SYMBOL(vsyscall_ehdr); 49EXPORT_SYMBOL(vsyscall_end); 50#endif 51 52EXPORT_SYMBOL_PROTO(__errno_location); 53 54EXPORT_SYMBOL_PROTO(access); 55EXPORT_SYMBOL_PROTO(open); 56EXPORT_SYMBOL_PROTO(open64); 57EXPORT_SYMBOL_PROTO(close); 58EXPORT_SYMBOL_PROTO(read); 59EXPORT_SYMBOL_PROTO(write); 60EXPORT_SYMBOL_PROTO(dup2); 61EXPORT_SYMBOL_PROTO(__xstat); 62EXPORT_SYMBOL_PROTO(__lxstat); 63EXPORT_SYMBOL_PROTO(__lxstat64); 64EXPORT_SYMBOL_PROTO(lseek); 65EXPORT_SYMBOL_PROTO(lseek64); 66EXPORT_SYMBOL_PROTO(chown); 67EXPORT_SYMBOL_PROTO(truncate); 68EXPORT_SYMBOL_PROTO(utime); 69EXPORT_SYMBOL_PROTO(chmod); 70EXPORT_SYMBOL_PROTO(rename); 71EXPORT_SYMBOL_PROTO(__xmknod); 72 73EXPORT_SYMBOL_PROTO(symlink); 74EXPORT_SYMBOL_PROTO(link); 75EXPORT_SYMBOL_PROTO(unlink); 76EXPORT_SYMBOL_PROTO(readlink); 77 78EXPORT_SYMBOL_PROTO(mkdir); 79EXPORT_SYMBOL_PROTO(rmdir); 80EXPORT_SYMBOL_PROTO(opendir); 81EXPORT_SYMBOL_PROTO(readdir); 82EXPORT_SYMBOL_PROTO(closedir); 83EXPORT_SYMBOL_PROTO(seekdir); 84EXPORT_SYMBOL_PROTO(telldir); 85 86EXPORT_SYMBOL_PROTO(ioctl); 87 88EXPORT_SYMBOL_PROTO(pread64); 89EXPORT_SYMBOL_PROTO(pwrite64); 90 91EXPORT_SYMBOL_PROTO(statfs); 92EXPORT_SYMBOL_PROTO(statfs64); 93 94EXPORT_SYMBOL_PROTO(getuid); 95 96EXPORT_SYMBOL_PROTO(fsync); 97EXPORT_SYMBOL_PROTO(fdatasync); 98 99/* Export symbols used by GCC for the stack protector. */ 100extern void __stack_smash_handler(void *) __attribute__((weak)); 101EXPORT_SYMBOL(__stack_smash_handler); 102 103extern long __guard __attribute__((weak)); 104EXPORT_SYMBOL(__guard); 105 106/* 107 * Overrides for Emacs so that we follow Linus's tabbing style. 108 * Emacs will notice this stuff at the end of the file and automatically 109 * adjust the settings for this buffer only. This must remain at the end 110 * of the file. 111 * --------------------------------------------------------------------------- 112 * Local variables: 113 * c-file-style: "linux" 114 * End: 115 */ 116