|
@@ -77,6 +77,15 @@ int fsetxattrat_nofollow(int dirfd, const char *filename, const char *name,
|
|
int qemu_mknodat(int dirfd, const char *filename, mode_t mode, dev_t dev)
|
|
int qemu_mknodat(int dirfd, const char *filename, mode_t mode, dev_t dev)
|
|
{
|
|
{
|
|
int preserved_errno, err;
|
|
int preserved_errno, err;
|
|
|
|
+
|
|
|
|
+ if (S_ISREG(mode) || !(mode & S_IFMT)) {
|
|
|
|
+ int fd = openat_file(dirfd, filename, O_CREAT, mode);
|
|
|
|
+ if (fd == -1) {
|
|
|
|
+ return fd;
|
|
|
|
+ }
|
|
|
|
+ close(fd);
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
if (!pthread_fchdir_np) {
|
|
if (!pthread_fchdir_np) {
|
|
error_report_once("pthread_fchdir_np() not available on this version of macOS");
|
|
error_report_once("pthread_fchdir_np() not available on this version of macOS");
|
|
return -ENOTSUP;
|
|
return -ENOTSUP;
|