This is deja vu - I fixed this earlier....

No need to use stackgap for ioctl to get PTM name, directly call file's
ioctl function with kernel buffer.
This commit is contained in:
dsl 2007-05-13 16:04:00 +00:00
parent 5ab39134be
commit a163d15464
1 changed files with 5 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_termios.c,v 1.30 2007/03/14 21:52:17 manu Exp $ */
/* $NetBSD: linux_termios.c,v 1.31 2007/05/13 16:04:00 dsl Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_termios.c,v 1.30 2007/03/14 21:52:17 manu Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_termios.c,v 1.31 2007/05/13 16:04:00 dsl Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ptm.h"
@ -325,20 +325,11 @@ linux_ioctl_termios(l, uap, retval)
case LINUX_TIOCGPTN:
#ifndef NO_DEV_PTM
{
void *sg = stackgap_init(l->l_proc, 0);
struct ptmget ptm, *ptmp = stackgap_alloc(l->l_proc, &sg,
sizeof(*ptmp));
struct ptmget ptm;
SCARG(&ia, fd) = SCARG(uap, fd);
SCARG(&ia, com) = TIOCPTSNAME;
SCARG(&ia, data) = ptmp;
if ((error = sys_ioctl(curlwp, &ia, retval)) != 0)
error = (*bsdioctl)(fp, TIOCPTSNAME, &ptm, l);
if (error != 0)
goto out;
if ((error = copyin(ptmp, &ptm, sizeof(ptm))) != 0)
printf("copyin %d\n", error);
error = copyout(&ptm.sfd, SCARG(uap, data),
sizeof(ptm.sfd));
goto out;