Subject: Re: COPYIN/COPYOUT macro problems Re: IOCTL implementation and
To: None <reinoud@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 08/26/2005 03:01:18
> +#ifdef _KERNEL
> +#define COPYIN(ioctlflags, uaddr, kaddr, len)\
> + if ((ioctlflags) & FKIOCTL) {\
> + memcpy((kaddr), (uaddr), (len));\
> + } else {\
> + copyin((uaddr), (kaddr), (len));\
> + };
> +#define COPYOUT(ioctlflags, kaddr, uaddr, len)\
> + if ((ioctlflags) & FKIOCTL) {\
> + memcpy((uaddr), (kaddr), (len));\
> + } else {\
> + copyout((kaddr), (uaddr), (len));\
> + };
> +#endif /* KERNEL */
- don't discard return values.
- why memcpy rather than kcopy?
- is there any benefits to use macros? why not functions?
- do you have any plan for non-vnode ioctls?
YAMAMOTO Takashi