* Linux implementation.
*/
#include <afsconfig.h>
-#include "../afs/param.h"
+#include "afs/param.h"
RCSID("$Header$");
+#include <linux/version.h>
#ifdef AFS_LINUX22_ENV
-#include "../rx/rx_kcommon.h"
+#include "rx/rx_kcommon.h"
#if defined(AFS_LINUX24_ENV)
-#include "../h/smp_lock.h"
+#include "h/smp_lock.h"
#endif
#include <asm/uaccess.h>
/* free socket allocated by osi_NetSocket */
-int rxk_FreeSocket(asocket)
- register struct socket *asocket;
+int rxk_FreeSocket(register struct socket *asocket)
{
AFS_STATCNT(osi_FreeSocket);
return 0;
* 0 = success
* non-zero = failure
*/
-int osi_NetSend(struct socket *sop, struct sockaddr_in *to,
- struct iovec *iov, int iovcnt, int size, int istack)
+int osi_NetSend(osi_socket sop, struct sockaddr_in *to,
+ struct iovec *iov, int iovcnt, afs_int32 size, int istack)
{
KERNEL_SPACE_DECL;
struct msghdr msg;
void osi_StopListener(void)
{
- extern int (*sys_killp)();
+ struct task_struct *listener;
extern int rxk_ListenerPid;
- if (rxk_ListenerPid) {
- (void) (*sys_killp)(rxk_ListenerPid, 9);
-#ifdef AFS_LINUX24_ENV
- afs_osi_Sleep(&rxk_ListenerPid); /* get an event */
- afs_osi_Sleep(&rxk_ListenerPid); /* actually sleep */
-#else
- rxk_ListenerPid = 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ read_lock(&tasklist_lock);
+#endif
+ listener = find_task_by_pid(rxk_ListenerPid);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ read_unlock(&tasklist_lock);
#endif
+ while (rxk_ListenerPid) {
+ struct task_struct *p;
+
+ flush_signals(listener);
+ force_sig(SIGKILL, listener);
+ afs_osi_Sleep(&rxk_ListenerPid);
}
sock_release(rx_socket);
rx_socket = NULL;