put in the new version of the sync() and sync(pid) functions.