- Subject: Finding how much data is available for read from a SOCK_SEQPACKET
- From: Francois Grieu <fgrieu@xxxxxxxxx>
- Date: Wed, 25 Mar 2009 10:39:01 +0100
- List-id: <linux-c-programming.vger.kernel.org>
- User-agent: Microsoft-Entourage/9.0.6.8320
Hello,
I have a working program that receives blocks of data from a
SOCK_SEQPACKET using a blocking read(). So far I use a
fixed-size buffer of the maximum size.
I would like to query for the size available, malloc a block
of the appropriate size, then read. Is that feasible?
Note: I think that I can not put the size at the head of the
packet since
" SOCK_SEQPACKET
Provides a sequenced, reliable, two-way connection-based
data transmission path for datagrams of fixed maximum length;
a consumer is required to read an entire packet with each
read system call."
TIA,
Francois Grieu
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Assembler]
[Git]
[Kernel List]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[Yosemite Campsites]
[Yosemite News]
[GCC Help]