1*61186Sbostic.\" Copyright (c) 1980, 1991, 1993 2*61186Sbostic.\" The Regents of the University of California. All rights reserved. 320092Smckusick.\" 447208Scael.\" %sccs.include.redist.man% 520092Smckusick.\" 6*61186Sbostic.\" @(#)sync.2 8.1 (Berkeley) 06/04/93 747208Scael.\" 847208Scael.Dd 947208Scael.Dt SYNC 2 1047208Scael.Os BSD 4 1147208Scael.Sh NAME 1247208Scael.Nm sync 1347208Scael.Nd "synchronize disk block in-core status with that on disk" 1447208Scael.Sh SYNOPSIS 1547208Scael.Fd #include <unistd.h> 1647208Scael.Ft void 1747208Scael.Fn sync void 1847208Scael.Sh DESCRIPTION 1947208ScaelThe 2047208Scael.Fn sync 2147208Scaelfunction forces a write of dirty (modified) buffers 2247208Scaelin the block buffer cache out 2347208Scaelto disk. The kernel keeps this information in core to reduce 2447208Scaelthe number of disk I/O transfers required by the system. 2547208ScaelAs information in the cache is lost after a system crash a 2647208Scael.Fn sync 2747208Scaelcall is issued 2847208Scaelfrequently 2947208Scaelby the user process 3047208Scael.Xr update 8 3147208Scael(about every 30 seconds). 3247208Scael.Pp 3347208ScaelThe function 3447208Scael.Xr fsync 2 3547208Scaelmay be used to synchronize individual file descriptor 3647208Scaelattributes. 3747208Scael.Sh SEE ALSO 3847208Scael.Xr fsync 2 , 3947208Scael.Xr sync 8 , 4047208Scael.Xr update 8 4147208Scael.Sh BUGS 4247208Scael.Fn Sync 4347208Scaelmay return before the buffers are completely flushed. 4447208Scael.Sh HISTORY 4547208ScaelA 4647208Scael.Nm 4747208Scaelfunction call appeared in Version 6 AT&T UNIX. 48