linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francois Grieu <fgrieu@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Finding how much data is available for read from a SOCK_SEQPACKET
Date: Wed, 25 Mar 2009 10:39:01 +0100	[thread overview]
Message-ID: <C5EFBA45.17C2D%fgrieu@gmail.com> (raw)

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


             reply	other threads:[~2009-03-25  9:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25  9:39 Francois Grieu [this message]
2009-03-25 15:05 ` Finding how much data is available for read from a SOCK_SEQPACKET Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C5EFBA45.17C2D%fgrieu@gmail.com \
    --to=fgrieu@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).