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

What to do about widely used ioctl.scala? #3020

Open
LeeTibbert opened this issue Dec 2, 2022 · 1 comment
Open

What to do about widely used ioctl.scala? #3020

LeeTibbert opened this issue Dec 2, 2022 · 1 comment

Comments

@LeeTibbert
Copy link
Contributor

To ensure that everything implemented in posixlib was documented in ReadTheDocs, I did a sweep through
comparing the documentation with the contents of posixlib.

I discovered a blivet when it came to ioctl.scala. It needs a new home
and to be removed from the posixlib documentation.

It is not POSIX. Posix had an ioctl but it was in strops.h
and, to boot, is now marked obsolescent ( their word, English
I would use, my grammar teacher would blanch)

It is not part of the ISO C standard library, under any name I could find.

Now the delicate part is that posix.sys.ioctl (sic) is used in a number
of places in Scala Native. I suspect that it is also used in the wider
SN world. If it is going to change location, and I believe it should,
the breaking 0.5.0 is the time to do it.

I have talked often about the need in SN for a "WYSIWYG" (what you
see is what you get) or OS specific (gnu, Linux, MacOS, (Windows?))
library. This is another case, although it would probably go in a "shared"
sub-directory. There are several other candidates for such an "Wild West"
non-POSIX, non-ISO_C library. It is kinda like the case of 'irregular verbs'.

I invite discussion. Let's see if we can get some consensus.

There is a hack solution, but I do not want to document that in public.
We have enough of these "special" cases to drive an architectural (project)
solution.

@ekrich
Copy link
Member

ekrich commented Dec 2, 2022

My guess is that it is located in POSIX because of this - https://man7.org/linux/man-pages/man2/ioctl_tty.2.html

You can also find it as a BSD API which makes since because it would have to compile on macOS too.
https://www.freebsd.org/cgi/man.cgi?sektion=2&query=ioctl

I would say "obsolescent" or not that strops.h would be ok if FIONREAD was defined in POSIX but it isn't so that isn't a good solution.

I found this so it even makes it more unclear where ioctl should land or if there is a POSIX replacement.
https://stackoverflow.com/questions/7294732/replacement-for-the-ioctl-function

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

No branches or pull requests

2 participants