+
+#define BSPEED B150
+
+/*
+ * send a break
+ */
+genbrk(fn, bnulls)
+register int fn, bnulls;
+{
+#ifdef USG
+ if (ioctl(fn, TCSBRK, STBNULL) < 0)
+ DEBUG(5, "break TCSBRK %s\n", sys_errlist[errno]);
+#else !USG
+# ifdef TIOCSBRK
+ if (ioctl(fn, TIOCSBRK, STBNULL) < 0)
+ DEBUG(5, "break TIOCSBRK %s\n", sys_errlist[errno]);
+# ifdef TIOCCBRK
+ uucpdelay(bnulls, 10);
+ if (ioctl(fn, TIOCCBRK, STBNULL) < 0)
+ DEBUG(5, "break TIOCCBRK %s\n", sys_errlist[errno]);
+# endif TIOCCBRK
+ DEBUG(4, "ioctl %f second break\n", (float) bnulls/10 );
+# else !TIOCSBRK
+ struct sgttyb ttbuf;
+ register int sospeed;
+
+ if (ioctl(fn, TIOCGETP, &ttbuf) < 0)
+ DEBUG(5, "break TIOCGETP %s\n", sys_errlist[errno]);
+ sospeed = ttbuf.sg_ospeed;
+ ttbuf.sg_ospeed = BSPEED;
+ if (ioctl(fn, TIOCSETP, &ttbuf) < 0)
+ DEBUG(5, "break TIOCSETP %s\n", sys_errlist[errno]);
+ if (write(fn, "\0\0\0\0\0\0\0\0\0\0\0\0", bnulls) != bnulls) {
+badbreak:
+ logent(sys_errlist[errno], "BAD WRITE genbrk");
+ alarm(0);
+ longjmp(Sjbuf, 3);
+ }
+ ttbuf.sg_ospeed = sospeed;
+ if (ioctl(fn, TIOCSETP, &ttbuf) < 0)
+ DEBUG(5, "break ioctl %s\n", sys_errlist[errno]);
+ if (write(fn, "@", 1) != 1)
+ goto badbreak;
+ DEBUG(4, "sent BREAK nulls - %d\n", bnulls);
+#endif !TIOCSBRK
+#endif !USG
+}
+