Skip to content

Commit

Permalink
Fix more of __map_file and add support for mkdirat. Corresponds to ll…
Browse files Browse the repository at this point in the history
…vm-project-deluge/9e56fee21c8a
  • Loading branch information
Filip Pizlo committed May 3, 2024
1 parent 95332e8 commit 3ac7d8e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/stat/mkdir.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#include <sys/stat.h>
#include <fcntl.h>
#include "syscall.h"
#include <stdfil.h>

int mkdir(const char *path, mode_t mode)
{
#ifdef SYS_mkdir
return syscall(SYS_mkdir, path, mode);
#else
return syscall(SYS_mkdirat, AT_FDCWD, path, mode);
#endif
return zsys_mkdirat(AT_FDCWD, path, mode);
}
2 changes: 1 addition & 1 deletion src/stat/mkdirat.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

int mkdirat(int fd, const char *path, mode_t mode)
{
return syscall(SYS_mkdirat, fd, path, mode);
return zsys_mkdirat(fd, path, mode);
}
2 changes: 1 addition & 1 deletion src/time/__map_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ const char unsigned *__map_file(const char *pathname, size_t *size)
map = __mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
*size = st.st_size;
}
__syscall(SYS_close, fd);
zsys_close(fd);
return map == MAP_FAILED ? 0 : map;
}

0 comments on commit 3ac7d8e

Please sign in to comment.