97 references to Interop
System.IO.Ports (97)
LibraryImports.g.cs (15)
7
internal static extern partial global::
Interop
.Error ConvertErrorPlatformToPal(int platformErrno);
15
internal static extern partial int ConvertErrorPalToPlatform(global::
Interop
.Error error);
31
internal static unsafe extern partial global::
Interop
.Error GetSocketAddressSizes(int* ipv4SocketAddressSize, int* ipv6SocketAddressSize, int* udsSocketAddressSize, int* maxSocketAddressSize);
39
internal static unsafe extern partial global::
Interop
.Error GetAddressFamily(byte* socketAddress, int socketAddressLen, int* addressFamily);
47
internal static unsafe extern partial global::
Interop
.Error SetAddressFamily(byte* socketAddress, int socketAddressLen, int addressFamily);
55
internal static unsafe extern partial global::
Interop
.Error GetPort(byte* socketAddress, int socketAddressLen, ushort* port);
63
internal static unsafe extern partial global::
Interop
.Error SetPort(byte* socketAddress, int socketAddressLen, ushort port);
71
internal static unsafe extern partial global::
Interop
.Error GetIPv4Address(byte* socketAddress, int socketAddressLen, uint* address);
79
internal static unsafe extern partial global::
Interop
.Error SetIPv4Address(byte* socketAddress, int socketAddressLen, uint address);
87
internal static unsafe extern partial global::
Interop
.Error GetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint* scopeId);
95
internal static unsafe extern partial global::
Interop
.Error SetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint scopeId);
134
internal static unsafe extern partial int GetNameInfo(byte* address, uint addressLength, byte isIpv6, byte* host, uint hostLength, byte* service, uint serviceLength, global::
Interop
.Sys.GetNameInfoFlags flags);
142
internal static unsafe partial int GetHostEntryForName(string address, global::System.Net.Sockets.AddressFamily family, global::
Interop
.Sys.HostEntry* entry)
167
static extern unsafe int __PInvoke(byte* __address_native, global::System.Net.Sockets.AddressFamily __family_native, global::
Interop
.Sys.HostEntry* __entry_native);
176
internal static unsafe extern partial void FreeHostEntry(global::
Interop
.Sys.HostEntry* entry);
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
124
_error =
Interop
.Sys.ConvertErrorPlatformToPal(errno);
141
get { return _rawErrno == -1 ? (_rawErrno =
Interop
.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; }
146
return
Interop
.Sys.StrError(RawErrno);
220
public static
Interop
.ErrorInfo Info(this
Interop
.Error error)
222
return new
Interop
.ErrorInfo(error);
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
16
throw
Interop
.GetExceptionForIoErrno(errorInfo, path, isDirError);
21
if (error !=
Interop
.Error.SUCCESS)
99
Exception e =
Interop
.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError);
179
internal static Exception GetIOException(
Interop
.ErrorInfo errorInfo, string? path = null)
System\IO\Ports\SafeSerialDeviceHandle.Unix.cs (6)
22
SafeSerialDeviceHandle handle =
Interop
.Serial.SerialPortOpen(portName);
31
Interop
.GetIOException(
Interop
.Sys.GetLastErrorInfo()));
39
Interop
.Serial.Shutdown(handle, SocketShutdown.Both);
40
int result =
Interop
.Serial.SerialPortClose(handle);
42
Debug.Assert(result == 0, $"Close failed with result {result} and error {
Interop
.Sys.GetLastErrorInfo()}");
System\IO\Ports\SerialStream.Unix.cs (66)
12
using Signals =
Interop
.Termios.Signals;
133
return
Interop
.Termios.TermiosGetSpeed(_handle);
141
if (
Interop
.Termios.TermiosSetSpeed(_handle, value) < 0)
160
Interop
.Termios.TermiosSendBreak(_handle, 0);
168
get { return
Interop
.Termios.TermiosGetAvailableBytes(_handle, false); }
173
get { return
Interop
.Termios.TermiosGetAvailableBytes(_handle, true); }
180
int status =
Interop
.Termios.TermiosGetSignal(_handle,
Interop
.Termios.Signals.SignalDcd);
194
int status =
Interop
.Termios.TermiosGetSignal(_handle,
Interop
.Termios.Signals.SignalCts);
208
int status =
Interop
.Termios.TermiosGetSignal(_handle,
Interop
.Termios.Signals.SignalDsr);
222
int status =
Interop
.Termios.TermiosGetSignal(_handle,
Interop
.Termios.Signals.SignalDtr);
233
if (
Interop
.Termios.TermiosGetSignal(_handle,
Interop
.Termios.Signals.SignalDtr, value ? 1 : 0) != 0)
242
int status =
Interop
.Termios.TermiosGetSignal(_handle,
Interop
.Termios.Signals.SignalRts);
266
if (
Interop
.Termios.TermiosGetSignal(_handle,
Interop
.Termios.Signals.SignalRts, value ? 1 : 0) != 0)
282
if (
Interop
.Termios.TermiosReset(_handle, _baudRate, _dataBits, _stopBits, _parity, value) != 0)
299
if (
Interop
.Termios.TermiosReset(_handle, _baudRate, value, _stopBits, _parity, _handshake) != 0)
317
if (
Interop
.Termios.TermiosReset(_handle, _baudRate, _dataBits, _stopBits, value, _handshake) != 0)
334
if (
Interop
.Termios.TermiosReset(_handle, _baudRate, _dataBits, value, _parity, _handshake) != 0)
372
Interop
.Termios.TermiosDiscard(_handle,
Interop
.Termios.Queue.ReceiveQueue);
379
Interop
.Termios.TermiosDiscard(_handle,
Interop
.Termios.Queue.SendQueue);
408
Interop
.Termios.TermiosDrain(_handle);
528
private
Interop
.PollEvents PollEvents(int timeout, bool pollReadEvents, bool pollWriteEvents, out
Interop
.ErrorInfo? error)
536
Interop
.PollEvents eventsToPoll =
Interop
.PollEvents.POLLERR;
540
eventsToPoll |=
Interop
.PollEvents.POLLIN;
545
eventsToPoll |=
Interop
.PollEvents.POLLOUT;
548
Interop
.PollEvents events;
549
Interop
.Error ret =
Interop
.Serial.Poll(
555
error = ret !=
Interop
.Error.SUCCESS ?
Interop
.Sys.GetLastErrorInfo() : (
Interop
.ErrorInfo?)null;
621
if (
Interop
.Termios.TermiosReset(_handle, _baudRate, _dataBits, _stopBits, _parity, _handshake) != 0)
691
private void FinishPendingIORequests(
Interop
.ErrorInfo? error = null)
698
Interop
.GetIOException(error.Value) :
708
Interop
.GetIOException(error.Value) :
784
int numBytes =
Interop
.Serial.Read(_handle, bufPtr, buff.Length);
788
Interop
.ErrorInfo lastError =
Interop
.Sys.GetLastErrorInfo();
791
if (lastError.Error !=
Interop
.Error.EWOULDBLOCK)
793
readRequest.Complete(
Interop
.GetIOException(lastError));
817
int numBytes =
Interop
.Serial.Write(_handle, bufPtr, buff.Length);
821
Interop
.ErrorInfo lastError =
Interop
.Sys.GetLastErrorInfo();
825
if (lastError.Error !=
Interop
.Error.SUCCESS && lastError.Error !=
Interop
.Error.EWOULDBLOCK)
827
r.Complete(
Interop
.GetIOException(lastError));
894
Signals lastSignals = _pinChanged != null ?
Interop
.Termios.TermiosGetAllSignals(_handle) : Signals.Error;
949
Interop
.PollEvents events = PollEvents(1,
952
out
Interop
.ErrorInfo? error);
960
if (events.HasFlag(
Interop
.PollEvents.POLLNVAL) ||
961
events.HasFlag(
Interop
.PollEvents.POLLERR))
968
if (events.HasFlag(
Interop
.PollEvents.POLLIN))
974
if (events.HasFlag(
Interop
.PollEvents.POLLOUT))
996
Signals current =
Interop
.Termios.TermiosGetAllSignals(_handle);
1074
return
Interop
.GetIOException(
Interop
.Sys.GetLastErrorInfo());