blob: 73926fa3f96b2e92efa8c3d301f89da027ee1808 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#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 Dikee8234482007-07-15 23:38:57 -07008 * add an EXPORT for the glibc one.
9 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
11#undef strlen
12#undef strstr
13#undef memcpy
14#undef memset
15
16extern size_t strlen(const char *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070017extern void *memmove(void *, const void *, size_t);
18extern void *memset(void *, int, size_t);
19extern int printf(const char *, ...);
20
Jeff Dike1a65f492007-07-23 18:43:46 -070021/* If it's not defined, the export is included in lib/string.c.*/
Paolo 'Blaisorblade' Giarrusso7c45ad12006-04-10 22:53:33 -070022#ifdef __HAVE_ARCH_STRSTR
23EXPORT_SYMBOL(strstr);
24#endif
25
akpm@linux-foundation.org00699e82009-03-12 14:31:24 -070026#ifndef __x86_64__
27extern void *memcpy(void *, const void *, size_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070028EXPORT_SYMBOL(memcpy);
akpm@linux-foundation.org00699e82009-03-12 14:31:24 -070029#endif
30
Linus Torvalds1da177e2005-04-16 15:20:36 -070031EXPORT_SYMBOL(memmove);
32EXPORT_SYMBOL(memset);
33EXPORT_SYMBOL(printf);
34
Linus Torvalds1da177e2005-04-16 15:20:36 -070035/* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms.
36 * However, the modules will use the CRC defined *here*, no matter if it is
37 * good; so the versions of these symbols will always match
38 */
39#define EXPORT_SYMBOL_PROTO(sym) \
Jeff Dike5134d8f2008-02-08 04:22:08 -080040 int sym(void); \
41 EXPORT_SYMBOL(sym);
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
Paolo 'Blaisorblade' Giarrusso74433c02005-12-29 17:39:59 +010043extern void readdir64(void) __attribute__((weak));
44EXPORT_SYMBOL(readdir64);
45extern void truncate64(void) __attribute__((weak));
46EXPORT_SYMBOL(truncate64);
47
Al Viroc6b17bb2012-02-10 19:02:28 -050048#ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA
Linus Torvalds1da177e2005-04-16 15:20:36 -070049EXPORT_SYMBOL(vsyscall_ehdr);
50EXPORT_SYMBOL(vsyscall_end);
51#endif
52
53EXPORT_SYMBOL_PROTO(__errno_location);
54
55EXPORT_SYMBOL_PROTO(access);
56EXPORT_SYMBOL_PROTO(open);
57EXPORT_SYMBOL_PROTO(open64);
58EXPORT_SYMBOL_PROTO(close);
59EXPORT_SYMBOL_PROTO(read);
60EXPORT_SYMBOL_PROTO(write);
61EXPORT_SYMBOL_PROTO(dup2);
62EXPORT_SYMBOL_PROTO(__xstat);
63EXPORT_SYMBOL_PROTO(__lxstat);
64EXPORT_SYMBOL_PROTO(__lxstat64);
Jeff Dikee8234482007-07-15 23:38:57 -070065EXPORT_SYMBOL_PROTO(__fxstat64);
Linus Torvalds1da177e2005-04-16 15:20:36 -070066EXPORT_SYMBOL_PROTO(lseek);
67EXPORT_SYMBOL_PROTO(lseek64);
68EXPORT_SYMBOL_PROTO(chown);
Jeff Dikee8234482007-07-15 23:38:57 -070069EXPORT_SYMBOL_PROTO(fchown);
Linus Torvalds1da177e2005-04-16 15:20:36 -070070EXPORT_SYMBOL_PROTO(truncate);
Jeff Dikee8234482007-07-15 23:38:57 -070071EXPORT_SYMBOL_PROTO(ftruncate64);
Linus Torvalds1da177e2005-04-16 15:20:36 -070072EXPORT_SYMBOL_PROTO(utime);
Jeff Dikee8234482007-07-15 23:38:57 -070073EXPORT_SYMBOL_PROTO(utimes);
74EXPORT_SYMBOL_PROTO(futimes);
Linus Torvalds1da177e2005-04-16 15:20:36 -070075EXPORT_SYMBOL_PROTO(chmod);
Jeff Dikee8234482007-07-15 23:38:57 -070076EXPORT_SYMBOL_PROTO(fchmod);
Linus Torvalds1da177e2005-04-16 15:20:36 -070077EXPORT_SYMBOL_PROTO(rename);
78EXPORT_SYMBOL_PROTO(__xmknod);
79
80EXPORT_SYMBOL_PROTO(symlink);
81EXPORT_SYMBOL_PROTO(link);
82EXPORT_SYMBOL_PROTO(unlink);
83EXPORT_SYMBOL_PROTO(readlink);
84
85EXPORT_SYMBOL_PROTO(mkdir);
86EXPORT_SYMBOL_PROTO(rmdir);
87EXPORT_SYMBOL_PROTO(opendir);
88EXPORT_SYMBOL_PROTO(readdir);
89EXPORT_SYMBOL_PROTO(closedir);
90EXPORT_SYMBOL_PROTO(seekdir);
91EXPORT_SYMBOL_PROTO(telldir);
92
93EXPORT_SYMBOL_PROTO(ioctl);
94
95EXPORT_SYMBOL_PROTO(pread64);
96EXPORT_SYMBOL_PROTO(pwrite64);
97
98EXPORT_SYMBOL_PROTO(statfs);
99EXPORT_SYMBOL_PROTO(statfs64);
100
101EXPORT_SYMBOL_PROTO(getuid);
102
Paolo 'Blaisorblade' Giarrussoa2d76bd2005-07-28 21:16:15 -0700103EXPORT_SYMBOL_PROTO(fsync);
104EXPORT_SYMBOL_PROTO(fdatasync);
105
Al Viro005a59e2009-04-21 01:27:08 -0400106EXPORT_SYMBOL_PROTO(lstat64);
107EXPORT_SYMBOL_PROTO(fstat64);
108EXPORT_SYMBOL_PROTO(mknod);
109
Paolo 'Blaisorblade' Giarrussocead61a2006-05-01 12:16:06 -0700110/* Export symbols used by GCC for the stack protector. */
111extern void __stack_smash_handler(void *) __attribute__((weak));
112EXPORT_SYMBOL(__stack_smash_handler);
113
114extern long __guard __attribute__((weak));
115EXPORT_SYMBOL(__guard);
Richard Weinbergerf956b3e2011-07-25 17:12:47 -0700116
117#ifdef _FORTIFY_SOURCE
118extern int __sprintf_chk(char *str, int flag, size_t strlen, const char *format);
119EXPORT_SYMBOL(__sprintf_chk);
120#endif