/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-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> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* sync all outstanding file operations for file opened on fd
* if file==0 then fd used
* if fd<0 then file used
* if mode<0 then fd not created
*
* NOTE: this is an unfortunate NFS workaround that should be done by fsync()
*/
#include "colib.h"
#include <ls.h>
int
{
#if defined(_cmd_nfsd)
{
{
register const char* s;
register char* t;
register char* b;
int td;
/*
* writing to a dir apparently flushes the
* attribute cache for all entries in the dir
*/
s = file;
b = t = tmp;
{
if (!(*t = *s++)) break;
if (*t++ == '/') b = t;
}
s = "..nfs..botch..";
t = b;
*t = 0;
{
return(-1);
}
}
#if defined(F_SETLK)
else
{
int clean = 0;
if (fd < 0)
{
clean = 1;
}
/*
* this sets the VNOCACHE flag across NFS
*/
{
}
/*
* 4.1 has a bug that lets VNOCACHE linger after unlock
* VNOCACHE inhibits mapping which kills exec
* the double rename flushes the incore vnode (and VNOCACHE)
*
* this kind of stuff doesn't happen with *real* file systems
*/
{
}
}
#endif
}
#endif
return(0);
}