Lines Matching refs:fd

137 	int fd = open("/dev/urandom", O_RDONLY);
138 if (fd < 0) {
139 fd = open("/dev/random", O_RDONLY);
140 if (fd < 0)
146 ssize_t bytesRead = read(fd, buffer, sizeof(buffer));
150 close(fd);
171 get_id_attribute(const char *path, int fd, string& _id)
182 ssize_t bytesRead = get_attribute(fd, path, attributeName.c_str(), buffer,
205 set_id_attribute(const char *path, int fd, const char* id)
210 if (set_attribute(fd, path, attributeName.c_str(), id, strlen(id)) < 0)
217 get_attribute_dir_path(NodeRef ref, const char *path, int fd)
220 status_t error = get_id_attribute(path, fd, id);
232 get_attribute_dir_path_needed(NodeRef ref, const char *path, int fd,
236 status_t error = get_id_attribute(path, fd, id);
242 error = set_id_attribute(path, fd, id.c_str());
258 get_attribute_dir_path(NodeRef ref, const char *path, int fd)
269 get_attribute_dir_path_needed(NodeRef ref, const char *path, int fd,
272 _attrDirPath = get_attribute_dir_path(ref, path, fd);
282 ensure_attribute_dir_exists(NodeRef ref, const char *path, int fd)
290 error = get_attribute_dir_path_needed(ref, path, fd, attrDirPath);
317 open_attr_dir(NodeRef ref, const char *path, int fd)
320 status_t error = ensure_attribute_dir_exists(ref, path, fd);
327 string dirPath(get_attribute_dir_path(ref, path, fd));
333 get_attribute_path(NodeRef ref, const char *path, int fd,
340 status_t error = ensure_attribute_dir_exists(ref, path, fd);
347 attrPath = get_attribute_dir_path(ref, path, fd) + '/';
358 get_attribute_path_virtual_fd(int fd, const char *attribute, string &attrPath,
363 status_t error = _kern_read_stat(fd, NULL, false, &st, sizeof(st));
371 bool pathValid = (get_path(fd, NULL, path) == B_OK);
375 (pathValid ? -1 : fd), attribute, attrPath, typePath);
381 get_attribute_path(int fd, const char *attribute, string &attrPath,
384 if (get_descriptor(fd)) {
387 return get_attribute_path_virtual_fd(fd, attribute, attrPath,
395 if (fstat(fd, &st) < 0)
399 return get_attribute_path(ref, NULL, fd, attribute, attrPath, typePath);
420 fs_fopen_attr_dir(int fd)
424 status_t error = _kern_read_stat(fd, NULL, false, &st,
434 bool pathValid = (get_path(fd, NULL, path) == B_OK);
438 (pathValid ? -1 : fd));
477 fs_fopen_attr(int fd, const char *attribute, uint32 type, int openMode)
487 status_t error = get_attribute_path(fd, attribute, attrPath, typePath);
535 fs_close_attr(int fd)
537 return close(fd);
542 fs_read_attr(int fd, const char *attribute, uint32 type, off_t pos,
546 int attrFD = fs_fopen_attr(fd, attribute, type, O_RDONLY);
567 fs_write_attr(int fd, const char *attribute, uint32 type, off_t pos,
571 int attrFD = fs_fopen_attr(fd, attribute, type,
578 if (strcmp(attribute, "BEOS:TYPE") == 0 && fstat(fd, &st) == 0
602 fs_remove_attr(int fd, const char *attribute)
612 status_t error = get_attribute_path(fd, attribute, attrPath, typePath);
629 fs_stat_attr(int fd, const char *attribute, struct attr_info *attrInfo)
639 status_t error = get_attribute_path(fd, attribute, attrPath, typePath);
680 _kern_open_attr_dir(int fd, const char *path)
684 status_t error = _kern_read_stat(fd, path, false, &st,
695 error = get_path(fd, path, realPath);
702 (path ? -1 : fd));
752 _kern_remove_attr(int fd, const char *name)
760 status_t error = get_attribute_path_virtual_fd(fd, name, attrPath,