You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2020/07/01 09:58:21 UTC

[incubator-nuttx] branch master updated: fs: Rename link to symlink

This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 651eefc  fs: Rename link to symlink
651eefc is described below

commit 651eefc8f7f74040fdeab835a148a7f3276f6bf9
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Jul 1 13:37:39 2020 +0800

    fs: Rename link to symlink
    
    since the current implementation is really a symoblic link not hard link
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
    Change-Id: I59d30d0a620b0b5714fe91bbe90d4405cf53d187
---
 fs/vfs/Make.defs                   | 2 +-
 fs/vfs/{fs_link.c => fs_symlink.c} | 8 ++++----
 include/sys/syscall_lookup.h       | 2 +-
 include/unistd.h                   | 4 ++--
 syscall/syscall.csv                | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/vfs/Make.defs b/fs/vfs/Make.defs
index ced07db..b8bb9e6 100644
--- a/fs/vfs/Make.defs
+++ b/fs/vfs/Make.defs
@@ -51,7 +51,7 @@ endif
 CSRCS += fs_pread.c fs_pwrite.c
 
 ifneq ($(CONFIG_PSEUDOFS_SOFTLINKS),0)
-CSRCS += fs_link.c fs_readlink.c
+CSRCS += fs_symlink.c fs_readlink.c
 endif
 
 # Stream support
diff --git a/fs/vfs/fs_link.c b/fs/vfs/fs_symlink.c
similarity index 96%
rename from fs/vfs/fs_link.c
rename to fs/vfs/fs_symlink.c
index 25916c6..01882e9 100644
--- a/fs/vfs/fs_link.c
+++ b/fs/vfs/fs_symlink.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * fs/vfs/fs_link.c
+ * fs/vfs/fs_symlink.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -47,10 +47,10 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: link
+ * Name: symlink
  *
  * Description:
- *   The link() function will create a new link (directory entry) for the
+ *   The symlink() function will create a new link (directory entry) for the
  *   existing file, path2.  This implementation is simplied for use with
  *   NuttX in these ways:
  *
@@ -72,7 +72,7 @@
  *
  ****************************************************************************/
 
-int link(FAR const char *path1, FAR const char *path2)
+int symlink(FAR const char *path1, FAR const char *path2)
 {
   struct inode_search_s desc;
   FAR struct inode *inode = NULL;
diff --git a/include/sys/syscall_lookup.h b/include/sys/syscall_lookup.h
index 67b8472..91027c8 100644
--- a/include/sys/syscall_lookup.h
+++ b/include/sys/syscall_lookup.h
@@ -246,7 +246,7 @@ SYSCALL_LOOKUP(telldir,                    1)
 #endif
 
 #if defined(CONFIG_PSEUDOFS_SOFTLINKS)
-  SYSCALL_LOOKUP(link,                     2)
+  SYSCALL_LOOKUP(symlink,                  2)
   SYSCALL_LOOKUP(readlink,                 3)
 #endif
 
diff --git a/include/unistd.h b/include/unistd.h
index b64175a..3c3742f 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -268,7 +268,7 @@
 
 /* Helpers and legacy compatibility definitions */
 
-#define symlink(p1, p2)                  link((p1), (p2))
+#define link(p1, p2)                     symlink((p1), (p2))
 #define fdatasync(f)                     fsync(f)
 #define getdtablesize(f)                 ((int)sysconf(_SC_OPEN_MAX))
 
@@ -359,7 +359,7 @@ int     unlink(FAR const char *pathname);
 int     truncate(FAR const char *path, off_t length);
 
 #ifdef CONFIG_PSEUDOFS_SOFTLINKS
-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);
 #endif
 
diff --git a/syscall/syscall.csv b/syscall/syscall.csv
index b79f779..d9ba878 100644
--- a/syscall/syscall.csv
+++ b/syscall/syscall.csv
@@ -42,7 +42,7 @@
 "insmod","nuttx/module.h","defined(CONFIG_MODULE)","FAR void *","FAR const char *","FAR const char *"
 "ioctl","sys/ioctl.h","","int","int","int","...","unsigned long"
 "kill","signal.h","","int","pid_t","int"
-"link","unistd.h","defined(CONFIG_PSEUDOFS_SOFTLINKS)","int","FAR const char *","FAR const char *"
+"symlink","unistd.h","defined(CONFIG_PSEUDOFS_SOFTLINKS)","int","FAR const char *","FAR const char *"
 "listen","sys/socket.h","defined(CONFIG_NET)","int","int","int"
 "lseek","unistd.h","","off_t","int","off_t","int"
 "lstat","sys/stat.h","","int","FAR const char *","FAR struct stat *"