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/] [sys/] [linux/] [sleep.c] - Blame information for rev 258

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

Line No. Rev Author Line
1 207 jeremybenn
/* libc/sys/linux/sleep.c - sleep function */
2
 
3
/* Written 2000 by Werner Almesberger */
4
 
5
 
6
#include <errno.h>
7
#include <sys/types.h>
8
#include <sys/time.h>
9
#include <linux/times.h>
10
 
11
unsigned int sleep(unsigned int seconds)
12
{
13
    struct timespec ts;
14
 
15
    ts.tv_sec = seconds;
16
    ts.tv_nsec = 0;
17
    if (!nanosleep(&ts,&ts)) return 0;
18
    if (errno == EINTR) return ts.tv_sec;
19
    return -1;
20
}

powered by: WebSVN 2.1.0

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