Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 |
Jeff Dike | e823448 | 2007-07-15 23:38:57 -0700 | [diff] [blame] | 8 | * add an EXPORT for the glibc one. |
| 9 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | |
| 11 | #undef strlen |
| 12 | #undef strstr |
| 13 | #undef memcpy |
| 14 | #undef memset |
| 15 | |
| 16 | extern size_t strlen(const char *); |
| 17 | extern void *memcpy(void *, const void *, size_t); |
| 18 | extern void *memmove(void *, const void *, size_t); |
| 19 | extern void *memset(void *, int, size_t); |
| 20 | extern int printf(const char *, ...); |
| 21 | |
Jeff Dike | 1a65f49 | 2007-07-23 18:43:46 -0700 | [diff] [blame] | 22 | /* If it's not defined, the export is included in lib/string.c.*/ |
Paolo 'Blaisorblade' Giarrusso | 7c45ad1 | 2006-04-10 22:53:33 -0700 | [diff] [blame] | 23 | #ifdef __HAVE_ARCH_STRSTR |
| 24 | EXPORT_SYMBOL(strstr); |
| 25 | #endif |
| 26 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | EXPORT_SYMBOL(memcpy); |
| 28 | EXPORT_SYMBOL(memmove); |
| 29 | EXPORT_SYMBOL(memset); |
| 30 | EXPORT_SYMBOL(printf); |
| 31 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | /* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms. |
| 33 | * However, the modules will use the CRC defined *here*, no matter if it is |
| 34 | * good; so the versions of these symbols will always match |
| 35 | */ |
| 36 | #define EXPORT_SYMBOL_PROTO(sym) \ |
Jeff Dike | 5134d8f | 2008-02-08 04:22:08 -0800 | [diff] [blame] | 37 | int sym(void); \ |
| 38 | EXPORT_SYMBOL(sym); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Paolo 'Blaisorblade' Giarrusso | 74433c0 | 2005-12-29 17:39:59 +0100 | [diff] [blame] | 40 | extern void readdir64(void) __attribute__((weak)); |
| 41 | EXPORT_SYMBOL(readdir64); |
| 42 | extern void truncate64(void) __attribute__((weak)); |
| 43 | EXPORT_SYMBOL(truncate64); |
| 44 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | #ifdef SUBARCH_i386 |
| 46 | EXPORT_SYMBOL(vsyscall_ehdr); |
| 47 | EXPORT_SYMBOL(vsyscall_end); |
| 48 | #endif |
| 49 | |
| 50 | EXPORT_SYMBOL_PROTO(__errno_location); |
| 51 | |
| 52 | EXPORT_SYMBOL_PROTO(access); |
| 53 | EXPORT_SYMBOL_PROTO(open); |
| 54 | EXPORT_SYMBOL_PROTO(open64); |
| 55 | EXPORT_SYMBOL_PROTO(close); |
| 56 | EXPORT_SYMBOL_PROTO(read); |
| 57 | EXPORT_SYMBOL_PROTO(write); |
| 58 | EXPORT_SYMBOL_PROTO(dup2); |
| 59 | EXPORT_SYMBOL_PROTO(__xstat); |
| 60 | EXPORT_SYMBOL_PROTO(__lxstat); |
| 61 | EXPORT_SYMBOL_PROTO(__lxstat64); |
Jeff Dike | e823448 | 2007-07-15 23:38:57 -0700 | [diff] [blame] | 62 | EXPORT_SYMBOL_PROTO(__fxstat64); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | EXPORT_SYMBOL_PROTO(lseek); |
| 64 | EXPORT_SYMBOL_PROTO(lseek64); |
| 65 | EXPORT_SYMBOL_PROTO(chown); |
Jeff Dike | e823448 | 2007-07-15 23:38:57 -0700 | [diff] [blame] | 66 | EXPORT_SYMBOL_PROTO(fchown); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | EXPORT_SYMBOL_PROTO(truncate); |
Jeff Dike | e823448 | 2007-07-15 23:38:57 -0700 | [diff] [blame] | 68 | EXPORT_SYMBOL_PROTO(ftruncate64); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | EXPORT_SYMBOL_PROTO(utime); |
Jeff Dike | e823448 | 2007-07-15 23:38:57 -0700 | [diff] [blame] | 70 | EXPORT_SYMBOL_PROTO(utimes); |
| 71 | EXPORT_SYMBOL_PROTO(futimes); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | EXPORT_SYMBOL_PROTO(chmod); |
Jeff Dike | e823448 | 2007-07-15 23:38:57 -0700 | [diff] [blame] | 73 | EXPORT_SYMBOL_PROTO(fchmod); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | EXPORT_SYMBOL_PROTO(rename); |
| 75 | EXPORT_SYMBOL_PROTO(__xmknod); |
| 76 | |
| 77 | EXPORT_SYMBOL_PROTO(symlink); |
| 78 | EXPORT_SYMBOL_PROTO(link); |
| 79 | EXPORT_SYMBOL_PROTO(unlink); |
| 80 | EXPORT_SYMBOL_PROTO(readlink); |
| 81 | |
| 82 | EXPORT_SYMBOL_PROTO(mkdir); |
| 83 | EXPORT_SYMBOL_PROTO(rmdir); |
| 84 | EXPORT_SYMBOL_PROTO(opendir); |
| 85 | EXPORT_SYMBOL_PROTO(readdir); |
| 86 | EXPORT_SYMBOL_PROTO(closedir); |
| 87 | EXPORT_SYMBOL_PROTO(seekdir); |
| 88 | EXPORT_SYMBOL_PROTO(telldir); |
| 89 | |
| 90 | EXPORT_SYMBOL_PROTO(ioctl); |
| 91 | |
| 92 | EXPORT_SYMBOL_PROTO(pread64); |
| 93 | EXPORT_SYMBOL_PROTO(pwrite64); |
| 94 | |
| 95 | EXPORT_SYMBOL_PROTO(statfs); |
| 96 | EXPORT_SYMBOL_PROTO(statfs64); |
| 97 | |
| 98 | EXPORT_SYMBOL_PROTO(getuid); |
| 99 | |
Paolo 'Blaisorblade' Giarrusso | a2d76bd | 2005-07-28 21:16:15 -0700 | [diff] [blame] | 100 | EXPORT_SYMBOL_PROTO(fsync); |
| 101 | EXPORT_SYMBOL_PROTO(fdatasync); |
| 102 | |
Paolo 'Blaisorblade' Giarrusso | cead61a | 2006-05-01 12:16:06 -0700 | [diff] [blame] | 103 | /* Export symbols used by GCC for the stack protector. */ |
| 104 | extern void __stack_smash_handler(void *) __attribute__((weak)); |
| 105 | EXPORT_SYMBOL(__stack_smash_handler); |
| 106 | |
| 107 | extern long __guard __attribute__((weak)); |
| 108 | EXPORT_SYMBOL(__guard); |