93 references to Interop
System.IO.Ports (93)
LibraryImports.g.cs (11)
71
private static partial int PathConf(string path, global::
Interop
.Sys.PathConfName name)
100
static extern unsafe int __PInvoke(byte* __path_native, global::
Interop
.Sys.PathConfName __name_native);
109
internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::
Interop
.Sys.FileStatus output)
122
fixed (global::
Interop
.Sys.FileStatus* __output_native = &output)
141
static extern unsafe int __PInvoke(nint __fd_native, global::
Interop
.Sys.FileStatus* __output_native);
150
internal static partial int Stat(string path, out global::
Interop
.Sys.FileStatus output)
163
fixed (global::
Interop
.Sys.FileStatus* __output_native = &output)
182
static extern unsafe int __PInvoke(byte* __path_native, global::
Interop
.Sys.FileStatus* __output_native);
191
internal static partial int LStat(string path, out global::
Interop
.Sys.FileStatus output)
204
fixed (global::
Interop
.Sys.FileStatus* __output_native = &output)
223
static 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);
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());