Fix Syscall.readlink() for non-ascii targets
authorSteffen Kieß <s-kiess@web.de>
Sun, 28 Jul 2013 09:11:38 +0000 (11:11 +0200)
committerSteffen Kieß <s-kiess@web.de>
Sun, 28 Jul 2013 09:11:38 +0000 (11:11 +0200)
commit9b824c31c81715ba2ca0845be3d4b098f055115b
tree9d04a0e3db9fd93f4944fa9997c8de92bd93b5ae
parent7c89014866fd7d162336970a78a89c9f0ffd7a4d
Fix Syscall.readlink() for non-ascii targets

Syscall.readlink() currently returns an integer indicating the number of
bytes in the link. As buf contains chars, this value is useless if the
target contains non-ascii characters.

This commit creates a new overload which uses a byte array instead of a
StringBuilder and rewrites the old overload to return the number of chars
instead.

Fixes #11778 and #9611
mcs/class/Mono.Management/Mono.Attach/VirtualMachine.cs
mcs/class/Mono.Posix/Mono.Posix_test.dll.sources
mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs
mcs/class/Mono.Posix/Mono.Unix/UnixPath.cs
mcs/class/Mono.Posix/Mono.Unix/UnixSymbolicLinkInfo.cs
mcs/class/Mono.Posix/Test/Mono.Unix/ReadlinkTest.cs [new file with mode: 0644]
support/map.h
support/unistd.c