summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib/cfsetispeed.c
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>2003-02-25 09:37:46 +0000
committerMystery Man <unknown@mandriva.org>2003-02-25 09:37:46 +0000
commit07dc2ddb40089c216ab4ff323de177ecab8f02ef (patch)
tree0b88fcba964e83b283b89aab8740fc3cdcd0d939 /mdk-stage1/dietlibc/lib/cfsetispeed.c
parent327bd24f8e4291bd1882de1990dd7339f781a9cb (diff)
downloaddrakx-backup-do-not-use-07dc2ddb40089c216ab4ff323de177ecab8f02ef.tar
drakx-backup-do-not-use-07dc2ddb40089c216ab4ff323de177ecab8f02ef.tar.gz
drakx-backup-do-not-use-07dc2ddb40089c216ab4ff323de177ecab8f02ef.tar.bz2
drakx-backup-do-not-use-07dc2ddb40089c216ab4ff323de177ecab8f02ef.tar.xz
drakx-backup-do-not-use-07dc2ddb40089c216ab4ff323de177ecab8f02ef.zip
This commit was manufactured by cvs2svn to create branch
'R9_0-64bit-branch'.
Diffstat (limited to 'mdk-stage1/dietlibc/lib/cfsetispeed.c')
-rw-r--r--mdk-stage1/dietlibc/lib/cfsetispeed.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/mdk-stage1/dietlibc/lib/cfsetispeed.c b/mdk-stage1/dietlibc/lib/cfsetispeed.c
new file mode 100644
index 000000000..ab0333853
--- /dev/null
+++ b/mdk-stage1/dietlibc/lib/cfsetispeed.c
@@ -0,0 +1,22 @@
+#include <termios.h>
+#include <errno.h>
+#include "dietfeatures.h"
+
+#define IBAUD0 020000000000
+
+int cfsetispeed(struct termios *termios_p, speed_t speed)
+{
+ if ((speed & (speed_t)~CBAUD) != 0 && (speed < B57600 || speed > B460800)) {
+ errno=EINVAL;
+ return -1;
+ }
+ if (speed == 0)
+ termios_p->c_iflag |= IBAUD0;
+ else {
+ termios_p->c_iflag &= ~IBAUD0;
+ termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
+ termios_p->c_cflag |= speed;
+ }
+ return 0;
+}
+