code = osi_file_uio_rdwr(tfile, &tuio, UIO_WRITE);
AFS_GLOCK();
#else
+#if defined(AFS_DARWIN_ENV)
+ AFS_GUNLOCK();
+ VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc());
+ code = VOP_WRITE(tfile->vnode, &tuio, 0, &afs_osi_cred);
+ VOP_UNLOCK(tfile->vnode, 0, current_proc());
+ AFS_GLOCK();
+#else
code = VOP_RDWR(tfile->vnode, &tuio, UIO_WRITE, 0, &afs_osi_cred);
+#endif /* AFS_DARWIN_ENV */
#endif /* AFS_LINUX20_ENV */
#endif /* AFS_HPUX100_ENV */
#endif /* AFS_OSF_ENV */
* If write is implemented via VM, afs_fsync() is called from the high-level
* write op.
*/
+#ifdef AFS_DARWIN_ENV
+ if (noLock && (aio & IO_SYNC)) {
+#else
#ifdef AFS_HPUX_ENV
/* On hpux on synchronous writes syncio will be set to IO_SYNC. If
* we're doing them because the file was opened with O_SYNCIO specified,
#else
if (noLock && (aio & FSYNC)) {
#endif
+#endif
if (!AFS_NFSXLATORREQ(acred))
afs_fsync(avc, acred);
}
-#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
#ifdef AFS_DUX50_ENV
#define vno_close(X) vn_close((X), 0, NOCRED)
#elif defined(AFS_DUX40_ENV)