1*ebf4a993SGarrett D'Amore.\" 2*ebf4a993SGarrett D'Amore.\" This file and its contents are supplied under the terms of the 3*ebf4a993SGarrett D'Amore.\" Common Development and Distribution License ("CDDL"), version 1.0. 4*ebf4a993SGarrett D'Amore.\" You may only use this file in accordance with the terms of version 5*ebf4a993SGarrett D'Amore.\" 1.0 of the CDDL. 6*ebf4a993SGarrett D'Amore.\" 7*ebf4a993SGarrett D'Amore.\" A full copy of the text of the CDDL should have accompanied this 8*ebf4a993SGarrett D'Amore.\" source. A copy of the CDDL is also available via the Internet at 9*ebf4a993SGarrett D'Amore.\" http://www.illumos.org/license/CDDL. 10*ebf4a993SGarrett D'Amore.\" 11*ebf4a993SGarrett D'Amore.\" 12*ebf4a993SGarrett D'Amore.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> 13*ebf4a993SGarrett D'Amore.\" 14*ebf4a993SGarrett D'Amore.Dd "Dec 15, 2014" 15*ebf4a993SGarrett D'Amore.Dt CANPUTNEXT 9F 16*ebf4a993SGarrett D'Amore.Os 17*ebf4a993SGarrett D'Amore.Sh NAME 18*ebf4a993SGarrett D'Amore.Nm canputnext , 19*ebf4a993SGarrett D'Amore.Nm bcanputnext 20*ebf4a993SGarrett D'Amore.Nd test for room in next message queue 21*ebf4a993SGarrett D'Amore.Sh SYNOPSIS 22*ebf4a993SGarrett D'Amore.In sys/stream.h 23*ebf4a993SGarrett D'Amore. 24*ebf4a993SGarrett D'Amore.Ft int 25*ebf4a993SGarrett D'Amore.Fo canputnext 26*ebf4a993SGarrett D'Amore.Fa "queue_t *q" 27*ebf4a993SGarrett D'Amore.Fc 28*ebf4a993SGarrett D'Amore. 29*ebf4a993SGarrett D'Amore.Ft int 30*ebf4a993SGarrett D'Amore.Fo bcanputnext 31*ebf4a993SGarrett D'Amore.Fa "queue_t *q" 32*ebf4a993SGarrett D'Amore.Fa "unsigned char pri" 33*ebf4a993SGarrett D'Amore.Fc 34*ebf4a993SGarrett D'Amore. 35*ebf4a993SGarrett D'Amore.Sh DESCRIPTION 36*ebf4a993SGarrett D'AmoreThe 37*ebf4a993SGarrett D'Amore.Fn canputnext 38*ebf4a993SGarrett D'Amoreand 39*ebf4a993SGarrett D'Amore.Fn bcanputnext 40*ebf4a993SGarrett D'Amorefunctions atomically test for available space in the next 41*ebf4a993SGarrett D'Amorelinked queue or priority band. 42*ebf4a993SGarrett D'AmoreThey are preferable to and safer than calling 43*ebf4a993SGarrett D'Amore.Xr canput 9F 44*ebf4a993SGarrett D'Amoreand 45*ebf4a993SGarrett D'Amore.Xr bcanput 9F 46*ebf4a993SGarrett D'Amoredirectly on the the queue linked to by 47*ebf4a993SGarrett D'Amore.Fa q Ns No -> Ns Fa q_next . 48*ebf4a993SGarrett D'Amore.Lp 49*ebf4a993SGarrett D'AmoreDrivers and modules should call these routines to ensure that room 50*ebf4a993SGarrett D'Amoreon the next queue exists before calling 51*ebf4a993SGarrett D'Amore.Xr putnext 9F . 52*ebf4a993SGarrett D'Amore.Sh INTERFACE LEVEL 53*ebf4a993SGarrett D'AmoreArchitecture independent (DDI/DDK). 54*ebf4a993SGarrett D'Amore.Sh PARAMETERS 55*ebf4a993SGarrett D'Amore.Bl -tag -width Ds 56*ebf4a993SGarrett D'Amore.It Fa q 57*ebf4a993SGarrett D'AmoreSTREAMS queue. 58*ebf4a993SGarrett D'Amore.It Fa pri 59*ebf4a993SGarrett D'AmorePriority band to test. 60*ebf4a993SGarrett D'Amore.El 61*ebf4a993SGarrett D'Amore.Sh CONTEXT 62*ebf4a993SGarrett D'AmoreThese functions may be called in user, kernel, or interrupt 63*ebf4a993SGarrett D'Amorecontext. 64*ebf4a993SGarrett D'Amore.Sh RETURN VALUES 65*ebf4a993SGarrett D'Amore.Bl -tag -width Ds 66*ebf4a993SGarrett D'Amore.It 1 67*ebf4a993SGarrett D'AmoreIf the next message queue is not full. 68*ebf4a993SGarrett D'Amore.It 0 69*ebf4a993SGarrett D'AmoreIf the next message queue is full. 70*ebf4a993SGarrett D'Amore.El 71*ebf4a993SGarrett D'Amore.Sh SEE ALSO 72*ebf4a993SGarrett D'Amore.Rs 73*ebf4a993SGarrett D'Amore.%B "STREAMS Programming Guide" 74*ebf4a993SGarrett D'Amore.Re 75*ebf4a993SGarrett D'Amore.Rs 76*ebf4a993SGarrett D'Amore.%B "Writing Device Drivers" 77*ebf4a993SGarrett D'Amore.Re 78*ebf4a993SGarrett D'Amore.Pp 79*ebf4a993SGarrett D'Amore.Xr bcanput 9F , 80*ebf4a993SGarrett D'Amore.Xr canput 9F , 81*ebf4a993SGarrett D'Amore.Xr putnext 9F , 82