/*
* 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 2004 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"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <poll.h>
#include <signal.h>
#include <errno.h>
#include "ttymon.h"
#include "tmstruct.h"
#include "tmextern.h"
static int process();
extern void sigint();
static int interrupt;
/*
* poll_data - it polls the device, waiting for data
* - return BADSPEED it <brk> is received
* - return the result of process if data is received
* - write a newline if <del> is received
* - exit if hangup is received
*/
int
{
int j;
#ifdef DEBUG
debug("in poll_data");
#endif
}
for (;;) {
interrupt = 0;
return(BADSPEED);
}
return(BADSPEED);
}
}
else if (j > 0) {
log( "POLLHUP received, about to exit");
exit(1);
}
}
}
}
}
}
/*
* process - process the data
* - return GOODNAME if it is a non-empty line
* - return NONAME if a <CR> is received
* - return BADNAME if zero byte is detected
* - except the case of GOODNAME, data will be pulled out
* of the stream
*/
static int
int fd, /* fd to read data from if necessary */
{
unsigned i;
return (BADSPEED);
if (i == 0) {
return (NONAME);
} else
return (GOODNAME);
}
} /* end for loop */
/* end of input is encountered */
#ifdef DEBUG
debug("in process: EOF encountered");
#endif
exit(1);
/*NOTREACHED*/
}
/*
* do_peek - peek at the stream to get the data
* - this only called when POLLIN is detected,
* - so there should always be something there
* - return a ptr to the buf that contains the data
* - return NULL if nothing to peek at
*/
struct strbuf *
int fd; /* fd to do the ioctl on */
int n; /* maxlen of data to peek at */
{
int ret;
#ifdef DEBUG
debug("in do_peek");
#endif
/* need to ask for ctl info to avoid bug in I_PEEK code */
if (ret == -1) {
exit(1);
}
if (ret == 0) {
}
}
/*
* sigint - this is called when SIGINT is caught
*/
void
sigint()
{
#ifdef DEBUG
debug("in sigint");
#endif
}
else {
/* somebody type <brk> or frame error */
}
}
}