write.c revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * CDDL HEADER START
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * The contents of this file are subject to the terms of the
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * Common Development and Distribution License (the "License").
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * You may not use this file except in compliance with the License.
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * See the License for the specific language governing permissions
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * and limitations under the License.
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * When distributing Covered Code, include this CDDL HEADER in each
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * If applicable, add the following below this CDDL HEADER, with the
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * fields enclosed by brackets "[]" replaced with your own identifying
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * information: Portions Copyright [yyyy] [name of copyright owner]
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * CDDL HEADER END
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * Use is subject to license terms.
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers#pragma ident "%Z%%M% %I% %E% SMI"
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * write thread - read from vcc console and write to tcp client. There are one
f9fbec18f5b458b560ecf45d3db8e8bd56bf6942mcpowers * writer and multiple readers per console. The first client who connects to
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <thread.h>
#include <synch.h>
#include <signal.h>
#include <assert.h>
#include <poll.h>
#include <syslog.h>
#include <libintl.h>
#include "vntsd.h"
#include "chars.h"
thr_exit(0);
switch (status) {
case VNTSD_STATUS_VCC_IO_ERR:
thr_exit(0);
case VNTSD_STATUS_INTR:
thr_exit(0);
static int term_null_seq = 0;
if (term_null_seq) {
term_null_seq = 0;
for (i = sz; i > 0; i--) {
sz++;
sz--;
if (sz == 0) {
return (sz);
for (i = 0; i < sz; i++) {
for (i = 0; i < sz; i++) {
sz--;
buf[i] = 0;
return (sz);
for (j = i; j < sz -i; j++) {
buf[i] = 0;
if (i == sz) {
return (sz);
return (VNTSD_STATUS_INTR);
if ((*sz > 0)) {
return (VNTSD_SUCCESS);
return (VNTSD_STATUS_VCC_IO_ERR);
static int s_sz;
static boolean_t
int rv;
return (B_FALSE);
int sz;
int rv;
if (sz <= 0) {
return (NULL);