}
}
printf("succefully write %d pages(%d per xfer)\n", _npages, xfer);
-
memset(_buffer, 0, sizeof(_buffer));
/* read */
ENTRY("empty directory readdir");
t_mkdir(dir);
- fd = t_open(dir);
+ fd = t_opendir(dir);
t_ls(fd, buf, sizeof(buf));
t_close(fd);
t_rmdir(dir);
sprintf(name, "%s%s%05d", dir, prefix, i);
t_touch(name);
}
- fd = t_open(dir);
+ fd = t_opendir(dir);
t_ls(fd, buf, sizeof(buf));
t_close(fd);
printf("Cleanup...\n");
sprintf(name, "%s%s%05d", dir, prefix, i);
t_touch(name);
}
- fd = t_open(dir);
+ fd = t_opendir(dir);
t_ls(fd, buf, sizeof(buf));
t_close(fd);
printf("Cleanup...\n");
return fd;
}
+int t_opendir(const char *path)
+{
+ int fd;
+
+ fd = open(path, O_RDONLY);
+ if (fd < 0) {
+ printf("opendir(%s) error: %s\n", path, strerror(errno));
+ EXIT_RET(fd);
+ }
+ return fd;
+}
+
void t_close(int fd)
{
int rc;
void t_rename(const char *oldpath, const char *newpath);
int t_open_readonly(const char *path);
int t_open(const char *path);
+int t_opendir(const char *path);
void t_close(int fd);
int t_check_stat(const char *name, struct stat *buf);
int t_check_stat_fail(const char *name);