'\" te .\" Copyright 1989 AT&T .\" Copyright (c) 2006, Sun Microsystems, Inc., .\" All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (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 or http://www.opensolaris.org/os/licensing. 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] .TH PUTNEXTCTL1 9F "Jan 16, 2006" .SH NAME putnextctl1 \- send a control message with a one-byte parameter to a queue .SH SYNOPSIS .LP .nf #include \fBint\fR \fBputnextctl1\fR(\fBqueue_t *\fR\fIq\fR, \fBint\fR \fItype\fR, \fBint\fR \fIp\fR); .fi .SH INTERFACE LEVEL .sp .LP Architecture independent level 1 (DDI/DKI). .SH PARAMETERS .sp .ne 2 .na \fB\fIq\fR\fR .ad .RS 8n Queue to which the message is to be sent. .RE .sp .ne 2 .na \fB\fItype\fR\fR .ad .RS 8n Type of message. .RE .sp .ne 2 .na \fB\fIp\fR\fR .ad .RS 8n One-byte parameter. .RE .SH DESCRIPTION .sp .LP The \fBputnextctl1()\fR function, like \fBputctl1\fR(9F), tests the \fItype\fR argument to make sure a data type has not been specified, and attempts to allocate a message block. The \fIp\fR parameter can be used, for example, to specify how long the delay will be when an \fBM_DELAY\fR message is being sent. \fBputnextctl1()\fR fails if \fItype\fR is \fBM_DATA\fR, \fBM_PROTO\fR, or \fBM_PCPROTO\fR, or if a message block cannot be allocated. If successful, \fBputnextctl1()\fR calls the \fBput\fR(9E) routine of the queue pointed to by \fIq\fR with the newly allocated and initialized message. .sp .LP A call to \fBputnextctl1(\fR\fIq\fR,\fItype, p\fR\fB)\fR is an atomic equivalent of \fBputctl1(\fR\fIq\fR\fB->q_next,\fR \fItype, p\fR\fB).\fR The STREAMS framework provides whatever mutual exclusion is necessary to insure that dereferencing \fIq\fR through its \fBq_next\fR field and then invoking \fBputctl1\fR(9F) proceeds without interference from other threads. .sp .LP The \fBputnextctl1()\fR function should always be used in preference to \fBputctl1\fR(9F) .SH RETURN VALUES .sp .LP On success, \fB1\fR is returned. \fB0\fR is returned if \fItype\fR is a data type, or if a message block cannot be allocated. .SH CONTEXT .sp .LP The \fBputnextctl1()\fR function can be called from user, interrupt, or kernel context. .SH EXAMPLES .sp .LP See the \fBputnextctl\fR(9F) function page for an example of \fBputnextctl1()\fR. .SH SEE ALSO .sp .LP \fBput\fR(9E), \fBallocb\fR(9F), \fBdatamsg\fR(9F), \fBputctl1\fR(9F), \fBputnextctl\fR(9F) .sp .LP \fIWriting Device Drivers\fR .sp .LP \fISTREAMS Programming Guide\fR