Changeset View
Changeset View
Standalone View
Standalone View
bin/sync/sync.8
| Show All 23 Lines | |||||
| .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
| .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
| .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
| .\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
| .\" | .\" | ||||
| .\" @(#)sync.8 8.1 (Berkeley) 5/31/93 | .\" @(#)sync.8 8.1 (Berkeley) 5/31/93 | ||||
| .\" $FreeBSD$ | .\" $FreeBSD$ | ||||
| .\" | .\" | ||||
| .Dd May 31, 1993 | .Dd September 14, 2019 | ||||
| .Dt SYNC 8 | .Dt SYNC 8 | ||||
| .Os | .Os | ||||
| .Sh NAME | .Sh NAME | ||||
| .Nm sync | .Nm sync | ||||
| .Nd force completion of pending disk writes (flush cache) | .Nd force completion of pending disk writes (flush cache) | ||||
| .Sh SYNOPSIS | .Sh SYNOPSIS | ||||
| .Nm | .Nm | ||||
| .Op Ar number | |||||
| .Nm | |||||
| .Op arg | |||||
| .Sh DESCRIPTION | .Sh DESCRIPTION | ||||
| The | The | ||||
| .Nm | .Nm | ||||
| utility | utility | ||||
| can be called to ensure that all disk writes have been completed before the | can be called to ensure that all disk writes have been completed before the | ||||
| processor is halted in a way not suitably done by | processor is halted in a way not suitably done by | ||||
| .Xr reboot 8 | .Xr reboot 8 | ||||
| or | or | ||||
| .Xr halt 8 . | .Xr halt 8 . | ||||
| Generally, it is preferable to use | Generally, it is preferable to use | ||||
| .Xr reboot 8 | .Xr reboot 8 | ||||
| or | or | ||||
| .Xr halt 8 | .Xr halt 8 | ||||
| to shut down the system, | to shut down the system, | ||||
| as they may perform additional actions | as they may perform additional actions | ||||
| such as resynchronizing the hardware clock | such as resynchronizing the hardware clock | ||||
| and flushing internal caches before performing a final | and flushing internal caches before performing a final | ||||
| .Nm . | .Nm . | ||||
| .Pp | .Pp | ||||
| The | The | ||||
| .Nm | .Nm | ||||
| utility utilizes the | utility utilizes the | ||||
| .Xr sync 2 | .Xr sync 2 | ||||
| function call. | function call. | ||||
| .Pp | |||||
| If | |||||
| .Nm | |||||
| is given a single numeric argument, it will call the | |||||
| .Xr sync 2 | |||||
| function call that number of times; if it is given a non-numeric | |||||
| argument, or the number is 0 or negative, then | |||||
| .Nm | |||||
| will call the | |||||
| .Xr sync 2 | |||||
| function call once for each argument, and one additional time. | |||||
| .Sh EXAMPLES | |||||
| Call the | |||||
| .Xr sync 2 | |||||
| function once: | |||||
| .Dl $ sync | |||||
| .Pp | |||||
| Call the | |||||
| .Xr sync 2 | |||||
| function three times: | |||||
| .Dl $ sync 3 | |||||
| or: | |||||
| .Dl $ sync sync sync | |||||
| .Sh SEE ALSO | .Sh SEE ALSO | ||||
| .Xr fsync 2 , | .Xr fsync 2 , | ||||
| .Xr sync 2 , | .Xr sync 2 , | ||||
| .Xr syncer 4 , | .Xr syncer 4 , | ||||
| .Xr halt 8 , | .Xr halt 8 , | ||||
| .Xr reboot 8 | .Xr reboot 8 | ||||
| .Sh HISTORY | .Sh HISTORY | ||||
| A | A | ||||
| .Nm | .Nm | ||||
| utility appeared in | utility appeared in | ||||
| .At v4 . | .At v4 . | ||||