Bug 13754 – src/std/mmfile.d: MmFile neither has ioctl nor a way to get the fd

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-11-19T22:48:31Z
Last change time
2024-12-01T16:23:01Z
Assigned to
No Owner
Creator
Danny Milosavljevic
Moved to GitHub: phobos#10100 →

Comments

Comment #0 by danny.milo — 2014-11-19T22:48:31Z
std.mmfile.MmFile neither has ioctl nor has a way to get the fileno. (I'm trying to use it to draw to a framebuffer. The framebuffer physical extent can be queried using ioctls and the colorspace set, among other things) Unfortunately the MmFile ctor with the fileno is private. Why? Fine, there's a public one taking a File (which is... weird - I now have a file taking a file?). But then I have to carry around a File and a MmFile everywhere in order to be able to do ioctls. I'd suggest: - add ioctl to MmFile. - add a way to get the fileno to MmFile - maybe make MmFile an alternative to File rather than an additional layer - which it doesn't seem to be anyway. Why the constructor taking a File, then? I'd not do that... (ioctl are common in Posix and almost every device supports some)
Comment #1 by danny.milo — 2014-11-25T10:49:31Z
I'm trying to implement that right now. Is there are way not to repeat the .ioctl signature in the (potential) member function MmFile.ioctl ? Like ioctl = .ioctl fileno; ? Also, there are many different prototypes for ioctl in core/sys/posix/sys/ioctl.d . Do I just choose a superset? Is ulong.sizeof >= c_ulong.sizeof always ? Is ulong.sizeof >= int.sizeof always ? (Then I'd use int ioctl(ulong request, ...) as the member function, if really necessary)
Comment #2 by robert.schadek — 2024-12-01T16:23:01Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10100 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB