blob: 4c37b1b1d0b588d7a9c822a69d976a6a2ed26644 [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 *);
17extern void *memcpy(void *, const void *, size_t);
18extern void *memmove(void *, const void *, size_t);
19extern void *memset(void *, int, size_t);
20extern int printf(const char *, ...);
21
Jeff Dike1a65f492007-07-23 18:43:46 -070022/* If it's not defined, the export is included in lib/string.c.*/
Paolo 'Blaisorblade' Giarrusso7c45ad12006-04-10 22:53:33 -070023#ifdef __HAVE_ARCH_STRSTR
24EXPORT_SYMBOL(strstr);
25#endif
26
Linus Torvalds1da177e2005-04-16 15:20:36 -070027EXPORT_SYMBOL(memcpy);
28EXPORT_SYMBOL(memmove);
29EXPORT_SYMBOL(memset);
30EXPORT_SYMBOL(printf);
31
Linus Torvalds1da177e2005-04-16 15:20:36 -070032/* 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) \
37 int sym(void); \
38 EXPORT_SYMBOL(sym);
39
Paolo 'Blaisorblade' Giarrusso74433c02005-12-29 17:39:59 +010040extern void readdir64(void) __attribute__((weak));
41EXPORT_SYMBOL(readdir64);
42extern void truncate64(void) __attribute__((weak));
43EXPORT_SYMBOL(truncate64);
44
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#ifdef SUBARCH_i386
46EXPORT_SYMBOL(vsyscall_ehdr);
47EXPORT_SYMBOL(vsyscall_end);
48#endif
49
50EXPORT_SYMBOL_PROTO(__errno_location);
51
52EXPORT_SYMBOL_PROTO(access);
53EXPORT_SYMBOL_PROTO(open);
54EXPORT_SYMBOL_PROTO(open64);
55EXPORT_SYMBOL_PROTO(close);
56EXPORT_SYMBOL_PROTO(read);
57EXPORT_SYMBOL_PROTO(write);
58EXPORT_SYMBOL_PROTO(dup2);
59EXPORT_SYMBOL_PROTO(__xstat);
60EXPORT_SYMBOL_PROTO(__lxstat);
61EXPORT_SYMBOL_PROTO(__lxstat64);
Jeff Dikee8234482007-07-15 23:38:57 -070062EXPORT_SYMBOL_PROTO(__fxstat64);
Linus Torvalds1da177e2005-04-16 15:20:36 -070063EXPORT_SYMBOL_PROTO(lseek);
64EXPORT_SYMBOL_PROTO(lseek64);
65EXPORT_SYMBOL_PROTO(chown);
Jeff Dikee8234482007-07-15 23:38:57 -070066EXPORT_SYMBOL_PROTO(fchown);
Linus Torvalds1da177e2005-04-16 15:20:36 -070067EXPORT_SYMBOL_PROTO(truncate);
Jeff Dikee8234482007-07-15 23:38:57 -070068EXPORT_SYMBOL_PROTO(ftruncate64);
Linus Torvalds1da177e2005-04-16 15:20:36 -070069EXPORT_SYMBOL_PROTO(utime);
Jeff Dikee8234482007-07-15 23:38:57 -070070EXPORT_SYMBOL_PROTO(utimes);
71EXPORT_SYMBOL_PROTO(futimes);
Linus Torvalds1da177e2005-04-16 15:20:36 -070072EXPORT_SYMBOL_PROTO(chmod);
Jeff Dikee8234482007-07-15 23:38:57 -070073EXPORT_SYMBOL_PROTO(fchmod);
Linus Torvalds1da177e2005-04-16 15:20:36 -070074EXPORT_SYMBOL_PROTO(rename);
75EXPORT_SYMBOL_PROTO(__xmknod);
76
77EXPORT_SYMBOL_PROTO(symlink);
78EXPORT_SYMBOL_PROTO(link);
79EXPORT_SYMBOL_PROTO(unlink);
80EXPORT_SYMBOL_PROTO(readlink);
81
82EXPORT_SYMBOL_PROTO(mkdir);
83EXPORT_SYMBOL_PROTO(rmdir);
84EXPORT_SYMBOL_PROTO(opendir);
85EXPORT_SYMBOL_PROTO(readdir);
86EXPORT_SYMBOL_PROTO(closedir);
87EXPORT_SYMBOL_PROTO(seekdir);
88EXPORT_SYMBOL_PROTO(telldir);
89
90EXPORT_SYMBOL_PROTO(ioctl);
91
92EXPORT_SYMBOL_PROTO(pread64);
93EXPORT_SYMBOL_PROTO(pwrite64);
94
95EXPORT_SYMBOL_PROTO(statfs);
96EXPORT_SYMBOL_PROTO(statfs64);
97
98EXPORT_SYMBOL_PROTO(getuid);
99
Paolo 'Blaisorblade' Giarrussoa2d76bd2005-07-28 21:16:15 -0700100EXPORT_SYMBOL_PROTO(fsync);
101EXPORT_SYMBOL_PROTO(fdatasync);
102
Paolo 'Blaisorblade' Giarrussocead61a2006-05-01 12:16:06 -0700103/* Export symbols used by GCC for the stack protector. */
104extern void __stack_smash_handler(void *) __attribute__((weak));
105EXPORT_SYMBOL(__stack_smash_handler);
106
107extern long __guard __attribute__((weak));
108EXPORT_SYMBOL(__guard);