'\" te .\" Copyright (c) 2006, Sun Microsystems, Inc. .TH canputnext 9F "16 Jan 2006" "SunOS 5.11" "Kernel Functions for Drivers" .SH NAME canputnext, bcanputnext \- test for room in next module's message queue .SH SYNOPSIS .LP .nf #include \fBint\fR \fBcanputnext\fR(\fBqueue_t *\fR\fIq\fR); .fi .LP .nf \fBint\fR \fBbcanputnext\fR(\fBqueue_t *\fR\fIq\fR, \fBunsigned char\fR \fIpri\fR); .fi .SH INTERFACE LEVEL .sp .LP Architecture independent level 1 (DDI/DKI). .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIq\fR\fR .ad .RS 7n .rt Pointer to a message queue belonging to the invoking module. .RE .sp .ne 2 .mk .na \fB\fIpri\fR\fR .ad .RS 7n .rt Minimum priority level. .RE .SH DESCRIPTION .sp .LP The invocation \fBcanputnext(\fR\fIq\fR\fB);\fR is an atomic equivalent of the \fBcanput(\fR\fIq\fR\fB\(->q_next);\fR routine. That is, the \fBSTREAMS \fRframework provides whatever mutual exclusion is necessary to insure that dereferencing \fIq\fR through its \fBq_next\fR field and then invoking \fBcanput\fR(9F) proceeds without interference from other threads. .sp .LP \fBbcanputnext(\fR\fIq\fR\fB,\fR \fIpri\fR\fB);\fR is the equivalent of the \fBbcanput(\fR\fIq\fR\fB\(->q_next,\fR \fIpri\fR\fB);\fR routine. .sp .LP \fBcanputnext(\fR\fIq\fR\fB);\fR and \fBbcanputnext(\fR\fIq\fR\fB,\fR \fIpri\fR\fB);\fR should always be used in preference to \fBcanput(\fR\fIq\fR\fB\(->q_next);\fR and \fBbcanput(\fR\fIq\fR\fB\(->q_next,\fR \fIpri\fR\fB);\fR respectively. .sp .LP See \fBcanput\fR(9F) and \fBbcanput\fR(9F) for further details. .SH RETURN VALUES .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .RS 5n .rt If the message queue is not full. .RE .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 5n .rt If the queue is full. .RE .SH CONTEXT .sp .LP The \fBcanputnext()\fR and \fBbcanputnext()\fR functions can be called from user, interrupt, or kernel context. .SH WARNINGS .sp .LP Drivers are responsible for both testing a queue with \fBcanputnext()\fR or \fBbcanputnext()\fR and refraining from placing a message on the queue if the queue is full. .SH SEE ALSO .sp .LP \fBbcanput\fR(9F), \fBcanput\fR(9F) .sp .LP \fIWriting Device Drivers for Oracle Solaris 11.2\fR .sp .LP \fISTREAMS Programming Guide\fR