sync(2)

iv at hal6000.UUCP iv at hal6000.UUCP
Tue Nov 29 06:10:00 AEST 1988


>> Maybe.  Some vendors have taken to having sync() delay until the buffers
>> have actually been written.
There is a problem with this approach if implemented incorrectly in that
if sync() [or, update() as it is called in the kernel] tries to flush
*all* dirty buffers and inodes on an extremely active system, it may
never come back...

>> Xenix has a similiar feature.  There is a system call shutdn() which
>> locks out all other processes by diddling the process table or setting a
>> flag for the scheduler to check.
Actually, it sets a variable called `Hogproc' to it's own Proc[] entry.

>> It then unmounts [ as far as I can
>> tell; the volumes are flagged as 'clean' ] each device causing the
>> buffers to get flushed [ or maybe it calls bflush() or whatever first? ]
Well, it actually cheats.  First, it writes `clean' superblocks out for
each mounted filesystem, then it calls update() to write the modified inodes,
which calls bflush(NULL) to schedule ALL modified blocks for writing.

>> It is used by fsck amongst other things to fix up the root device during
>> a cleaning.
This is done because the system call shutdn() has a provision for handing
the kernel a modified root superblock.  No more "BOOT UNIX, NO SYNC" cute
messages from fsck.  Actually, they finally replaced that in XENIX 3 with:

   ***** REBOOT (RESET OR CYCLE POWER WITHOUT HALTSYS OR SYNC!) *****

Progress.  ;-)
----
IV  (aka John Elliott IV)	 Domain: iv at hal6000.Tandy.COM
Tandy Systems Software		   UUCP: ...!killer!sys1!hal6000!iv
1300 Two Tandy Center		     or: ...!decvax!microsoft!trsvax!hal6000!iv
Fort Worth, TX 76102		  Phone: 817/390-2701; 9:30am-6:00pm CST

[This information was provided by an individual and is  not  nor  should
 be  construed  as  being  provided by Radio Shack or Tandy Corporation.
 Radio Shack and/or Tandy Corporation have no obligation to support  the
 information provided.  They wouldn't know what to do with a UNIX wizard
 if one one bit them on the nose, anyway.   This note will "rm -f $0" in 
 5 secs.  No, "rm -if $0".  No, uh, "rm -i $0".  No, wait, "rm $0"..]



More information about the Comp.unix.wizards mailing list