aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/tcgetattr.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-05-04 13:19:20 +0000
committerUlrich Drepper <drepper@redhat.com>1998-05-04 13:19:20 +0000
commiteb4063467c4ef625c1687b4c158bacf475821363 (patch)
tree9f47ace87d060f54a05b1315b741acb8ae3f5728 /sysdeps/unix/sysv/linux/tcgetattr.c
parent15f32e7b7912df66ff5e1d337e4f621157504058 (diff)
downloadglibc-eb4063467c4ef625c1687b4c158bacf475821363.tar
glibc-eb4063467c4ef625c1687b4c158bacf475821363.tar.gz
glibc-eb4063467c4ef625c1687b4c158bacf475821363.tar.bz2
glibc-eb4063467c4ef625c1687b4c158bacf475821363.zip
Update.
1998-05-04 12:40 Ulrich Drepper <drepper@cygnus.com> * malloc/malloc.c (ptmalloc_init_all): New function. Similar to ptmalloc_unlock_all, but re-initializes the mutexes instead. (ptmalloc_init): Use new function in thread_at_fork call. (thread_atfork_static): Likewise. Suggested by Wolfram Gloger and Xavier Leroy.
Diffstat (limited to 'sysdeps/unix/sysv/linux/tcgetattr.c')
-rw-r--r--sysdeps/unix/sysv/linux/tcgetattr.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/tcgetattr.c b/sysdeps/unix/sysv/linux/tcgetattr.c
index 7866183abe..cbb372f317 100644
--- a/sysdeps/unix/sysv/linux/tcgetattr.c
+++ b/sysdeps/unix/sysv/linux/tcgetattr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,9 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <string.h>
#include <termios.h>
+#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@@ -33,7 +35,6 @@ __tcgetattr (fd, termios_p)
{
struct __kernel_termios k_termios;
int retval;
- size_t cnt;
retval = __ioctl (fd, TCGETS, &k_termios);
@@ -48,8 +49,21 @@ __tcgetattr (fd, termios_p)
#ifdef _HAVE_C_OSPEED
termios_p->c_ospeed = k_termios.c_ospeed;
#endif
- for (cnt = 0; cnt < __KERNEL_NCCS; ++cnt)
- termios_p->c_cc[cnt] = k_termios.c_cc[cnt];
+ if (sizeof (cc_t) == 1 || _POSIX_VDISABLE == 0
+ || (unsigned char) _POSIX_VDISABLE == (unsigned char) -1)
+ memset (__mempcpy (&termios_p->c_cc[0], &k_termios.c_cc[0],
+ __KERNEL_NCCS * sizeof (cc_t)),
+ _POSIX_VDISABLE, (NCCS - __KERNEL_NCCS) * sizeof (cc_t));
+ else
+ {
+ size_t cnt;
+
+ memcpy (&termios_p->c_cc[0], &k_termios.c_cc[0],
+ __KERNEL_NCCS * sizeof (cc_t));
+
+ for (cnt = __KERNEL_NCCS; cnt < NCCS; ++cnt)
+ termios_p->c_cc[cnt] = _POSIX_VDISABLE;
+ }
return retval;
}