summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/bsd-misc.c')
-rw-r--r--openbsd-compat/bsd-misc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 8dc7d02d1..d75854e83 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -165,6 +165,17 @@ int nanosleep(const struct timespec *req, struct timespec *rem)
165} 165}
166#endif 166#endif
167 167
168#if !defined(HAVE_USLEEP)
169int usleep(unsigned int useconds)
170{
171 struct timespec ts;
172
173 ts.tv_sec = useconds / 1000000;
174 ts.tv_nsec = (useconds % 1000000) * 1000;
175 return nanosleep(&ts, NULL);
176}
177#endif
178
168#ifndef HAVE_TCGETPGRP 179#ifndef HAVE_TCGETPGRP
169pid_t 180pid_t
170tcgetpgrp(int fd) 181tcgetpgrp(int fd)