when i was an endurance athlete i would have some rice/fruit 2-3 hours before my race, i would make sure i drink a boatload of water and shit/piss everything out before my race. you see a lot of athletes eat bananas (i don't really agree with this but if it works for them great) .. some guys would eat nothing before a race and run fasted completely. i will tell you that if you eat too close to your running you will likely get sick. the body is going to want to get rid of undigested food in your stomach
the bottom line is you need to see what works best for you. during long distance running 10miles+ you will see them have cookies and sports drinks along the race for people. i never felt the need to have either but some guys would to get in some sugar