11da177e4SLinus Torvalds #include "linux/types.h" 21da177e4SLinus Torvalds #include "linux/module.h" 31da177e4SLinus Torvalds 41da177e4SLinus Torvalds /* Some of this are builtin function (some are not but could in the future), 51da177e4SLinus Torvalds * so I *must* declare good prototypes for them and then EXPORT them. 61da177e4SLinus Torvalds * The kernel code uses the macro defined by include/linux/string.h, 71da177e4SLinus Torvalds * so I undef macros; the userspace code does not include that and I 8*e8234483SJeff Dike * add an EXPORT for the glibc one. 9*e8234483SJeff Dike */ 101da177e4SLinus Torvalds 111da177e4SLinus Torvalds #undef strlen 121da177e4SLinus Torvalds #undef strstr 131da177e4SLinus Torvalds #undef memcpy 141da177e4SLinus Torvalds #undef memset 151da177e4SLinus Torvalds 161da177e4SLinus Torvalds extern size_t strlen(const char *); 171da177e4SLinus Torvalds extern void *memcpy(void *, const void *, size_t); 181da177e4SLinus Torvalds extern void *memmove(void *, const void *, size_t); 191da177e4SLinus Torvalds extern void *memset(void *, int, size_t); 201da177e4SLinus Torvalds extern int printf(const char *, ...); 211da177e4SLinus Torvalds 227c45ad16SPaolo 'Blaisorblade' Giarrusso /* If they're not defined, the export is included in lib/string.c.*/ 237c45ad16SPaolo 'Blaisorblade' Giarrusso #ifdef __HAVE_ARCH_STRLEN 241da177e4SLinus Torvalds EXPORT_SYMBOL(strlen); 257c45ad16SPaolo 'Blaisorblade' Giarrusso #endif 267c45ad16SPaolo 'Blaisorblade' Giarrusso #ifdef __HAVE_ARCH_STRSTR 277c45ad16SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(strstr); 287c45ad16SPaolo 'Blaisorblade' Giarrusso #endif 297c45ad16SPaolo 'Blaisorblade' Giarrusso 301da177e4SLinus Torvalds EXPORT_SYMBOL(memcpy); 311da177e4SLinus Torvalds EXPORT_SYMBOL(memmove); 321da177e4SLinus Torvalds EXPORT_SYMBOL(memset); 331da177e4SLinus Torvalds EXPORT_SYMBOL(printf); 341da177e4SLinus Torvalds 351da177e4SLinus Torvalds /* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms. 361da177e4SLinus Torvalds * However, the modules will use the CRC defined *here*, no matter if it is 371da177e4SLinus Torvalds * good; so the versions of these symbols will always match 381da177e4SLinus Torvalds */ 391da177e4SLinus Torvalds #define EXPORT_SYMBOL_PROTO(sym) \ 401da177e4SLinus Torvalds int sym(void); \ 411da177e4SLinus Torvalds EXPORT_SYMBOL(sym); 421da177e4SLinus Torvalds 4374433c0fSPaolo 'Blaisorblade' Giarrusso extern void readdir64(void) __attribute__((weak)); 4474433c0fSPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(readdir64); 4574433c0fSPaolo 'Blaisorblade' Giarrusso extern void truncate64(void) __attribute__((weak)); 4674433c0fSPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(truncate64); 4774433c0fSPaolo 'Blaisorblade' Giarrusso 481da177e4SLinus Torvalds #ifdef SUBARCH_i386 491da177e4SLinus Torvalds EXPORT_SYMBOL(vsyscall_ehdr); 501da177e4SLinus Torvalds EXPORT_SYMBOL(vsyscall_end); 511da177e4SLinus Torvalds #endif 521da177e4SLinus Torvalds 531da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(__errno_location); 541da177e4SLinus Torvalds 551da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(access); 561da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(open); 571da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(open64); 581da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(close); 591da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(read); 601da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(write); 611da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(dup2); 621da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(__xstat); 631da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(__lxstat); 641da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(__lxstat64); 65*e8234483SJeff Dike EXPORT_SYMBOL_PROTO(__fxstat64); 661da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(lseek); 671da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(lseek64); 681da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(chown); 69*e8234483SJeff Dike EXPORT_SYMBOL_PROTO(fchown); 701da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(truncate); 71*e8234483SJeff Dike EXPORT_SYMBOL_PROTO(ftruncate64); 721da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(utime); 73*e8234483SJeff Dike EXPORT_SYMBOL_PROTO(utimes); 74*e8234483SJeff Dike EXPORT_SYMBOL_PROTO(futimes); 751da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(chmod); 76*e8234483SJeff Dike EXPORT_SYMBOL_PROTO(fchmod); 771da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(rename); 781da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(__xmknod); 791da177e4SLinus Torvalds 801da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(symlink); 811da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(link); 821da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(unlink); 831da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(readlink); 841da177e4SLinus Torvalds 851da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(mkdir); 861da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(rmdir); 871da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(opendir); 881da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(readdir); 891da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(closedir); 901da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(seekdir); 911da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(telldir); 921da177e4SLinus Torvalds 931da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(ioctl); 941da177e4SLinus Torvalds 951da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(pread64); 961da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(pwrite64); 971da177e4SLinus Torvalds 981da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(statfs); 991da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(statfs64); 1001da177e4SLinus Torvalds 1011da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(getuid); 1021da177e4SLinus Torvalds 103a2d76bd8SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL_PROTO(fsync); 104a2d76bd8SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL_PROTO(fdatasync); 105a2d76bd8SPaolo 'Blaisorblade' Giarrusso 106cead61a6SPaolo 'Blaisorblade' Giarrusso /* Export symbols used by GCC for the stack protector. */ 107cead61a6SPaolo 'Blaisorblade' Giarrusso extern void __stack_smash_handler(void *) __attribute__((weak)); 108cead61a6SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(__stack_smash_handler); 109cead61a6SPaolo 'Blaisorblade' Giarrusso 110cead61a6SPaolo 'Blaisorblade' Giarrusso extern long __guard __attribute__((weak)); 111cead61a6SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(__guard); 112