Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pywasm/wasi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1177,8 +1177,12 @@ def path_open(self, m: pywasm.core.Machine, args: typing.List[int]) -> typing.Li
return [self.ERRNO_ISDIR]
except NotADirectoryError:
return [self.ERRNO_NOTDIR]
except OSError:
return [self.ERRNO_LOOP]
except OSError as e:
if platform.system().lower() == 'darwin' and e.errno == 62:
return [self.ERRNO_LOOP]
if platform.system().lower() == 'linux' and e.errno == 40:
return [self.ERRNO_LOOP]
raise e
rights_base = args[5]
rights_root = args[6]
# Drectory does not have the seek right.
Expand Down Expand Up @@ -1237,8 +1241,6 @@ def path_readlink(self, m: pywasm.core.Machine, args: typing.List[int]) -> typin
data = os.readlink(name, dir_fd=file.host_fd)
except FileNotFoundError:
return [self.ERRNO_NOENT]
except OSError:
return [self.ERRNO_INVAL]
size = min(len(data), args[4])
mems.put(args[3], bytearray(data[:size].encode()))
mems.put_u32(args[5], size)
Expand Down
Loading