For a future Xamarin.Android release, we'd like to include
Mono.Posix.dll for simple Unix interop support.
That said, since Mono.Posix has never been included with
Xamarin.Andorid before, this makes a perfect opportunity to remove
some [Obsolete] cruft within Mono.Posix.dll, namely the types within
the Mono.Posix namespace.
Unfortunately, simply not compiling the types within the Mono.Posix
directory doesn't result in compilable code, due to references to
types within the Mono.Posix namespace by other types, e.g.
Mono.Unix.PeerCred using Mono.Posix.PeerCredData.
Fix things so that the Mono.Posix sources can be omitted, allowing
compilation of an assembly with fewer [Obsolete] types.
This change shrinks the size of Mono.Posix.dll by ~10.5KB.
using System.Runtime.Remoting.Messaging;
using System.IO;
using System.Runtime.Remoting.Channels;
-using Mono.Posix;
namespace Mono.Remoting.Channels.Unix
{
namespace Mono.Unix
{
+ internal struct PeerCredData {
+ public int pid;
+ public int uid;
+ public int gid;
+ }
+
public class PeerCred
{
/* Make sure this doesn't clash with anything in
* runtime
*/
private const int so_peercred=10001;
- private Mono.Posix.PeerCredData data;
+ private PeerCredData data;
public PeerCred (Socket sock) {
if (sock.AddressFamily != AddressFamily.Unix) {
throw new ArgumentException ("Only Unix sockets are supported", "sock");
}
- data = (Mono.Posix.PeerCredData)
+ data = (PeerCredData)
sock.GetSocketOption (SocketOptionLevel.Socket, (SocketOptionName)so_peercred);
}