* afs_osi.h.
*/
+/* Id: $ */
+
#ifndef _OSI_MACHDEP_H_
#define _OSI_MACHDEP_H_
#define vType(vc) (vc)->v->v_type
#define vSetType(vc, type) AFSTOV(vc)->v_type = (type)
#define vSetVfsp(vc, vfsp) AFSTOV(vc)->v_mount = (vfsp)
-#define osi_sleep(chan, pri) tsleep((chan), pri, "afs", 0)
-#define afs_osi_Sleep(chan) tsleep((chan), PVFS, "afs", 0)
-#define afs_osi_Wakeup(chan) (wakeup(chan), 1)
#define FTRUNC O_TRUNC
#define FEXLOCK O_EXLOCK
#define FSHLOCK O_SHLOCK
return code;
}
+void afs_osi_Sleep(void *event)
+{
+ tsleep(event, PVFS, "afs", 0);
+}
+
int afs_osi_SleepSig(void *event)
{
- afs_osi_Sleep(event);
+ tsleep(event, PVFS, "afs", 0);
return 0;
}
+
+int afs_osi_Wakeup(void *event)
+{
+ wakeup(event);
+ return 1;
+}
char rootVolume[64] = "root.afs"; /*AFS root volume name*/
afs_int32 cacheSetTime = 1; /*Keep checking time to avoid drift?*/
afs_int32 isHomeCell; /*Is current cell info for the home cell?*/
+#ifdef AFS_XBSD_ENV
+int createAndTrunc = O_RDWR | O_CREAT | O_TRUNC; /*Create & truncate on open*/
+#else
int createAndTrunc = O_CREAT | O_TRUNC; /*Create & truncate on open*/
+#endif
int ownerRWmode = 0600; /*Read/write OK by owner*/
static int filesSet = 0; /*True if number of files explicitly set*/
static int nFilesPerDir = 2048; /* # files per cache dir */
if (code)
osi_Panic("osi_NewSocket: last attempt to reserve 32K failed!\n");
}
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
#if defined(AFS_FBSD_ENV)
code = sobind(newSocket, (struct sockaddr *) &myaddr, curproc);
-#elif defined(AFS_OBSD_ENV)
- code = sockargs(&nam, (caddr_t) &myaddr, sizeof(myaddr), MT_SONAME);
- if (code == 0) {
- code = sobind(newSocket, nam);
- m_freem(nam);
- }
#else
code = sobind(newSocket, (struct sockaddr *) &myaddr);
#endif
if (code) {
- printf("sobind fails\n");
+ printf("sobind fails (%d)\n", (int) code);
soclose(newSocket);
goto bad;
}
-#else
+#else /* defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) */
#ifdef AFS_OSF_ENV
nam = m_getclr(M_WAIT, MT_SONAME);
#else /* AFS_OSF_ENV */
nam = m_get(M_WAIT, MT_SONAME);
#endif
if (nam == NULL) {
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_XBSD_ENV)
+#if defined(KERNEL_HAVE_UERROR)
setuerror(ENOBUFS);
#endif
goto bad;
}
nam->m_len = sizeof(myaddr);
-#ifdef AFS_OSF_ENV
- myaddr.sin_len = nam->m_len;
-#endif /* AFS_OSF_ENV */
memcpy(mtod(nam, caddr_t), &myaddr, sizeof(myaddr));
#ifdef AFS_SGI65_ENV
BHV_PDATA(&bhv) = (void*)newSocket;
code = sobind(&bhv, nam);
m_freem(nam);
-#elif defined(AFS_XBSD_ENV)
- code = sobind(newSocket, nam, curproc);
#else
code = sobind(newSocket, nam);
#endif
if (code) {
+ printf("sobind fails (%d)\n", (int) code);
soclose(newSocket);
#ifndef AFS_SGI65_ENV
m_freem(nam);