1FFLUSH(3) 386BSD Programmer's Manual FFLUSH(3) 2 3NNAAMMEE 4 fffflluusshh, ffppuurrggee - flush a stream 5 6SSYYNNOOPPSSIISS 7 ##iinncclluuddee <<ssttddiioo..hh>> 8 9 _i_n_t 10 fffflluusshh(_F_I_L_E *_s_t_r_e_a_m) 11 12 _i_n_t 13 ffppuurrggee(_F_I_L_E *_s_t_r_e_a_m) 14 15DDEESSCCRRIIPPTTIIOONN 16 The function fffflluusshh() forces a write of all buffered data for the given 17 output or update _s_t_r_e_a_m via the stream's underlying write function. The 18 open status of the stream is unaffected. 19 20 If the _s_t_r_e_a_m argument is NULL, fffflluusshh() flushes _a_l_l open output streams. 21 22 The function ffppuurrggee() erases any input or output buffered in the given 23 _s_t_r_e_a_m. For output streams this discards any unwritten output. For input 24 streams this discards any input read from the underlying object but not 25 yet obtained via getc(3); this includes any text pushed back via ungetc. 26 27 28RREETTUURRNN VVAALLUUEESS 29 Upon successful completion 0 is returned. Otherwise, EOF is returned and 30 the global variable _e_r_r_n_o is set to indicate the error. 31 32EERRRROORRSS 33 [EBADF] _S_t_r_e_a_m is not an open stream, or, in the case of fffflluusshh(), not a 34 stream open for writing. 35 36 The function fffflluusshh() may also fail and set _e_r_r_n_o for any of the errors 37 specified for the routine write(2). 38 39SSEEEE AALLSSOO 40 write(2), fopen(3), fclose(3), setbuf(3) 41 42SSTTAANNDDAARRDDSS 43 The fffflluusshh() function conforms to ANSI C3.159-1989 (``ANSI C''). 44 45BSD Experimental June 29, 1991 1 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67