Skip to content

Conversation

AsakuraMizu
Copy link
Collaborator

@AsakuraMizu AsakuraMizu commented May 10, 2025

Finally, we can start solving this old issue (#16).

This PR is basically the same as #18, but cleaned up.

Content

  1. Remove the dependency on arceos_posix_api and integrate the code here.
  2. Replace bindgen generated type with linux_raw_sys.
  3. Improve UserPtr related stuffs. (we have proved in actual development that this design is better, although there are still many problems, but now may not be too late to do a completely new design)
  4. Reorganize handle_syscall content. Before this, the order of syscalls was completely chaotic.
  5. Drop syscall_instrument as it's now useless.
  6. Add several very simple syscalls (like link/unlink/geteuid/getgid/getegid) and especially handle some x86_64 specific issues.
  7. Additionally, fixed the following issues:
    1. Wrong behaviour of pipes
    2. dup2 should close old fd
    3. writev should ignore zero-length buffer (see fix ftello_unflushed_append arceos#28)
    4. Fix a lot of stat-related stuffs but I cannot remember all of them 😢
    5. gettimeofday should use wall_time (see refactor: remove arceos_posix_api #47 (comment))
    6. openat could not associate correct path with opened file or directory (see refactor: remove arceos_posix_api #47 (comment))
    7. Fix getdents64 progress

Known issues

  1. getdents64 has issues but I actually don't know how to fix it. I'm asking @eternalcomet to make a PR maybe.
  2. Since we no longer define timespec, timeval or sockaddr ourselves but using the definition from linux_raw_sys, we can't implement conversion traits (From<Duration> and etc) on it. So a set of conversion functions are added.
  3. FilePath is still ugly but I don't touch it. I'm hoping of path types from axfs-ng-vfs.

@Azure-stars
Copy link
Collaborator

This PR will be merged after oscomp/arceos#38

@AsakuraMizu
Copy link
Collaborator Author

This PR will be merged after oscomp/arceos#38

I don't quite agree with this. It seems that there is still a long way to go to solve the problem of namespaces, and the issues here are more urgent.

AsakuraMizu and others added 7 commits May 13, 2025 13:04
- organize handle_syscall
- add (un)link
- add geteuid, get(e)gid
- add warning for pipe2
Co-authored-by: mivik <mivikq@gmail.com>
see oscomp/arceos#28
Co-authored-by: jhwang <jiahua-wang@outlook.com>
@AsakuraMizu
Copy link
Collaborator Author

Hold on a second, i'm going to fix getdents64 here.

@Azure-stars Azure-stars merged commit eda0112 into oscomp:main May 13, 2025
25 checks passed
@AsakuraMizu AsakuraMizu deleted the refactor branch May 13, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants