- markus@cvs.openbsd.org 2003/08/13 09:07:10
[readconf.c ssh.c]
socks4->socks, since with support both 4 and 5; dtucker@zip.com.au
+ - (dtucker) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
+ Add a tcsendbreak function for platforms that don't have one, based on the
+ one from OpenBSD.
20030811
- (dtucker) OpenBSD CVS Sync
setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
setproctitle setregid setresgid setresuid setreuid setrlimit \
setsid setvbuf sigaction sigvec snprintf socketpair strerror \
- strlcat strlcpy strmode strnvis sysconf tcgetpgrp truncate utimes \
- vhangup vsnprintf waitpid \
+ strlcat strlcpy strmode strnvis sysconf tcgetpgrp tcsendbreak \
+ truncate utimes vhangup vsnprintf waitpid \
)
AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
}
#endif /* HAVE_TCGETPGRP */
+#ifndef HAVE_TCSENDBREAK
+int
+tcsendbreak(int fd, int duration)
+{
+# if defined(TIOCSBRK) && defined(TIOCCBRK)
+ struct timeval sleepytime;
+
+ sleepytime.tv_sec = 0;
+ sleepytime.tv_usec = 400000;
+ if (ioctl(fd, TIOCSBRK, 0) == -1)
+ return (-1);
+ (void)select(0, 0, 0, 0, &sleepytime);
+ if (ioctl(fd, TIOCCBRK, 0) == -1)
+ return (-1);
+ return (0);
+# else
+ return -1;
+# endif
+}
+#endif /* HAVE_TCSENDBREAK */
#ifndef HAVE_TCGETPGRP
pid_t tcgetpgrp(int);
-#endif /* HAVE_TCGETPGRP */
+#endif
+
+#ifndef HAVE_TCSENDBREAK
+int tcsendbreak(int, int);
+#endif
#endif /* _BSD_MISC_H */