syscall: port fix for netbsd unix sockets from upstream

NetBSD does not include the null terminator when in its reported socket
length. Port the upstream bugfix for the issue (#6627).

This was likely missed during the usual upstream merge because the gc
and gccgo socket implementations have diverged quite a bit.

Change-Id: Id808bae481b5de494cfc641ca9d7f56fef6acd41
Trust: Than McIntosh <>
Reviewed-by: Ian Lance Taylor <>
1 file changed