8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / sendmail / db / os / os_fsync.c
blob61a504f84d73e08c00dee3142e8722546700d9d7
1 /*-
2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 1997, 1998
5 * Sleepycat Software. All rights reserved.
6 */
8 #include "config.h"
10 #ifndef lint
11 static const char sccsid[] = "@(#)os_fsync.c 10.7 (Sleepycat) 10/12/98";
12 #endif /* not lint */
14 #ifndef NO_SYSTEM_INCLUDES
15 #include <sys/types.h>
17 #include <errno.h>
18 #include <fcntl.h> /* XXX: Required by __hp3000s900 */
19 #include <unistd.h>
20 #endif
22 #include "db_int.h"
23 #include "os_jump.h"
25 #ifdef __hp3000s900
26 int
27 __mpe_fsync(fd)
28 int fd;
30 extern FCONTROL(short, short, void *);
32 FCONTROL(_MPE_FILENO(fd), 2, NULL); /* Flush the buffers */
33 FCONTROL(_MPE_FILENO(fd), 6, NULL); /* Write the EOF */
34 return (0);
36 #endif
38 #ifdef __hp3000s900
39 #define fsync(fd) __mpe_fsync(fd);
40 #endif
41 #ifdef _WIN32
42 #define fsync(fd) _commit(fd);
43 #endif
46 * __os_fsync --
47 * Flush a file descriptor.
49 * PUBLIC: int __os_fsync __P((int));
51 int
52 __os_fsync(fd)
53 int fd;
55 int ret;
57 ret = __db_jump.j_fsync != NULL ? __db_jump.j_fsync(fd) : fsync(fd);
58 return (ret == 0 ? 0 : errno);