posix: Move gettimeofday declaration to <sys/time.h>

According to POSIX, that's the header which defines this function.
Similarly, nothing in POSIX indicates that <time.h> should have
access to struct timeval, so it's removed (it's made accessible
to <sys/time.h> via <sys/_timeval.h> introduced earlier).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
Paul Sokolovsky 2019-04-24 00:43:25 +03:00 committed by Anas Nashif
commit 81fa697f32
4 changed files with 24 additions and 7 deletions

22
include/posix/sys/time.h Normal file
View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2019 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_POSIX_SYS_TIME_H_
#define ZEPHYR_INCLUDE_POSIX_SYS_TIME_H_
#include <sys/_timeval.h>
#ifdef __cplusplus
extern "C" {
#endif
int gettimeofday(struct timeval *tv, const void *tz);
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_POSIX_SYS_TIME_H_ */

View file

@ -34,11 +34,6 @@ struct itimerspec {
};
#endif
struct timeval {
signed int tv_sec;
signed int tv_usec;
};
#include <kernel.h>
#include <errno.h>
#include "posix_types.h"
@ -72,8 +67,6 @@ int timer_gettime(timer_t timerid, struct itimerspec *its);
int timer_settime(timer_t timerid, int flags, const struct itimerspec *value,
struct itimerspec *ovalue);
int gettimeofday(struct timeval *tv, const void *tz);
#ifdef __cplusplus
}
#endif