[comp.unix.questions] sync

swfc@ulysses.att.com (Shu-Wie F Chen) (07/03/90)

According to the man page for fsync(2) on a Sun-4:

...some description about fsync...

Note: this is different than sync(8) which schedules disk I/O for all
files (as though an fsync() had been done on all files) but returns
before the I/O completes.

...

However, I can't find sync in section 8 of the man pages.  What does it
actually do?  How does it differ from sync(2) which writes out all
information in core memory that should be on disk.

Thanks,
*swfc

cpcahil@virtech.uucp (Conor P. Cahill) (07/03/90)

In article <13278@ulysses.att.com> swfc@ulysses.att.com (Shu-Wie F Chen) writes:
>However, I can't find sync in section 8 of the man pages.  What does it
>actually do?  How does it differ from sync(2) which writes out all
>information in core memory that should be on disk.

Sync(8) is the command that calls the sync(2) system call which initiates
a write of all dirty file system information in the kernel.

If you can't find it in your docs, check for sync(1M) which it may also
appear as.


-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 

jeff@quark.WV.TEK.COM (Jeff Beadles;685-2568;;;quark) (07/03/90)

swfc@ulysses.att.com (Shu-Wie F Chen) writes:
[...]


>However, I can't find sync in section 8 of the man pages.  What does it
>actually do?  How does it differ from sync(2) which writes out all
>information in core memory that should be on disk.


In most (if not all) of the implimentations of sync(8) that I've seen, they
could be written as a one-liner:

main() {sync(); exit(0);}

They just call sync(2) and return a zero exit code.

	-Jeff
-- 
Jeff Beadles				jeff@quark.WV.TEK.COM 
Utek Engineering, Tektronix Inc.	+1 503 685 2568
			SPEEA - Just say no.

etxtorn@juno11.ericsson.se (Thomas Tornblom TM/JU 99367) (07/03/90)

In article <13278@ulysses.att.com> swfc@ulysses.att.com (Shu-Wie F Chen) writes:
>According to the man page for fsync(2) on a Sun-4:
>
>...some description about fsync...
>
>Note: this is different than sync(8) which schedules disk I/O for all
>files (as though an fsync() had been done on all files) but returns
>before the I/O completes.
>
>...
>
>However, I can't find sync in section 8 of the man pages.  What does it
>actually do?  How does it differ from sync(2) which writes out all
>information in core memory that should be on disk.
>
>Thanks,
>*swfc

You'll find it in section (1) of the manual. And no, it doesn't differ, it is
merely sync(2) packaged into a program.

Thomas.