xref: /src/lib/libc/sys/fsync.c (revision b59aecef032eb8287ccdac003341f397214fc9ee)
18495e8b1SKonstantin Belousov /*
28495e8b1SKonstantin Belousov  * Copyright (c) 2014 The FreeBSD Foundation.
38495e8b1SKonstantin Belousov  *
48495e8b1SKonstantin Belousov  * Portions of this software were developed by Konstantin Belousov
58495e8b1SKonstantin Belousov  * under sponsorship from the FreeBSD Foundation.
68495e8b1SKonstantin Belousov  *
78495e8b1SKonstantin Belousov  * Redistribution and use in source and binary forms, with or without
88495e8b1SKonstantin Belousov  * modification, are permitted provided that the following conditions
98495e8b1SKonstantin Belousov  * are met:
108495e8b1SKonstantin Belousov  * 1. Redistributions of source code must retain the above copyright
118495e8b1SKonstantin Belousov  *    notice(s), this list of conditions and the following disclaimer as
128495e8b1SKonstantin Belousov  *    the first lines of this file unmodified other than the possible
138495e8b1SKonstantin Belousov  *    addition of one or more copyright notices.
148495e8b1SKonstantin Belousov  * 2. Redistributions in binary form must reproduce the above copyright
158495e8b1SKonstantin Belousov  *    notice(s), this list of conditions and the following disclaimer in
168495e8b1SKonstantin Belousov  *    the documentation and/or other materials provided with the
178495e8b1SKonstantin Belousov  *    distribution.
188495e8b1SKonstantin Belousov  *
198495e8b1SKonstantin Belousov  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
208495e8b1SKonstantin Belousov  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
218495e8b1SKonstantin Belousov  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
228495e8b1SKonstantin Belousov  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
238495e8b1SKonstantin Belousov  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
248495e8b1SKonstantin Belousov  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
258495e8b1SKonstantin Belousov  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
268495e8b1SKonstantin Belousov  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
278495e8b1SKonstantin Belousov  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
288495e8b1SKonstantin Belousov  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
298495e8b1SKonstantin Belousov  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
308495e8b1SKonstantin Belousov  */
318495e8b1SKonstantin Belousov 
328495e8b1SKonstantin Belousov #include <sys/types.h>
338495e8b1SKonstantin Belousov #include <sys/fcntl.h>
34cfb65fa2SCraig Rodrigues #include <unistd.h>
358495e8b1SKonstantin Belousov #include "libc_private.h"
368495e8b1SKonstantin Belousov 
378495e8b1SKonstantin Belousov int
fsync(int fd)388495e8b1SKonstantin Belousov fsync(int fd)
398495e8b1SKonstantin Belousov {
40*7dd9070eSBrooks Davis 	return (INTERPOS_SYS(fsync, fd));
418495e8b1SKonstantin Belousov }
42