Changeset 185 for trunk/src


Ignore:
Timestamp:
May 19, 2003, 1:59:07 PM (22 years ago)
Author:
bird
Message:

#434: switch on lower word of the request number to support new and old defines.

Location:
trunk/src/emx/src/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/io/ioctl.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r184 r185  
    1111#include <emx/syscalls.h>
    1212
    13 /* Including the socket header files would be overkill. */
     13/** Get the low word of the ioctl request number.
     14 * Used to support ioctl request numbers from old and new _IOC macros.
     15 */
     16#define __IOCLW(a) ((unsigned short)(a))
    1417
    15 #define FIONBIO         0x667e
    1618
    1719int _STD(ioctl) (int handle, int request, ...)
     
    3234  rc = __ioctl2 (handle, request, arg);
    3335  if (rc >= 0 && errno == 0)
    34     switch (request)
     36    switch (__IOCLW(request))
    3537      {
    36       case TCSETAF:
    37       case TCSETAW:
    38       case TCSETA:
     38      case __IOCLW(TCSETAF):
     39      case __IOCLW(TCSETAW):
     40      case __IOCLW(TCSETA):
    3941        va_start (va, request);
    4042        tp = va_arg (va, const struct termio *);
     
    4648        break;
    4749
    48       case _TCSANOW:
    49       case _TCSADRAIN:
    50       case _TCSAFLUSH:
     50      case __IOCLW(_TCSANOW):
     51      case __IOCLW(_TCSADRAIN):
     52      case __IOCLW(_TCSAFLUSH):
    5153        *pflags |= F_TERMIO;
    5254        break;
    5355
    54       case FIONREAD:
     56      case __IOCLW(FIONREAD):
    5557        if ((pla = _fd_lookahead (handle)) != NULL && *pla >= 0)
    5658          {
     
    6264        break;
    6365
    64       case FIONBIO:
     66      case __IOCLW(FIONBIO):
    6567        va_start (va, request);
    6668        int_ptr = va_arg (va, int *);
  • trunk/src/emx/src/lib/sys/__ioctl2.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r184 r185  
    99#include "syscalls.h"
    1010
     11/** Get the low word of the ioctl request number.
     12 * Used to support ioctl request numbers from old and new _IOC macros.
     13 */
     14#define __IOCLW(a) ((unsigned short)(a))
     15
    1116int __ioctl2 (int handle, int request, int arg)
    1217{
     
    1520  int *int_ptr;
    1621
    17   switch (request)
     22  switch (__IOCLW(request))
    1823    {
    19     case FGETHTYPE:
     24    case __IOCLW(FGETHTYPE):
    2025      int_ptr = (int *)arg;
    2126      rc = DosQueryHType (handle, &type, &flags);
Note: See TracChangeset for help on using the changeset viewer.