> Have a look at the digi driver in -current where I did this.  The 
> caveat is that the kernel code looks ugly.  From the driver's ioctl 
> routine:
> 
>                 case DIGIIO_IDENT:
>                         return (copyout(sc->name, *(char **)data,
>                             strlen(sc->name) + 1));
> 
> and from digiio.h:
> 
> #define DIGIIO_IDENT            _IOW('e', 'E', char *)
> 
> and from userland (digictl.c):
> 
>         char namedata[256], *name = namedata;
>         ....
>                         } else if (ioctl(fd, DIGIIO_IDENT, &name) != 0) {
> 

Oops, we weren't talking about copyout() :*D

There's a copyinstr() function available.  Would that solve the 
problem ?

> > -- 
> > -Alfred Perlstein [[EMAIL PROTECTED]]
> > Ok, who wrote this damn function called '??'?
> > And why do my programs keep crashing in it?
[.....]
-- 
Brian <[EMAIL PROTECTED]>                <[EMAIL PROTECTED]>
      http://www.freebsd-services.com/        <brian@[uk.]FreeBSD.org>
Don't _EVER_ lose your sense of humour !      <brian@[uk.]OpenBSD.org>



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to