Struct devela::os::linux::LINUX_IOCTL

source ·
pub struct LINUX_IOCTL;
Available on crate feature linux only.
Expand description

Linux ioctl constants.

Implementations§

source§

impl LINUX_IOCTL

source

pub const TCGETS: c_ulong = 21_505u32

Get the current serial port settings.

Argument: struct termios *argp

source

pub const TCSETS: c_ulong = 21_506u32

Set the current serial port settings.

Argument: const struct termios *argp

source

pub const TCSETSW: c_ulong = 21_507u32

Allow the output buffer to drain, and set the current serial port settings.

Argument: const struct termios *argp

source

pub const TCSETSF: c_ulong = 21_508u32

Allow the output buffer to drain, discard pending input, and set the current serial port settings.

Argument: const struct termios *argp

source

pub const TCGETS2: c_ulong = 2_150_388_778u32

Get the current serial port settings. (termios2)

Argument: struct termios2 *argp

source

pub const TCSETS2: c_ulong = 1_076_646_955u32

Set the current serial port settings. (termios2)

Argument: const struct termios2 *argp

source

pub const TCSETSW2: c_ulong = 1_076_646_956u32

Allow the output buffer to drain, and set the current serial port settings. (termios2)

Argument: const struct termios2 *argp

source

pub const TCSETSF2: c_ulong = 1_076_646_957u32

Allow the output buffer to drain, discard pending input, and set the current serial port settings. (termios2)

Argument: const struct termios2 *argp

source

pub const TCGETA: c_ulong = 21_509u32

Get the current serial port settings. (termio)

Argument: struct termio *argp

source

pub const TCSETA: c_ulong = 21_510u32

Set the current serial port settings. (termio)

Argument: const struct termio *argp

source

pub const TCSETAW: c_ulong = 21_511u32

Allow the output buffer to drain, and set the current serial port settings. (termio)

Argument: const struct termio *argp

source

pub const TCSETAF: c_ulong = 21_512u32

Allow the output buffer to drain, discard pending input, and set the current serial port settings. (termio)

Argument: const struct termio *argp

source§

impl LINUX_IOCTL

source

pub const TCXONC: c_ulong = 21_514u32

Equivalent to tcflow(fd, arg).

Argument: int arg

See tcflow(3) for the argument values TCOOFF, TCOON, TCIOFF, TCION.

source

pub const TCOOFF: c_int = 0i32

Suspends output.

source

pub const TCOON: c_int = 1i32

Resumes suspended output.

source

pub const TCIOFF: c_int = 2i32

Sends a STOP character to the terminal, to stop the terminal from sending any further input.

source

pub const TCION: c_int = 3i32

Sends a START character to the terminal, to tell the terminal that it can resume sending input.

source§

impl LINUX_IOCTL

source

pub const TIOCEXCL: c_ulong = 21_516u32

Put the terminal into exclusive mode.

No further open(2) operations on the terminal are permitted. (They fail with EBUSY, except for a process with the CAP_SYS_ADMIN capability.)

source

pub const TIOCNXCL: c_ulong = 21_517u32

Disable exclusive mode.

source

pub const TIOCGEXCL: c_ulong = 2_147_767_360u32

(since Linux 3.8) If the terminal is currently in exclusive mode, place a nonzero value in the location pointed to by argp; otherwise, place zero in *argp.

source§

impl LINUX_IOCTL

source

pub const TIOCSTI: c_ulong = 21_522u32

Insert the given byte in the input queue.

Argument: const char *argp

source§

impl LINUX_IOCTL

source

pub const TIOCGWINSZ: c_ulong = 21_523u32

Get window size.

Argument: struct winsize *argp

source

pub const TIOCSWINSZ: c_ulong = 21_524u32

Set window size.

Argument: const struct winsize *argp

source§

impl LINUX_IOCTL

source

pub const TIOCMGET: c_ulong = 21_525u32

Get the status of modem bits.

Argument: int *argp

source

pub const TIOCMBIS: c_ulong = 21_526u32

Set the indicated modem bits.

Argument: const int *argp

source

pub const TIOCMBIC: c_ulong = 21_527u32

Clear the indicated modem bits.

Argument: const int *argp

source

pub const TIOCMSET: c_ulong = 21_528u32

Set the status of modem bits.

Argument: const int *argp

source

pub const TIOCM_LE: c_int = 1i32

DSR (data set ready/line enable)

source

pub const TIOCM_DTR: c_int = 2i32

DTR (data terminal ready)

source

pub const TIOCM_RTS: c_int = 4i32

RTS (request to send)

source

pub const TIOCM_ST: c_int = 8i32

Secondary TXD (transmit)

source

pub const TIOCM_SR: c_int = 16i32

Secondary RXD (receive)

source

pub const TIOCM_CTS: c_int = 32i32

CTS (clear to send)

source

pub const TIOCM_CAR: c_int = 64i32

DCD (data carrier detect)

source

pub const TIOCM_CD: c_int = 64i32

source

pub const TIOCM_RNG: c_int = 128i32

RNG (ring)

source

pub const TIOCM_RI: c_int = 128i32

source

pub const TIOCM_DSR: c_int = 256i32

DSR (data set ready)

source§

impl LINUX_IOCTL

source

pub const TIOCGSOFTCAR: c_ulong = 21_529u32

(“Get software carrier flag”)

Get the status of the CLOCAL flag in the c_cflag field of the termios structure.

Argument: int *argp

source

pub const TIOCSSOFTCAR: c_ulong = 21_530u32

(“Set software carrier flag”)

Set the CLOCAL flag in the termios structure when *argp is nonzero, and clear it otherwise.

Argument: const int *argp

source§

impl LINUX_IOCTL

source

pub const FIONREAD: c_ulong = 21_531u32

Get the number of bytes in the input buffer.

source

pub const TIOCINQ: c_ulong = 21_531u32

Same as FIONREAD.

source

pub const TIOCOUTQ: c_ulong = 21_521u32

Get the number of bytes in the output buffer.

source

pub const TCFLSH: c_ulong = 21_515u32

See tcflush(3) for the argument values TCIFLUSH, TCOFLUSH, TCIOFLUSH.

Equivalent to tcflush(fd, arg).

source

pub const TIOCSERGETLSR: c_ulong = 21_593u32

Get line status register.

Status register has TIOCSER_TEMT bit set when output buffer is empty and also hardware transmitter is physically empty.

source§

impl LINUX_IOCTL

source

pub const TIOCLINUX: c_ulong = 21_532u32

Linux-specific ioctls.

The action of the following ioctls depends on the first byte in the struct pointed to by argp, referred to here as the subcode. These are legal only for the superuser or the owner of the current terminal. Symbolic subcodes are available in <linux/tiocl.h> since Linux 2.5.71.

See https://man7.org/linux/man-pages/man2/ioctl_console.2.html.

source§

impl LINUX_IOCTL

source

pub const TIOCCONS: c_ulong = 21_533u32

Redirect output that would have gone to /dev/console or /dev/tty0 to the given terminal.

Argument: void

If that was a pseudoterminal master, send it to the slave. Before Linux 2.6.10, anybody can do this as long as the output was not redirected yet; since Linux 2.6.10, only a process with the CAP_SYS_ADMIN capability may do this. If output was redirected already, then EBUSY is returned, but redirection can be stopped by using this ioctl with fd pointing at /dev/console or /dev/tty0.

source§

impl LINUX_IOCTL

source

pub const TIOCPKT: c_ulong = 21_536u32

Enable (when *argp is nonzero) or disable packet mode.

Argument: const int *argp

Can be applied to the master side of a pseudoterminal only (and will return ENOTTY otherwise).

In packet mode, each subsequent read(2) will return a packet that either contains a single nonzero control byte, or has a single byte containing zero (‘\0’) followed by data written on the slave side of the pseudoterminal.

If the first byte is not TIOCPKT_DATA (0), it is an OR of one or more of the following bits:

  • TIOCPKT_FLUSHREAD The read queue for the terminal is flushed.
  • TIOCPKT_FLUSHWRITE The write queue for the terminal is flushed.
  • TIOCPKT_STOP Output to the terminal is stopped.
  • TIOCPKT_START Output to the terminal is restarted.
  • TIOCPKT_DOSTOP The start and stop characters are ^S/^Q.
  • TIOCPKT_NOSTOP The start and stop characters are not ^S/^Q.
source

pub const TIOCSPTLCK: c_ulong = 1_074_025_521u32

Set (if *argp is nonzero) or remove (if *argp is zero) the lock on the pseudoterminal slave device.

Argument: int *argp

source

pub const TIOCGPKT: c_ulong = 2_147_767_352u32

Return the current packet mode setting in the integer pointed to by argp.

Argument: const int *argp

source

pub const TIOCGPTLCK: c_ulong = 2_147_767_353u32

Place the current lock state of the pseudoterminal slave device in the location pointed to by argp.

Argument: int *argp

source

pub const TIOCGPTPEER: c_ulong = 21_569u32

Open and return a new file descriptor that refers to the peer pseudoterminal slave device.

Argument: int flags

Given a file descriptor in fd that refers to a pseudoterminal master, open (with the given open(2)-style flags) and return a new file descriptor that refers to the peer pseudoterminal slave device.

This operation can be performed regardless of whether the pathname of the slave device is accessible through the calling process’s mount namespace.

source§

impl LINUX_IOCTL

source

pub const TIOCSCTTY: c_ulong = 21_518u32

Make the given terminal the controlling terminal of the calling process.

Argument: int arg

The calling process must be a session leader and not have a controlling terminal already. For this case, arg should be specified as zero.

If this terminal is already the controlling terminal of a different session group, then the ioctl fails with EPERM, unless the caller has the CAP_SYS_ADMIN capability and arg equals 1, in which case the terminal is stolen, and all processes that had it as controlling terminal lose it.

source

pub const TIOCNOTTY: c_ulong = 21_538u32

Give up this controlling terminal.

Argument: void

If the process was session leader, then send SIGHUP and SIGCONT to the foreground process group and all processes in the current session lose their controlling terminal.

source§

impl LINUX_IOCTL

source

pub const TIOCSETD: c_ulong = 21_539u32

Get the line discipline of the terminal.

Argument: int *argp

source

pub const TIOCGETD: c_ulong = 21_540u32

Set the line discipline of the terminal.

Argument: const int *argp

source§

impl LINUX_IOCTL

source

pub const TCSBRK: c_ulong = 21_513u32

Equivalent to tcsendbreak(fd, arg).

Argument: int arg

If the terminal is using asynchronous serial data transmission, and arg is zero, then send a break (a stream of zero bits) for between 0.25 and 0.5 seconds. If the terminal is not using asynchronous serial data transmission, then either a break is sent, or the function returns without doing anything. When arg is nonzero, nobody knows what will happen.

source

pub const TCSBRKP: c_ulong = 21_541u32

So-called “POSIX version” of TCSBRK.

It treats nonzero arg as a time interval measured in deciseconds, and does nothing when the driver does not support breaks.

Argument: int arg

source

pub const TIOCSBRK: c_ulong = 21_543u32

Turn break on, that is, start sending zero bits.

Argument: void

source

pub const TIOCCBRK: c_ulong = 21_544u32

Turn break off, that is, stop sending zero bits.

Argument: void

source§

impl LINUX_IOCTL

source

pub const TIOCGSID: c_ulong = 21_545u32

Get the session ID of the given terminal.

Argument: pid_t *argp

This fails with the error ENOTTY if the terminal is not a master pseudoterminal and not our controlling terminal.

source

pub const TIOCGPGRP: c_ulong = 21_519u32

Get the process group ID of the foreground process group on this terminal.

Argument: pid_t *argp

source

pub const TIOCSPGRP: c_ulong = 21_520u32

Set the foreground process group ID of this terminal.

Argument: const pid_t *argp

source§

impl LINUX_IOCTL

source

pub const FIONBIO: c_ulong = 21_537u32

Set non-blocking I/O mode if the argument is non-zero.

In non-blocking mode, read(2) or write(2) calls return -1 and set errno to EAGAIN immediately when no data is available.

source

pub const TIOCGSERIAL: c_ulong = 21_534u32

source

pub const TIOCSSERIAL: c_ulong = 21_535u32

source

pub const TIOCGRS485: c_ulong = 21_550u32

source

pub const TIOCSRS485: c_ulong = 21_551u32

source

pub const TIOCGPTN: c_ulong = 2_147_767_344u32

source

pub const TIOCGDEV: c_ulong = 2_147_767_346u32

source

pub const TCGETX: c_ulong = 21_554u32

source

pub const TCSETX: c_ulong = 21_555u32

source

pub const TCSETXF: c_ulong = 21_556u32

source

pub const TCSETXW: c_ulong = 21_557u32

source

pub const TIOCSIG: c_ulong = 1_074_025_526u32

source

pub const TIOCVHANGUP: c_ulong = 21_559u32

source

pub const FIONCLEX: c_ulong = 21_584u32

source

pub const FIOCLEX: c_ulong = 21_585u32

source

pub const FIOASYNC: c_ulong = 21_586u32

source

pub const TIOCSERCONFIG: c_ulong = 21_587u32

source

pub const TIOCSERGWILD: c_ulong = 21_588u32

source

pub const TIOCSERSWILD: c_ulong = 21_589u32

source

pub const TIOCGLCKTRMIOS: c_ulong = 21_590u32

source

pub const TIOCSLCKTRMIOS: c_ulong = 21_591u32

source

pub const TIOCSERGSTRUCT: c_ulong = 21_592u32

source

pub const TIOCSERGETMULTI: c_ulong = 21_594u32

source

pub const TIOCSERSETMULTI: c_ulong = 21_595u32

source

pub const TIOCMIWAIT: c_ulong = 21_596u32

source

pub const TIOCGICOUNT: c_ulong = 21_597u32

source

pub const BLKIOMIN: c_ulong = 4_728u32

source

pub const BLKIOOPT: c_ulong = 4_729u32

source

pub const BLKSSZGET: c_ulong = 4_712u32

source

pub const BLKPBSZGET: c_ulong = 4_731u32

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Also for T

source§

fn also_mut<F: FnOnce(&mut Self)>(self, f: F) -> Self

Available on crate feature result only.
Applies a function which takes the parameter by exclusive reference, and then returns the (possibly) modified owned value. Read more
source§

fn also_ref<F: FnOnce(&Self)>(self, f: F) -> Self

Available on crate feature result only.
Applies a function which takes the parameter by shared reference, and then returns the (possibly) modified owned value. Read more
source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AnyExt for Twhere T: Any,

source§

fn type_of(&self) -> TypeId

Available on crate feature any only.
Returns the TypeId of self. Read more
source§

fn type_name(&self) -> &'static str

Available on crate feature any only.
Returns the type name of self. Read more
source§

fn type_is<T: 'static>(&self) -> bool

Available on crate feature any only.
Returns true if Self is of type T. Read more
source§

fn as_any_ref(&self) -> &dyn Anywhere Self: Sized,

Available on crate feature any only.
Upcasts &self as &dyn Any. Read more
source§

fn as_any_mut(&mut self) -> &mut dyn Anywhere Self: Sized,

Available on crate feature any only.
Upcasts &mut self as &mut dyn Any. Read more
source§

fn as_any_box(self: Box<Self>) -> Box<dyn Any>where Self: Sized,

Available on crate feature any only.
Upcasts Box<self> as Box<dyn Any>. Read more
source§

impl<T, Res> Apply<Res> for Twhere T: ?Sized,

source§

fn apply<F: FnOnce(Self) -> Res>(self, f: F) -> Reswhere Self: Sized,

Available on crate feature result only.
Apply a function which takes the parameter by value.
source§

fn apply_ref<F: FnOnce(&Self) -> Res>(&self, f: F) -> Res

Available on crate feature result only.
Apply a function which takes the parameter by shared reference.
source§

fn apply_mut<F: FnOnce(&mut Self) -> Res>(&mut self, f: F) -> Res

Available on crate feature result only.
Apply a function which takes the parameter by exclusive reference.
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dstwhere Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Mem for Twhere T: ?Sized,

source§

const NEEDS_DROP: bool = _

Available on crate feature mem only.
Whether dropping values of this type matters.
source§

fn mem_needs_drop(&self) -> bool

Available on crate feature mem only.
Returns true if dropping values of this type matters.
source§

fn mem_drop(self)where Self: Sized,

Available on crate feature mem only.
Drops self by running its destructor.
source§

fn mem_forget(self)where Self: Sized,

Available on crate feature mem only.
Forgets about self without running its destructor.
source§

fn mem_replace(&mut self, other: Self) -> Selfwhere Self: Sized,

Available on crate feature mem only.
Replaces self with other, returning the previous value of self.
source§

fn mem_take(&mut self) -> Selfwhere Self: Default,

Available on crate feature mem only.
Replaces self with its default value, returning the previous value of self.
source§

fn mem_swap(&mut self, other: &mut Self)where Self: Sized,

Available on crate feature mem only.
Swaps the value of self and other without deinitializing either one.
source§

fn mem_as_bytes(&self) -> &[u8] where Self: Sync + Unpin,

Available on crate features mem and unsafe_mem only.
View a Sync + Unpin self as &[u8]. Read more
source§

fn mem_as_bytes_mut(&mut self) -> &mut [u8] where Self: Sync + Unpin,

Available on crate features mem and unsafe_mem only.
View a Sync + Unpin self as &mut [u8].
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> Size for T

source§

const BYTE_ALIGN: usize = _

Available on crate feature mem only.
The alignment of this type in bytes.
source§

const BYTE_SIZE: usize = _

Available on crate feature mem only.
The size of this type in bytes.
source§

const PTR_SIZE: usize = 4usize

Available on crate feature mem only.
The size of a pointer in bytes, for the current platform.
source§

fn byte_align(&self) -> usize

Available on crate feature mem only.
Returns the alignment of this type in bytes.
source§

fn byte_size(&self) -> usize

Available on crate feature mem only.
Returns the size of this type in bytes. Read more
source§

fn ptr_ratio(&self) -> (usize, usize)

Available on crate feature mem only.
Returns the size ratio between PTR_SIZE and BYTE_SIZE. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.