A C standard library for sh3eb-elf.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.1KB

  1. /* Copyright (c) 2016 Phoenix Systems
  2. All rights reserved.
  3. Redistribution and use in source and binary forms, with or without
  4. modification, are permitted provided that the following conditions
  5. are met:
  6. 1. Redistributions of source code must retain the above copyright
  7. notice, this list of conditions and the following disclaimer.
  8. 2. Redistributions in binary form must reproduce the above copyright
  9. notice, this list of conditions and the following disclaimer in the
  10. documentation and/or other materials provided with the distribution.
  11. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  12. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  13. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  14. ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  15. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  16. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  17. OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  18. HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  19. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  20. OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. SUCH DAMAGE.*/
  22. #ifndef _SYS_DIRENT_H
  23. #define _SYS_DIRENT_H
  24. #include <phoenix/fs.h>
  25. #include <sys/lock.h>
  26. #include <sys/types.h>
  27. #define PATH_MAX_SIZE 1024
  28. #define HAVE_DD_LOCK
  29. typedef struct {
  30. int dd_fd; /* Directory file. */
  31. int dd_loc; /* Position in buffer. */
  32. int dd_seek;
  33. char *dd_buf; /* Pointer to buffer. */
  34. int dd_len; /* Buffer size. */
  35. int dd_size; /* Data size in buffer. */
  36. _LOCK_RECURSIVE_T dd_lock;
  37. } DIR;
  38. #define __dirfd(dir) (dir)->dd_fd
  39. #define _seekdir seekdir
  40. /* Declare which dirent fields are available in Phoenix-RTOS. */
  41. #undef _DIRENT_HAVE_D_NAMLEN
  42. #define _DIRENT_HAVE_D_OFF
  43. #define _DIRENT_HAVE_D_RECLEN
  44. #define d_fileno d_ino /* Backwards compatibility. */
  45. #ifdef __USE_LARGEFILE64
  46. #define dirent64 dirent
  47. #endif
  48. #endif