From d7440f640efc06dfadd9ebf2ffa9a3f262e0be3b Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 25 Jan 1999 08:42:15 +0000 Subject: 1999-01-24 Roland McGrath * sysdeps/mach/hurd/ioctl.c: Include . (__ioctl): Use IOC_MSGID macro. --- sysdeps/mach/hurd/ioctl.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'sysdeps/mach') diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c index 1a7c42aad7..8d8ac9adcd 100644 --- a/sysdeps/mach/hurd/ioctl.c +++ b/sysdeps/mach/hurd/ioctl.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc. +/* Copyright (C) 1992, 93, 94, 95, 96, 97, 99 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,6 +28,8 @@ #include #include +#include + #define typesize(type) (1 << (type)) @@ -144,17 +146,7 @@ __ioctl (int fd, unsigned long int request, ...) /* Compute the Mach message ID for the RPC from the group and command parts of the ioctl request. */ - msgid = 100000 + ((_IOC_GROUP (request) - 'f') * 4000); /* Base subsystem */ - /* Because of MiG's poorly chosen algorithm of adding 100 to a request - msgid to produce the reply msgid, we cannot just add the command part - of the ioctl request to the subsystem base msgid. For ioctl requests - past 99, we must skip blocks of 100 msgids to allow for the reply - msgids corresponding to the earlier requests. */ - if (_IOC_COMMAND (request) >= 100) - msgid += 100; - if (_IOC_COMMAND (request) >= 200) - msgid += 100; - msgid += _IOC_COMMAND (request); + msgid = IOC_MSGID (request); if (_IOC_INOUT (request) & IOC_IN) { -- cgit 1.4.1