diff options
author | Zbigniew Sarbinowski <zibi@ca.ibm.com> | 2020-11-12 11:22:04 -0500 |
---|---|---|
committer | Abhina Sreeskantharajan <Abhina.Sreeskantharajan@ibm.com> | 2020-11-12 11:29:13 -0500 |
commit | 173b51169b838255aff4d4ff4eb6014b101a9687 (patch) | |
tree | ae0d50d9cb14ba542265a08ad2d19d6d800dc155 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 89967427412489e10b3625bf1563a804fe5f2be2 (diff) | |
download | llvm-173b51169b838255aff4d4ff4eb6014b101a9687.zip llvm-173b51169b838255aff4d4ff4eb6014b101a9687.tar.gz llvm-173b51169b838255aff4d4ff4eb6014b101a9687.tar.bz2 |
[SystemZ][ZOS] Porting the time functions within libc++ to z/OS
This patch is one part of many steps required to build libc++ and libc++abi libraries on z/OS. This particular deals with time related functions and consists of the following 3 parts.
1) Initialization of :timeval within libc++ library need to be adjusted to work on z/OS.
The following is z/OS definition from time.h which includes additional aggregate member.
typedef signed int suseconds_t;
struct timeval {
time_t tv_sec;
char tv_usec_pad[4];
suseconds_t tv_usec;
};
In contracts the following is definition from time.h on Linux.
typedef long int __suseconds_t;
struct timeval
{
__time_t tv_sec;
__suseconds_t tv_usec;
};
2) In addition, retrieving ::timespec within libc++ library needs to be adjusted to compensate the difference of some of the members of ::stat depending of the target host.
Here are the 2 members in conflict on z/OS extracted from stat.h.
struct stat {
...
time_t st_atime;
time_t st_mtime;
...
};
In contract here is Linux equivalent from stat.h.
struct stat
{
...
struct timespec st_atim;
struct timespec st_mtim;
...
};
3) On Linux both members are of type timespec whereas on z/OS an object of type timespec need to be constructed first before retrieving it within libc++ library.
The libc++ header file __threading_support calls nanosleep, which is not available on z/OS.
The equivalent functionality will be implemented by using both sleep() and usleep().
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D87940
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions