From 58c34e103c2772ff3791dcca93e0b75e66d4b189 Mon Sep 17 00:00:00 2001 From: Jim Rees Date: Wed, 30 Oct 2002 22:56:58 +0000 Subject: [PATCH] openbsd-20021030 More small OpenBSD fixes. Now the module loads, afsd starts, and /afs gets mounted. --- src/afs/OBSD/osi_inode.h | 10 ++++++++++ src/afs/OBSD/osi_machdep.h | 5 ++--- src/afs/OBSD/osi_sleep.c | 13 ++++++++++++- src/afsd/afsd.c | 4 ++++ src/rx/rx_kcommon.c | 20 +++++--------------- 5 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 src/afs/OBSD/osi_inode.h diff --git a/src/afs/OBSD/osi_inode.h b/src/afs/OBSD/osi_inode.h new file mode 100644 index 000000000..33e808a94 --- /dev/null +++ b/src/afs/OBSD/osi_inode.h @@ -0,0 +1,10 @@ +/* + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ + +/* Id: $ */ diff --git a/src/afs/OBSD/osi_machdep.h b/src/afs/OBSD/osi_machdep.h index 59d2f74f0..1001e676a 100644 --- a/src/afs/OBSD/osi_machdep.h +++ b/src/afs/OBSD/osi_machdep.h @@ -16,6 +16,8 @@ * afs_osi.h. */ +/* Id: $ */ + #ifndef _OSI_MACHDEP_H_ #define _OSI_MACHDEP_H_ @@ -78,9 +80,6 @@ typedef void (*osi_timeout_t)(void *); #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 diff --git a/src/afs/OBSD/osi_sleep.c b/src/afs/OBSD/osi_sleep.c index f47ea902a..4a796d480 100644 --- a/src/afs/OBSD/osi_sleep.c +++ b/src/afs/OBSD/osi_sleep.c @@ -70,8 +70,19 @@ int afs_osi_Wait(afs_int32 ams, struct afs_osi_WaitHandle *ahandle, int aintok) 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; +} diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 5ba6687ad..f5a2c8af0 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -226,7 +226,11 @@ char cacheMountDir[1024]; /*Mount directory for AFS*/ 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 */ diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index ad00f7cb6..6ea6e5162 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -825,50 +825,40 @@ struct osi_socket *rxk_NewSocket(short aport) 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); -- 2.39.5