Changeset fcab7ef in mainline for uspace/lib/c/generic/vfs/vfs.c
- Timestamp:
- 2017-03-26T20:46:56Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fe91f66
- Parents:
- f644472
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
rf644472 rfcab7ef 76 76 r = ENOENT; 77 77 else 78 r = vfs_clone(root_fd, true);78 r = vfs_clone(root_fd, -1, true); 79 79 fibril_mutex_unlock(&root_mutex); 80 80 return r; … … 86 86 if (root_fd >= 0) 87 87 close(root_fd); 88 root_fd = vfs_clone(nroot, true);88 root_fd = vfs_clone(nroot, -1, true); 89 89 fibril_mutex_unlock(&root_mutex); 90 90 } … … 1071 1071 } 1072 1072 1073 /** Duplicate open file.1074 *1075 * Duplicate open file under a new file descriptor.1076 *1077 * @param oldfd Old file descriptor1078 * @param newfd New file descriptor1079 * @return 0 on success. On error -1 is returned and errno is set1080 */1081 int dup2(int oldfd, int newfd)1082 {1083 async_exch_t *exch = vfs_exchange_begin();1084 1085 sysarg_t ret;1086 sysarg_t rc = async_req_2_1(exch, VFS_IN_DUP, oldfd, newfd, &ret);1087 1088 vfs_exchange_end(exch);1089 1090 if (rc == EOK)1091 rc = ret;1092 1093 if (rc != EOK) {1094 errno = rc;1095 return -1;1096 }1097 1098 return 0;1099 }1100 1101 1073 static void process_mp(const char *path, struct stat *stat, list_t *mtab_list) 1102 1074 { … … 1254 1226 } 1255 1227 1256 int vfs_clone(int file , bool high_descriptor)1228 int vfs_clone(int file_from, int file_to, bool high_descriptor) 1257 1229 { 1258 1230 async_exch_t *vfs_exch = vfs_exchange_begin(); 1259 int rc = async_req_ 2_0(vfs_exch, VFS_IN_CLONE, (sysarg_t) file,1260 (sysarg_t) high_descriptor);1231 int rc = async_req_3_0(vfs_exch, VFS_IN_CLONE, (sysarg_t) file_from, 1232 (sysarg_t) file_to, (sysarg_t) high_descriptor); 1261 1233 vfs_exchange_end(vfs_exch); 1262 1234 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.