/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1994 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* create a Datakit connection to a remote destination
*/
#ifndef DIAL
#endif
/*
* COMMKIT(TM) Software - Datakit(R) VCS Interface Release 2.0 V1
*/
#include <fcntl.h>
#include "dk.h"
#include <stdio.h>
#include <signal.h>
#define SIGRTN void
#include <setjmp.h>
#include <sysexits.h>
#include <errno.h>
extern char *getenv();
GLOBAL int
char *dest;
{
}
GLOBAL int
char *dest;
{
char *key;
struct diocdial {
} ioreq;
/*
** Clear our elapsed time and save caller's alarm stuff.
*/
/*
** If requested timeout interval is unreasonable, use the default.
*/
/*
** Do an alarm protected open of the dial device
*/
setalarm(0);
if (dk_verbose)
return(dk_errno = -EX_TEMPFAIL);
else
}
/*
** If the caller has a DKKEY, use it.
*/
else
/*
** Try to dial the call. If the alarm expires during the ioctl,
** the ioctl will return in error.
*/
setalarm(0);
if (dk_verbose)
if (TimeErr)
else
else
}
return (fd);
}
/*
** timout() is the alarm clock signal handling routine. It is called
** whenever the alarm clock expires during dial processing.
*/
/* ARGSUSED */
static SIGRTN
int arg;
{
TimeErr++;
}
/*
** setalarm() is called to request an alarm at a future time. The residual
** from the previous alarm (if any) is added to the elapsed time counter.
*/
static void
{
TimeErr = 0;
}
/*
** usralarm() is used to restore the alarm service for the caller.
*/
static void
int TimWas; /* Caller's alarm clock */
{
if (TimWas > 0) {
if (TimWas < 2)
TimWas = 2;
}
}