2023-01-06 21:08:04 +00:00
|
|
|
/* Copyright (C) 1992-2023 Free Software Foundation, Inc.
|
1997-05-26 23:01:17 +00:00
|
|
|
This file is part of the GNU C Library.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1997-05-26 23:01:17 +00:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1997-05-26 23:01:17 +00:00
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
Prefer https to http for gnu.org and fsf.org URLs
Also, change sources.redhat.com to sourceware.org.
This patch was automatically generated by running the following shell
script, which uses GNU sed, and which avoids modifying files imported
from upstream:
sed -ri '
s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g
s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g
' \
$(find $(git ls-files) -prune -type f \
! -name '*.po' \
! -name 'ChangeLog*' \
! -path COPYING ! -path COPYING.LIB \
! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \
! -path manual/texinfo.tex ! -path scripts/config.guess \
! -path scripts/config.sub ! -path scripts/install-sh \
! -path scripts/mkinstalldirs ! -path scripts/move-if-change \
! -path INSTALL ! -path locale/programs/charmap-kw.h \
! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \
! '(' -name configure \
-execdir test -f configure.ac -o -f configure.in ';' ')' \
! '(' -name preconfigure \
-execdir test -f preconfigure.ac ';' ')' \
-print)
and then by running 'make dist-prepare' to regenerate files built
from the altered files, and then executing the following to cleanup:
chmod a+x sysdeps/unix/sysv/linux/riscv/configure
# Omit irrelevant whitespace and comment-only changes,
# perhaps from a slightly-different Autoconf version.
git checkout -f \
sysdeps/csky/configure \
sysdeps/hppa/configure \
sysdeps/riscv/configure \
sysdeps/unix/sysv/linux/csky/configure
# Omit changes that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines
git checkout -f \
sysdeps/powerpc/powerpc64/ppc-mcount.S \
sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
# Omit change that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline
git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 05:40:42 +00:00
|
|
|
<https://www.gnu.org/licenses/>. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
#include <errno.h>
|
2023-05-04 04:06:46 +00:00
|
|
|
#include <libc-pointer-arith.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <hurd.h>
|
|
|
|
#include <hurd/fd.h>
|
|
|
|
#include <hurd/signal.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <mach/notify.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <string.h>
|
2000-12-07 00:05:30 +00:00
|
|
|
#include <stdint.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
#include <hurd/ioctl.h>
|
1996-11-15 19:50:04 +00:00
|
|
|
#include <mach/mig_support.h>
|
2023-05-06 20:55:10 +00:00
|
|
|
#include <mach_rpc.h>
|
2020-06-28 22:41:18 +00:00
|
|
|
#include <sysdep-cancel.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1999-01-25 08:42:15 +00:00
|
|
|
#include <hurd/ioctls.defs>
|
|
|
|
|
2023-05-04 04:06:46 +00:00
|
|
|
#define msg_align(x) ALIGN_UP (x, __alignof__ (uintptr_t))
|
1995-02-18 01:27:10 +00:00
|
|
|
#define typesize(type) (1 << (type))
|
|
|
|
|
|
|
|
/* Perform the I/O control operation specified by REQUEST on FD.
|
|
|
|
The actual type and use of ARG and the return value depend on REQUEST. */
|
|
|
|
int
|
1997-05-26 23:01:17 +00:00
|
|
|
__ioctl (int fd, unsigned long int request, ...)
|
1995-02-18 01:27:10 +00:00
|
|
|
{
|
2023-05-04 04:06:46 +00:00
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
1995-02-18 01:27:10 +00:00
|
|
|
/* Map individual type fields to Mach IPC types. */
|
|
|
|
static const int mach_types[] =
|
|
|
|
{ MACH_MSG_TYPE_CHAR, MACH_MSG_TYPE_INTEGER_16, MACH_MSG_TYPE_INTEGER_32,
|
1997-06-21 02:59:26 +00:00
|
|
|
MACH_MSG_TYPE_INTEGER_64 };
|
2023-05-04 04:06:46 +00:00
|
|
|
#define io2mach_type(count, type) \
|
|
|
|
((mach_msg_type_t) { \
|
|
|
|
.msgt_name = mach_types[type], \
|
|
|
|
.msgt_size = typesize(type) * 8, \
|
|
|
|
.msgt_number = count, \
|
|
|
|
.msgt_inline = TRUE, \
|
|
|
|
.msgt_longform = FALSE, \
|
|
|
|
.msgt_deallocate = FALSE, \
|
|
|
|
.msgt_unused = 0 \
|
|
|
|
})
|
2002-02-17 22:54:39 +00:00
|
|
|
#endif
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
/* Extract the type information encoded in the request. */
|
|
|
|
unsigned int type = _IOC_TYPE (request);
|
|
|
|
|
|
|
|
/* Message buffer. */
|
|
|
|
struct
|
2002-02-17 22:54:39 +00:00
|
|
|
{
|
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
2005-12-29 10:51:20 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
mig_reply_header_t header;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
mach_msg_header_t Head;
|
2023-05-04 04:06:46 +00:00
|
|
|
mach_msg_type_t RetCodeType;
|
2005-12-29 10:51:20 +00:00
|
|
|
kern_return_t RetCode;
|
|
|
|
} header_typecheck;
|
|
|
|
};
|
2019-02-26 15:01:50 +00:00
|
|
|
char data[3 * sizeof (mach_msg_type_t)
|
|
|
|
+ msg_align (_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type)))
|
|
|
|
+ msg_align (_IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type)))
|
2023-05-04 04:06:46 +00:00
|
|
|
+ msg_align (_IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type)))];
|
2002-02-17 22:54:39 +00:00
|
|
|
#else /* Untyped Mach IPC format. */
|
|
|
|
mig_reply_error_t header;
|
2019-02-26 15:01:50 +00:00
|
|
|
char data[_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type))
|
|
|
|
+ _IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type))
|
|
|
|
+ _IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type))];
|
2002-02-17 22:54:39 +00:00
|
|
|
mach_msg_trailer_t trailer;
|
|
|
|
#endif
|
|
|
|
} msg;
|
1995-02-18 01:27:10 +00:00
|
|
|
mach_msg_header_t *const m = &msg.header.Head;
|
|
|
|
mach_msg_id_t msgid;
|
|
|
|
unsigned int reply_size;
|
2002-02-17 22:54:39 +00:00
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
|
|
|
mach_msg_type_t *t;
|
|
|
|
#else
|
|
|
|
void *p;
|
|
|
|
#endif
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2012-05-10 20:26:40 +00:00
|
|
|
void *arg = NULL;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
error_t err;
|
|
|
|
|
|
|
|
/* Send the RPC already packed up in MSG to IOPORT
|
|
|
|
and decode the return value. */
|
|
|
|
error_t send_rpc (io_t ioport)
|
|
|
|
{
|
|
|
|
error_t err;
|
2002-02-17 22:54:39 +00:00
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
1999-03-08 21:01:20 +00:00
|
|
|
mach_msg_type_t *t = &msg.header.RetCodeType;
|
2002-02-17 22:54:39 +00:00
|
|
|
#else
|
|
|
|
void *p = &msg.header.RetCode;
|
|
|
|
#endif
|
1999-03-08 21:01:20 +00:00
|
|
|
|
|
|
|
/* Marshal the request arguments into the message buffer.
|
|
|
|
We must redo this work each time we retry the RPC after a SIGTTOU,
|
|
|
|
because the reply message containing the EBACKGROUND error code
|
|
|
|
clobbers the same message buffer also used for the request. */
|
|
|
|
|
|
|
|
if (_IOC_INOUT (request) & IOC_IN)
|
|
|
|
{
|
2000-12-07 00:05:30 +00:00
|
|
|
/* We don't want to advance ARG since it will be used to copy out
|
2012-05-10 20:26:40 +00:00
|
|
|
too if IOC_OUT is also set. */
|
2000-12-07 00:05:30 +00:00
|
|
|
void *argptr = arg;
|
2021-02-01 18:39:48 +00:00
|
|
|
int zero = 0;
|
|
|
|
|
2021-02-01 19:00:18 +00:00
|
|
|
if (request == TIOCFLUSH && !argptr)
|
|
|
|
argptr = &zero;
|
2000-12-07 00:05:30 +00:00
|
|
|
|
1999-03-08 21:01:20 +00:00
|
|
|
/* Pack an argument into the message buffer. */
|
|
|
|
void in (unsigned int count, enum __ioctl_datum type)
|
|
|
|
{
|
|
|
|
if (count > 0)
|
|
|
|
{
|
|
|
|
const size_t len = count * typesize ((unsigned int) type);
|
2002-02-17 22:54:39 +00:00
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
|
|
|
void *p = &t[1];
|
1999-03-08 21:01:20 +00:00
|
|
|
*t = io2mach_type (count, type);
|
2000-12-07 00:05:30 +00:00
|
|
|
p = __mempcpy (p, argptr, len);
|
2023-05-04 04:06:46 +00:00
|
|
|
p = (void *) msg_align ((uintptr_t) p);
|
1999-03-08 21:01:20 +00:00
|
|
|
t = p;
|
2002-02-17 22:54:39 +00:00
|
|
|
#else
|
|
|
|
p = __mempcpy (p, argptr, len);
|
|
|
|
#endif
|
|
|
|
argptr += len;
|
1999-03-08 21:01:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Pack the argument data. */
|
|
|
|
in (_IOT_COUNT0 (type), _IOT_TYPE0 (type));
|
|
|
|
in (_IOT_COUNT1 (type), _IOT_TYPE1 (type));
|
|
|
|
in (_IOT_COUNT2 (type), _IOT_TYPE2 (type));
|
|
|
|
}
|
2012-05-10 20:26:40 +00:00
|
|
|
else if (_IOC_INOUT (request) == IOC_VOID && _IOT_COUNT0 (type) != 0)
|
1999-03-08 21:01:20 +00:00
|
|
|
{
|
|
|
|
/* The RPC takes a single integer_t argument.
|
|
|
|
Rather than pointing to the value, ARG is the value itself. */
|
2002-02-17 22:54:39 +00:00
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
2002-05-29 08:10:07 +00:00
|
|
|
*t++ = io2mach_type (1, _IOTS (integer_t));
|
2023-03-19 15:09:55 +00:00
|
|
|
*(integer_t *) t = (integer_t) (intptr_t) arg;
|
2023-05-04 04:06:46 +00:00
|
|
|
t = (void *) msg_align ((uintptr_t) t + sizeof (integer_t));
|
2002-02-17 22:54:39 +00:00
|
|
|
#else
|
2023-03-19 15:09:55 +00:00
|
|
|
*(integer_t *) p = (integer_t) (intptr_t) arg;
|
2005-10-23 00:43:15 +00:00
|
|
|
p = (void *) p + sizeof (integer_t);
|
2002-02-17 22:54:39 +00:00
|
|
|
#endif
|
1999-03-08 21:01:20 +00:00
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2002-02-17 22:54:39 +00:00
|
|
|
memset (m, 0, sizeof *m); /* Clear unused fields. */
|
|
|
|
m->msgh_size = (
|
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
|
|
|
(char *) t
|
|
|
|
#else
|
|
|
|
(char *) p
|
|
|
|
#endif
|
|
|
|
- (char *) &msg);
|
1995-02-18 01:27:10 +00:00
|
|
|
m->msgh_remote_port = ioport;
|
|
|
|
m->msgh_local_port = __mig_get_reply_port ();
|
|
|
|
m->msgh_id = msgid;
|
|
|
|
m->msgh_bits = MACH_MSGH_BITS (MACH_MSG_TYPE_COPY_SEND,
|
|
|
|
MACH_MSG_TYPE_MAKE_SEND_ONCE);
|
1995-08-14 22:49:23 +00:00
|
|
|
err = _hurd_intr_rpc_mach_msg (m, MACH_SEND_MSG|MACH_RCV_MSG,
|
|
|
|
m->msgh_size, sizeof (msg),
|
|
|
|
m->msgh_local_port,
|
|
|
|
MACH_MSG_TIMEOUT_NONE,
|
|
|
|
MACH_PORT_NULL);
|
1995-02-18 01:27:10 +00:00
|
|
|
switch (err)
|
|
|
|
{
|
|
|
|
case MACH_MSG_SUCCESS:
|
|
|
|
break;
|
|
|
|
case MACH_SEND_INVALID_REPLY:
|
|
|
|
case MACH_RCV_INVALID_NAME:
|
|
|
|
__mig_dealloc_reply_port (m->msgh_local_port);
|
2019-02-26 02:09:18 +00:00
|
|
|
/* Fall through. */
|
1995-02-18 01:27:10 +00:00
|
|
|
default:
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((m->msgh_bits & MACH_MSGH_BITS_COMPLEX))
|
|
|
|
{
|
|
|
|
/* Allow no ports or VM. */
|
|
|
|
__mach_msg_destroy (m);
|
|
|
|
/* Want to return a different error below for a different msgid. */
|
|
|
|
if (m->msgh_id == msgid + 100)
|
|
|
|
return MIG_TYPE_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m->msgh_id != msgid + 100)
|
2019-02-26 15:01:50 +00:00
|
|
|
return (m->msgh_id == MACH_NOTIFY_SEND_ONCE
|
|
|
|
? MIG_SERVER_DIED : MIG_REPLY_MISMATCH);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2019-02-26 15:01:50 +00:00
|
|
|
if (m->msgh_size != reply_size
|
|
|
|
&& m->msgh_size != sizeof msg.header)
|
1995-02-18 01:27:10 +00:00
|
|
|
return MIG_TYPE_ERROR;
|
|
|
|
|
2002-02-17 22:54:39 +00:00
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
2023-05-04 04:06:46 +00:00
|
|
|
mach_msg_type_t ipctype = io2mach_type(1, _IOTS (msg.header.RetCode));
|
|
|
|
if (BAD_TYPECHECK (&msg.header_typecheck.RetCodeType, &ipctype))
|
1995-02-18 01:27:10 +00:00
|
|
|
return MIG_TYPE_ERROR;
|
2002-02-17 22:54:39 +00:00
|
|
|
#endif
|
1995-02-18 01:27:10 +00:00
|
|
|
return msg.header.RetCode;
|
|
|
|
}
|
|
|
|
|
2012-05-10 20:26:40 +00:00
|
|
|
if (_IOT_COUNT0 (type) != 0)
|
|
|
|
{
|
|
|
|
/* Data need either be sent, received, or even both. */
|
|
|
|
va_list ap;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2012-05-10 20:26:40 +00:00
|
|
|
va_start (ap, request);
|
|
|
|
arg = va_arg (ap, void *);
|
|
|
|
va_end (ap);
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
/* Check for a registered handler for REQUEST. */
|
|
|
|
ioctl_handler_t handler = _hurd_lookup_ioctl_handler (request);
|
|
|
|
if (handler)
|
1996-02-16 02:19:52 +00:00
|
|
|
{
|
|
|
|
/* This handler groks REQUEST. Se lo puntamonos. */
|
|
|
|
int save = errno;
|
|
|
|
int result = (*handler) (fd, request, arg);
|
|
|
|
if (result != -1 || errno != ENOTTY)
|
|
|
|
return result;
|
|
|
|
|
|
|
|
/* The handler doesn't really grok this one.
|
|
|
|
Try the normal RPC translation. */
|
|
|
|
errno = save;
|
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Compute the Mach message ID for the RPC from the group and command
|
|
|
|
parts of the ioctl request. */
|
1999-01-25 08:42:15 +00:00
|
|
|
msgid = IOC_MSGID (request);
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
/* Compute the expected size of the reply. There is a standard header
|
|
|
|
consisting of the message header and the reply code. Then, for out
|
|
|
|
and in/out ioctls, there come the data with their type headers. */
|
2002-02-17 22:54:39 +00:00
|
|
|
reply_size = sizeof msg.header;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
if (_IOC_INOUT (request) & IOC_OUT)
|
|
|
|
{
|
|
|
|
inline void figure_reply (unsigned int count, enum __ioctl_datum type)
|
|
|
|
{
|
|
|
|
if (count > 0)
|
|
|
|
{
|
2002-02-17 22:54:39 +00:00
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
1995-02-18 01:27:10 +00:00
|
|
|
/* Add the size of the type and data. */
|
|
|
|
reply_size += sizeof (mach_msg_type_t) + typesize (type) * count;
|
|
|
|
/* Align it to word size. */
|
2023-05-04 04:06:46 +00:00
|
|
|
reply_size = msg_align (reply_size);
|
2002-02-17 22:54:39 +00:00
|
|
|
#else
|
|
|
|
reply_size += typesize (type) * count;
|
|
|
|
#endif
|
1995-02-18 01:27:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
figure_reply (_IOT_COUNT0 (type), _IOT_TYPE0 (type));
|
|
|
|
figure_reply (_IOT_COUNT1 (type), _IOT_TYPE1 (type));
|
|
|
|
figure_reply (_IOT_COUNT2 (type), _IOT_TYPE2 (type));
|
|
|
|
}
|
|
|
|
|
1999-03-08 21:01:20 +00:00
|
|
|
/* Marshal the arguments into the request message and make the RPC.
|
|
|
|
This wrapper function handles EBACKGROUND returns, turning them
|
|
|
|
into either SIGTTOU or EIO. */
|
2020-06-28 22:41:18 +00:00
|
|
|
if (request == TIOCDRAIN)
|
|
|
|
{
|
|
|
|
/* This is a cancellation point. */
|
|
|
|
int cancel_oldtype = LIBC_CANCEL_ASYNC();
|
|
|
|
err = HURD_DPORT_USE_CANCEL (fd, _hurd_ctty_output (port, ctty, send_rpc));
|
|
|
|
LIBC_CANCEL_RESET (cancel_oldtype);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
err = HURD_DPORT_USE (fd, _hurd_ctty_output (port, ctty, send_rpc));
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2002-02-17 22:54:39 +00:00
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
1995-02-18 01:27:10 +00:00
|
|
|
t = (mach_msg_type_t *) msg.data;
|
2002-02-17 22:54:39 +00:00
|
|
|
#else
|
|
|
|
p = (void *) msg.data;
|
|
|
|
#endif
|
1995-02-18 01:27:10 +00:00
|
|
|
switch (err)
|
|
|
|
{
|
|
|
|
/* Unpack the message buffer into the argument location. */
|
|
|
|
int out (unsigned int count, unsigned int type,
|
|
|
|
void *store, void **update)
|
|
|
|
{
|
|
|
|
if (count > 0)
|
|
|
|
{
|
|
|
|
const size_t len = count * typesize (type);
|
2002-02-17 22:54:39 +00:00
|
|
|
#ifdef MACH_MSG_TYPE_BIT
|
2023-05-04 04:06:46 +00:00
|
|
|
const mach_msg_type_t ipctype = io2mach_type(count, type);
|
|
|
|
if (BAD_TYPECHECK (t, &ipctype))
|
1995-02-18 01:27:10 +00:00
|
|
|
return 1;
|
|
|
|
++t;
|
|
|
|
memcpy (store, t, len);
|
|
|
|
if (update != NULL)
|
|
|
|
*update += len;
|
2023-05-04 04:06:46 +00:00
|
|
|
t = (mach_msg_type_t *) msg_align ((uintptr_t) t + len);
|
2002-02-17 22:54:39 +00:00
|
|
|
#else
|
|
|
|
memcpy (store, p, len);
|
|
|
|
p += len;
|
|
|
|
if (update != NULL)
|
|
|
|
*update += len;
|
|
|
|
#endif
|
1995-02-18 01:27:10 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0:
|
2019-02-26 15:01:50 +00:00
|
|
|
if (m->msgh_size != reply_size
|
|
|
|
|| ((_IOC_INOUT (request) & IOC_OUT)
|
|
|
|
&& (out (_IOT_COUNT0 (type), _IOT_TYPE0 (type), arg, &arg)
|
|
|
|
|| out (_IOT_COUNT1 (type), _IOT_TYPE1 (type), arg, &arg)
|
|
|
|
|| out (_IOT_COUNT2 (type), _IOT_TYPE2 (type), arg, &arg))))
|
1995-02-18 01:27:10 +00:00
|
|
|
return __hurd_fail (MIG_TYPE_ERROR);
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case MIG_BAD_ID:
|
|
|
|
case EOPNOTSUPP:
|
|
|
|
/* The server didn't understand the RPC. */
|
|
|
|
err = ENOTTY;
|
2019-02-26 02:09:18 +00:00
|
|
|
/* Fall through. */
|
1995-02-18 01:27:10 +00:00
|
|
|
default:
|
|
|
|
return __hurd_fail (err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-01 22:58:52 +00:00
|
|
|
libc_hidden_def (__ioctl)
|
1995-02-18 01:27:10 +00:00
|
|
|
weak_alias (__ioctl, ioctl)
|