source: trunk/libs/newlib/src/libgloss/ft32/sim-time.c @ 606

Last change on this file since 606 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.2 KB
Line 
1/* sim-time.c -- stubs so clock can be linked in.
2 *
3 * Copyright (C) 2015 FTDI (support@ftdichip.com)
4 *
5 * The authors hereby grant permission to use, copy, modify, distribute,
6 * and license this software and its documentation for any purpose, provided
7 * that existing copyright notices are retained in all copies and that this
8 * notice is included verbatim in any distributions. No written agreement,
9 * license, or royalty fee is required for any of the authorized uses.
10 * Modifications to this software may be copyrighted by their authors
11 * and need not follow the licensing terms described here, provided that
12 * the new terms are clearly indicated on the first page of each file where
13 * they apply.
14 */
15#include <errno.h>
16#include <sys/time.h>
17#include <sys/times.h>
18#include "glue.h"
19
20/*
21 * _times -- no clock, so return an error.
22 */
23int
24_times (struct tms *buf)
25{
26  errno = EINVAL;
27  return (-1);
28}
29
30/*
31 * _gettimeofday -- implement in terms of time, which means we can't return the
32 * microseconds.
33 */
34int
35_gettimeofday (struct timeval *tv,
36        void *tzvp)
37{
38  struct timezone *tz = tzvp;
39  if (tz)
40    tz->tz_minuteswest = tz->tz_dsttime = 0;
41
42  tv->tv_usec = 0;
43  tv->tv_sec = 0;
44  return 0;
45}
Note: See TracBrowser for help on using the repository browser.