Browse Source

Fix FreeBSD `recvfrom`

`fromlen` must be a pointer, not a value.
Feoramund 1 year ago
parent
commit
f0cf1052d0
1 changed files with 4 additions and 1 deletions
  1. 4 1
      core/sys/freebsd/syscalls.odin

+ 4 - 1
core/sys/freebsd/syscalls.odin

@@ -79,7 +79,10 @@ where
 		cast(uintptr)len(buf),
 		cast(uintptr)flags,
 		cast(uintptr)from,
-		cast(uintptr)fromlen)
+		cast(uintptr)&fromlen)
+
+	// `from.len` will be modified by the syscall, so we shouldn't need to pass
+	// `fromlen` back from this API.
 
 	if !ok {
 		return 0, cast(Errno)result