summaryrefslogtreecommitdiff
path: root/StdLib/Include/sys/termios.h
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/Include/sys/termios.h')
-rw-r--r--StdLib/Include/sys/termios.h154
1 files changed, 153 insertions, 1 deletions
diff --git a/StdLib/Include/sys/termios.h b/StdLib/Include/sys/termios.h
index 13e15d2fad..e144d521f5 100644
--- a/StdLib/Include/sys/termios.h
+++ b/StdLib/Include/sys/termios.h
@@ -215,19 +215,171 @@ struct termios {
#include <sys/EfiCdefs.h>
__BEGIN_DECLS
+
+/** Get input baud rate.
+
+ Extracts the input baud rate from the termios structure pointed to by the
+ pTermios argument.
+
+ @param[in] pTermios A pointer to the termios structure from which to extract
+ the input baud rate.
+
+ @return The value of the input speed is returned exactly as it is contained
+ in the termios structure, without interpretation.
+**/
speed_t cfgetispeed (const struct termios *);
+
+/** Get output baud rate.
+
+ Extracts the output baud rate from the termios structure pointed to by the
+ pTermios argument.
+
+ @param[in] pTermios A pointer to the termios structure from which to extract
+ the output baud rate.
+
+ @return The value of the output speed is returned exactly as it is contained
+ in the termios structure, without interpretation.
+**/
speed_t cfgetospeed (const struct termios *);
+
+/** Set input baud rate.
+
+ Replaces the input baud rate, in the termios structure pointed to by the
+ pTermios argument, with the value of NewSpeed.
+
+ @param[out] pTermios A pointer to the termios structure into which to set
+ the input baud rate.
+ @param[in] NewSpeed The new input baud rate.
+
+ @retval 0 The operation completed successfully.
+ @retval -1 An error occured and errno is set to indicate the error.
+ * EINVAL - The value of NewSpeed is outside the range of
+ possible speed values as specified in <sys/termios.h>.
+**/
int cfsetispeed (struct termios *, speed_t);
+
+/** Set output baud rate.
+
+ Replaces the output baud rate, in the termios structure pointed to by the
+ pTermios argument, with the value of NewSpeed.
+
+ @param[out] pTermios A pointer to the termios structure into which to set
+ the output baud rate.
+ @param[in] NewSpeed The new output baud rate.
+
+ @retval 0 The operation completed successfully.
+ @retval -1 An error occured and errno is set to indicate the error.
+ * EINVAL - The value of NewSpeed is outside the range of
+ possible speed values as specified in <sys/termios.h>.
+**/
int cfsetospeed (struct termios *, speed_t);
+
+/** Get the parameters associated with an interactive IO device.
+
+ Get the parameters associated with the device referred to by
+ fd and store them into the termios structure referenced by pTermios.
+
+ @param[in] fd The file descriptor for an open interactive IO device.
+ @param[out] pTermios A pointer to a termios structure into which to store
+ attributes of the interactive IO device.
+
+ @retval 0 The operation completed successfully.
+ @retval -1 An error occured and errno is set to indicate the error.
+ * EBADF - The fd argument is not a valid file descriptor.
+ * ENOTTY - The file associated with fd is not an interactive IO device.
+**/
int tcgetattr (int, struct termios *);
+
+/** Set the parameters associated with an interactive IO device.
+
+ Set the parameters associated with the device referred to by
+ fd to the values in the termios structure referenced by pTermios.
+
+ Behavior is modified by the value of the OptAct parameter:
+ * TCSANOW: The change shall occur immediately.
+ * TCSADRAIN: The change shall occur after all output written to fd is
+ transmitted. This action should be used when changing parameters which
+ affect output.
+ * TCSAFLUSH: The change shall occur after all output written to fd is
+ transmitted, and all input so far received but not read shall be
+ discarded before the change is made.
+
+ @param[in] fd The file descriptor for an open interactive IO device.
+ @param[in] OptAct Currently has no effect.
+ @param[in] pTermios A pointer to a termios structure into which to retrieve
+ attributes to set in the interactive IO device.
+
+ @retval 0 The operation completed successfully.
+ @retval -1 An error occured and errno is set to indicate the error.
+ * EBADF - The fd argument is not a valid file descriptor.
+ * ENOTTY - The file associated with fd is not an interactive IO device.
+**/
int tcsetattr (int, int, const struct termios *);
+
+/** Transmit pending output.
+
+
+ @param[in] fd The file descriptor for an open interactive IO device.
+
+ @retval 0 The operation completed successfully.
+ @retval -1 An error occured and errno is set to indicate the error.
+ * EBADF - The fd argument is not a valid file descriptor.
+ * ENOTTY - The file associated with fd is not an interactive IO device.
+ * EINTR - A signal interrupted tcdrain().
+ * ENOTSUP - This function is not supported.
+**/
int tcdrain (int);
+
+/** Suspend or restart the transmission or reception of data.
+
+ This function will suspend or resume transmission or reception of data on
+ the file referred to by fd, depending on the value of Action.
+
+ @param[in] fd The file descriptor of an open interactive IO device (terminal).
+ @param[in] Action The action to be performed:
+ * TCOOFF - Suspend output.
+ * TCOON - Resume suspended output.
+ * TCIOFF - If fd refers to an IIO device, transmit a
+ STOP character, which is intended to cause the
+ terminal device to stop transmitting data.
+ * TCION - If fd refers to an IIO device, transmit a
+ START character, which is intended to cause the
+ terminal device to start transmitting data.
+
+ @retval 0 The operation completed successfully.
+ @retval -1 An error occured and errno is set to indicate the error.
+ * EBADF - The fd argument is not a valid file descriptor.
+ * ENOTTY - The file associated with fd is not an interactive IO device.
+ * EINVAL - The Action argument is not a supported value.
+ * ENOTSUP - This function is not supported.
+**/
int tcflow (int, int);
+
+/** Discard non-transmitted output data, non-read input data, or both.
+
+
+ @param[in] fd The file descriptor for an open interactive IO device.
+ @param[in] QueueSelector The IO queue to be affected:
+ * TCIFLUSH - If fd refers to a device open for input, flush
+ pending input. Otherwise error EINVAL.
+ * TCOFLUSH - If fd refers to a device open for output,
+ flush pending output. Otherwise error EINVAL.
+ * TCIOFLUSH - If fd refers to a device open for both
+ input and output, flush pending input and output.
+ Otherwise error EINVAL.
+
+ @retval 0 The operation completed successfully.
+ @retval -1 An error occured and errno is set to indicate the error.
+ * EBADF - The fd argument is not a valid file descriptor.
+ * ENOTTY - The file associated with fd is not an interactive IO device.
+ * EINVAL - The QueueSelector argument is not a supported value.
+ * ENOTSUP - This function is not supported.
+**/
int tcflush (int, int);
+
//int tcsendbreak (int, int);
//pid_t tcgetsid (int);
-
//void cfmakeraw (struct termios *);
//int cfsetspeed (struct termios *, speed_t);
__END_DECLS