> Anyhow, if it helps, or even if someone is interested, I'm happy to 
> explain in detail why I need to peek for data on a filedescriptor.

 I'd be interested in knowing why you need to do that. Maybe, by
looking at the big picture, we can help you design a solution that
fulfills your needs without this particular issue.


> Otherwise, I'm hoping for help w.r.t. my question, being even fine with 
> a statement from an experienced BusyBox expert that BusyBox cannot do 
> what I'd like to do, as I could easily write an appropriate helper in C 
> that does what I need.

 I'm no Busybox expert, but the problem you're facing here is that
peeking on a fd without reading it is a fundamentally asynchronous
operation, and usual Unix command line programs - such as the ones
provided by Busybox - only perform synchronous operations. Unless
specifically documented, you can't pass an ofile with the O_NONBLOCK
flag set to a Unix command-line program.
 (Yes, I'm aware than just checking for readability with poll() can
be done even on a blocking ofile, but this is kind of a hack, and
poll() is still an asynchronous operation.)

 You'd probably be better off writing a tiny C helper to do the check.
Unless I've missed something, it seems that busybox-based solutions, if
any, will always seem hackish and awkward.

-- 
 Laurent
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to