stdio.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2009, 2010 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_POSIX_STDIO_H
  19. #define GRUB_POSIX_STDIO_H 1
  20. #include <grub/misc.h>
  21. #include <grub/file.h>
  22. #include <sys/types.h>
  23. typedef struct grub_file FILE;
  24. #define EOF -1
  25. static inline int
  26. snprintf (char *str, grub_size_t n, const char *fmt, ...)
  27. {
  28. va_list ap;
  29. int ret;
  30. va_start (ap, fmt);
  31. ret = grub_vsnprintf (str, n, fmt, ap);
  32. va_end (ap);
  33. return ret;
  34. }
  35. #endif