fs: Implment link as a normal function instead macro

so "using ::link;" can pass the compiling. This change also
simplify the implementation of the hard link in the future.
This commit is contained in:
Stuart Ianna
2023-01-23 09:14:48 +11:00
committed by Alan Carvalho de Assis
parent 1e3af48fff
commit a2a542562f
6 changed files with 69 additions and 2 deletions
+1
View File
@@ -252,6 +252,7 @@ SYSCALL_LOOKUP(futimens, 2)
SYSCALL_LOOKUP(munmap, 2)
#if defined(CONFIG_PSEUDOFS_SOFTLINKS)
SYSCALL_LOOKUP(link, 2)
SYSCALL_LOOKUP(symlink, 2)
SYSCALL_LOOKUP(readlink, 3)
#endif
+1 -1
View File
@@ -259,7 +259,6 @@
/* Helpers and legacy compatibility definitions */
#define link(p1, p2) symlink((p1), (p2))
#define syncfs(f) fsync(f)
#define fdatasync(f) fsync(f)
#define getdtablesize(f) ((int)sysconf(_SC_OPEN_MAX))
@@ -372,6 +371,7 @@ int access(FAR const char *path, int amode);
int rmdir(FAR const char *pathname);
int unlink(FAR const char *pathname);
int truncate(FAR const char *path, off_t length);
int link(FAR const char *path1, FAR const char *path2);
int symlink(FAR const char *path1, FAR const char *path2);
ssize_t readlink(FAR const char *path, FAR char *buf, size_t bufsize);
int chown(FAR const char *path, uid_t owner, gid_t group);