Date: Mon, 12 Dec 2005 10:50:56 +0530 From: rashmi ns <nsrashmi@gmail.com> To: freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: Help Reqd: "uiomove" transferring zero bytes from user-kernel space Message-ID: <9f9993160512112120g42121d74pb9339971f0b89a61@mail.gmail.com> In-Reply-To: <9f9993160512112003i56f25cd6t78533717fec580d1@mail.gmail.com> References: <9f9993160512112003i56f25cd6t78533717fec580d1@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Sorry , uiomove does not written no of bytes copied from user_space to kernel space or from kernel space to userspace .My understanding was wrong . uiomove returns 0 on success . Regards, Rashmi On 12/12/05, rashmi ns <nsrashmi@gmail.com> wrote: > Hello Team, > when i use "uiomove" in the character device > interface the no of bytes transfrerred between kernel and userspace is > zero .but the actual data transferred when trraced through > "uio->resid" is correct .can any one explain why this is happening ? > > /*Character Device Interfaces*/ > static struct cdevsw hdlc_cdevsw =3D { > > .d_maj =3D CDEV_MAJOR, > .d_open =3D hdlc_open, > .d_read =3D hdlc_read, > .d_write =3D hdlc_write, > .d_ioctl =3D hdlc_ioctl, > .d_close =3D hdlc_close, > .d_version =3D D_VERSION, > }; > static int hdlc_write(dev_t dev, struct uio *uio, int ioflag) > { > int towrite,written; /*char device inf*/ > written=3Duiomove((void *)write_tx_buffer,towrite,uio); > uprintf("uio->resid=3D%d",uio->uio_resid); > uprintf("No of bytes written =3D%d",written); > > > > > } > > Thanks and Regards, > Rashmi.N.S >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9f9993160512112120g42121d74pb9339971f0b89a61>