Changeset 685f4d6 in rtems for c/src/lib/libc/newlibc.c


Ignore:
Timestamp:
Jun 3, 1996, 6:59:24 PM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
e984c645
Parents:
e88b589
Message:

sleep moved into newlibc.c so the sleep.o object would not be in the library.
This implementation of sleep is now only used when the POSIX API is not
configured.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libc/newlibc.c

    re88b589 r685f4d6  
    336336
    337337/*
    338  *  These are only supported in the posix api.
     338 *  These are directly supported (and completely correct) in the posix api.
    339339 */
    340340
     
    355355}
    356356
    357 #endif
    358 
    359 #endif
     357unsigned int sleep(
     358  unsigned int seconds
     359)
     360{
     361  rtems_status_code status;
     362  rtems_interval    ticks_per_second;
     363  rtems_interval    ticks;
     364 
     365  status = rtems_clock_get(
     366    RTEMS_CLOCK_GET_TICKS_PER_SECOND,
     367    &ticks_per_second
     368  );
     369 
     370  ticks = seconds * ticks_per_second;
     371 
     372  status = rtems_task_wake_after( ticks );
     373 
     374  /*
     375   *  Returns the "unslept" amount of time.  In RTEMS signals are not
     376   *  interruptable, so tasks really sleep all of the requested time.
     377   */
     378 
     379  return 0;
     380}
     381
     382#endif
     383
     384#endif
Note: See TracChangeset for help on using the changeset viewer.