Remove building with NOCRYPTO option
[minix.git] / minix / fs / isofs / link.c
blobc6f7e37c525142b5c1f166c2de8f9e110fba506c
1 #include "inc.h"
3 ssize_t fs_rdlink(ino_t ino_nr, struct fsdriver_data *data, size_t bytes)
5 struct inode *i_node;
6 size_t len = 0;
7 int r;
9 /* Try to get inode according to its index */
10 if ((i_node = get_inode(ino_nr)) == NULL)
11 return EINVAL; /* no inode found */
13 if (!S_ISLNK(i_node->i_stat.st_mode))
14 return EACCES;
16 len = strlen(i_node->s_name);
17 if (len > bytes)
18 len = bytes;
20 if ((r = fsdriver_copyout(data, 0, i_node->s_name, len)) != OK)
21 return r;
23 return len;