On Tue, Aug 22, 2006 at 04:27:17PM -0700, John Zavgren wrote:
> I tried to modify the code in arch/um/drivers/net_user.c so that I could
> introduce a delay (of a few milliseconds) to simulate the transmission time
> of ethernet packets. I used calls to: set_current_state, and
> schedule_timeout_interruptable. I added the necessary include files:
> linux/wait.h and linux/sched.h.
>
> Compilation failed. One can easily recreate this by merely including the new
> include files.

Note the _user part of that file name.  When you see that, it is compiled
against glibc, and you can't use kernel primitives or kernel headers in it.

The converse is true with _kern files - they are built against kernel headers
and can't have any glibc stuff in them.

I've mostly gone away from the _user/_kern convention and moved the libc stuff
into arch/um/os-Linux - anything there is strictly glibc.  Everything else
is kernel code.

So, if you're modifying net_user.c, you have to use userspace primitives.
In this case, you could just nanosleep for a few milliseconds.  This would
leave the process "running" as far as UML is concerned.  If you really want
to reschedule within UML, then do that in net_kern.c.

                                Jeff



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to