#include <netinet/in.h>
#endif
#include <sys/stat.h>
+
+/* #ifdef AFS_PTHREAD_ENV */
+#if 0 /* temporary hack - klm */
+/* nothing */
+#else
#include <lwp.h>
+#endif
+
#include <lock.h>
#include <errno.h>
#include <string.h>
return EBADF;
tfd = fdcache;
for (i = 0; i < MAXFDCACHE; i++, tfd++) {
- if (tfd->fd == afd) {
+ if (tfd->fd == afd && tfd->fileID != -10000) {
tfd->refCount--;
return 0;
}
uphys_close(fd);
return code;
}
+
+void
+uphys_invalidate(register struct ubik_dbase *adbase, afs_int32 afid)
+{
+ register int i;
+ register struct fdcache *tfd;
+
+ /* scan file descr cache */
+ for (tfd = fdcache, i = 0; i < MAXFDCACHE; i++, tfd++) {
+ if (afid == tfd->fileID) {
+ tfd->fileID = -10000;
+ if (tfd->fd >= 0 && tfd->refCount == 0)
+ close(tfd->fd);
+ return;
+ }
+ }
+}