user_syms.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #include "linux/types.h"
  2. #include "linux/module.h"
  3. /* Some of this are builtin function (some are not but could in the future),
  4. * so I *must* declare good prototypes for them and then EXPORT them.
  5. * The kernel code uses the macro defined by include/linux/string.h,
  6. * so I undef macros; the userspace code does not include that and I
  7. * add an EXPORT for the glibc one.*/
  8. #undef strlen
  9. #undef strstr
  10. #undef memcpy
  11. #undef memset
  12. extern size_t strlen(const char *);
  13. extern void *memcpy(void *, const void *, size_t);
  14. extern void *memmove(void *, const void *, size_t);
  15. extern void *memset(void *, int, size_t);
  16. extern int printf(const char *, ...);
  17. EXPORT_SYMBOL(strlen);
  18. EXPORT_SYMBOL(memcpy);
  19. EXPORT_SYMBOL(memmove);
  20. EXPORT_SYMBOL(memset);
  21. EXPORT_SYMBOL(printf);
  22. EXPORT_SYMBOL(strstr);
  23. /* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms.
  24. * However, the modules will use the CRC defined *here*, no matter if it is
  25. * good; so the versions of these symbols will always match
  26. */
  27. #define EXPORT_SYMBOL_PROTO(sym) \
  28. int sym(void); \
  29. EXPORT_SYMBOL(sym);
  30. extern void readdir64(void) __attribute__((weak));
  31. EXPORT_SYMBOL(readdir64);
  32. extern void truncate64(void) __attribute__((weak));
  33. EXPORT_SYMBOL(truncate64);
  34. #ifdef SUBARCH_i386
  35. EXPORT_SYMBOL(vsyscall_ehdr);
  36. EXPORT_SYMBOL(vsyscall_end);
  37. #endif
  38. EXPORT_SYMBOL_PROTO(__errno_location);
  39. EXPORT_SYMBOL_PROTO(access);
  40. EXPORT_SYMBOL_PROTO(open);
  41. EXPORT_SYMBOL_PROTO(open64);
  42. EXPORT_SYMBOL_PROTO(close);
  43. EXPORT_SYMBOL_PROTO(read);
  44. EXPORT_SYMBOL_PROTO(write);
  45. EXPORT_SYMBOL_PROTO(dup2);
  46. EXPORT_SYMBOL_PROTO(__xstat);
  47. EXPORT_SYMBOL_PROTO(__lxstat);
  48. EXPORT_SYMBOL_PROTO(__lxstat64);
  49. EXPORT_SYMBOL_PROTO(lseek);
  50. EXPORT_SYMBOL_PROTO(lseek64);
  51. EXPORT_SYMBOL_PROTO(chown);
  52. EXPORT_SYMBOL_PROTO(truncate);
  53. EXPORT_SYMBOL_PROTO(utime);
  54. EXPORT_SYMBOL_PROTO(chmod);
  55. EXPORT_SYMBOL_PROTO(rename);
  56. EXPORT_SYMBOL_PROTO(__xmknod);
  57. EXPORT_SYMBOL_PROTO(symlink);
  58. EXPORT_SYMBOL_PROTO(link);
  59. EXPORT_SYMBOL_PROTO(unlink);
  60. EXPORT_SYMBOL_PROTO(readlink);
  61. EXPORT_SYMBOL_PROTO(mkdir);
  62. EXPORT_SYMBOL_PROTO(rmdir);
  63. EXPORT_SYMBOL_PROTO(opendir);
  64. EXPORT_SYMBOL_PROTO(readdir);
  65. EXPORT_SYMBOL_PROTO(closedir);
  66. EXPORT_SYMBOL_PROTO(seekdir);
  67. EXPORT_SYMBOL_PROTO(telldir);
  68. EXPORT_SYMBOL_PROTO(ioctl);
  69. EXPORT_SYMBOL_PROTO(pread64);
  70. EXPORT_SYMBOL_PROTO(pwrite64);
  71. EXPORT_SYMBOL_PROTO(statfs);
  72. EXPORT_SYMBOL_PROTO(statfs64);
  73. EXPORT_SYMBOL_PROTO(getuid);
  74. EXPORT_SYMBOL_PROTO(fsync);
  75. EXPORT_SYMBOL_PROTO(fdatasync);
  76. /*
  77. * Overrides for Emacs so that we follow Linus's tabbing style.
  78. * Emacs will notice this stuff at the end of the file and automatically
  79. * adjust the settings for this buffer only. This must remain at the end
  80. * of the file.
  81. * ---------------------------------------------------------------------------
  82. * Local variables:
  83. * c-file-style: "linux"
  84. * End:
  85. */