Date: Fri, 13 Jul 2001 16:16:33 +0100 From: Brian Somers <brian@Awfulhak.org> To: Brian Somers <brian@Awfulhak.org> Cc: Alfred Perlstein <bright@sneakerz.org>, Greg Lehey <grog@FreeBSD.ORG>, y-carden@uniandes.edu.co, FreeBSD Hackers <hackers@FreeBSD.ORG>, brian@Awfulhak.org Subject: Re: Some questions about kernel programming Message-ID: <200107131516.f6DFGXW60354@hak.lan.Awfulhak.org> In-Reply-To: Message from Brian Somers <brian@Awfulhak.org> of "Fri, 13 Jul 2001 15:52:29 BST." <200107131452.f6DEqTW59861@hak.lan.Awfulhak.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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 [alfred@freebsd.org] > > Ok, who wrote this damn function called '??'? > > And why do my programs keep crashing in it? [.....] -- Brian <brian@freebsd-services.com> <brian@Awfulhak.org> 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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107131516.f6DFGXW60354>