Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.86 KB

File metadata and controls

56 lines (40 loc) · 1.86 KB
description title ms.date api_name api_location api_type topic_type f1_keywords helpviewer_keywords ms.assetid
Learn more about: _commit
_commit
4/2/2020
_commit
_o__commit
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
api-ms-win-crt-stdio-l1-1-0.dll
DLLExport
apiref
_commit
commit
files [C++], flushing
flushing files to disk
commit function
_commit function
committing files to disk
d0c74d3a-4f2d-4fb0-b140-2d687db3d233

_commit

Flushes a file directly to disk.

Syntax

int _commit(
   int fd
);

Parameters

fd
File descriptor referring to the open file.

Return value

_commit returns 0 if the file was successfully flushed to disk. A return value of -1 indicates an error.

Remarks

The _commit function forces the operating system to write the file associated with fd to disk. This call ensures that the specified file is flushed immediately, not at the operating system's discretion.

If fd is an invalid file descriptor, the invalid parameter handler is invoked, as described in Parameter validation. If execution is allowed to continue, the function returns -1 and errno is set to EBADF.

By default, this function's global state is scoped to the application. To change this behavior, see Global state in the CRT.

Requirements

Routine Required header Optional headers
_commit <io.h> <errno.h>

For more compatibility information, see Compatibility.

See also

Low-level I/O
_creat, _wcreat
_open, _wopen
_read
_write