diff --git a/include/fast_io_driver/install_path/bsd.h b/include/fast_io_driver/install_path/bsd.h index a0615fef..90b1e806 100644 --- a/include/fast_io_driver/install_path/bsd.h +++ b/include/fast_io_driver/install_path/bsd.h @@ -27,7 +27,7 @@ inline ::fast_io::install_path get_module_install_path() char buffer1[PATH_MAX + 1]; char buffer2[PATH_MAX + 1]; char *resolved{}; - int length = -1; + // int length = -1; #if defined(__NetBSD__) int mib[4]{CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME}; diff --git a/include/fast_io_hosted/filesystem/nt_at.h b/include/fast_io_hosted/filesystem/nt_at.h index 3be2375a..6a3c2de7 100644 --- a/include/fast_io_hosted/filesystem/nt_at.h +++ b/include/fast_io_hosted/filesystem/nt_at.h @@ -851,7 +851,7 @@ inline ::fast_io::details::basic_ct_string nt_readlinkat_impl(void *d ::fast_io::basic_nt_family_file<(zw ? nt_family::zw : nt_family::nt), char> file{ nt_call_determine_kernel_callback(dirhd, path_c_str, path_size, kernel, nt_create_callback{md})}; - throw_nt_error(0xC0000002); + throw_nt_error(0xC0000275u /*STATUS_NOT_A_REPARSE_POINT*/); return {}; #endif diff --git a/include/fast_io_hosted/process/process/posix.h b/include/fast_io_hosted/process/process/posix.h index 161b9bf2..ebe4c42b 100644 --- a/include/fast_io_hosted/process/process/posix.h +++ b/include/fast_io_hosted/process/process/posix.h @@ -8,6 +8,11 @@ namespace fast_io namespace posix { +// The statement about argu[] and enopl] being constants is included to make explicit to future writers of language bindings that these objects are completely constant. +// Due toa limitation of the ISOC standard, it is not possible to state that idea in standard C. Specifying two levels of const-qualification for the argol] and enopll +// parameters for the exec functions may seem to be the natural choice, given that these functions do not modify either the array of pointers or the characters to which the +// function points, but this would disallow existing correct code. Instead, only the array of pointers is noted as constant. + #if defined(__DARWIN_C_LEVEL) || defined(__MSDOS__) extern int libc_fexecve(int fd, char *const *argv, char *const *envp) noexcept __asm__("_fexecve"); extern int libc_execveat(int dirfd, char const *pathname, char *const *argv, char *const *envp, int flags) noexcept __asm__("_execveat"); @@ -763,7 +768,7 @@ inline void vfork_and_execveat(pid_t &pid, int dirfd, char const *cstr, char con flags |= AT_SYMLINK_NOFOLLOW; } - auto ret{::fast_io::posix::libc_execveat(dirfd, cstr, args, envp, flags)}; + auto ret{::fast_io::posix::libc_execveat(dirfd, cstr, const_cast(args), const_cast(envp), flags)}; if (ret == -1) { t_errno = errno; @@ -786,7 +791,7 @@ inline void vfork_and_execveat(pid_t &pid, int dirfd, char const *cstr, char con flags |= AT_SYMLINK_NOFOLLOW; } - auto ret{::fast_io::posix::libc_execveat(dirfd, cstr, args, envp, flags)}; + auto ret{::fast_io::posix::libc_execveat(dirfd, cstr, const_cast(args), const_cast(envp), flags)}; if (ret == -1) { t_errno = errno;