]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/LibC/Time/gettimeofday.c
StdLib: Replace some non-ASCII characters with ASCII equivalents.
[mirror_edk2.git] / StdLib / LibC / Time / gettimeofday.c
CommitLineData
53e1e5c6 1/** @file \r
2 gettimeofday implementation\r
3\r
4 Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials are licensed and made available under\r
6 the terms and conditions of the BSD License that accompanies this distribution.\r
7 The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php.\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
e3956339 13 * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Hogskolan\r
53e1e5c6 14 * (Royal Institute of Technology, Stockholm, Sweden).\r
15 * All rights reserved.\r
16 * \r
17 * Redistribution and use in source and binary forms, with or without\r
18 * modification, are permitted provided that the following conditions\r
19 * are met:\r
20 * \r
21 * 1. Redistributions of source code must retain the above copyright\r
22 * notice, this list of conditions and the following disclaimer.\r
23 * \r
24 * 2. Redistributions in binary form must reproduce the above copyright\r
25 * notice, this list of conditions and the following disclaimer in the\r
26 * documentation and/or other materials provided with the distribution.\r
27 * \r
28 * 3. Neither the name of the Institute nor the names of its contributors\r
29 * may be used to endorse or promote products derived from this software\r
30 * without specific prior written permission.\r
31 * \r
32 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND\r
33 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
34 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
35 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE\r
36 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
40 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
41 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
42 * SUCH DAMAGE.\r
43\r
44 Heimdal: gettimeofday.c 14773 2005-04-12 11:29:18Z lha $\r
45 NetBSD: gettimeofday.c,v 1.2 2008/03/22 08:37:21 mlelstv Exp $\r
46**/\r
53e1e5c6 47#include <LibConfig.h>\r
48#include <sys/EfiCdefs.h>\r
49#include <sys/time.h>\r
50#include <time.h>\r
51#ifndef HAVE_GETTIMEOFDAY\r
52\r
53\r
54/*\r
55 * Simple gettimeofday that only returns seconds.\r
56 */\r
57int \r
58gettimeofday (struct timeval *tp, void *ignore)\r
59{\r
60 time_t t;\r
61\r
62 t = time(NULL);\r
63 tp->tv_sec = t;\r
64 tp->tv_usec = 0;\r
65 return 0;\r
66}\r
67#endif\r