Hi,

On Tue, Oct 24 at 07:18, Andreas Jellinghaus wrote:
> not only sysfs. the files /proc/bus/usb/* and /dev/bus/usb/* might not
> exist either. it is those I worry about at that stage, so I added the
> sleep 1 as it is the easiest solution. (100ms would be fine too, but I
> know no tool to do sub second sleeps...)

Well this one I can answer.  A simple milli-second sleep routine:

#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

static void
sleep_ms ( int milli )
{
        struct timeval timeout;

        /* Crude safety */
        if ( milli <= 0 )
            milli = 1;

        timeout.tv_sec = milli / 1000;
        timeout.tv_usec = ( milli % 1000 ) * 1000;

        select ( 0, NULL, NULL, NULL, &timeout );
}


-- 
        Bob Dunlop
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to