Hopefully the last of Linux's ioctl enums. #340

Merged
merged 12 commits into from Dec 12, 2012

Projects

None yet

7 participants

@alexrp
D Programming Language member

After much internal bleeding, here is (hopefully) the complete set of ioctl enums for Linux. Also some supplemental changes.

(More OSs to follow...)

@quickfur
D Programming Language member

Somebody please merge this, this is causing compile errors for any code that uses these modules.

@klickverbot klickverbot and 2 others commented on an outdated diff Nov 20, 2012
src/core/sys/posix/termios.d
@@ -135,7 +135,7 @@ version( linux )
alias uint speed_t;
alias uint tcflag_t;
- enum NCCS = 32;
+ enum NCCS = 19;
@klickverbot
klickverbot Nov 20, 2012

On my Arch box (glibc 2.16.0), /usr/include/bits/termios.h, which is included by /usr/include/termios.h, has #define NCCS 32. In asm-generic/termios.h, it is 19, though?

@alexrp
alexrp Nov 20, 2012

From what I gathered back when I poked around with this, the NCCS value in the glibc termios.h file is just a generic/portable value, while the NCCS value in termbits.h is the actual value Linux uses.

I could be wrong though.

@MartinNowak
MartinNowak Dec 7, 2012

There is a translation layerin glibc which uses 32, please fix.

@alexrp
alexrp Dec 7, 2012

I'm confused. That link says 19?

@MartinNowak
MartinNowak Dec 7, 2012

Yep, because it's __KERNEL_NCCS, here is the linux definition. They actually copy the data before calling ioctl, see here.

@alexrp
alexrp Dec 7, 2012

So 32 is the user-facing definition, is what you're saying?

@WalterBright
D Programming Language member

Can't pull it until it can be merged and the test suite passes.

@alexrp
D Programming Language member

Test suite passes but the makefiles have changed since. Will rebase soon.

@alexrp
D Programming Language member

Rebased.

@andralex andralex merged commit 2783bf6 into dlang:master Dec 12, 2012

1 check was pending

Details default Pass: 8, Pending: 2
@andralex
D Programming Language member

merged - thanks!

@ariovistus

At least on Ubuntu 12.04 i686, c_ispeed and c_ospeed are fields in termios. What distro were these changes made for?

D Programming Language member

Can you please open a pull request to fix this?
Here is the correct definition in glibc.

it seems termios and termios2 as described in this changeset are kernel-level structures defined in /usr/include/asm-generic/termbits.h, so I guess that's where this changeset came from.

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