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