sync.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1992-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* David Korn
* Glenn Fowler
* AT&T Research
*/
static const char usage[] =
"[-?\n@(#)$Id: sync (AT&T Research) 2006-10-04 $\n]"
"[+NAME?sync - schedule file system updates]"
"[+DESCRIPTION?\bsync\b calls \bsync\b(2), which causes all information "
"in memory that updates file systems to be scheduled for writing out to "
"all file systems. The writing, although scheduled, is not necessarily "
"complete upon return from \bsync\b.]"
"[+?Since \bsync\b(2) has no failure indication, \bsync\b only fails for "
"which case \bsync\b also does not return.]"
"[+?At minimum \bsync\b should be called before halting the system. Most "
"systems provide graceful shutdown procedures that include \bsync\b -- "
"use them if possible.]"
"[+EXIT STATUS?]"
"{"
"[+0?\bsync\b(2) returned.]"
"}"
"[+SEE ALSO?\bsync\b(2), \bshutdown\b(8)]"
;
#include <cmd.h>
#include <ls.h>
int
{
for (;;)
{
{
case ':':
break;
case '?':
break;
}
break;
}
#if _lib_sync
sync();
#else
#endif
return 0;
}