fs: Rename link to symlink

since the current implementation is really a symoblic link not hard link

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I59d30d0a620b0b5714fe91bbe90d4405cf53d187
This commit is contained in:
Xiang Xiao 2020-07-01 13:37:39 +08:00 committed by Alin Jerpelea
parent 028d0c0d15
commit 651eefc8f7
5 changed files with 9 additions and 9 deletions

View File

@ -51,7 +51,7 @@ endif
CSRCS += fs_pread.c fs_pwrite.c CSRCS += fs_pread.c fs_pwrite.c
ifneq ($(CONFIG_PSEUDOFS_SOFTLINKS),0) ifneq ($(CONFIG_PSEUDOFS_SOFTLINKS),0)
CSRCS += fs_link.c fs_readlink.c CSRCS += fs_symlink.c fs_readlink.c
endif endif
# Stream support # Stream support

View File

@ -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 * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
@ -47,10 +47,10 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: link * Name: symlink
* *
* Description: * 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 * existing file, path2. This implementation is simplied for use with
* NuttX in these ways: * 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; struct inode_search_s desc;
FAR struct inode *inode = NULL; FAR struct inode *inode = NULL;

View File

@ -246,7 +246,7 @@ SYSCALL_LOOKUP(telldir, 1)
#endif #endif
#if defined(CONFIG_PSEUDOFS_SOFTLINKS) #if defined(CONFIG_PSEUDOFS_SOFTLINKS)
SYSCALL_LOOKUP(link, 2) SYSCALL_LOOKUP(symlink, 2)
SYSCALL_LOOKUP(readlink, 3) SYSCALL_LOOKUP(readlink, 3)
#endif #endif

View File

@ -268,7 +268,7 @@
/* Helpers and legacy compatibility definitions */ /* 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 fdatasync(f) fsync(f)
#define getdtablesize(f) ((int)sysconf(_SC_OPEN_MAX)) #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); int truncate(FAR const char *path, off_t length);
#ifdef CONFIG_PSEUDOFS_SOFTLINKS #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); ssize_t readlink(FAR const char *path, FAR char *buf, size_t bufsize);
#endif #endif

View File

@ -42,7 +42,7 @@
"insmod","nuttx/module.h","defined(CONFIG_MODULE)","FAR void *","FAR const char *","FAR const char *" "insmod","nuttx/module.h","defined(CONFIG_MODULE)","FAR void *","FAR const char *","FAR const char *"
"ioctl","sys/ioctl.h","","int","int","int","...","unsigned long" "ioctl","sys/ioctl.h","","int","int","int","...","unsigned long"
"kill","signal.h","","int","pid_t","int" "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" "listen","sys/socket.h","defined(CONFIG_NET)","int","int","int"
"lseek","unistd.h","","off_t","int","off_t","int" "lseek","unistd.h","","off_t","int","off_t","int"
"lstat","sys/stat.h","","int","FAR const char *","FAR struct stat *" "lstat","sys/stat.h","","int","FAR const char *","FAR struct stat *"

Can't render this file because it has a wrong number of fields in line 2.