Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement open() #13

Closed
Lment opened this issue Mar 30, 2017 · 1 comment
Closed

Implement open() #13

Lment opened this issue Mar 30, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@Lment
Copy link
Contributor

Lment commented Mar 30, 2017

Implement open(), which opens a file with given name, returning file descriptor.
File descriptor value is unique, i.e, two distinct file must not have same file descriptor value. So, there should be some kind of FD-dispatcher which assign integer to each files. Unopened files should have no influence over current execution, so FD-dispatching sequence should be placed inside open(). Also, if a thread has file descriptors of whole files it is accessing, it could track files with that values.

Implementation should consider the following:

  1. New member in struct thread to contain every file descriptors of files that thread is accessing.
  2. New member in struct thread, to make current thread what number next opening file would have as its file descriptor.
  3. New struct that saves fd and corresponding file in linked list, to find a file with a given file descriptor. In this step, file structure defined in file.c should be moved to file.h, to be used in this declaration of new structure complex.
  4. A function in file.c named file_open() should be used..
@Lment Lment added the feature label Mar 30, 2017
@Lment Lment added this to the Project #2 milestone Mar 30, 2017
@hangpark hangpark self-assigned this Apr 2, 2017
hangpark added a commit that referenced this issue Apr 12, 2017
hangpark added a commit that referenced this issue Apr 12, 2017
[#13] Implement open system call
@hangpark
Copy link
Owner

Done by PR #63.

@hangpark hangpark mentioned this issue Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants