From 4eacaa4eaf3c3eaf2e1037a8e4d086138685bd5e Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 26 May 2009 17:58:06 +0200 Subject: explain a bit more about ioctl numbers --- hurd/porting/guidelines.mdwn | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'hurd') diff --git a/hurd/porting/guidelines.mdwn b/hurd/porting/guidelines.mdwn index 1beb53a0..5fd66292 100644 --- a/hurd/porting/guidelines.mdwn +++ b/hurd/porting/guidelines.mdwn @@ -170,12 +170,15 @@ This comes from ioctls. Fixing this is easy if the structure members can be exp `#define _IOT_termios /* Hurd ioctl type field. */ \ _IOT (_IOTS (tcflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)` -because `struct termios` holds 4 members of type `tcflag_ts`, then `NCCS` -members of type `cc_tsi` and finaly 2 members of type `speed_ts`. - -As you can see, this limits the number of kinds of members to 3, and in -addition to that (see the bitfield described in `ioctls.h`), the third -kind of member is limited to 3 members. +The rationale behind is that on the Hurd ioctl numbers actually encode how the +data should be transferred via RPC: here `struct termios` holds 4 members of +type `tcflag_ts`, then `NCCS` members of type `cc_tsi` and finaly 2 members of +type `speed_ts`, so the RPC mecanism will know how to transfer them. + +As you can see, this limits the number of contiguous kinds of members to 3, and +in addition to that (see the bitfield described in `ioctls.h`), the third kind +of member is limited to 3 members. This is a design limitation, there is no way +to overcome it at the moment. Note: if a field member is a pointer, then the ioctl can't be expressed this way, and that makes sense, since the server you're talking to -- cgit v1.2.3