13#include <sys/resource.h>
15#include <sys/ucontext.h>
44 int ret_code = gettimeofday(&tv, &tz);
50 return (-tz.tz_minuteswest * 60) + (localtm.tm_isdst > 0 ? 3600 : 0);
62 if (std::isnan(time_ms))
return "";
63 time_t tv =
static_cast<time_t
>(floor(time_ms /
msPerSecond));
65 struct tm* t = localtime_r(&tv, &tm);
66 if (
nullptr == t)
return "";
73 time_t utc =
time(
nullptr);
76 struct tm* loc = localtime_r(&utc, &tm);
85 return static_cast<unsigned>(strtol(buffer,
nullptr, 16));
89 std::vector<SharedLibraryAddress>
result;
90 static const int MAP_LENGTH = 1024;
91 int fd = open(
"/proc/self/maps", O_RDONLY);
98 ssize_t rc = read(fd, addr_buffer + 2, 8);
101 rc = read(fd, addr_buffer + 2, 1);
103 if (addr_buffer[2] !=
'-')
break;
104 rc = read(fd, addr_buffer + 2, 8);
107 char buffer[MAP_LENGTH];
111 if (bytes_read >= MAP_LENGTH - 1)
break;
112 rc = read(fd, buffer + bytes_read, 1);
114 }
while (buffer[bytes_read] !=
'\n');
115 buffer[bytes_read] = 0;
117 if (buffer[3] !=
'x')
continue;
118 char* start_of_path =
index(buffer,
'/');
120 if (start_of_path ==
nullptr)
continue;
121 buffer[bytes_read] = 0;
152 pthread_t tid = pthread_self();
153 struct __pthrdsinfo buf;
155 memset(&buf, 0,
sizeof(buf));
157 int regbufsize =
sizeof(regbuf);
158 const int rc = pthread_getthrds_np(&tid, PTHRDSINFO_QUERY_ALL, &buf,
159 sizeof(buf), regbuf, ®bufsize);
161 if (buf.__pi_stackend == NULL || buf.__pi_stackaddr == NULL) {
164 return reinterpret_cast<void*
>(buf.__pi_stackend);
180 mmap(address, size, PROT_NONE, MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0)
186 if (ptr != address) {
189 if (munmap(address, size)) {
~AIXTimezoneCache() override
const char * LocalTimezone(double time) override
double LocalTimeOffset(double time_ms, bool is_utc) override
static void SignalCodeMovingGC()
static V8_WARN_UNUSED_RESULT bool DecommitPages(void *address, size_t size)
static size_t CommitPageSize()
static std::vector< SharedLibraryAddress > GetSharedLibraryAddresses()
static TimezoneCache * CreateTimezoneCache()
static std::optional< MemoryRange > GetFirstFreeMemoryRangeWithin(Address boundary_start, Address boundary_end, size_t minimum_size, size_t alignment)
static void AdjustSchedulingParams()
static const int msPerSecond
static Stack::StackSlot ObtainCurrentThreadStackStart()
ZoneVector< RpoNumber > & result
int64_t get_gmt_offset(const tm &localtm)
static unsigned StringToLong(char *buffer)
#define DCHECK_NOT_NULL(val)
#define DCHECK_NE(v1, v2)
#define CHECK_EQ(lhs, rhs)
#define DCHECK_EQ(v1, v2)