96 references to Interop
System.IO.Ports (96)
_generated\0\LibraryImports.g.cs (14)
47internal static partial int TermiosGetSignal(global::System.IO.Ports.SafeSerialDeviceHandle handle, global::Interop.Termios.Signals signal) 76static extern unsafe int __PInvoke(nint __handle_native, global::Interop.Termios.Signals __signal_native); 86internal static partial int TermiosGetSignal(global::System.IO.Ports.SafeSerialDeviceHandle handle, global::Interop.Termios.Signals signal, int set) 115static extern unsafe int __PInvoke(nint __handle_native, global::Interop.Termios.Signals __signal_native, int __set_native); 125internal static partial global::Interop.Termios.Signals TermiosGetAllSignals(global::System.IO.Ports.SafeSerialDeviceHandle handle) 128global::Interop.Termios.Signals __retVal = default; 150static extern unsafe global::Interop.Termios.Signals __PInvoke(nint __handle_native); 279internal static partial int TermiosDiscard(global::System.IO.Ports.SafeSerialDeviceHandle handle, global::Interop.Termios.Queue input) 308static extern unsafe int __PInvoke(nint __handle_native, global::Interop.Termios.Queue __input_native); 473internal static extern partial global::Interop.Error Shutdown(nint socket, global::System.Net.Sockets.SocketShutdown how); 559private static unsafe extern partial global::Interop.Error Poll(global::Interop.PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered); 567internal static extern partial global::Interop.Error ConvertErrorPlatformToPal(int platformErrno); 575internal static extern partial int ConvertErrorPalToPlatform(global::Interop.Error error);
src\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (4)
16throw Interop.GetExceptionForIoErrno(errorInfo, path, isDirError); 21if (error != Interop.Error.SUCCESS) 99Exception e = Interop.GetExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirError); 183internal static Exception GetIOException(Interop.ErrorInfo errorInfo, string? path = null)
System\IO\Ports\SafeSerialDeviceHandle.Unix.cs (6)
22SafeSerialDeviceHandle handle = Interop.Serial.SerialPortOpen(portName); 31Interop.GetIOException(Interop.Sys.GetLastErrorInfo())); 39Interop.Serial.Shutdown(handle, SocketShutdown.Both); 40int result = Interop.Serial.SerialPortClose(handle); 42Debug.Assert(result == 0, $"Close failed with result {result} and error {Interop.Sys.GetLastErrorInfo()}");
System\IO\Ports\SerialStream.Unix.cs (66)
12using Signals = Interop.Termios.Signals; 133return Interop.Termios.TermiosGetSpeed(_handle); 141if (Interop.Termios.TermiosSetSpeed(_handle, value) < 0) 160Interop.Termios.TermiosSendBreak(_handle, 0); 168get { return Interop.Termios.TermiosGetAvailableBytes(_handle, false); } 173get { return Interop.Termios.TermiosGetAvailableBytes(_handle, true); } 180int status = Interop.Termios.TermiosGetSignal(_handle, Interop.Termios.Signals.SignalDcd); 194int status = Interop.Termios.TermiosGetSignal(_handle, Interop.Termios.Signals.SignalCts); 208int status = Interop.Termios.TermiosGetSignal(_handle, Interop.Termios.Signals.SignalDsr); 222int status = Interop.Termios.TermiosGetSignal(_handle, Interop.Termios.Signals.SignalDtr); 233if (Interop.Termios.TermiosGetSignal(_handle, Interop.Termios.Signals.SignalDtr, value ? 1 : 0) != 0) 242int status = Interop.Termios.TermiosGetSignal(_handle, Interop.Termios.Signals.SignalRts); 266if (Interop.Termios.TermiosGetSignal(_handle, Interop.Termios.Signals.SignalRts, value ? 1 : 0) != 0) 282if (Interop.Termios.TermiosReset(_handle, _baudRate, _dataBits, _stopBits, _parity, value) != 0) 299if (Interop.Termios.TermiosReset(_handle, _baudRate, value, _stopBits, _parity, _handshake) != 0) 317if (Interop.Termios.TermiosReset(_handle, _baudRate, _dataBits, _stopBits, value, _handshake) != 0) 334if (Interop.Termios.TermiosReset(_handle, _baudRate, _dataBits, value, _parity, _handshake) != 0) 372Interop.Termios.TermiosDiscard(_handle, Interop.Termios.Queue.ReceiveQueue); 379Interop.Termios.TermiosDiscard(_handle, Interop.Termios.Queue.SendQueue); 408Interop.Termios.TermiosDrain(_handle); 528private Interop.PollEvents PollEvents(int timeout, bool pollReadEvents, bool pollWriteEvents, out Interop.ErrorInfo? error) 536Interop.PollEvents eventsToPoll = Interop.PollEvents.POLLERR; 540eventsToPoll |= Interop.PollEvents.POLLIN; 545eventsToPoll |= Interop.PollEvents.POLLOUT; 548Interop.PollEvents events; 549Interop.Error ret = Interop.Serial.Poll( 555error = ret != Interop.Error.SUCCESS ? Interop.Sys.GetLastErrorInfo() : (Interop.ErrorInfo?)null; 621if (Interop.Termios.TermiosReset(_handle, _baudRate, _dataBits, _stopBits, _parity, _handshake) != 0) 691private void FinishPendingIORequests(Interop.ErrorInfo? error = null) 698Interop.GetIOException(error.Value) : 708Interop.GetIOException(error.Value) : 784int numBytes = Interop.Serial.Read(_handle, bufPtr, buff.Length); 788Interop.ErrorInfo lastError = Interop.Sys.GetLastErrorInfo(); 791if (lastError.Error != Interop.Error.EWOULDBLOCK) 793readRequest.Complete(Interop.GetIOException(lastError)); 817int numBytes = Interop.Serial.Write(_handle, bufPtr, buff.Length); 821Interop.ErrorInfo lastError = Interop.Sys.GetLastErrorInfo(); 825if (lastError.Error != Interop.Error.SUCCESS && lastError.Error != Interop.Error.EWOULDBLOCK) 827r.Complete(Interop.GetIOException(lastError)); 894Signals lastSignals = _pinChanged != null ? Interop.Termios.TermiosGetAllSignals(_handle) : Signals.Error; 949Interop.PollEvents events = PollEvents(1, 952out Interop.ErrorInfo? error); 960if (events.HasFlag(Interop.PollEvents.POLLNVAL) || 961events.HasFlag(Interop.PollEvents.POLLERR)) 968if (events.HasFlag(Interop.PollEvents.POLLIN)) 974if (events.HasFlag(Interop.PollEvents.POLLOUT)) 996Signals current = Interop.Termios.TermiosGetAllSignals(_handle); 1074return Interop.GetIOException(Interop.Sys.GetLastErrorInfo());