/*
* 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 1997 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" /* SVr4.0 1.2 */
#include <unistd.h>
#include <signal.h>
#include <stropts.h>
#include <errno.h>
#include "lp.h"
#include "msgs.h"
extern int errno;
/*
* Putmsg() function
* Return 0: success,
* non-zero: return code of the failed putmsg() system call.
* plus errno for caller to check.
* NOTE: cannot do TRACE* calls if errno is expected to be returned!
* TRACE* uses fprintf and destroys the content of errno.
* Save errno before the TRACE* calls.
*/
int
{
int i;
int rtncode;
int count;
return (-1);
}
return (-1);
}
return (rtncode);
}
int
{
int rtncode;
return (rtncode);
}
/*
** Function: static int read3_2( MESG *, char *, int)
** Args: message descriptor
** message buffer (var)
** buffer size
** Return: 0 for sucess, -1 for failure
**
** This performs a 3.2 HPI style read_fifo on the pipe referanced
** in the message descriptor. If a message is found, it is returned
** in message buffer.
*/
{
short type;
do
{
{
case -1:
return (-1);
case 0:
/*
** The fifo was empty and we have O_NDELAY set,
** or the Spooler closed our FIFO.
** We don't set O_NDELAY in the user process,
** so that should never happen. But be warned
** that we can't tell the difference in some versions
** of the UNIX op. sys.!!
**
*/
return (-1);
}
{
return (-1);
}
}
while (type == I_QUEUE_CHK);
/*
** Get the size from the 3.2 HPI message
** minus the size of the control data
** Copy the actual message
** Reset the message size.
*/
return(0);
}
{
int rval;
return (rval);
}