Changeset 6568 in vbox
- Timestamp:
- Jan 29, 2008 3:03:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp
r6556 r6568 34 34 #include <iprt/asm.h> 35 35 #include <iprt/string.h> 36 #ifdef VBOX_VBGLR3_XFREE86 37 /* Definitions for X server library functions such as xf86open and mappings to C functions. */ 38 /* Make the headers C++-compatible */ 39 # define class xf86_vbox_class 40 # define bool xf86_vbox_bool 41 # define private xf86_vbox_private 42 # define new xf86_vbox_new 43 extern "C" 44 { 45 # include "xf86.h" 46 # include "xf86_OSproc.h" 47 # include "xf86Resources.h" 48 # include "xf86_ansic.h" 49 } 50 # undef class 51 # undef bool 52 # undef private 53 # undef new 54 #else 55 # include <iprt/file.h> 56 # include <iprt/assert.h> 57 # include <iprt/thread.h> 58 #endif 36 #include <iprt/file.h> 37 #include <iprt/assert.h> 38 #include <iprt/thread.h> 59 39 #include <VBox/VBoxGuest.h> 60 40 #include "VBGLR3Internal.h" 61 41 42 #ifdef VBOX_VBGLR3_XFREE86 43 /* Rather than try to resolve all the header file conflicts, I will just 44 prototype what we need here. */ 45 # define XF86_O_RDWR 0x0002 46 typedef void *pointer; 47 extern int xf86open(const char*, int,...); 48 extern int xf86close(int); 49 extern int xf86ioctl(int, unsigned long, pointer); 50 #endif 62 51 63 52 /******************************************************************************* … … 158 147 159 148 #elif defined(VBOX_VBGLR3_XFREE86) 160 int File = open(VBOXGUEST_DEVICE_NAME,O_RDWR);149 int File = xf86open(VBOXGUEST_DEVICE_NAME, XF86_O_RDWR); 161 150 if (File == -1) 162 151 return VERR_OPEN_FAILED; … … 200 189 201 190 #elif defined(VBOX_VBGLR3_XFREE86) 202 close(File);191 xf86close(File); 203 192 File = -1; 204 193 … … 255 244 /* PORTME - This is preferred over the RTFileIOCtl variant below, just be careful with the (int). */ 256 245 /** @todo test status code passing! */ 257 int rc = ioctl(g_File, (int)iFunction, pvData);246 int rc = xf86ioctl(g_File, iFunction, pvData); 258 247 if (rc == -1) 259 { 260 rc = errno; 261 return RTErrConvertFromErrno(rc); 262 } 248 return VERR_FILE_IO_ERROR; /* This is purely legacy stuff, it has to work and no more. */ 263 249 return VINF_SUCCESS; 264 250
Note:
See TracChangeset
for help on using the changeset viewer.