Cider Isn't Darwin Emulation, Really
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344#include "for-libelfloader.h"#include "../base.h"#include "../errno.h"#include "../bsdthread/cancelable.h"#include "../bsdthread/per_thread_wd.h"#include "../fcntl/open.h"
VISIBLElong _open_for_libelfloader(const char* path, int flags, unsigned int mode) { int linux_flags; int wd; int ret;
CANCELATION_POINT();
linux_flags = oflags_bsd_to_linux(flags); wd = oflags_bsd_to_linux(flags);
if (sizeof(void*) == 4) { linux_flags |= LINUX_O_LARGEFILE; }
ret = LINUX_SYSCALL(__NR_openat, wd, path, linux_flags, mode); if (ret < 0) ret = errno_linux_to_bsd(ret);
return ret;};
VISIBLElong _access_for_libelfloader(const char* path, int mode) { int ret; int wd;
wd = get_perthread_wd();
ret = LINUX_SYSCALL(__NR_faccessat, wd, path, mode, 0);
if (ret < 0) ret = errno_linux_to_bsd(ret);
return ret;};