X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fcompat%2Ffcntl-internal.h;h=f0894e739f63b59af2672fce366a220c9f96781d;hb=bb9c6e6a0252d6239b00d8fe4cbcabd2f2af0a66;hp=2040bec0e84b5d4fc049ba57e2035960150b8ccc;hpb=a555e971548b4a747fb845ce4992cee27f8fb653;p=babeltrace.git diff --git a/include/babeltrace/compat/fcntl-internal.h b/include/babeltrace/compat/fcntl-internal.h index 2040bec0..f0894e73 100644 --- a/include/babeltrace/compat/fcntl-internal.h +++ b/include/babeltrace/compat/fcntl-internal.h @@ -232,44 +232,4 @@ end: } #endif /* #else #ifdef BABELTRACE_HAVE_POSIX_FALLOCATE */ - -#ifdef BABELTRACE_HAVE_FACCESSAT - -#include -#include - -static inline -int bt_faccessat(int dirfd, const char *dirname, - const char *pathname, int mode, int flags) -{ - return faccessat(dirfd, pathname, mode, flags); -} - -#else /* #ifdef BABELTRACE_HAVE_FACCESSAT */ - -#include -#include - -static inline -int bt_faccessat(int dirfd, const char *dirname, - const char *pathname, int mode, int flags) -{ - char cpath[PATH_MAX]; - - if (flags != 0) { - errno = EINVAL; - return -1; - } - /* Includes middle / and final \0. */ - if (strlen(dirname) + strlen(pathname) + 2 > PATH_MAX) { - return -1; - } - strcpy(cpath, dirname); - strcat(cpath, "/"); - strcat(cpath, pathname); - return access(cpath, mode); -} - -#endif /* #else #ifdef BABELTRACE_HAVE_FACCESSAT */ - #endif /* _BABELTRACE_COMPAT_FCNTL_H */