93 references to Interop
System.IO.Ports (93)
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\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); 179internal 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());