| @@ -7,6 +7,8 @@ | ||
| objects = { | ||
|
|
||
| /* Begin PBXBuildFile section */ | ||
| 40616E3C236642B6008CDF19 /* mount.c in Sources */ = {isa = PBXBuildFile; fileRef = 40616E3B236642B5008CDF19 /* mount.c */; }; | ||
| 408A263A236440F8008A4E81 /* iOSFS.m in Sources */ = {isa = PBXBuildFile; fileRef = 408A2639236440F8008A4E81 /* iOSFS.m */; }; | ||
| 650B337422EA235C00B4C03E /* PasteboardDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 650B337322EA235C00B4C03E /* PasteboardDevice.m */; }; | ||
| 8632A7BF219A59FB00F02325 /* UserPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 8632A7BE219A59FB00F02325 /* UserPreferences.m */; }; | ||
| 9A28E4EA219A8B670073D200 /* AboutAppearanceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A28E4E9219A8B670073D200 /* AboutAppearanceViewController.m */; }; | ||
| @@ -96,6 +98,9 @@ | ||
| /* End PBXCopyFilesBuildPhase section */ | ||
|
|
||
| /* Begin PBXFileReference section */ | ||
| 40616E3B236642B5008CDF19 /* mount.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mount.c; sourceTree = "<group>"; }; | ||
| 408A2639236440F8008A4E81 /* iOSFS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = iOSFS.m; sourceTree = "<group>"; }; | ||
| 408A263B23644102008A4E81 /* iOSFS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = iOSFS.h; sourceTree = "<group>"; }; | ||
| 650B335A22E9E46A00B4C03E /* mem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mem.c; sourceTree = "<group>"; tabWidth = 4; }; | ||
| 650B335B22E9E46A00B4C03E /* mem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mem.h; sourceTree = "<group>"; tabWidth = 4; }; | ||
| 650B335D22E9EF9B00B4C03E /* proc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = proc.c; sourceTree = "<group>"; }; | ||
| @@ -431,6 +436,8 @@ | ||
| BBCC9D952365430800424C83 /* SceneDelegate.m */, | ||
| BB792B561F96D90D00FFB7A4 /* TerminalViewController.h */, | ||
| BB792B571F96D90D00FFB7A4 /* TerminalViewController.m */, | ||
| 408A263B23644102008A4E81 /* iOSFS.h */, | ||
| 408A2639236440F8008A4E81 /* iOSFS.m */, | ||
tbodt
Could you put these under Devices? |
||
| BBFB557D21587B2B00DFE6DE /* Bar */, | ||
| BB78AB291FAD22440013E782 /* TerminalView.h */, | ||
| BB78AB2A1FAD22440013E782 /* TerminalView.m */, | ||
| @@ -548,6 +555,7 @@ | ||
| 650B335A22E9E46A00B4C03E /* mem.c */, | ||
| 650B335B22E9E46A00B4C03E /* mem.h */, | ||
| BB101B512364EAF0000A93BC /* mount.c */, | ||
| 40616E3B236642B5008CDF19 /* mount.c */, | ||
tbodt
Seems to be a duplicate |
||
| BB7D93742087C2890008DA78 /* path.c */, | ||
| BB7D93752087C2890008DA78 /* path.h */, | ||
| BB7D93762087C2890008DA78 /* pipe.c */, | ||
| @@ -977,6 +985,7 @@ | ||
| 9A28E4EA219A8B670073D200 /* AboutAppearanceViewController.m in Sources */, | ||
| BB1D9D93234A8FE100F364E8 /* AboutNavigationController.m in Sources */, | ||
| BB235534235D488500139E00 /* LocationDevice.m in Sources */, | ||
| 40616E3C236642B6008CDF19 /* mount.c in Sources */, | ||
| BB792B581F96D90D00FFB7A4 /* TerminalViewController.m in Sources */, | ||
| BB78AB2B1FAD22440013E782 /* TerminalView.m in Sources */, | ||
| BB23F58D231E1D1400585522 /* ScrollbarView.m in Sources */, | ||
| @@ -993,6 +1002,7 @@ | ||
| BBFB5579215876CD00DFE6DE /* AboutViewController.m in Sources */, | ||
| 650B337422EA235C00B4C03E /* PasteboardDevice.m in Sources */, | ||
| BBFB557121586C4800DFE6DE /* UIViewController+Back.m in Sources */, | ||
| 408A263A236440F8008A4E81 /* iOSFS.m in Sources */, | ||
| BBFB558021587B6800DFE6DE /* ArrowBarButton.m in Sources */, | ||
| BB792B551F96D90D00FFB7A4 /* AppDelegate.m in Sources */, | ||
| ); | ||
| @@ -108,6 +108,7 @@ void mount_release(struct mount *mount); | ||
|
|
||
| // must hold mounts_lock while calling these, or traversing mounts | ||
| int do_mount(const struct fs_ops *fs, const char *source, const char *point, int flags); | ||
| int do_mount_with_data(const struct fs_ops *fs, const char *source, const char *point, int flags, void *data); | ||
tbodt
Unused, please remove |
||
| int do_umount(const char *point); | ||
| int mount_remove(struct mount *mount); | ||
| extern struct list mounts; | ||
| @@ -174,6 +175,25 @@ const char *fix_path(const char *path); // TODO reconsider | ||
| // real fs | ||
| extern const struct fd_ops realfs_fdops; | ||
|
|
||
| struct fd *realfs_open_with_fdops(struct mount *mount, const char *path, int flags, int mode, const struct fd_ops *fdops); | ||
tbodt
At this point there should be a separate fs/real.h header. |
||
| struct fd *realfs_open(struct mount *mount, const char *path, int flags, int mode); | ||
|
|
||
| ssize_t realfs_readlink(struct mount *mount, const char *path, char *buf, size_t bufsize); | ||
| int realfs_link(struct mount *mount, const char *src, const char *dst); | ||
| int realfs_unlink(struct mount *mount, const char *path); | ||
| int realfs_rmdir(struct mount *mount, const char *path); | ||
| int realfs_rename(struct mount *mount, const char *src, const char *dst); | ||
| int realfs_symlink(struct mount *mount, const char *target, const char *link); | ||
| int realfs_mknod(struct mount *mount, const char *path, mode_t_ mode, dev_t_ UNUSED(dev)); | ||
|
|
||
| int realfs_stat(struct mount *mount, const char *path, struct statbuf *fake_stat, bool follow_links); | ||
| int realfs_statfs(struct mount *mount, struct statfsbuf *stat); | ||
| int realfs_fstat(struct fd *fd, struct statbuf *fake_stat); | ||
| int realfs_setattr(struct mount *mount, const char *path, struct attr attr); | ||
| int realfs_fsetattr(struct fd *fd, struct attr attr); | ||
|
|
||
| int realfs_mkdir(struct mount *mount, const char *path, mode_t_ mode); | ||
|
|
||
| int realfs_truncate(struct mount *mount, const char *path, off_t_ size); | ||
| int realfs_utime(struct mount *mount, const char *path, struct timespec atime, struct timespec mtime); | ||
|
|
||
| @@ -182,7 +202,16 @@ int realfs_flock(struct fd *fd, int operation); | ||
| int realfs_getpath(struct fd *fd, char *buf); | ||
| ssize_t realfs_read(struct fd *fd, void *buf, size_t bufsize); | ||
| ssize_t realfs_write(struct fd *fd, const void *buf, size_t bufsize); | ||
|
|
||
| int realfs_readdir(struct fd *fd, struct dir_entry *entry); | ||
| unsigned long realfs_telldir(struct fd *fd); | ||
| void realfs_seekdir(struct fd *fd, unsigned long ptr); | ||
|
|
||
| off_t realfs_lseek(struct fd *fd, off_t offset, int whence); | ||
|
|
||
| int realfs_poll(struct fd *fd); | ||
| int realfs_mmap(struct fd *fd, struct mem *mem, page_t start, pages_t pages, off_t offset, int prot, int flags); | ||
| int realfs_fsync(struct fd *fd); | ||
| int realfs_getflags(struct fd *fd); | ||
| int realfs_setflags(struct fd *fd, dword_t arg); | ||
| int realfs_close(struct fd *fd); | ||
| @@ -196,4 +225,8 @@ extern const struct fs_ops procfs; | ||
| extern const struct fs_ops fakefs; | ||
| extern const struct fs_ops devptsfs; | ||
|
|
||
| extern const struct fs_ops *filesystems[]; | ||
tbodt
I think a function |
||
| #define IOS_FILESYSTEM_ID 3 | ||
| #define IOS_UNSAFE_FILESYSTEM_ID 4 | ||
|
|
||
| #endif | ||
tbodtDec 16, 2019
Member
Instead of a new function here, how about setting fd->ops after calling realfs_open?