* sysdeps/mach/hurd/errno.c: New file.

* sysdeps/mach/hurd/ioctl.c (__ioctl): Use a union to avoid a cast.
This commit is contained in:
Roland McGrath 2005-12-29 10:51:20 +00:00
parent 8ad684db49
commit 1d02865b2d
3 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,9 @@
2005-12-29 Roland McGrath <roland@frob.com> 2005-12-29 Roland McGrath <roland@frob.com>
* sysdeps/mach/hurd/errno.c: New file.
* sysdeps/mach/hurd/ioctl.c (__ioctl): Use a union to avoid a cast.
* sysdeps/posix/libc_fatal.c (__libc_message): Add a const, a cast. * sysdeps/posix/libc_fatal.c (__libc_message): Add a const, a cast.
* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Fix cast. * hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Fix cast.

View File

@ -0,0 +1 @@
/* No definition of `errno' variable on the Hurd. */

View File

@ -58,7 +58,16 @@ __ioctl (int fd, unsigned long int request, ...)
struct struct
{ {
#ifdef MACH_MSG_TYPE_BIT #ifdef MACH_MSG_TYPE_BIT
mig_reply_header_t header; union
{
mig_reply_header_t header;
struct
{
mach_msg_header_t Head;
int RetCodeType;
kern_return_t RetCode;
} header_typecheck;
};
char data[3 * sizeof (mach_msg_type_t) + char data[3 * sizeof (mach_msg_type_t) +
msg_align (_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type))) + msg_align (_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type))) +
msg_align (_IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type))) + msg_align (_IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type))) +
@ -192,7 +201,7 @@ __ioctl (int fd, unsigned long int request, ...)
return MIG_TYPE_ERROR; return MIG_TYPE_ERROR;
#ifdef MACH_MSG_TYPE_BIT #ifdef MACH_MSG_TYPE_BIT
if (*(int *) &msg.header.RetCodeType != if (msg.header_typecheck.RetCodeType !=
((union { mach_msg_type_t t; int i; }) ((union { mach_msg_type_t t; int i; })
{ t: io2mach_type (1, _IOTS (msg.header.RetCode)) }).i) { t: io2mach_type (1, _IOTS (msg.header.RetCode)) }).i)
return MIG_TYPE_ERROR; return MIG_TYPE_ERROR;