xref: /linux/arch/um/os-Linux/user_syms.c (revision 37185b33240870719b6b5913a46e6a441f1ae96f)
1*37185b33SAl Viro #include <linux/types.h>
2*37185b33SAl Viro #include <linux/module.h>
31da177e4SLinus Torvalds 
41da177e4SLinus Torvalds /* Some of this are builtin function (some are not but could in the future),
51da177e4SLinus Torvalds  * so I *must* declare good prototypes for them and then EXPORT them.
61da177e4SLinus Torvalds  * The kernel code uses the macro defined by include/linux/string.h,
71da177e4SLinus Torvalds  * so I undef macros; the userspace code does not include that and I
8e8234483SJeff Dike  * add an EXPORT for the glibc one.
9e8234483SJeff Dike  */
101da177e4SLinus Torvalds 
111da177e4SLinus Torvalds #undef strlen
121da177e4SLinus Torvalds #undef strstr
131da177e4SLinus Torvalds #undef memcpy
141da177e4SLinus Torvalds #undef memset
151da177e4SLinus Torvalds 
161da177e4SLinus Torvalds extern size_t strlen(const char *);
171da177e4SLinus Torvalds extern void *memmove(void *, const void *, size_t);
181da177e4SLinus Torvalds extern void *memset(void *, int, size_t);
191da177e4SLinus Torvalds extern int printf(const char *, ...);
201da177e4SLinus Torvalds 
211a65f493SJeff Dike /* If it's not defined, the export is included in lib/string.c.*/
227c45ad16SPaolo 'Blaisorblade' Giarrusso #ifdef __HAVE_ARCH_STRSTR
237c45ad16SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(strstr);
247c45ad16SPaolo 'Blaisorblade' Giarrusso #endif
257c45ad16SPaolo 'Blaisorblade' Giarrusso 
2600699e84Sakpm@linux-foundation.org #ifndef __x86_64__
2700699e84Sakpm@linux-foundation.org extern void *memcpy(void *, const void *, size_t);
281da177e4SLinus Torvalds EXPORT_SYMBOL(memcpy);
2900699e84Sakpm@linux-foundation.org #endif
3000699e84Sakpm@linux-foundation.org 
311da177e4SLinus Torvalds EXPORT_SYMBOL(memmove);
321da177e4SLinus Torvalds EXPORT_SYMBOL(memset);
331da177e4SLinus Torvalds EXPORT_SYMBOL(printf);
341da177e4SLinus Torvalds 
351da177e4SLinus Torvalds /* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms.
361da177e4SLinus Torvalds  * However, the modules will use the CRC defined *here*, no matter if it is
371da177e4SLinus Torvalds  * good; so the versions of these symbols will always match
381da177e4SLinus Torvalds  */
391da177e4SLinus Torvalds #define EXPORT_SYMBOL_PROTO(sym)       \
401da177e4SLinus Torvalds 	int sym(void);                  \
411da177e4SLinus Torvalds 	EXPORT_SYMBOL(sym);
421da177e4SLinus Torvalds 
4374433c0fSPaolo 'Blaisorblade' Giarrusso extern void readdir64(void) __attribute__((weak));
4474433c0fSPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(readdir64);
4574433c0fSPaolo 'Blaisorblade' Giarrusso extern void truncate64(void) __attribute__((weak));
4674433c0fSPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(truncate64);
4774433c0fSPaolo 'Blaisorblade' Giarrusso 
48c6b17bbdSAl Viro #ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA
491da177e4SLinus Torvalds EXPORT_SYMBOL(vsyscall_ehdr);
501da177e4SLinus Torvalds EXPORT_SYMBOL(vsyscall_end);
511da177e4SLinus Torvalds #endif
521da177e4SLinus Torvalds 
531da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(__errno_location);
541da177e4SLinus Torvalds 
551da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(access);
561da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(open);
571da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(open64);
581da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(close);
591da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(read);
601da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(write);
611da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(dup2);
621da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(__xstat);
631da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(__lxstat);
641da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(__lxstat64);
65e8234483SJeff Dike EXPORT_SYMBOL_PROTO(__fxstat64);
661da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(lseek);
671da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(lseek64);
681da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(chown);
69e8234483SJeff Dike EXPORT_SYMBOL_PROTO(fchown);
701da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(truncate);
71e8234483SJeff Dike EXPORT_SYMBOL_PROTO(ftruncate64);
721da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(utime);
73e8234483SJeff Dike EXPORT_SYMBOL_PROTO(utimes);
74e8234483SJeff Dike EXPORT_SYMBOL_PROTO(futimes);
751da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(chmod);
76e8234483SJeff Dike EXPORT_SYMBOL_PROTO(fchmod);
771da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(rename);
781da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(__xmknod);
791da177e4SLinus Torvalds 
801da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(symlink);
811da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(link);
821da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(unlink);
831da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(readlink);
841da177e4SLinus Torvalds 
851da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(mkdir);
861da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(rmdir);
871da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(opendir);
881da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(readdir);
891da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(closedir);
901da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(seekdir);
911da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(telldir);
921da177e4SLinus Torvalds 
931da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(ioctl);
941da177e4SLinus Torvalds 
951da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(pread64);
961da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(pwrite64);
971da177e4SLinus Torvalds 
981da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(statfs);
991da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(statfs64);
1001da177e4SLinus Torvalds 
1011da177e4SLinus Torvalds EXPORT_SYMBOL_PROTO(getuid);
1021da177e4SLinus Torvalds 
103a2d76bd8SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL_PROTO(fsync);
104a2d76bd8SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL_PROTO(fdatasync);
105a2d76bd8SPaolo 'Blaisorblade' Giarrusso 
106005a59ecSAl Viro EXPORT_SYMBOL_PROTO(lstat64);
107005a59ecSAl Viro EXPORT_SYMBOL_PROTO(fstat64);
108005a59ecSAl Viro EXPORT_SYMBOL_PROTO(mknod);
109005a59ecSAl Viro 
110cead61a6SPaolo 'Blaisorblade' Giarrusso /* Export symbols used by GCC for the stack protector. */
111cead61a6SPaolo 'Blaisorblade' Giarrusso extern void __stack_smash_handler(void *) __attribute__((weak));
112cead61a6SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(__stack_smash_handler);
113cead61a6SPaolo 'Blaisorblade' Giarrusso 
114cead61a6SPaolo 'Blaisorblade' Giarrusso extern long __guard __attribute__((weak));
115cead61a6SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(__guard);
116f956b3e4SRichard Weinberger 
117f956b3e4SRichard Weinberger #ifdef _FORTIFY_SOURCE
118f956b3e4SRichard Weinberger extern int __sprintf_chk(char *str, int flag, size_t strlen, const char *format);
119f956b3e4SRichard Weinberger EXPORT_SYMBOL(__sprintf_chk);
120f956b3e4SRichard Weinberger #endif
121