blob: 2598158e1f53a30fff62dc85c24f474c89cfe890 [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
8 * add an EXPORT for the glibc one.*/
9
10#undef strlen
11#undef strstr
12#undef memcpy
13#undef memset
14
15extern size_t strlen(const char *);
16extern void *memcpy(void *, const void *, size_t);
17extern void *memmove(void *, const void *, size_t);
18extern void *memset(void *, int, size_t);
19extern int printf(const char *, ...);
20
Paolo 'Blaisorblade' Giarrusso7c45ad12006-04-10 22:53:33 -070021/* If they're not defined, the export is included in lib/string.c.*/
22#ifdef __HAVE_ARCH_STRLEN
Linus Torvalds1da177e2005-04-16 15:20:36 -070023EXPORT_SYMBOL(strlen);
Paolo 'Blaisorblade' Giarrusso7c45ad12006-04-10 22:53:33 -070024#endif
25#ifdef __HAVE_ARCH_STRSTR
26EXPORT_SYMBOL(strstr);
27#endif
28
Linus Torvalds1da177e2005-04-16 15:20:36 -070029EXPORT_SYMBOL(memcpy);
30EXPORT_SYMBOL(memmove);
31EXPORT_SYMBOL(memset);
32EXPORT_SYMBOL(printf);
33
Linus Torvalds1da177e2005-04-16 15:20:36 -070034/* 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
Paolo 'Blaisorblade' Giarrusso74433c02005-12-29 17:39:59 +010042extern void readdir64(void) __attribute__((weak));
43EXPORT_SYMBOL(readdir64);
44extern void truncate64(void) __attribute__((weak));
45EXPORT_SYMBOL(truncate64);
46
Linus Torvalds1da177e2005-04-16 15:20:36 -070047#ifdef SUBARCH_i386
48EXPORT_SYMBOL(vsyscall_ehdr);
49EXPORT_SYMBOL(vsyscall_end);
50#endif
51
52EXPORT_SYMBOL_PROTO(__errno_location);
53
54EXPORT_SYMBOL_PROTO(access);
55EXPORT_SYMBOL_PROTO(open);
56EXPORT_SYMBOL_PROTO(open64);
57EXPORT_SYMBOL_PROTO(close);
58EXPORT_SYMBOL_PROTO(read);
59EXPORT_SYMBOL_PROTO(write);
60EXPORT_SYMBOL_PROTO(dup2);
61EXPORT_SYMBOL_PROTO(__xstat);
62EXPORT_SYMBOL_PROTO(__lxstat);
63EXPORT_SYMBOL_PROTO(__lxstat64);
64EXPORT_SYMBOL_PROTO(lseek);
65EXPORT_SYMBOL_PROTO(lseek64);
66EXPORT_SYMBOL_PROTO(chown);
67EXPORT_SYMBOL_PROTO(truncate);
68EXPORT_SYMBOL_PROTO(utime);
69EXPORT_SYMBOL_PROTO(chmod);
70EXPORT_SYMBOL_PROTO(rename);
71EXPORT_SYMBOL_PROTO(__xmknod);
72
73EXPORT_SYMBOL_PROTO(symlink);
74EXPORT_SYMBOL_PROTO(link);
75EXPORT_SYMBOL_PROTO(unlink);
76EXPORT_SYMBOL_PROTO(readlink);
77
78EXPORT_SYMBOL_PROTO(mkdir);
79EXPORT_SYMBOL_PROTO(rmdir);
80EXPORT_SYMBOL_PROTO(opendir);
81EXPORT_SYMBOL_PROTO(readdir);
82EXPORT_SYMBOL_PROTO(closedir);
83EXPORT_SYMBOL_PROTO(seekdir);
84EXPORT_SYMBOL_PROTO(telldir);
85
86EXPORT_SYMBOL_PROTO(ioctl);
87
88EXPORT_SYMBOL_PROTO(pread64);
89EXPORT_SYMBOL_PROTO(pwrite64);
90
91EXPORT_SYMBOL_PROTO(statfs);
92EXPORT_SYMBOL_PROTO(statfs64);
93
94EXPORT_SYMBOL_PROTO(getuid);
95
Paolo 'Blaisorblade' Giarrussoa2d76bd2005-07-28 21:16:15 -070096EXPORT_SYMBOL_PROTO(fsync);
97EXPORT_SYMBOL_PROTO(fdatasync);
98
Linus Torvalds1da177e2005-04-16 15:20:36 -070099/*
100 * Overrides for Emacs so that we follow Linus's tabbing style.
101 * Emacs will notice this stuff at the end of the file and automatically
102 * adjust the settings for this buffer only. This must remain at the end
103 * of the file.
104 * ---------------------------------------------------------------------------
105 * Local variables:
106 * c-file-style: "linux"
107 * End:
108 */