int fd = __llvm_libc::syscall_impl(SYS_openat, AT_FDCWD, path, open_flags,
OPEN_MODE);
#else
-#error "SYS_open and SYS_openat syscalls not available to perform a file open."
+#error "open and openat syscalls not available."
#endif
if (fd < 0)
#ifdef SYS_mmap2
static constexpr long MMAP_SYSCALL_NUMBER = SYS_mmap2;
-#elif SYS_mmap
+#elif defined(SYS_mmap)
static constexpr long MMAP_SYSCALL_NUMBER = SYS_mmap;
#else
-#error "SYS_mmap or SYS_mmap2 not available on the target platform"
+#error "mmap or mmap2 syscalls not available."
#endif
static constexpr size_t NAME_SIZE_MAX = 16; // Includes the null terminator
#elif defined(SYS_clone)
return __llvm_libc::syscall_impl(SYS_clone, SIGCHLD, 0);
#else
-#error "SYS_fork or SYS_clone not available."
+#error "fork or clone syscalls not available."
#endif
}
#elif defined(SYS_dup3)
long ret = __llvm_libc::syscall_impl(SYS_dup3, fd, newfd, 0);
#else
-#error "SYS_dup2 and SYS_dup3 not available for the target."
+#error "dup2 and dup3 syscalls not available."
#endif
return ret < 0 ? false : true;
}
#ifdef SYS_mmap2
offset /= EXEC_PAGESIZE;
long syscall_number = SYS_mmap2;
-#elif SYS_mmap
+#elif defined(SYS_mmap)
long syscall_number = SYS_mmap;
#else
-#error "Target platform does not have SYS_mmap or SYS_mmap2 defined"
+#error "mmap or mmap2 syscalls not available."
#endif
long ret_val =
#elif defined(SYS_fchmodat)
long ret = __llvm_libc::syscall_impl(SYS_fchmodat, AT_FDCWD, path, mode);
#else
-#error "chmod and chmodat syscalls not available."
+#error "chmod and fchmodat syscalls not available."
#endif
if (ret < 0) {
#ifdef SYS_mkdirat
long ret = __llvm_libc::syscall_impl(SYS_mkdirat, dfd, path, mode);
#else
-#error "mkdirat syscalls not available."
+#error "mkdirat syscall not available."
#endif
if (ret < 0) {
#elif defined(SYS_faccessat)
long ret = __llvm_libc::syscall_impl(SYS_faccessat, AT_FDCWD, path, mode, 0);
#else
-#error "access syscalls not available."
+#error "access and faccessat syscalls not available."
#endif
if (ret < 0) {
}
long ret = __llvm_libc::syscall_impl(SYS_dup3, oldfd, newfd, 0);
#else
-#error "SYS_dup2 and SYS_dup3 not available for the target."
+#error "dup2 and dup3 syscalls not available."
#endif
if (ret < 0) {
libc_errno = -ret;
#elif defined(SYS_clone)
pid_t ret = __llvm_libc::syscall_impl(SYS_clone, SIGCHLD, 0);
#else
-#error "SYS_fork or SYS_clone not available."
+#error "fork and clone syscalls not available."
#endif
if (ret == 0) {
// Return value is 0 in the child process.
long ret = __llvm_libc::syscall_impl(SYS_linkat, AT_FDCWD, path1, AT_FDCWD,
path2, 0);
#else
-#error "SYS_link or SYS_linkat not available."
+#error "link or linkat syscalls not available."
#endif
if (ret < 0) {
libc_errno = -ret;
ssize_t ret =
__llvm_libc::syscall_impl(SYS_readlinkat, AT_FDCWD, path, buf, bufsize);
#else
-#error "SYS_readlink or SYS_readlinkat not available."
+#error "readlink or readlinkat syscalls not available."
#endif
if (ret < 0) {
libc_errno = -ret;
#elif defined(SYS_symlinkat)
long ret = __llvm_libc::syscall_impl(SYS_symlinkat, path1, AT_FDCWD, path2);
#else
-#error "SYS_symlink or SYS_symlinkat not available."
+#error "symlink or symlinkat syscalls not available."
#endif
if (ret < 0) {
libc_errno = -ret;
#elif defined(SYS_unlinkat)
long ret = __llvm_libc::syscall_impl(SYS_unlinkat, AT_FDCWD, path, 0);
#else
-#error "Unlink syscalls not available."
+#error "unlink and unlinkat syscalls not available."
#endif
if (ret < 0) {
#ifdef SYS_unlinkat
long ret = __llvm_libc::syscall_impl(SYS_unlinkat, dfd, path, flags);
#else
-#error "unlinkat syscall not available."
+#error "unlinkat syscalls not available."
#endif
if (ret < 0) {
#elif SYS_mmap
static constexpr long MMAP_SYSCALL_NUMBER = SYS_mmap;
#else
-#error "Target platform does not have SYS_mmap or SYS_mmap2 defined"
+#error "mmap and mmap2 syscalls not available."
#endif
AppProperties app;
#elif SYS_mmap
static constexpr long MMAP_SYSCALL_NUMBER = SYS_mmap;
#else
-#error "Target platform does not have SYS_mmap or SYS_mmap2 defined"
+#error "mmap and mmap2 syscalls not available."
#endif
AppProperties app;
#elif SYS_mmap
static constexpr long mmapSyscallNumber = SYS_mmap;
#else
-#error "Target platform does not have SYS_mmap or SYS_mmap2 defined"
+#error "mmap and mmap2 syscalls not available."
#endif
AppProperties app;
#elif defined(SYS_symlinkat)
ASSERT_GE(__llvm_libc::syscall(SYS_symlinkat, LINK_VAL, AT_FDCWD, LINK), 0l);
#else
-#error "Symlink syscalls not available."
+#error "symlink and symlinkat syscalls not available."
#endif
ASSERT_EQ(libc_errno, 0);
#elif defined(SYS_unlinkat)
ASSERT_GE(__llvm_libc::syscall(SYS_unlinkat, AT_FDCWD, LINK, 0), 0l);
#else
-#error "Unlink syscalls not available."
+#error "unlink and unlinkat syscalls not available."
#endif
ASSERT_EQ(libc_errno, 0);
}
int fd = __llvm_libc::syscall(SYS_openat, AT_FDCWD, TEST_FILE,
O_WRONLY | O_CREAT, S_IRWXU);
#else
-#error "Open syscalls not available to available."
+#error "open and openat syscalls not available."
#endif
ASSERT_GT(fd, 0);
ASSERT_EQ(libc_errno, 0);
int write_fd = __llvm_libc::syscall(SYS_openat, AT_FDCWD, TEST_FILE_PATH,
O_WRONLY | O_CREAT, S_IRWXU);
#else
-#error "Open syscalls not available to available."
+#error "open and openat syscalls not available."
#endif
ASSERT_GT(write_fd, 0);
ASSERT_EQ(libc_errno, 0);
int dir_fd =
__llvm_libc::syscall(SYS_openat, AT_FDCWD, TEST_DIR, O_DIRECTORY, 0);
#else
-#error "Open syscalls not available to available."
+#error "open and openat syscalls not available."
#endif
ASSERT_GT(dir_fd, 0);
ASSERT_EQ(libc_errno, 0);
int link_fd = __llvm_libc::syscall(SYS_openat, AT_FDCWD, TEST_FILE_LINK_PATH,
O_PATH, 0);
#else
-#error "Open syscalls not available to available."
+#error "open and openat syscalls not available."
#endif
ASSERT_GT(link_fd, 0);
ASSERT_EQ(libc_errno, 0);
ASSERT_GE(__llvm_libc::syscall(SYS_unlinkat, AT_FDCWD, TEST_FILE_PATH, 0),
0l);
#else
-#error "Unlink syscalls not available."
+#error "unlink and unlinkat syscalls not available."
#endif
ASSERT_EQ(libc_errno, 0);
ASSERT_GE(
__llvm_libc::syscall(SYS_unlinkat, AT_FDCWD, TEST_FILE_LINK_PATH, 0), 0l);
#else
-#error "Unlink syscalls not available."
+#error "unlink and unlinkat syscalls not available."
#endif
ASSERT_EQ(libc_errno, 0);