# $NetBSD: Makefile,v 1.22 2007/12/31 15:31:24 ad Exp $
# @(#)Makefile 8.1 (Berkeley) 5/31/93
-SUBDIR= cat date echo ed expr kill ln \
- mkdir pax pwd rm rmdir test
+SUBDIR= cat date echo ed expr kill ln ls \
+ mkdir pax pwd rm rmdir sync test
.include <bsd.subdir.mk>
--- /dev/null
+# $NetBSD: Makefile,v 1.9 1997/07/20 22:38:07 christos Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
+
+PROG= sync
+MAN= sync.8
+
+.include <bsd.prog.mk>
--- /dev/null
+.\" $NetBSD: sync.8,v 1.15 2003/08/07 09:05:42 agc Exp $
+.\"
+.\" Copyright (c) 1980, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" 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
+.\" SUCH DAMAGE.
+.\"
+.\" @(#)sync.8 8.1 (Berkeley) 5/31/93
+.\"
+.Dd May 31, 1993
+.Dt SYNC 8
+.Os
+.Sh NAME
+.Nm sync
+.Nd force completion of pending disk writes (flush cache)
+.Sh SYNOPSIS
+.Nm
+.Sh DESCRIPTION
+The
+.Nm
+program can be called to ensure that all disk writes have been
+completed before the processor is halted in a way not suitably done by
+.Xr reboot 8
+or
+.Xr halt 8 .
+Generally, it is preferable to use
+.Xr reboot 8
+or
+.Xr halt 8
+to shut down the system,
+as they may perform additional actions
+such as resynchronizing the hardware clock
+and flushing internal caches before performing a final
+.Nm .
+.Pp
+The
+.Nm
+program simply invokes the
+.Xr sync 2
+system call.
+.Sh SEE ALSO
+.Xr fsync 2 ,
+.Xr sync 2 ,
+.Xr halt 8 ,
+.Xr reboot 8
+.Sh HISTORY
+A
+.Nm
+command appeared in
+.At v6 .
--- /dev/null
+/* $NetBSD: sync.c,v 1.13 2008/07/20 00:52:40 lukem Exp $ */
+
+/*
+ * Copyright (c) 1987, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__COPYRIGHT("@(#) Copyright (c) 1987, 1993\
+ The Regents of the University of California. All rights reserved.");
+#endif /* not lint */
+
+#ifndef lint
+#if 0
+static char sccsid[] = "@(#)sync.c 8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: sync.c,v 1.13 2008/07/20 00:52:40 lukem Exp $");
+#endif
+#endif /* not lint */
+
+#include <stdlib.h>
+#include <unistd.h>
+
+int main(int, char *[]);
+
+/* ARGSUSED */
+int
+main(int argc, char *argv[])
+{
+ setprogname(argv[0]);
+ sync();
+ exit(0);
+ /* NOTREACHED */
+}
reboot remsync rev rget rlogin \
rotate rsh rshd service setup shar acksize \
sleep slip spell split sprofalyze sprofdiff srccrc \
- stty svclog svrctl swifi sync synctree sysenv \
+ stty svclog svrctl swifi synctree sysenv \
syslogd tail tcpd tcpdp tcpstat tee telnet \
telnetd term termcap tget time touch tr \
truncate tty udpstat umount uname unexpand \
+++ /dev/null
-PROG= sync
-BINDIR= /bin
-MAN=
-
-.include <bsd.prog.mk>
+++ /dev/null
-/* sync - flush the file system buffers. Author: Andy Tanenbaum */
-
-#include <sys/types.h>
-#include <unistd.h>
-
-int main(void);
-
-int main()
-{
-/* First prize in shortest useful program contest. */
-/* Highest comment/code ratio */
- sync();
- return(0);
-}
.if ${MACHINE_ARCH} == "earm"
EXTRA+= rc.arm mylogin.sh ttys
PROG_DRIVERS+= mmc tty gpio
-PROG_COMMANDS+= cp dd getty time sync sleep stty umount
-PROG_BIN+= cat ls rm
+PROG_COMMANDS+= cp dd getty time sleep stty umount
+PROG_BIN+= cat ls rm sync
PROTO= proto.arm.small
.endif # ${MACHINE_ARCH} == "earm"
poweroff.8 printroot.8 pr_routes.8 pwdauth.8 rarpd.8 \
rdate.8 readclock.8 reboot.8 repartition.8 \
rshd.8 screendump.8 serial-ip.8 service.8 \
- setup.8 shutdown.8 slip.8 srccrc.8 sync.8 syslogd.8 tcpd.8 \
+ setup.8 shutdown.8 slip.8 srccrc.8 syslogd.8 tcpd.8 \
unix.8 update.8 usage.8 vbfs.8
MLINKS += httpd.8 in.httpd.8
+++ /dev/null
-.TH SYNC 8
-.SH NAME
-sync \- flush the cache to disk
-.SH SYNOPSIS
-\fBsync\fR
-.br
-.de FL
-.TP
-\\fB\\$1\\fR
-\\$2
-..
-.de EX
-.TP 20
-\\fB\\$1\\fR
-# \\$2
-..
-.SH EXAMPLES
-.TP 20
-.B sync
-# Write out all modified cache blocks
-.SH DESCRIPTION
-.PP
-\s-1MINIX 3\s-1
-maintains a cache of recently used disk blocks.
-The
-.I sync
-command writes any modified cache blocks back to the disk.
-This is essential before stopping the system, and should be done before
-running any
-.I a.out
-program that might crash.
-.SH "SEE ALSO"
-.BR sync (2),
-.BR update (8),
-.BR shutdown (8).
2012/10/17 12:00:00,bin/pwd
2011/08/29 14:48:46,bin/rm
2011/08/29 14:49:38,bin/rmdir
+2012/10/17 12:00:00,bin/sync
2012/10/17 12:00:00,bin/test
2012/10/17 12:00:00,build.sh
2012/10/17 12:00:00,common/dist/zlib