2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
7 * Copyright (c) 1983 Regents of the University of California.
8 * All rights reserved. The Berkeley software License Agreement
9 * specifies the terms and conditions for redistribution.
12 #pragma ident "%Z%%M% %I% %E% SMI"
16 static sigjmp_buf deadline
;
24 siglongjmp(deadline
, 1);
33 f
= signal(SIGALRM
, (sig_handler_t
)dead
);
34 while (cp
= getremote(name
)) {
37 if (tip_mlock(uucplock
) < 0) {
42 * Straight through call units, such as the BIZCOMP,
43 * VADIC and the DF, must indicate they're hardwired in
44 * order to get an open file descriptor placed in FD.
45 * Otherwise, as for a DN-11, the open will have to
46 * be done in the "open" routine.
50 if (sigsetjmp(deadline
, 1) == 0) {
55 if ((FD
= open(cp
, O_RDWR
)) < 0 && errno
!= EBUSY
) {
56 (void) fprintf(stderr
, "tip: ");
61 if (FD
>= 0 && !isatty(FD
)) {
62 (void) fprintf(stderr
, "tip: %s: not a tty\n",
69 if (!deadfl
&& FD
>= 0) {
72 (void) ioctl(FD
, TCGETS
, &t
);
73 t
.c_cflag
|= XCLUDE
|HUPCL
;
74 (void) ioctl(FD
, TCSETSF
, &t
);
75 (void) signal(SIGALRM
, f
);
80 (void) signal(SIGALRM
, f
);
81 return (deadfl
? -1 : (int)cp
);