File: mongoc_stream_read.page

package info (click to toggle)
libmongoc 1.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,824 kB
  • ctags: 4,501
  • sloc: ansic: 57,956; makefile: 717; python: 502; sh: 54
file content (55 lines) | stat: -rw-r--r-- 2,391 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?xml version="1.0"?>

<page xmlns="http://projectmallard.org/1.0/"
      type="topic"
      style="function"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/experimental/ui/"
      id="mongoc_stream_read">


  <info>
    <link type="guide" xref="mongoc_stream_t" group="function"/>
  </info>
  <title>mongoc_stream_read()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[ssize_t
mongoc_stream_read (mongoc_stream_t *stream,
                    void            *buf,
                    size_t           count,
                    size_t           min_bytes,
                    int32_t          timeout_msec);
]]></code></synopsis>
  </section>


  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>stream</p></td><td><p>A <code xref="mongoc_stream_t">mongoc_stream_t</code>.</p></td></tr>
      <tr><td><p>buf</p></td><td><p>The buffer to read into.</p></td></tr>
      <tr><td><p>count</p></td><td><p>The number of bytes to read.</p></td></tr>
      <tr><td><p>min_bytes</p></td><td><p>The minimum number of bytes to read, or else indicate failure.</p></td></tr>
      <tr><td><p>timeout_msec</p></td><td><p>The number of milliseconds to wait before failure, a timeout of 0 will not block. If negative, use the default timeout.</p></td></tr>
    </table>
  </section>

  <section id="description">
    <p>The <code xref="mongoc_stream_read">mongoc_stream_read()</code> function shall perform a read from a <code xref="mongoc_stream_t">mongoc_stream_t</code>. It's modeled on the API and semantics of <code>read()</code>, though the parameters map only loosely.</p>
  </section>

  <section id="return">
    <title>Returns</title>
    <p>The <code xref="mongoc_stream_read">mongoc_stream_read</code> function returns the number of bytes read on success. It returns <code>&gt;= 0</code> and <code>&lt; min_bytes</code> when end-of-file is encountered and <code>-1</code> on failure. <code>errno</code> is set upon failure.</p>
  </section>

  <section id="seealso">
    <title>See Also</title>
    <p><code xref="mongoc_stream_readv">mongoc_stream_readv()</code></p>
    <p><code xref="mongoc_stream_write">mongoc_stream_write()</code></p>
    <p><code xref="mongoc_stream_writev">mongoc_stream_writev()</code></p>
  </section>

</page>