Reactos
at master 22 lines 665 B view raw
1// 2// fsetpos.cpp 3// 4// Copyright (c) Microsoft Corporation. All rights reserved. 5// 6// Defines fsetpos(), which sets the file position using a position previously 7// returned by fgetpos(). 8// 9#include <corecrt_internal_stdio.h> 10 11 12 13// Sets the file position to the given position. The position value must have 14// been returned by a prior call to fgetpos(). Returns 0 on success; returns 15// nonzero on failure. 16extern "C" int __cdecl fsetpos(FILE* const stream, fpos_t const* const position) 17{ 18 _VALIDATE_RETURN(stream != nullptr, EINVAL, -1); 19 _VALIDATE_RETURN(position != nullptr, EINVAL, -1); 20 21 return _fseeki64(stream, *position, SEEK_SET); 22}