xref: /third_party/musl/compat/time32/nanosleep_time32.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/musl/compat/time32/
1570af302Sopenharmony_ci#include "time32.h"
2570af302Sopenharmony_ci#include <time.h>
3570af302Sopenharmony_ci#include <errno.h>
4570af302Sopenharmony_ci
5570af302Sopenharmony_ciint __nanosleep_time32(const struct timespec32 *req32, struct timespec32 *rem32)
6570af302Sopenharmony_ci{
7570af302Sopenharmony_ci	struct timespec rem;
8570af302Sopenharmony_ci	int ret = nanosleep((&(struct timespec){
9570af302Sopenharmony_ci		.tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
10570af302Sopenharmony_ci	if (ret<0 && errno==EINTR && rem32) {
11570af302Sopenharmony_ci		rem32->tv_sec = rem.tv_sec;
12570af302Sopenharmony_ci		rem32->tv_nsec = rem.tv_nsec;
13570af302Sopenharmony_ci	}
14570af302Sopenharmony_ci	return ret;
15570af302Sopenharmony_ci}
16

Indexes created Thu Nov 07 10:32:03 CST 2024