OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [machine/] [spu/] [sleep.c] - Blame information for rev 301

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* Copied from libc/posix/sleep.c, removed the check for HAVE_NANOSLEEP */
2
 
3
/* Written 2000 by Werner Almesberger */
4
 
5
#include <errno.h>
6
#include <time.h>
7
#include <unistd.h>
8
 
9
unsigned sleep(unsigned seconds)
10
{
11
    struct timespec ts;
12
 
13
    ts.tv_sec = seconds;
14
    ts.tv_nsec = 0;
15
    if (!nanosleep(&ts,&ts)) return 0;
16
    if (errno == EINTR) return ts.tv_sec;
17
    return -1;
18
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.