canput(9r)canput(9r)NAME
canput - STREAMS: Tests for room in a message queue
SYNOPSIS
#include <sys/stream.h>
int canput(
queue_t *message_queue );
ARGUMENTS
Specifies a pointer to the message queue. The typedef queue_t is an alternate name for struct queue_entry *.
DESCRIPTION
The canput interface searches through the stream (starting at the message queue identified by the message_queue argument) until it finds a
queue that contains a service interface where the message can be enqueued or until it reaches the end of the stream. If canput finds a
service interface in a queue, it tests the queue to determine if there is space in the queue to accommodate a message. If the queue is
full, canput sets the q_flag member of the queue_entry structure pointer (the message queue) to the constant QWANTW to back-enable the
caller's service interface.
NOTES
You are responsible for both testing a queue with canput and not placing a message on the queue if canput fails.
RETURN VALUES
The canput interface returns a value of 1 if the message queue is not full. It returns the value zero(0) if the message queue is full.
SEE ALSO
Kernel Interfaces: bcanput(9r), putbq(9r), putnext(9r)
Programmer's Guide: STREAMS
canput(9r)
Check Out this Related Man Page
canput(9F) Kernel Functions for Drivers canput(9F)NAME
canput - test for room in a message queue
SYNOPSIS
#include <sys/stream.h>
int canput(queue_t *q);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
q Pointer to the message queue.
DESCRIPTION
canput() searches through the stream (starting at q) until it finds a queue containing a service routine where the message can be enqueued,
or until it reaches the end of the stream. If found, the queue containing the service routine is tested to see if there is room for a mes-
sage in the queue.
canputnext(q) and bcanputnext(q, pri) should always be used in preference to canput(q->q_next) and bcanput(q->q_next, pri) respectively.
RETURN VALUES
1 If the message queue is not full.
0 If the queue is full.
CONTEXT
canput() can be called from user or interrupt context.
SEE ALSO bcanput(9F), bcanputnext(9F), canputnext(9F), putbq(9F), putnext(9F)
Writing Device Drivers
STREAMS Programming Guide
WARNINGS
Drivers are responsible for both testing a queue with canput() and refraining from placing a message on the queue if canput() fails.
SunOS 5.10 11 Apr 1991 canput(9F)
How is the hash queue categorized? I am trying to understand the free list vs the hash queue and i'm just not getting it. The book im using is written like you already have a degree in Unix architecture. Maybe someone knows a web site that explains this in laymans terms. A Unix architecture for... (1 Reply)
hi all,
I'm working on this problem for 2 days. Can somebody tell me that how to delete all message queues from the system ?
Since "ipcs -q" gives the list of all existing message queue, then there must be a system call and data stucture where from I can fetch the data about all existing... (2 Replies)
Hi All
I am looking for a script that would collect statistics in a summarised format.
CPU, Memory,Swap, Wait queue, Run queue and disk activity.
Something that would allow me to profile the environment based on a 1 line output that I could run every 15 min.
Thx
Junaid (1 Reply)
i have been in trouble please help me out
i have developed a message queue.it is a simple message queue program
after running it give error like NO SPACE LEFT ON DEVICE
what is this error
how could i solve this problem i am working on solaris9.2 (2 Replies)
Hello,
i need to write a message queue "chat server", that should work only localy.
Can anyone please help me with some ideas and peshaps code. I'm studying the UNIX IPC mechanisms right now. So far, i understand how it works but i still cannot get an idea how to write a chat programm...
... (2 Replies)
hello,
I had to implement a message queue application....between 30 processes......
all 30 proceses are getting data from serial port....
And here is THE FLOW::::::::1 connector process...which is linked with message queue to all the 30 applications. Processes get the data from serial port and... (9 Replies)
hello ,
I have to write an application in which I had to implement both Socket Comminication and IPC- message queues.
and that process should run in Infinite loop as well I had to continously check and send data through both type of communications...
What should I use to implement it...
I had... (34 Replies)
Hi,
I browsed thru the previous posts and couldnt find a solution for my problem. Hence I decided to post it.
I have a buffer array that I want to send thru a message queue. The array consists of a header structure and a payload structure memcopied to it. When I print the contents of the... (1 Reply)
Such as how to display these:
number of message queue IDs : 4,096
bytes per message : 8,192
bytes per message queue : 65,536
messages per message queue : 8,192 (4 Replies)
Hi guys.
i have wrote a simple program to test message queue attributes. here it is:
#include <stdio.h>
#include <stdlib.h>
#include <mqueue.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
int main()
{
struct mq_attr attr;
mqd_t mqd;
... (2 Replies)
On our prod system we found sometime runqueue goes back to 0 as below.
Whereas on test server even with very very less work the r-queue never dropped to 0. Under what conditions r-queue drops to 0? Does it mean something unusual?
EG:
kthr memory page faults ... (1 Reply)
Hi
I am trying to figure out, on how to automate whether in a simple script or using awk/sed/grep commands to automate a "service.message" file which has tag separated message stating as;
"There is currently no outage or system is unavailable for duration of change....", therefore, when... (14 Replies)