AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
AC_CHECK_FUNCS(waitpid strlcpy strlcat initgroups memmove strdup)
-AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp)
+AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp dup2)
- AC_CHECK_FUNCS(isatty)
+ AC_CHECK_FUNCS(isatty chown lchown link readlink symlink realpath)
AC_HAVE_DECL(setresuid, [#include <unistd.h>])
AC_HAVE_DECL(setresgid, [#include <unistd.h>])
AC_HAVE_DECL(errno, [#include <errno.h>])
}
#endif
+#ifndef HAVE_DUP2
+int rep_dup2(int oldfd, int newfd)
+{
+ errno = ENOSYS;
+ return -1;
+}
+#endif
+
+ #ifndef HAVE_CHOWN
+ /**
+ chown isn't used much but OS/2 doesn't have it
+ **/
+ int rep_chown(const char *fname, uid_t uid, gid_t gid)
+ {
+ errno = ENOSYS;
+ return -1;
+ }
+ #endif
+
+ #ifndef HAVE_LINK
+ int rep_link(const char *oldpath, const char *newpath)
+ {
+ errno = ENOSYS;
+ return -1;
+ }
+ #endif
+
+ #ifndef HAVE_READLINK
+ int rep_readlink(const char *path, char *buf, size_t bufsiz)
+ {
+ errno = ENOSYS;
+ return -1;
+ }
+ #endif
+
+ #ifndef HAVE_SYMLINK
+ int rep_symlink(const char *oldpath, const char *newpath)
+ {
+ errno = ENOSYS;
+ return -1;
+ }
+ #endif
+
+ #ifndef HAVE_LCHOWN
+ int rep_lchown(const char *fname,uid_t uid,gid_t gid)
+ {
+ errno = ENOSYS;
+ return -1;
+ }
+ #endif
+
+ #ifndef HAVE_REALPATH
+ char *rep_realpath(const char *path, char *resolved_path)
+ {
+ /* As realpath is not a system call we can't return ENOSYS. */
+ errno = EINVAL;
+ return NULL;
+ }
+ #endif