From 98ac7a97098f78f2de25e645724140eef22beb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 23 Sep 2004 23:49:53 +0000 Subject: [PATCH] Removed the termios subdirectory; it's replaced by posix/termios.c. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9051 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/posix/Jamfile | 1 - src/kernel/libroot/posix/termios/Jamfile | 17 --- src/kernel/libroot/posix/termios/tcsetattr.c | 38 ------- src/kernel/libroot/posix/termios/termios.c | 110 ------------------- 4 files changed, 166 deletions(-) delete mode 100644 src/kernel/libroot/posix/termios/Jamfile delete mode 100644 src/kernel/libroot/posix/termios/tcsetattr.c delete mode 100644 src/kernel/libroot/posix/termios/termios.c diff --git a/src/kernel/libroot/posix/Jamfile b/src/kernel/libroot/posix/Jamfile index 75882fb3af..83c9eb0cdf 100644 --- a/src/kernel/libroot/posix/Jamfile +++ b/src/kernel/libroot/posix/Jamfile @@ -29,7 +29,6 @@ SubInclude OBOS_TOP src kernel libroot posix stdio ; SubInclude OBOS_TOP src kernel libroot posix stdlib ; SubInclude OBOS_TOP src kernel libroot posix string ; SubInclude OBOS_TOP src kernel libroot posix sys ; -SubInclude OBOS_TOP src kernel libroot posix termios ; SubInclude OBOS_TOP src kernel libroot posix time ; SubInclude OBOS_TOP src kernel libroot posix unistd ; diff --git a/src/kernel/libroot/posix/termios/Jamfile b/src/kernel/libroot/posix/termios/Jamfile deleted file mode 100644 index d6187a6cb8..0000000000 --- a/src/kernel/libroot/posix/termios/Jamfile +++ /dev/null @@ -1,17 +0,0 @@ -SubDir OBOS_TOP src kernel libroot posix termios ; - -KernelMergeObject posix_termios.o : - <$(SOURCE_GRIST)>termios.c - <$(SOURCE_GRIST)>tcsetattr.c - : - -fPIC -DPIC - ; - - -# there are no files in the kernel - -#MergeObjectFromObjects kernel_posix_termios.o : -# : -# -fPIC -DPIC -# ; - diff --git a/src/kernel/libroot/posix/termios/tcsetattr.c b/src/kernel/libroot/posix/termios/tcsetattr.c deleted file mode 100644 index 38527268a0..0000000000 --- a/src/kernel/libroot/posix/termios/tcsetattr.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -** Copyright 2003, Daniel Reinhold, danielre@users.sf.net. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ - -#include -#include -#include - - -/* - * tcsetattr - set the attributes for the tty device at fd - * (using the structure in the last arg for the values) - */ -int -tcsetattr(int fd, int opt, const struct termios *tp) -{ - switch (opt) { - case TCSANOW: - // set the attributes immediately - return ioctl(fd, TCSETA, tp); - - case TCSADRAIN: - // wait for ouput to finish before setting the attributes - return ioctl(fd, TCSETAW, tp); - - case TCSAFLUSH: - // wait for ouput to finish and then flush the input buffer - // before setting the attributes - return ioctl(fd, TCSETAF, tp); - - default: - // no other valid options - errno = EINVAL; - return -1; - } -} - diff --git a/src/kernel/libroot/posix/termios/termios.c b/src/kernel/libroot/posix/termios/termios.c deleted file mode 100644 index d3b9ca7837..0000000000 --- a/src/kernel/libroot/posix/termios/termios.c +++ /dev/null @@ -1,110 +0,0 @@ -/* -** Copyright 2003, Daniel Reinhold, danielre@users.sf.net. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ - -#include -#include -#include -#include -#include - - -/* tcdrain - wait for all output to be transmitted */ -int -tcdrain(int fd) -{ - /* Some termios implementations have a TIOCDRAIN command - * expressly for this purpose (e.g. ioctl(fd, TIOCDRAIN, 0). - * However, the BeOS implementation adheres to another - * interface which uses a non-zero last parameter to the - * TCSBRK ioctl to signify this functionality. - */ - return ioctl(fd, TCSBRK, 1); -} - - -/* tcflow - suspend or restart transmission */ -int -tcflow(int fd, int action) -{ - /* action will be one of the following: - * TCIOFF - input off (stops input) - * TCION - input on (restart input) - * TCOOFF - output off (stops output) - * TCOON - output on (restart output) - */ - return ioctl(fd, TCXONC, action); -} - - -/* tcflush - flush all pending data (input or output) */ -int -tcflush(int fd, int queue_selector) -{ - return ioctl(fd, TCFLSH, queue_selector); -} - - -/* tcsendbreak - send zero bits for the specified duration */ -int -tcsendbreak(int fd, int duration) -{ - if (duration == 0) - // Posix spec says this should take ~ 0.25 to 0.5 seconds - return ioctl(fd, TCSBRK, 0); - - /* Posix does not specify how long the transmission time - * should last if 'duration' is non-zero -- i.e. it is up - * to each implementation to decide what to do... - * - * For simplicity, here is it assumed that a positive duration - * of N will mean "N time intervals" where each interval lasts - * from 0.25 to 0.5 seconds. A negative duration will be treated - * as an error. - */ - if (duration < 0) { - errno = EINVAL; - return -1; - } - - while (duration-- > 0) - if (ioctl(fd, TCSBRK, 0) < 0) - return -1; - - return 0; -} - - - -/* - * The following four "speed control" functions are not supported - * in the BeOS. But the interface is still part of the Posix - * terminal IO specification, so they are implemented here as - * stub functions for basic compliance. - */ - -speed_t -cfgetispeed(const struct termios *term) -{ - return (speed_t)0; -} - -int -cfsetispeed( struct termios *term, speed_t speed) -{ - return 0; -} - -speed_t -cfgetospeed(const struct termios *term) -{ - return (speed_t)0; -} - -int -cfsetospeed( struct termios *term, speed_t speed) -{ - return 0; -} -