139 references to Interop
System.Net.Ping (139)
LibraryImports.g.cs (11)
71private static partial int PathConf(string path, global::Interop.Sys.PathConfName name) 100static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.PathConfName __name_native); 109internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::Interop.Sys.FileStatus output) 122fixed (global::Interop.Sys.FileStatus* __output_native = &output) 141static extern unsafe int __PInvoke(nint __fd_native, global::Interop.Sys.FileStatus* __output_native); 150internal static partial int Stat(string path, out global::Interop.Sys.FileStatus output) 163fixed (global::Interop.Sys.FileStatus* __output_native = &output) 182static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native); 191internal static partial int LStat(string path, out global::Interop.Sys.FileStatus output) 204fixed (global::Interop.Sys.FileStatus* __output_native = &output) 223static extern unsafe int __PInvoke(byte* __path_native, global::Interop.Sys.FileStatus* __output_native);
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
124_error = Interop.Sys.ConvertErrorPlatformToPal(errno); 141get { return _rawErrno == -1 ? (_rawErrno = Interop.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; } 146return Interop.Sys.StrError(RawErrno); 220public static Interop.ErrorInfo Info(this Interop.Error error) 222return new Interop.ErrorInfo(error);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (23)
26Interop.Error err = Interop.Sys.GetSocketAddressSizes(&ipv4, &ipv6, &uds, &max); 27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 39private static void ThrowOnFailure(Interop.Error err) 43case Interop.Error.SUCCESS: 46case Interop.Error.EFAULT: 50case Interop.Error.EAFNOSUPPORT: 63Interop.Error err; 66err = Interop.Sys.GetAddressFamily(rawAddress, buffer.Length, (int*)&family); 75Interop.Error err; 81err = Interop.Sys.SetAddressFamily(rawAddress, buffer.Length, (int)family); 91Interop.Error err; 94err = Interop.Sys.GetPort(rawAddress, buffer.Length, &port); 103Interop.Error err; 106err = Interop.Sys.SetPort(rawAddress, buffer.Length, port); 115Interop.Error err; 118err = Interop.Sys.GetIPv4Address(rawAddress, buffer.Length, &ipAddress); 128Interop.Error err; 132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope); 141Interop.Error err; 144err = Interop.Sys.SetIPv4Address(rawAddress, buffer.Length, address); 167Interop.Error err; 170err = Interop.Sys.SetIPv6Address(rawAddress, buffer.Length, address, addressLength, scope);
src\libraries\Common\src\System\Net\SocketProtocolSupportPal.Unix.cs (5)
25Interop.Error result = Interop.Sys.Socket((int)af, DgramSocketType, 0, &socket); 27return result != Interop.Error.EAFNOSUPPORT && result != Interop.Error.EPROTONOSUPPORT; 33Interop.Sys.Close(socket);
src\libraries\Common\src\System\Net\Sockets\SocketErrorPal.Unix.cs (92)
20internal static SocketError GetSocketErrorForNativeError(Interop.Error errno) => errno switch 22Interop.Error.EACCES => SocketError.AccessDenied, 23Interop.Error.EADDRINUSE => SocketError.AddressAlreadyInUse, 24Interop.Error.EADDRNOTAVAIL => SocketError.AddressNotAvailable, 25Interop.Error.EAFNOSUPPORT => SocketError.AddressFamilyNotSupported, 26Interop.Error.EAGAIN => SocketError.WouldBlock, 27Interop.Error.EALREADY => SocketError.AlreadyInProgress, 28Interop.Error.EBADF => SocketError.OperationAborted, 29Interop.Error.ECANCELED => SocketError.OperationAborted, 30Interop.Error.ECONNABORTED => SocketError.ConnectionAborted, 31Interop.Error.ECONNREFUSED => SocketError.ConnectionRefused, 32Interop.Error.ECONNRESET => SocketError.ConnectionReset, 33Interop.Error.EDESTADDRREQ => SocketError.DestinationAddressRequired, 34Interop.Error.EFAULT => SocketError.Fault, 35Interop.Error.EHOSTDOWN => SocketError.HostDown, 36Interop.Error.ENXIO => SocketError.HostNotFound, // not perfect, but closest match available 37Interop.Error.EHOSTUNREACH => SocketError.HostUnreachable, 38Interop.Error.EINPROGRESS => SocketError.InProgress, 39Interop.Error.EINTR => SocketError.Interrupted, 40Interop.Error.EINVAL => SocketError.InvalidArgument, 41Interop.Error.EISCONN => SocketError.IsConnected, 42Interop.Error.EMFILE => SocketError.TooManyOpenSockets, 43Interop.Error.EMSGSIZE => SocketError.MessageSize, 44Interop.Error.ENETDOWN => SocketError.NetworkDown, 45Interop.Error.ENETRESET => SocketError.NetworkReset, 46Interop.Error.ENETUNREACH => SocketError.NetworkUnreachable, 47Interop.Error.ENFILE => SocketError.TooManyOpenSockets, 48Interop.Error.ENOBUFS => SocketError.NoBufferSpaceAvailable, 49Interop.Error.ENODATA => SocketError.NoData, 50Interop.Error.ENOENT => SocketError.AddressNotAvailable, 51Interop.Error.ENOPROTOOPT => SocketError.ProtocolOption, 52Interop.Error.ENOTCONN => SocketError.NotConnected, 53Interop.Error.ENOTSOCK => SocketError.NotSocket, 54Interop.Error.ENOTSUP => SocketError.OperationNotSupported, 55Interop.Error.EPERM => SocketError.AccessDenied, 56Interop.Error.EPIPE => SocketError.Shutdown, 57Interop.Error.EPFNOSUPPORT => SocketError.ProtocolFamilyNotSupported, 58Interop.Error.EPROTONOSUPPORT => SocketError.ProtocolNotSupported, 59Interop.Error.EPROTOTYPE => SocketError.ProtocolType, 60Interop.Error.ESOCKTNOSUPPORT => SocketError.SocketNotSupported, 61Interop.Error.ESHUTDOWN => SocketError.Disconnecting, 62Interop.Error.SUCCESS => SocketError.Success, 63Interop.Error.ETIMEDOUT => SocketError.TimedOut, 67private static Interop.Error GetNativeErrorForSocketErrorHelper(SocketError error) => error switch 75SocketError.AccessDenied => Interop.Error.EACCES, // could also have been EPERM 76SocketError.AddressAlreadyInUse => Interop.Error.EADDRINUSE, 77SocketError.AddressNotAvailable => Interop.Error.EADDRNOTAVAIL, 78SocketError.AddressFamilyNotSupported => Interop.Error.EAFNOSUPPORT, 79SocketError.AlreadyInProgress => Interop.Error.EALREADY, 80SocketError.ConnectionAborted => Interop.Error.ECONNABORTED, 81SocketError.ConnectionRefused => Interop.Error.ECONNREFUSED, 82SocketError.ConnectionReset => Interop.Error.ECONNRESET, 83SocketError.DestinationAddressRequired => Interop.Error.EDESTADDRREQ, 84SocketError.Disconnecting => Interop.Error.ESHUTDOWN, 85SocketError.Fault => Interop.Error.EFAULT, 86SocketError.HostDown => Interop.Error.EHOSTDOWN, 87SocketError.HostNotFound => Interop.Error.EHOSTNOTFOUND, 88SocketError.HostUnreachable => Interop.Error.EHOSTUNREACH, 89SocketError.InProgress => Interop.Error.EINPROGRESS, 90SocketError.Interrupted => Interop.Error.EINTR, 91SocketError.InvalidArgument => Interop.Error.EINVAL, 92SocketError.IOPending => Interop.Error.EINPROGRESS, 93SocketError.IsConnected => Interop.Error.EISCONN, 94SocketError.MessageSize => Interop.Error.EMSGSIZE, 95SocketError.NetworkDown => Interop.Error.ENETDOWN, 96SocketError.NetworkReset => Interop.Error.ENETRESET, 97SocketError.NetworkUnreachable => Interop.Error.ENETUNREACH, 98SocketError.NoBufferSpaceAvailable => Interop.Error.ENOBUFS, 99SocketError.NoData => Interop.Error.ENODATA, 100SocketError.NotConnected => Interop.Error.ENOTCONN, 101SocketError.NotSocket => Interop.Error.ENOTSOCK, 102SocketError.OperationAborted => Interop.Error.ECANCELED, 103SocketError.OperationNotSupported => Interop.Error.ENOTSUP, 104SocketError.ProtocolFamilyNotSupported => Interop.Error.EPFNOSUPPORT, 105SocketError.ProtocolNotSupported => Interop.Error.EPROTONOSUPPORT, 106SocketError.ProtocolOption => Interop.Error.ENOPROTOOPT, 107SocketError.ProtocolType => Interop.Error.EPROTOTYPE, 108SocketError.Shutdown => Interop.Error.EPIPE, 109SocketError.SocketNotSupported => Interop.Error.ESOCKTNOSUPPORT, 110SocketError.Success => Interop.Error.SUCCESS, 111SocketError.TimedOut => Interop.Error.ETIMEDOUT, 112SocketError.TooManyOpenSockets => Interop.Error.ENFILE, // could also have been EMFILE 113SocketError.TryAgain => Interop.Error.EAGAIN, // not a perfect mapping, but better than nothing 114SocketError.WouldBlock => Interop.Error.EAGAIN, 115SocketError.SocketError => Interop.Error.ESOCKETERROR, 116_ => Interop.Error.SUCCESS, // default for unknown mappings 119internal static Interop.Error GetNativeErrorForSocketError(SocketError error) 121Interop.Error errno = GetNativeErrorForSocketErrorHelper(error); 122if (errno == Interop.Error.SUCCESS) 125errno = (Interop.Error)(int)error; 130internal static bool TryGetNativeErrorForSocketError(SocketError error, out Interop.Error errno) 133return errno != Interop.Error.SUCCESS;
System\Net\NetworkInformation\Ping.RawSocket.cs (2)
305Interop.Sys.MessageHeader header = default; 312result = Interop.Sys.ReceiveSocketError(socket.SafeHandle, &header);