xref: /illumos-gate/usr/src/man/man2/sync.2 (revision 4763305e3243687c189d755d737d52205b2614ed)
1*4763305eSRobert Mustacchi.\"
2c10c16deSRichard Lowe.\"  Copyright 1989 AT&T  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
3*4763305eSRobert Mustacchi.\" Copyright 2024 Oxide Computer Company
4c10c16deSRichard Lowe.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5c10c16deSRichard Lowe.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6c10c16deSRichard Lowe.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7*4763305eSRobert Mustacchi.Dd July 2, 2024
8*4763305eSRobert Mustacchi.Dt SYNC 2
9*4763305eSRobert Mustacchi.Os
10*4763305eSRobert Mustacchi.Sh NAME
11*4763305eSRobert Mustacchi.Nm sync
12*4763305eSRobert Mustacchi.Nd update super block
13*4763305eSRobert Mustacchi.Sh SYNOPSIS
14*4763305eSRobert Mustacchi.In unistd.h
15*4763305eSRobert Mustacchi.Ft void
16*4763305eSRobert Mustacchi.Fo sync
17*4763305eSRobert Mustacchi.Fa void
18*4763305eSRobert Mustacchi.Fc
19*4763305eSRobert Mustacchi.Sh DESCRIPTION
20*4763305eSRobert MustacchiThe
21*4763305eSRobert Mustacchi.Fn sync
22*4763305eSRobert Mustacchifunction writes all information in memory that should be on disk, including
23*4763305eSRobert Mustacchimodified super blocks, modified inodes, and delayed block I/O.
24*4763305eSRobert Mustacchi.Pp
25*4763305eSRobert MustacchiUnlike
26*4763305eSRobert Mustacchi.Xr fsync 3C ,
27*4763305eSRobert Mustacchiwhich completes the writing before it returns,
28*4763305eSRobert Mustacchi.Fn sync
29*4763305eSRobert Mustacchischedules but does not necessarily complete the writing before returning.
30*4763305eSRobert MustacchiTo perform a blocking synchronization of a single file system, use the
31*4763305eSRobert Mustacchi.Xr syncfs 3C
32*4763305eSRobert Mustacchifunction.
33*4763305eSRobert Mustacchi.Sh USAGE
34*4763305eSRobert MustacchiThe
35*4763305eSRobert Mustacchi.Fn sync
36*4763305eSRobert Mustacchifunction should be used by applications that examine a file system, such as
37*4763305eSRobert Mustacchi.Xr fsck 8 ,
38*4763305eSRobert Mustacchi.Xr df 8 ,
39*4763305eSRobert Mustacchiand is mandatory before rebooting.
40*4763305eSRobert Mustacchi.Sh INTERFACE STABILITY
41*4763305eSRobert Mustacchi.Sy Committed
42*4763305eSRobert Mustacchi.Sh SEE ALSO
43*4763305eSRobert Mustacchi.Xr fsync 3C ,
44*4763305eSRobert Mustacchi.Xr syncfs 3C ,
45*4763305eSRobert Mustacchi.Xr attributes 7 ,
46*4763305eSRobert Mustacchi.Xr standards 7 ,
47*4763305eSRobert Mustacchi.Xr df 8 ,
48*4763305eSRobert Mustacchi.Xr fsck 8
49