blob: 9b027f60100caad3331283db478d6c43b899166b (
plain)
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
|
/*-
* Copyright (c) 2014-2019 MongoDB, Inc.
* Copyright (c) 2008-2014 WiredTiger, Inc.
* All rights reserved.
*
* See the file LICENSE for redistribution information.
*/
#include "wt_internal.h"
/*
* __wt_stream_set_line_buffer --
* Set line buffering on a stream.
*/
void
__wt_stream_set_line_buffer(FILE *fp)
{
/*
* This function exists because MSVC doesn't support buffer sizes of 0 to the setvbuf call. To
* avoid re-introducing the bug, we have helper functions and disallow calling setvbuf directly
* in WiredTiger code.
*
* Additionally, MSVC doesn't support line buffering, the result is the same as full-buffering.
* We assume our caller wants immediate output, set no-buffering instead.
*/
__wt_stream_set_no_buffer(fp);
}
/*
* __wt_stream_set_no_buffer --
* Turn off buffering on a stream.
*/
void
__wt_stream_set_no_buffer(FILE *fp)
{
(void)setvbuf(fp, NULL, _IONBF, 0);
}
|