diff options
Diffstat (limited to 'libc/termios')
| -rw-r--r-- | libc/termios/Makefile.in | 10 | ||||
| -rw-r--r-- | libc/termios/cfmakeraw.c | 5 | ||||
| -rw-r--r-- | libc/termios/cfsetspeed.c | 7 | ||||
| -rw-r--r-- | libc/termios/isatty.c | 7 | ||||
| -rw-r--r-- | libc/termios/kernel_termios.h | 5 | ||||
| -rw-r--r-- | libc/termios/speed.c | 7 | ||||
| -rw-r--r-- | libc/termios/tcdrain.c | 25 | ||||
| -rw-r--r-- | libc/termios/tcflow.c | 6 | ||||
| -rw-r--r-- | libc/termios/tcflush.c | 6 | ||||
| -rw-r--r-- | libc/termios/tcgetattr.c | 10 | ||||
| -rw-r--r-- | libc/termios/tcgetpgrp.c | 7 | ||||
| -rw-r--r-- | libc/termios/tcgetsid.c | 8 | ||||
| -rw-r--r-- | libc/termios/tcsendbrk.c | 6 | ||||
| -rw-r--r-- | libc/termios/tcsetattr.c | 8 | ||||
| -rw-r--r-- | libc/termios/tcsetpgrp.c | 6 | ||||
| -rw-r--r-- | libc/termios/ttyname.c | 9 |
16 files changed, 53 insertions, 79 deletions
diff --git a/libc/termios/Makefile.in b/libc/termios/Makefile.in index 99b1a729f..73f72729e 100644 --- a/libc/termios/Makefile.in +++ b/libc/termios/Makefile.in @@ -1,10 +1,12 @@ # Makefile for uClibc # -# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org> # # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # +subdirs += libc/termios + TERMIOS_DIR := $(top_srcdir)libc/termios TERMIOS_OUT := $(top_builddir)libc/termios @@ -13,7 +15,7 @@ TERMIOS_OBJ := $(patsubst $(TERMIOS_DIR)/%.c,$(TERMIOS_OUT)/%.o,$(TERMIOS_SRC)) libc-y += $(TERMIOS_OBJ) -objclean-y += termios_objclean +objclean-y += CLEAN_libc/termios -termios_objclean: - $(RM) $(TERMIOS_OUT)/*.{o,os} +CLEAN_libc/termios: + $(do_rm) $(addprefix $(TERMIOS_OUT)/*., o os) diff --git a/libc/termios/cfmakeraw.c b/libc/termios/cfmakeraw.c index aae76782d..0c5ec4651 100644 --- a/libc/termios/cfmakeraw.c +++ b/libc/termios/cfmakeraw.c @@ -12,9 +12,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <termios.h> diff --git a/libc/termios/cfsetspeed.c b/libc/termios/cfsetspeed.c index 5d5eb8cda..f2bfa4e8c 100644 --- a/libc/termios/cfsetspeed.c +++ b/libc/termios/cfsetspeed.c @@ -12,9 +12,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <termios.h> #include <errno.h> @@ -22,8 +21,6 @@ #ifdef __USE_BSD -libc_hidden_proto(cfsetispeed) -libc_hidden_proto(cfsetospeed) struct speed_struct { diff --git a/libc/termios/isatty.c b/libc/termios/isatty.c index 7532f334b..9c054d962 100644 --- a/libc/termios/isatty.c +++ b/libc/termios/isatty.c @@ -12,15 +12,12 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <unistd.h> #include <termios.h> -libc_hidden_proto(isatty) -libc_hidden_proto(tcgetattr) /* Return 1 if FD is a terminal, 0 if not. */ int isatty (int fd) diff --git a/libc/termios/kernel_termios.h b/libc/termios/kernel_termios.h index 87d5c07e4..defb462b7 100644 --- a/libc/termios/kernel_termios.h +++ b/libc/termios/kernel_termios.h @@ -12,9 +12,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #ifndef _KERNEL_TERMIOS_H #define _KERNEL_TERMIOS_H 1 diff --git a/libc/termios/speed.c b/libc/termios/speed.c index 52647b9cc..a32e5ed71 100644 --- a/libc/termios/speed.c +++ b/libc/termios/speed.c @@ -14,16 +14,13 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <stddef.h> #include <errno.h> #include <termios.h> -libc_hidden_proto(cfsetispeed) -libc_hidden_proto(cfsetospeed) /* This is a gross hack around a kernel bug. If the cfsetispeed functions is called with the SPEED argument set to zero this means use the same diff --git a/libc/termios/tcdrain.c b/libc/termios/tcdrain.c index a13374cb5..011a78636 100644 --- a/libc/termios/tcdrain.c +++ b/libc/termios/tcdrain.c @@ -12,13 +12,15 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <termios.h> #include <sys/ioctl.h> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +#include <sysdep-cancel.h> +#endif libc_hidden_proto(ioctl) @@ -26,6 +28,21 @@ extern __typeof(tcdrain) __libc_tcdrain; /* Wait for pending output to be written on FD. */ int __libc_tcdrain (int fd) { - return ioctl(fd, TCSBRK, 1); +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ + if (SINGLE_THREAD_P) + /* With an argument of 1, TCSBRK for output to be drain. */ + return INLINE_SYSCALL (ioctl, 3, fd, TCSBRK, 1); + + int oldtype = LIBC_CANCEL_ASYNC (); + + /* With an argument of 1, TCSBRK for output to be drain. */ + int result = INLINE_SYSCALL (ioctl, 3, fd, TCSBRK, 1); + + LIBC_CANCEL_RESET (oldtype); + + return result; +#else + return ioctl(fd, TCSBRK, 1); +#endif } weak_alias(__libc_tcdrain,tcdrain) diff --git a/libc/termios/tcflow.c b/libc/termios/tcflow.c index 63f96a860..10cc008d0 100644 --- a/libc/termios/tcflow.c +++ b/libc/termios/tcflow.c @@ -13,15 +13,13 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <termios.h> #include <sys/ioctl.h> -libc_hidden_proto(ioctl) /* Suspend or restart transmission on FD. */ int tcflow (int fd, int action) diff --git a/libc/termios/tcflush.c b/libc/termios/tcflush.c index 159231fb1..ec36a836c 100644 --- a/libc/termios/tcflush.c +++ b/libc/termios/tcflush.c @@ -13,15 +13,13 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <termios.h> #include <sys/ioctl.h> -libc_hidden_proto(ioctl) /* Flush pending data on FD. */ int diff --git a/libc/termios/tcgetattr.c b/libc/termios/tcgetattr.c index 541beb4f6..53e40c39a 100644 --- a/libc/termios/tcgetattr.c +++ b/libc/termios/tcgetattr.c @@ -12,9 +12,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <features.h> #include <string.h> @@ -23,11 +22,6 @@ #include <sys/ioctl.h> #include <sys/types.h> -libc_hidden_proto(ioctl) -/* Experimentally off - libc_hidden_proto(memset) */ -/* Experimentally off - libc_hidden_proto(memcpy) */ -/* Experimentally off - libc_hidden_proto(mempcpy) */ -libc_hidden_proto(tcgetattr) /* The difference here is that the termios structure used in the kernel is not the same as we use in the libc. Therefore we must diff --git a/libc/termios/tcgetpgrp.c b/libc/termios/tcgetpgrp.c index 1ad317139..7cec39c3d 100644 --- a/libc/termios/tcgetpgrp.c +++ b/libc/termios/tcgetpgrp.c @@ -12,17 +12,14 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sys/ioctl.h> #include <errno.h> #include <unistd.h> #include <sys/types.h> -libc_hidden_proto(tcgetpgrp) -libc_hidden_proto(ioctl) /* Return the foreground process group ID of FD. */ pid_t tcgetpgrp (int fd) diff --git a/libc/termios/tcgetsid.c b/libc/termios/tcgetsid.c index 8d3a40242..5e811422c 100644 --- a/libc/termios/tcgetsid.c +++ b/libc/termios/tcgetsid.c @@ -12,9 +12,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <termios.h> @@ -22,9 +21,6 @@ #include <sys/types.h> #include <unistd.h> -libc_hidden_proto(ioctl) -libc_hidden_proto(getsid) -libc_hidden_proto(tcgetpgrp) /* Return the session ID of FD. */ pid_t diff --git a/libc/termios/tcsendbrk.c b/libc/termios/tcsendbrk.c index ae04cb947..8339cfa46 100644 --- a/libc/termios/tcsendbrk.c +++ b/libc/termios/tcsendbrk.c @@ -13,16 +13,14 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <stddef.h> #include <termios.h> #include <sys/ioctl.h> -libc_hidden_proto(ioctl) /* Send zero bits on FD. */ int diff --git a/libc/termios/tcsetattr.c b/libc/termios/tcsetattr.c index d0d82c2ac..8b9d25361 100644 --- a/libc/termios/tcsetattr.c +++ b/libc/termios/tcsetattr.c @@ -12,9 +12,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <string.h> @@ -22,9 +21,6 @@ #include <sys/ioctl.h> #include <sys/types.h> -libc_hidden_proto(tcsetattr) -/* Experimentally off - libc_hidden_proto(memcpy) */ -libc_hidden_proto(ioctl) /* The difference here is that the termios structure used in the kernel is not the same as we use in the libc. Therefore we must diff --git a/libc/termios/tcsetpgrp.c b/libc/termios/tcsetpgrp.c index 9bf1cdaef..ee73fb149 100644 --- a/libc/termios/tcsetpgrp.c +++ b/libc/termios/tcsetpgrp.c @@ -12,16 +12,14 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ #include <sys/types.h> #include <sys/ioctl.h> #include <errno.h> #include <unistd.h> -libc_hidden_proto(ioctl) /* Set the foreground process group ID of FD set PGRP_ID. */ int tcsetpgrp (int fd, pid_t pgrp_id) diff --git a/libc/termios/ttyname.c b/libc/termios/ttyname.c index 9d6a8ce36..5fcf23b64 100644 --- a/libc/termios/ttyname.c +++ b/libc/termios/ttyname.c @@ -31,15 +31,6 @@ #include <dirent.h> #include <sys/stat.h> -libc_hidden_proto(ttyname_r) -libc_hidden_proto(fstat) -libc_hidden_proto(lstat) -/* Experimentally off - libc_hidden_proto(strcpy) */ -/* Experimentally off - libc_hidden_proto(strlen) */ -libc_hidden_proto(opendir) -libc_hidden_proto(closedir) -libc_hidden_proto(readdir) -libc_hidden_proto(isatty) #define TTYNAME_BUFLEN 32 |
