summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/bsd-misc.h')
-rw-r--r--openbsd-compat/bsd-misc.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index cb158cd5c..3a7dd6f4c 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -64,14 +64,6 @@ struct timeval {
64int utimes(char *, struct timeval *); 64int utimes(char *, struct timeval *);
65#endif /* HAVE_UTIMES */ 65#endif /* HAVE_UTIMES */
66 66
67#ifndef HAVE_UTIMENSAT
68/* start with the high bits and work down to minimise risk of overlap */
69# ifndef AT_SYMLINK_NOFOLLOW
70# define AT_SYMLINK_NOFOLLOW 0x80000000
71# endif
72int utimensat(int, const char *, const struct timespec[2], int);
73#endif
74
75#ifndef AT_FDCWD 67#ifndef AT_FDCWD
76# define AT_FDCWD (-2) 68# define AT_FDCWD (-2)
77#endif 69#endif
@@ -88,16 +80,27 @@ int fchownat(int, const char *, uid_t, gid_t, int);
88int truncate (const char *, off_t); 80int truncate (const char *, off_t);
89#endif /* HAVE_TRUNCATE */ 81#endif /* HAVE_TRUNCATE */
90 82
91#if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP)
92#ifndef HAVE_STRUCT_TIMESPEC 83#ifndef HAVE_STRUCT_TIMESPEC
93struct timespec { 84struct timespec {
94 time_t tv_sec; 85 time_t tv_sec;
95 long tv_nsec; 86 long tv_nsec;
96}; 87};
97#endif 88#endif /* !HAVE_STRUCT_TIMESPEC */
89
90#if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP)
91# include <time.h>
98int nanosleep(const struct timespec *, struct timespec *); 92int nanosleep(const struct timespec *, struct timespec *);
99#endif 93#endif
100 94
95#ifndef HAVE_UTIMENSAT
96# include <time.h>
97/* start with the high bits and work down to minimise risk of overlap */
98# ifndef AT_SYMLINK_NOFOLLOW
99# define AT_SYMLINK_NOFOLLOW 0x80000000
100# endif
101int utimensat(int, const char *, const struct timespec[2], int);
102#endif /* !HAVE_UTIMENSAT */
103
101#ifndef HAVE_USLEEP 104#ifndef HAVE_USLEEP
102int usleep(unsigned int useconds); 105int usleep(unsigned int useconds);
103#endif 106#endif
@@ -177,4 +180,12 @@ int flock(int, int);
177# define fflush(x) (_ssh_compat_fflush(x)) 180# define fflush(x) (_ssh_compat_fflush(x))
178#endif 181#endif
179 182
183#ifndef HAVE_LOCALTIME_R
184struct tm *localtime_r(const time_t *, struct tm *);
185#endif
186
187#ifndef HAVE_REALPATH
188#define realpath(x, y) (sftp_realpath((x), (y)))
189#endif
190
180#endif /* _BSD_MISC_H */ 191#endif /* _BSD_MISC_H */