2000-11-30 Roland McGrath <roland@frob.com>

* hurd/hurd/ioctl.h (_HURD_HANDLE_IOCTLS_1): New macro.
	(_HURD_HANDLE_IOCTLS, _HURD_HANDLE_IOCTL): Redefine using it, so as to
	allow multiple instances using the same function name in one file.
This commit is contained in:
Roland McGrath 2000-12-01 23:50:27 +00:00
parent deb7f0b41f
commit 72f841d535

View file

@ -1,5 +1,5 @@
/* User-registered handlers for specific `ioctl' requests.
Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1993,94,95,96,97,2000 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
@ -53,17 +53,20 @@ extern int hurd_register_ioctl_handler (int first_request, int last_request,
LAST inclusive. The last element gratuitously references HANDLER to
avoid `defined but not used' warnings. */
#define _HURD_HANDLE_IOCTLS(handler, first, last) \
static const struct ioctl_handler handler##_ioctl_handler \
#define _HURD_HANDLE_IOCTLS_1(handler, first, last, moniker) \
static const struct ioctl_handler handler##_ioctl_handler##moniker \
__attribute__ ((__unused__)) = \
{ _IOC_NOTYPE (first), _IOC_NOTYPE (last), \
(int (*) (int, int, void *)) (handler), NULL }; \
text_set_element (_hurd_ioctl_handler_lists, ##handler##_ioctl_handler)
text_set_element (_hurd_ioctl_handler_lists, \
##handler##_ioctl_handler##moniker)
#define _HURD_HANDLE_IOCTLS(handler, first, last) \
_HURD_HANDLE_IOCTLS_1 (handler, first, last, first##_to_##last)
/* Define a library-internal handler for a single ioctl command. */
#define _HURD_HANDLE_IOCTL(handler, ioctl) \
_HURD_HANDLE_IOCTLS (handler, (ioctl), (ioctl))
_HURD_HANDLE_IOCTLS_1 (handler, ioctl, ioctl, ioctl##_only)
/* Lookup the handler for the given ioctl request. */