win_file.c 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. /*
  2. * Copyright (C) 2023 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #include "platform_api_extension.h"
  6. #include "platform_internal.h"
  7. __wasi_errno_t
  8. os_fstat(os_file_handle handle, struct __wasi_filestat_t *buf)
  9. {
  10. return __WASI_ENOSYS;
  11. }
  12. __wasi_errno_t
  13. os_fstatat(os_file_handle handle, const char *path,
  14. struct __wasi_filestat_t *buf, __wasi_lookupflags_t lookup_flags)
  15. {
  16. return __WASI_ENOSYS;
  17. }
  18. __wasi_errno_t
  19. os_file_get_fdflags(os_file_handle handle, __wasi_fdflags_t *flags)
  20. {
  21. return __WASI_ENOSYS;
  22. }
  23. __wasi_errno_t
  24. os_file_set_fdflags(os_file_handle handle, __wasi_fdflags_t flags)
  25. {
  26. return __WASI_ENOSYS;
  27. }
  28. __wasi_errno_t
  29. os_file_get_access_mode(os_file_handle handle,
  30. wasi_libc_file_access_mode *access_mode)
  31. {
  32. return __WASI_ENOSYS;
  33. }
  34. __wasi_errno_t
  35. os_fdatasync(os_file_handle handle)
  36. {
  37. return __WASI_ENOSYS;
  38. }
  39. __wasi_errno_t
  40. os_fsync(os_file_handle handle)
  41. {
  42. return __WASI_ENOSYS;
  43. }
  44. __wasi_errno_t
  45. os_open_preopendir(const char *path, os_file_handle *out)
  46. {
  47. return __WASI_ENOSYS;
  48. }
  49. __wasi_errno_t
  50. os_openat(os_file_handle handle, const char *path, __wasi_oflags_t oflags,
  51. __wasi_fdflags_t fs_flags, __wasi_lookupflags_t lookup_flags,
  52. wasi_libc_file_access_mode read_write_mode, os_file_handle *out)
  53. {
  54. return __WASI_ENOSYS;
  55. }
  56. __wasi_errno_t
  57. os_close(os_file_handle handle, bool is_stdio)
  58. {
  59. return __WASI_ENOSYS;
  60. }
  61. __wasi_errno_t
  62. os_preadv(os_file_handle handle, const struct __wasi_iovec_t *iov, int iovcnt,
  63. __wasi_filesize_t offset, size_t *nread)
  64. {
  65. return __WASI_ENOSYS;
  66. }
  67. __wasi_errno_t
  68. os_pwritev(os_file_handle handle, const struct __wasi_ciovec_t *iov, int iovcnt,
  69. __wasi_filesize_t offset, size_t *nwritten)
  70. {
  71. return __WASI_ENOSYS;
  72. }
  73. __wasi_errno_t
  74. os_readv(os_file_handle handle, const struct __wasi_iovec_t *iov, int iovcnt,
  75. size_t *nread)
  76. {
  77. return __WASI_ENOSYS;
  78. }
  79. __wasi_errno_t
  80. os_writev(os_file_handle handle, const struct __wasi_ciovec_t *iov, int iovcnt,
  81. size_t *nwritten)
  82. {
  83. return __WASI_ENOSYS;
  84. }
  85. __wasi_errno_t
  86. os_fallocate(os_file_handle handle, __wasi_filesize_t offset,
  87. __wasi_filesize_t length)
  88. {
  89. return __WASI_ENOSYS;
  90. }
  91. __wasi_errno_t
  92. os_ftruncate(os_file_handle handle, __wasi_filesize_t size)
  93. {
  94. return __WASI_ENOSYS;
  95. }
  96. __wasi_errno_t
  97. os_futimens(os_file_handle handle, __wasi_timestamp_t access_time,
  98. __wasi_timestamp_t modification_time, __wasi_fstflags_t fstflags)
  99. {
  100. return __WASI_ENOSYS;
  101. }
  102. __wasi_errno_t
  103. os_utimensat(os_file_handle handle, const char *path,
  104. __wasi_timestamp_t access_time,
  105. __wasi_timestamp_t modification_time, __wasi_fstflags_t fstflags,
  106. __wasi_lookupflags_t lookup_flags)
  107. {
  108. return __WASI_ENOSYS;
  109. }
  110. __wasi_errno_t
  111. os_readlinkat(os_file_handle handle, const char *path, char *buf,
  112. size_t bufsize, size_t *nread)
  113. {
  114. return __WASI_ENOSYS;
  115. }
  116. __wasi_errno_t
  117. os_linkat(os_file_handle from_handle, const char *from_path,
  118. os_file_handle to_handle, const char *to_path,
  119. __wasi_lookupflags_t lookup_flags)
  120. {
  121. return __WASI_ENOSYS;
  122. }
  123. __wasi_errno_t
  124. os_symlinkat(const char *old_path, os_file_handle handle, const char *new_path)
  125. {
  126. return __WASI_ENOSYS;
  127. }
  128. __wasi_errno_t
  129. os_mkdirat(os_file_handle handle, const char *path)
  130. {
  131. return __WASI_ENOSYS;
  132. }
  133. __wasi_errno_t
  134. os_renameat(os_file_handle old_handle, const char *old_path,
  135. os_file_handle new_handle, const char *new_path)
  136. {
  137. return __WASI_ENOSYS;
  138. }
  139. __wasi_errno_t
  140. os_unlinkat(os_file_handle handle, const char *path, bool is_dir)
  141. {
  142. return __WASI_ENOSYS;
  143. }
  144. __wasi_errno_t
  145. os_lseek(os_file_handle handle, __wasi_filedelta_t offset,
  146. __wasi_whence_t whence, __wasi_filesize_t *new_offset)
  147. {
  148. return __WASI_ENOSYS;
  149. }
  150. __wasi_errno_t
  151. os_fadvise(os_file_handle handle, __wasi_filesize_t offset,
  152. __wasi_filesize_t length, __wasi_advice_t advice)
  153. {
  154. return __WASI_ENOSYS;
  155. }
  156. __wasi_errno_t
  157. os_isatty(os_file_handle handle)
  158. {
  159. return __WASI_ENOSYS;
  160. }
  161. os_file_handle
  162. os_convert_stdin_handle(os_raw_file_handle raw_stdin)
  163. {
  164. return INVALID_HANDLE_VALUE;
  165. }
  166. os_file_handle
  167. os_convert_stdout_handle(os_raw_file_handle raw_stdout)
  168. {
  169. return INVALID_HANDLE_VALUE;
  170. }
  171. os_file_handle
  172. os_convert_stderr_handle(os_raw_file_handle raw_stderr)
  173. {
  174. return INVALID_HANDLE_VALUE;
  175. }
  176. __wasi_errno_t
  177. os_fdopendir(os_file_handle handle, os_dir_stream *dir_stream)
  178. {
  179. return __WASI_ENOSYS;
  180. }
  181. __wasi_errno_t
  182. os_rewinddir(os_dir_stream dir_stream)
  183. {
  184. return __WASI_ENOSYS;
  185. }
  186. __wasi_errno_t
  187. os_seekdir(os_dir_stream dir_stream, __wasi_dircookie_t position)
  188. {
  189. return __WASI_ENOSYS;
  190. }
  191. __wasi_errno_t
  192. os_readdir(os_dir_stream dir_stream, __wasi_dirent_t *entry,
  193. const char **d_name)
  194. {
  195. return __WASI_ENOSYS;
  196. }
  197. __wasi_errno_t
  198. os_closedir(os_dir_stream dir_stream)
  199. {
  200. return __WASI_ENOSYS;
  201. }
  202. os_dir_stream
  203. os_get_invalid_dir_stream()
  204. {
  205. return NULL;
  206. }
  207. bool
  208. os_is_dir_stream_valid(os_dir_stream *dir_stream)
  209. {
  210. return false;
  211. }
  212. os_file_handle
  213. os_get_invalid_handle()
  214. {
  215. return INVALID_HANDLE_VALUE;
  216. }
  217. bool
  218. os_is_handle_valid(os_file_handle *handle)
  219. {
  220. return false;
  221. }
  222. char *
  223. os_realpath(const char *path, char *resolved_path)
  224. {
  225. return NULL;
  226. }