linux/arch/um/os-Linux/user_syms.c
<<
>>
Prefs
   1#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
  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
  22/* If it's not defined, the export is included in lib/string.c.*/
  23#ifdef __HAVE_ARCH_STRSTR
  24EXPORT_SYMBOL(strstr);
  25#endif
  26
  27EXPORT_SYMBOL(memcpy);
  28EXPORT_SYMBOL(memmove);
  29EXPORT_SYMBOL(memset);
  30EXPORT_SYMBOL(printf);
  31
  32/* 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
  40extern void readdir64(void) __attribute__((weak));
  41EXPORT_SYMBOL(readdir64);
  42extern void truncate64(void) __attribute__((weak));
  43EXPORT_SYMBOL(truncate64);
  44
  45#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);
  62EXPORT_SYMBOL_PROTO(__fxstat64);
  63EXPORT_SYMBOL_PROTO(lseek);
  64EXPORT_SYMBOL_PROTO(lseek64);
  65EXPORT_SYMBOL_PROTO(chown);
  66EXPORT_SYMBOL_PROTO(fchown);
  67EXPORT_SYMBOL_PROTO(truncate);
  68EXPORT_SYMBOL_PROTO(ftruncate64);
  69EXPORT_SYMBOL_PROTO(utime);
  70EXPORT_SYMBOL_PROTO(utimes);
  71EXPORT_SYMBOL_PROTO(futimes);
  72EXPORT_SYMBOL_PROTO(chmod);
  73EXPORT_SYMBOL_PROTO(fchmod);
  74EXPORT_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
 100EXPORT_SYMBOL_PROTO(fsync);
 101EXPORT_SYMBOL_PROTO(fdatasync);
 102
 103/* 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);
 109
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.