Good day.

Just do be sure that there is no scientifc paper that describes the pro
of using for() in sleep(2), as an architecture decision:

% cat /n/sources/plan9/sys/src/cmd/sleep.c
#include <u.h>
#include <libc.h>

void
main(int argc, char *argv[])
{
        long secs;

        if(argc>1)
                for(secs = atol(argv[1]); secs > 0; secs--)
                        sleep(1000);
        exits(0);
}

% cat /sys/src/cmd/sleep.c
#include <u.h>
#include <libc.h>

void
main(int argc, char *argv[])
{

        if(argc>1)
                sleep(atol(argv[1]) * 1000);

        exits(0);
}

% ls -l /386/bin/sleep /386/bin/_sleep
--rwxrwxr-x M 8 none sys 3409 May  8  13:43 /386/bin/_sleep
--rwxrwxr-x M 8 sys  sys 3390 Max  8  13:44 /386/bin/sleep

Is there any reason for the for()-loop?

Sincerely,

Christoph

Reply via email to