Mono Class Library: Mono.Unix.Native.Stdlib Overview | Members

Mono.Unix.Native.Stdlib.setbuf Method

Control FILE stream buffering operations. [Edit]

public static int setbuf (IntPtr stream, IntPtr buf)

Parameters

stream
The FILE stream to set buffering operations on. [Edit]
buf
The buffer to use for buffering. [Edit]

Returns

The setbuf() function returns the value 0 if successful; otherwise the value -1 is returned and Stdlib.GetLastError indicates the error. [Edit]

Remarks

The setbuf function disables FILE stream buffering if buf is IntPtr.Zero, otherwise full buffering is enabled (and buf is used as the buffer).

The setbuf function is an alias for calls to Stdlib.setvbuf. Except for the lack of a return value, the setbuf function is exactly equivalent to the call:

Stdlib.setvbuf (stream, buf, buf ? Stdlib._IOFBF : Stdlib._IONBF, Stdlib.BUFSIZ);

This function requires that buf refer to at least Stdlib.BUFSIZ bytes of memory. This memory must remain valid until the next setbuf, Stdlib.setvbuf, or Stdlib.fclose call.

[Edit]

Requirements

Namespace: Mono.Unix.Native
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0