Commit | Line | Data |
---|---|---|
1da177e4 LT |
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 | ||
15 | extern size_t strlen(const char *); | |
16 | extern void *memcpy(void *, const void *, size_t); | |
17 | extern void *memmove(void *, const void *, size_t); | |
18 | extern void *memset(void *, int, size_t); | |
19 | extern int printf(const char *, ...); | |
20 | ||
7c45ad16 PBG |
21 | /* If they're not defined, the export is included in lib/string.c.*/ |
22 | #ifdef __HAVE_ARCH_STRLEN | |
1da177e4 | 23 | EXPORT_SYMBOL(strlen); |
7c45ad16 PBG |
24 | #endif |
25 | #ifdef __HAVE_ARCH_STRSTR | |
26 | EXPORT_SYMBOL(strstr); | |
27 | #endif | |
28 | ||
1da177e4 LT |
29 | EXPORT_SYMBOL(memcpy); |
30 | EXPORT_SYMBOL(memmove); | |
31 | EXPORT_SYMBOL(memset); | |
32 | EXPORT_SYMBOL(printf); | |
33 | ||
1da177e4 LT |
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 | ||
74433c0f PBG |
42 | extern void readdir64(void) __attribute__((weak)); |
43 | EXPORT_SYMBOL(readdir64); | |
44 | extern void truncate64(void) __attribute__((weak)); | |
45 | EXPORT_SYMBOL(truncate64); | |
46 | ||
1da177e4 LT |
47 | #ifdef SUBARCH_i386 |
48 | EXPORT_SYMBOL(vsyscall_ehdr); | |
49 | EXPORT_SYMBOL(vsyscall_end); | |
50 | #endif | |
51 | ||
52 | EXPORT_SYMBOL_PROTO(__errno_location); | |
53 | ||
54 | EXPORT_SYMBOL_PROTO(access); | |
55 | EXPORT_SYMBOL_PROTO(open); | |
56 | EXPORT_SYMBOL_PROTO(open64); | |
57 | EXPORT_SYMBOL_PROTO(close); | |
58 | EXPORT_SYMBOL_PROTO(read); | |
59 | EXPORT_SYMBOL_PROTO(write); | |
60 | EXPORT_SYMBOL_PROTO(dup2); | |
61 | EXPORT_SYMBOL_PROTO(__xstat); | |
62 | EXPORT_SYMBOL_PROTO(__lxstat); | |
63 | EXPORT_SYMBOL_PROTO(__lxstat64); | |
64 | EXPORT_SYMBOL_PROTO(lseek); | |
65 | EXPORT_SYMBOL_PROTO(lseek64); | |
66 | EXPORT_SYMBOL_PROTO(chown); | |
67 | EXPORT_SYMBOL_PROTO(truncate); | |
68 | EXPORT_SYMBOL_PROTO(utime); | |
69 | EXPORT_SYMBOL_PROTO(chmod); | |
70 | EXPORT_SYMBOL_PROTO(rename); | |
71 | EXPORT_SYMBOL_PROTO(__xmknod); | |
72 | ||
73 | EXPORT_SYMBOL_PROTO(symlink); | |
74 | EXPORT_SYMBOL_PROTO(link); | |
75 | EXPORT_SYMBOL_PROTO(unlink); | |
76 | EXPORT_SYMBOL_PROTO(readlink); | |
77 | ||
78 | EXPORT_SYMBOL_PROTO(mkdir); | |
79 | EXPORT_SYMBOL_PROTO(rmdir); | |
80 | EXPORT_SYMBOL_PROTO(opendir); | |
81 | EXPORT_SYMBOL_PROTO(readdir); | |
82 | EXPORT_SYMBOL_PROTO(closedir); | |
83 | EXPORT_SYMBOL_PROTO(seekdir); | |
84 | EXPORT_SYMBOL_PROTO(telldir); | |
85 | ||
86 | EXPORT_SYMBOL_PROTO(ioctl); | |
87 | ||
88 | EXPORT_SYMBOL_PROTO(pread64); | |
89 | EXPORT_SYMBOL_PROTO(pwrite64); | |
90 | ||
91 | EXPORT_SYMBOL_PROTO(statfs); | |
92 | EXPORT_SYMBOL_PROTO(statfs64); | |
93 | ||
94 | EXPORT_SYMBOL_PROTO(getuid); | |
95 | ||
a2d76bd8 PBG |
96 | EXPORT_SYMBOL_PROTO(fsync); |
97 | EXPORT_SYMBOL_PROTO(fdatasync); | |
98 | ||
cead61a6 PBG |
99 | /* Export symbols used by GCC for the stack protector. */ |
100 | extern void __stack_smash_handler(void *) __attribute__((weak)); | |
101 | EXPORT_SYMBOL(__stack_smash_handler); | |
102 | ||
103 | extern long __guard __attribute__((weak)); | |
104 | EXPORT_SYMBOL(__guard); | |
105 | ||
1da177e4 LT |
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 | */ |