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

There is an adjustable hard limit on File Descriptors / Handles imposed by a downstream library #21

Open
seisatsu opened this issue Dec 21, 2021 · 4 comments
Assignees

Comments

@seisatsu
Copy link
Owner

seisatsu commented Dec 21, 2021

The ESP32 VFS Module has a downstream library that sets a maximum File Descriptor / File Handle, so I need to rewrite how I handle assigning them in DeviceFS, in order to reuse old ones. The default maximum is 64, but can be defined by the user by redefining FD_SETSIZE, in our project. However, we won't have infinite space to work with since higher descriptors are used for sockets. So, I still need to do some garbage collection on file handles.

See https://github.com/pycom/esp-idf-2.0/blob/master/components/newlib/include/sys/types.h

@seisatsu seisatsu changed the title The maximum File Descriptor is 64 so I need to handle them differently There is a maximum limit on File Descriptors / Handles imposed by a downstream library Dec 21, 2021
@seisatsu seisatsu changed the title There is a maximum limit on File Descriptors / Handles imposed by a downstream library There is an adjustable hard limit on File Descriptors / Handles imposed by a downstream library Dec 21, 2021
@seisatsu seisatsu self-assigned this Dec 21, 2021
@pmer
Copy link
Collaborator

pmer commented Dec 21, 2021

In which part of the code are higher descriptors used by sockets?

@seisatsu
Copy link
Owner Author

@seisatsu
Copy link
Owner Author

seisatsu commented Dec 21, 2021

Also it looks like file descriptors should be handled globally rather than by DeviceFS internally, so I will need to redo that as well once I hook DeviceFS up to the overall VFS manager.

Alternatively I might just end up writing our own simpler VFS, I have done it before and it would probably cut out some overhead. This is a big project on a tiny chip so we need to cut out as much overhead as we can; see also #20.

I can probably port the VFS from Tsunagari or Driftwood.

@pmer
Copy link
Collaborator

pmer commented Dec 21, 2021

I see, thanks.

And sure. We can also measure how much space everything uses with nm—there is a command line argument that will have it print the space of each symbol (function, global variable, etc.) in an object file/binary file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants