-/* Copyright (C) 1992 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1992, 1995, 1996, 1997 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
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <errno.h>
#include <stddef.h>
#include <sysv_termio.h>
#include <termios.h>
+#include <sys/ioctl.h>
/* Put the state of FD into *TERMIOS_P. */
int
-DEFUN(__tcgetattr, (fd, termios_p),
- int fd AND struct termios *termios_p)
+__tcgetattr (fd, termios_p)
+ int fd;
+ struct termios *termios_p;
{
struct __sysv_termio buf;
int termio_speed;
if (termios_p == NULL)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
termios_p->c_cc[VSTART] = '\021'; /* XON (^Q). */
termios_p->c_cc[VSTOP] = '\023'; /* XOFF (^S). */
termios_p->c_cc[VSUSP] = '\0'; /* System V release 3 lacks job control. */
- termios_p->c_cc[VMIN] = -1;
- termios_p->c_cc[VTIME] = -1;
+ termios_p->c_cc[VMIN] = buf.c_cc[_SYSV_VMIN];
+ termios_p->c_cc[VTIME] = buf.c_cc[_SYSV_VTIME];
return 0;
}
+
+weak_alias (__tcgetattr, tcgetattr)