/*
* 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.8 */
/* LINTLIBRARY */
# include <errno.h>
# include <string.h>
# include <stropts.h>
# include "lp.h"
# include "msgs.h"
int Lp_prio_msg = 0;
/*
* mflush()
* return 0
* if it successfully writes all the queued message(s), or
* if some of them (errno is EAGAIN in this case).
* return -1 (with errno) when it failed.
*/
int
{
MQUE *p;
errno = 0;
return (-1);
}
/* mwrite successful, get the next and free this entry */
Free(p);
}
return (0);
}
/*
* mwrite()
* return 0
* if it successfully writes the messages, or
* if it has been queued (errno is EAGAIN in this case)
* and md->mque is updated.
* return -1 (with errno) when it failed.
*/
{
short size;
MQUE * p;
MQUE * q;
errno = 0;
{
return(-1);
}
{
return(-1);
}
{
return (-1);
}
goto queue; /* if there is a queue already, try to write all */
return(0);
return(-1);
/*
* fall through to queue the messages that cannot be sent now.
*/
{
return(-1);
}
p->next = 0;
{
/* insert the new one to tail */
while (q->next)
q = q->next;
q->next = p;
{
}
/* mwrite successful, get the next and free this entry */
Free(p);
}
}
else
return(0);
}
{
int flag = 0;
{
case MD_CHILD:
case MD_STREAM:
case MD_BOUND:
{
return(-1);
}
flag = Lp_prio_msg;
Lp_prio_msg = 0; /* clean this up so there are no surprises */
return(0);
return(-1);
case MD_SYS_FIFO:
case MD_USR_FIFO:
{
case -1:
return(-1);
case 0:
break;
default:
return(0);
}
break;
default:
return(-1);
}
return 0;
}