Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[component] add openat syscall. #7488

Merged
merged 2 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix AT_FDCWD not defined error.
  • Loading branch information
geniusgogo committed May 15, 2023
commit 609fcdd70f6a9e8cf710c791acc16713a01110cc
3 changes: 3 additions & 0 deletions components/dfs/dfs_v1/src/dfs_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ int open(const char *file, int flags, ...)
}
RTM_EXPORT(open);

#ifndef AT_FDCWD
#define AT_FDCWD (-100)
#endif
int openat(int dirfd, const char *path, int flag, ...)
{
struct dfs_file *d;
Expand Down
3 changes: 3 additions & 0 deletions components/dfs/dfs_v2/src/dfs_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ int open(const char *file, int flags, ...)
}
RTM_EXPORT(open);

#ifndef AT_FDCWD
#define AT_FDCWD (-100)
#endif
int openat(int dirfd, const char *path, int flag, ...)
{
struct dfs_file *d;
Expand Down
5 changes: 3 additions & 2 deletions components/lwp/lwp_syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,12 @@ sysret_t sys_openat(int dirfd, const char *name, int flag, mode_t mode)
{
#ifdef ARCH_MM_MMU
int ret = -1;
int err = 0;
rt_size_t len = 0;
char *kname = RT_NULL;

len = lwp_user_strlen(name);
if (!len)
len = lwp_user_strlen(name, &err);
if (!len || err != 0)
{
return -EINVAL;
}
Expand Down