1 /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
2 /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
3 /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
4 /*%% (c) Copyright 1993, 1994 Novell, Inc. */
5 /*%% $XConsortium: issync.c /main/3 1995/10/23 11:45:20 rswiston $ */
7 static char sccsid[] = "@(#)issync.c 1.7 89/07/17 Copyr 1988 Sun Micro";
10 * Copyright (c) 1988 by Sun Microsystems, Inc.
17 * Sync all kernel buffers to the disk.
19 * Note: issync() flushes changed kernel buffers that are local to
20 * the application that issued the call.
22 * See sync(2) UNIX manual for what actually happens if sync() is called.
25 #include "isam_impl.h"
36 return iscntl(ALLISFD, ISCNTL_FSYNC);
47 return iscntl(isfd, ISCNTL_FSYNC);
55 for (i = 0; i < MAXISFD; i++)
69 * Get File Access Block.
71 if ((fab = _isfd_find(isfd)) == NULL) {
72 _setiserrno2(ENOTOPEN, '9', '0');
77 * Check that the open mode was ISINPUT, or ISINOUT.
79 if (fab->openmode != OM_INPUT && fab->openmode != OM_INOUT) {
80 _setiserrno2(ENOTOPEN, '9', '0');
87 * Get FCB corresponding to the isfhandle handle.
89 if ((fcb = _openfcb(&fab->isfhandle, &fab->errcode)) == NULL) {
96 (void)fsync(fcb->datfd);
99 (void)fsync(fcb->indfd);
101 if (fcb->varfd != -1)
102 (void)fsync(fcb->varfd);
104 _amseterrcode(&fab->errcode, ISOK);
109 _seterr_errcode(&fab->errcode);
111 return (ret); /* Successful write */