Portability fixes.
This commit is contained in:
parent
34909c206c
commit
c3e06df941
|
@ -10931,6 +10931,8 @@ done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10971,6 +10973,7 @@ for ac_header in \
|
||||||
sys/file.h \
|
sys/file.h \
|
||||||
sys/filio.h \
|
sys/filio.h \
|
||||||
sys/inttypes.h \
|
sys/inttypes.h \
|
||||||
|
sys/ioctl.h \
|
||||||
sys/ipc.h \
|
sys/ipc.h \
|
||||||
sys/link.h \
|
sys/link.h \
|
||||||
sys/lwp.h \
|
sys/lwp.h \
|
||||||
|
@ -10997,6 +11000,7 @@ for ac_header in \
|
||||||
sys/vm86.h \
|
sys/vm86.h \
|
||||||
sys/wait.h \
|
sys/wait.h \
|
||||||
syscall.h \
|
syscall.h \
|
||||||
|
termios.h \
|
||||||
ucontext.h \
|
ucontext.h \
|
||||||
unistd.h \
|
unistd.h \
|
||||||
|
|
||||||
|
|
|
@ -968,6 +968,7 @@ AC_CHECK_HEADERS(\
|
||||||
sys/file.h \
|
sys/file.h \
|
||||||
sys/filio.h \
|
sys/filio.h \
|
||||||
sys/inttypes.h \
|
sys/inttypes.h \
|
||||||
|
sys/ioctl.h \
|
||||||
sys/ipc.h \
|
sys/ipc.h \
|
||||||
sys/link.h \
|
sys/link.h \
|
||||||
sys/lwp.h \
|
sys/lwp.h \
|
||||||
|
@ -994,6 +995,7 @@ AC_CHECK_HEADERS(\
|
||||||
sys/vm86.h \
|
sys/vm86.h \
|
||||||
sys/wait.h \
|
sys/wait.h \
|
||||||
syscall.h \
|
syscall.h \
|
||||||
|
termios.h \
|
||||||
ucontext.h \
|
ucontext.h \
|
||||||
unistd.h \
|
unistd.h \
|
||||||
)
|
)
|
||||||
|
|
|
@ -54,7 +54,9 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#ifdef HAVE_TERMIOS_H
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef HAVE_STRINGS_H
|
#ifdef HAVE_STRINGS_H
|
||||||
|
@ -66,7 +68,9 @@
|
||||||
#ifdef HAVE_SYS_FILIO_H
|
#ifdef HAVE_SYS_FILIO_H
|
||||||
# include <sys/filio.h>
|
# include <sys/filio.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/poll.h>
|
#include <sys/poll.h>
|
||||||
#ifdef HAVE_SYS_MODEM_H
|
#ifdef HAVE_SYS_MODEM_H
|
||||||
|
@ -145,12 +149,16 @@ static void commio_async_cleanup (async_private *ovp)
|
||||||
|
|
||||||
static int COMM_WhackModem(int fd, unsigned int andy, unsigned int orrie)
|
static int COMM_WhackModem(int fd, unsigned int andy, unsigned int orrie)
|
||||||
{
|
{
|
||||||
|
#ifdef TIOCMGET
|
||||||
unsigned int mstat, okay;
|
unsigned int mstat, okay;
|
||||||
okay = ioctl(fd, TIOCMGET, &mstat);
|
okay = ioctl(fd, TIOCMGET, &mstat);
|
||||||
if (okay) return okay;
|
if (okay) return okay;
|
||||||
if (andy) mstat &= andy;
|
if (andy) mstat &= andy;
|
||||||
mstat |= orrie;
|
mstat |= orrie;
|
||||||
return ioctl(fd, TIOCMSET, &mstat);
|
return ioctl(fd, TIOCMSET, &mstat);
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -34,7 +34,9 @@
|
||||||
#ifdef HAVE_SYS_FILE_H
|
#ifdef HAVE_SYS_FILE_H
|
||||||
# include <sys/file.h>
|
# include <sys/file.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/ioctl.h>
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
|
# include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -27,19 +27,12 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "ntddk.h"
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
#include "winioctl.h"
|
#include <sys/ioctl.h>
|
||||||
#include "ntddstor.h"
|
#endif
|
||||||
#include "ntddcdrm.h"
|
|
||||||
#include "ntddscsi.h"
|
|
||||||
#include "drive.h"
|
|
||||||
#include "file.h"
|
|
||||||
#include "wine/debug.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_SCSI_SG_H
|
#ifdef HAVE_SCSI_SG_H
|
||||||
# include <scsi/sg.h>
|
# include <scsi/sg.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -62,8 +55,44 @@
|
||||||
# include <sys/cdio.h>
|
# include <sys/cdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "ntddk.h"
|
||||||
|
#include "winioctl.h"
|
||||||
|
#include "ntddstor.h"
|
||||||
|
#include "ntddcdrm.h"
|
||||||
|
#include "ntddscsi.h"
|
||||||
|
#include "drive.h"
|
||||||
|
#include "file.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(cdrom);
|
WINE_DEFAULT_DEBUG_CHANNEL(cdrom);
|
||||||
|
|
||||||
|
#ifdef linux
|
||||||
|
|
||||||
|
# ifndef IDE6_MAJOR
|
||||||
|
# define IDE6_MAJOR 88
|
||||||
|
# endif
|
||||||
|
# ifndef IDE7_MAJOR
|
||||||
|
# define IDE7_MAJOR 89
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* structure for CDROM_PACKET_COMMAND ioctl */
|
||||||
|
/* not all Linux versions have all the fields, so we define the
|
||||||
|
* structure ourselves to make sure */
|
||||||
|
struct linux_cdrom_generic_command
|
||||||
|
{
|
||||||
|
unsigned char cmd[CDROM_PACKET_SIZE];
|
||||||
|
unsigned char *buffer;
|
||||||
|
unsigned int buflen;
|
||||||
|
int stat;
|
||||||
|
struct request_sense *sense;
|
||||||
|
unsigned char data_direction;
|
||||||
|
int quiet;
|
||||||
|
int timeout;
|
||||||
|
void *reserved[1];
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* linux */
|
||||||
|
|
||||||
/* FIXME: this is needed because we can't open simultaneously several times /dev/cdrom
|
/* FIXME: this is needed because we can't open simultaneously several times /dev/cdrom
|
||||||
* this should be removed when a proper device interface is implemented
|
* this should be removed when a proper device interface is implemented
|
||||||
*/
|
*/
|
||||||
|
@ -1036,7 +1065,7 @@ static DWORD CDROM_ScsiPassThroughDirect(int dev, PSCSI_PASS_THROUGH_DIRECT pPac
|
||||||
{
|
{
|
||||||
int ret = STATUS_NOT_SUPPORTED;
|
int ret = STATUS_NOT_SUPPORTED;
|
||||||
#if defined(linux)
|
#if defined(linux)
|
||||||
struct cdrom_generic_command cmd;
|
struct linux_cdrom_generic_command cmd;
|
||||||
struct request_sense sense;
|
struct request_sense sense;
|
||||||
int io;
|
int io;
|
||||||
|
|
||||||
|
@ -1073,7 +1102,6 @@ static DWORD CDROM_ScsiPassThroughDirect(int dev, PSCSI_PASS_THROUGH_DIRECT pPac
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
io = ioctl(dev, CDROM_SEND_PACKET, &cmd);
|
io = ioctl(dev, CDROM_SEND_PACKET, &cmd);
|
||||||
|
@ -1100,7 +1128,7 @@ static DWORD CDROM_ScsiPassThrough(int dev, PSCSI_PASS_THROUGH pPacket)
|
||||||
{
|
{
|
||||||
int ret = STATUS_NOT_SUPPORTED;
|
int ret = STATUS_NOT_SUPPORTED;
|
||||||
#if defined(linux)
|
#if defined(linux)
|
||||||
struct cdrom_generic_command cmd;
|
struct linux_cdrom_generic_command cmd;
|
||||||
struct request_sense sense;
|
struct request_sense sense;
|
||||||
int io;
|
int io;
|
||||||
|
|
||||||
|
@ -1144,7 +1172,6 @@ static DWORD CDROM_ScsiPassThrough(int dev, PSCSI_PASS_THROUGH pPacket)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
io = ioctl(dev, CDROM_SEND_PACKET, &cmd);
|
io = ioctl(dev, CDROM_SEND_PACKET, &cmd);
|
||||||
|
|
|
@ -40,7 +40,9 @@
|
||||||
#ifdef HAVE_SYS_FILE_H
|
#ifdef HAVE_SYS_FILE_H
|
||||||
# include <sys/file.h>
|
# include <sys/file.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/ioctl.h>
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
|
# include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
# include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -440,6 +440,9 @@
|
||||||
/* Define to 1 if you have the <sys/inttypes.h> header file. */
|
/* Define to 1 if you have the <sys/inttypes.h> header file. */
|
||||||
#undef HAVE_SYS_INTTYPES_H
|
#undef HAVE_SYS_INTTYPES_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||||
|
#undef HAVE_SYS_IOCTL_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/ipc.h> header file. */
|
/* Define to 1 if you have the <sys/ipc.h> header file. */
|
||||||
#undef HAVE_SYS_IPC_H
|
#undef HAVE_SYS_IPC_H
|
||||||
|
|
||||||
|
@ -527,6 +530,9 @@
|
||||||
/* Define to 1 if you have the `tcgetattr' function. */
|
/* Define to 1 if you have the `tcgetattr' function. */
|
||||||
#undef HAVE_TCGETATTR
|
#undef HAVE_TCGETATTR
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <termios.h> header file. */
|
||||||
|
#undef HAVE_TERMIOS_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `timegm' function. */
|
/* Define to 1 if you have the `timegm' function. */
|
||||||
#undef HAVE_TIMEGM
|
#undef HAVE_TIMEGM
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,7 @@ static void fixup_resources( IMAGE_RESOURCE_DIRECTORY *dir, char *root, void *ba
|
||||||
/* map a builtin dll in memory and fixup RVAs */
|
/* map a builtin dll in memory and fixup RVAs */
|
||||||
static void *map_dll( const IMAGE_NT_HEADERS *nt_descr )
|
static void *map_dll( const IMAGE_NT_HEADERS *nt_descr )
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_MMAP
|
||||||
IMAGE_DATA_DIRECTORY *dir;
|
IMAGE_DATA_DIRECTORY *dir;
|
||||||
IMAGE_DOS_HEADER *dos;
|
IMAGE_DOS_HEADER *dos;
|
||||||
IMAGE_NT_HEADERS *nt;
|
IMAGE_NT_HEADERS *nt;
|
||||||
|
@ -292,6 +293,9 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr )
|
||||||
fixup_rva_ptrs( &exports->AddressOfNameOrdinals, addr, 1 );
|
fixup_rva_ptrs( &exports->AddressOfNameOrdinals, addr, 1 );
|
||||||
}
|
}
|
||||||
return addr;
|
return addr;
|
||||||
|
#else /* HAVE_MMAP */
|
||||||
|
return NULL;
|
||||||
|
#endif /* HAVE_MMAP */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,10 +40,14 @@
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#ifdef HAVE_TERMIOS_H
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_SYS_MMAN_H
|
#ifdef HAVE_SYS_MMAN_H
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,7 +65,7 @@
|
||||||
* usleep
|
* usleep
|
||||||
*/
|
*/
|
||||||
#ifndef HAVE_USLEEP
|
#ifndef HAVE_USLEEP
|
||||||
unsigned int usleep (unsigned int useconds)
|
int usleep (unsigned int useconds)
|
||||||
{
|
{
|
||||||
#if defined(__EMX__)
|
#if defined(__EMX__)
|
||||||
DosSleep(useconds);
|
DosSleep(useconds);
|
||||||
|
@ -474,6 +478,7 @@ static int try_mmap_fixed (void *addr, size_t len, int prot, int flags,
|
||||||
*/
|
*/
|
||||||
void *wine_anon_mmap( void *start, size_t size, int prot, int flags )
|
void *wine_anon_mmap( void *start, size_t size, int prot, int flags )
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_MMAP
|
||||||
static int fdzero = -1;
|
static int fdzero = -1;
|
||||||
|
|
||||||
#ifdef MAP_ANON
|
#ifdef MAP_ANON
|
||||||
|
@ -504,6 +509,9 @@ void *wine_anon_mmap( void *start, size_t size, int prot, int flags )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return mmap( start, size, prot, flags, fdzero, 0 );
|
return mmap( start, size, prot, flags, fdzero, 0 );
|
||||||
|
#else
|
||||||
|
return (void *)-1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue