Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: July 2017
 
 

canputnext(9F)

Name

canputnext, bcanputnext - test for room in next module's message queue

Synopsis

#include <sys/stream.h> 

int canputnext(queue_t *q);
int bcanputnext(queue_t *q, unsigned char pri);

Interface Level

Architecture independent level 1 (DDI/DKI).

Parameters

q

Pointer to a message queue belonging to the invoking module.

pri

Minimum priority level.

Description

The invocation canputnext(q ); is an atomic equivalent of the canput( q→q_next); routine. That is, the STREAMS framework provides whatever mutual exclusion is necessary to insure that dereferencing q through its q_next field and then invoking canput(9F) proceeds without interference from other threads.

bcanputnext(q, pri); is the equivalent of the bcanput( q→q_next, pri); routine.

canputnext(q); and bcanputnext(q, pri); should always be used in preference to canput(q→q_next); and bcanput(q→q_next, pri); respectively.

See canput(9F) and bcanput(9F) for further details.

Return Values

1

If the message queue is not full.

0

If the queue is full.

Context

The canputnext() and bcanputnext() functions can be called from user, interrupt, or kernel context.

Warnings

Drivers are responsible for both testing a queue with canputnext () or bcanputnext() and refraining from placing a message on the queue if the queue is full.

See Also

bcanput(9F), canput(9F)

Writing Device Drivers for Oracle Solaris 11.3

STREAMS Programming Guide