www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13754] New: src/std/mmfile.d: MmFile neither has ioctl nor a

https://issues.dlang.org/show_bug.cgi?id=13754

          Issue ID: 13754
           Summary: src/std/mmfile.d: MmFile neither has ioctl nor a way
                    to get the fd
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: danny.milo gmail.com

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)

--
Nov 19 2014