code: def sys_fsync(self, fd):
          
  
          ret = 0
          try:
              self.files[fd].sync()
          except IndexError:
              ret = -errno.EBADF
          except FdError:
              ret = -errno.EINVAL
  
          return ret
docs: Synchronize a file's in-core state with that on disk.