user.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __USER_H__
  6. #define __USER_H__
  7. #include "kern_constants.h"
  8. /*
  9. * The usual definition - copied here because the kernel provides its own,
  10. * fancier, type-safe, definition. Using that one would require
  11. * copying too much infrastructure for my taste, so userspace files
  12. * get less checking than kernel files.
  13. */
  14. #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
  15. /* This is to get size_t */
  16. #ifdef __KERNEL__
  17. #include <linux/types.h>
  18. #else
  19. #include <stddef.h>
  20. #endif
  21. extern void panic(const char *fmt, ...)
  22. __attribute__ ((format (printf, 1, 2)));
  23. #ifdef UML_CONFIG_PRINTK
  24. extern int printk(const char *fmt, ...)
  25. __attribute__ ((format (printf, 1, 2)));
  26. #else
  27. static inline int printk(const char *fmt, ...)
  28. {
  29. return 0;
  30. }
  31. #endif
  32. extern void schedule(void);
  33. extern int in_aton(char *str);
  34. extern int open_gdb_chan(void);
  35. extern size_t strlcpy(char *, const char *, size_t);
  36. extern size_t strlcat(char *, const char *, size_t);
  37. #endif