Changeset 18


Ignore:
Timestamp:
Jun 6, 2009, 9:27:15 PM (11 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib/io: Adopted QFSFileEngine for OS/2 (posix-style).

Location:
trunk
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/mkspecs/os2-g++/qplatformdefs.h

    r17 r18  
    5858// @todo
    5959//#ifdef QT_LARGEFILE_SUPPORT
    60 //#define QT_STATBUF            struct _stati64         // non-ANSI defs
    61 //#define QT_STATBUF4TSTAT      struct _stati64         // non-ANSI defs
    62 //#define QT_STAT                       ::_stati64
    63 //#define QT_FSTAT              ::_fstati64
    64 //#else
     60// provide large file versions of functions?
     61//#endif
    6562#define QT_STATBUF              struct stat
    6663#define QT_STATBUF4TSTAT        struct stat
     
    6865#define QT_FSTAT                ::fstat
    6966#define QT_LSTAT                ::lstat
    70 //#endif
    7167#define QT_STAT_REG             S_IFREG
    7268#define QT_STAT_DIR             S_IFDIR
     
    7773#define QT_FILENO               fileno
    7874#define QT_OPEN                 ::open
     75#define QT_TRUNCATE     ::truncate
     76#define QT_FTRUNCATE    ::ftruncate
    7977#define QT_CLOSE                ::close
    80 #ifdef QT_LARGEFILE_SUPPORT
    81 #define QT_LSEEK                ::lseeki64
    82 #define QT_TSTAT                ::stati64
    83 #else
    8478#define QT_LSEEK                ::lseek
    85 #define QT_TSTAT                ::stat
    86 #endif
    8779#define QT_READ                 ::read
    8880#define QT_WRITE                ::write
     
    10597
    10698#define QT_FOPEN                ::fopen
    107 #ifdef QT_LARGEFILE_SUPPORT
    108 #define QT_FSEEK                ::fseeko64
    109 #define QT_FTELL                ::ftello64
    110 #else
    11199#define QT_FSEEK                ::fseek
    112100#define QT_FTELL                ::ftell
    113 #endif
    114101#define QT_FGETPOS              ::fgetpos
    115102#define QT_FSETPOS              ::fsetpos
    116103#define QT_FPOS_T               fpos_t
    117 #ifdef QT_LARGEFILE_SUPPORT
    118 #define QT_OFF_T                off64_t
    119 #else
    120104#define QT_OFF_T                long
    121 #endif
    122105
    123106#define QT_SIGNAL_ARGS          int
  • trunk/qmake/Makefile.os2-g++

    r16 r18  
    6060        qfsfileengine.obj \
    6161        qfsfileengine_iterator.obj \
    62         qfsfileengine_pm.obj \
    63         qfsfileengine_iterator_pm.obj \
     62        qfsfileengine_os2.obj \
     63        qfsfileengine_iterator_os2.obj \
    6464        qglobal.obj \
    6565        qhash.obj \
     
    220220        $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp
    221221
    222 qfsfileengine_pm.obj: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_pm.cpp
    223         $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_pm.cpp
    224 
    225 qfsfileengine_iterator_pm.obj: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator_pm.cpp
    226         $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator_pm.cpp
     222qfsfileengine_os2.obj: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_os2.cpp
     223        $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_os2.cpp
     224
     225qfsfileengine_iterator_os2.obj: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator_os2.cpp
     226        $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator_os2.cpp
    227227
    228228qfsfileengine.obj: $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
  • trunk/src/corelib/io/io.pri

    r2 r18  
    6060        HEADERS += io/qwindowspipewriter_p.h
    6161        SOURCES += io/qwindowspipewriter.cpp
     62} else:os2 {
     63        SOURCES += io/qsettings_os2.cpp
     64        SOURCES += io/qprocess_os2.cpp
     65        SOURCES += io/qfsfileengine_os2.cpp
     66
     67        SOURCES += io/qfsfileengine_iterator_os2.cpp
     68        SOURCES += io/qfilesystemwatcher_os2.cpp
     69        HEADERS += io/qfilesystemwatcher_os2_p.h
    6270} else:unix {
    6371        SOURCES += io/qfsfileengine_unix.cpp
  • trunk/src/corelib/io/qfsfileengine_iterator_os2.cpp

    r17 r18  
    4444
    4545#include <QtCore/qvariant.h>
     46
     47#include <dirent.h>
     48#include <unistd.h>
    4649
    4750#ifndef QT_NO_FSFILEENGINE
  • trunk/src/corelib/io/qfsfileengine_os2.cpp

    r17 r18  
    5959#include <limits.h>
    6060#include <errno.h>
    61 #if !defined(QWS) && defined(Q_OS_MAC)
    62 # include <private/qcore_mac_p.h>
    63 #endif
     61#include <unistd.h>
     62
     63#include <pwd.h>
     64#include <grp.h>
    6465
    6566QT_BEGIN_NAMESPACE
     
    119120    }
    120121
    121 #ifdef O_CLOEXEC
    122     // supported on Linux >= 2.6.23; avoids one extra system call
    123     // and avoids a race condition: if another thread forks, we could
    124     // end up leaking a file descriptor...
    125     oflags |= O_CLOEXEC;
    126 #endif
    127122    return oflags;
    128123}
     
    178173        }
    179174
    180 #ifndef O_CLOEXEC
    181         // not needed on Linux >= 2.6.23
    182175        setCloseOnExec(fd);     // ignore failure
    183 #endif
    184176
    185177        // Seek to the end when in Append mode.
     
    956948uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags)
    957949{
     950#if 1
     951    // @todo mmap() and friends isn't implemented in kLIBC yet...
     952    return 0;
     953#else
    958954    Q_Q(QFSFileEngine);
    959955    Q_UNUSED(flags);
     
    997993    }
    998994    return 0;
     995#endif
    999996}
    1000997
    1001998bool QFSFileEnginePrivate::unmap(uchar *ptr)
    1002999{
     1000#if 1
     1001    // @todo mmap() and friends isn't implemented in kLIBC yet...
     1002    return false;
     1003#else
    10031004    Q_Q(QFSFileEngine);
    10041005    if (!maps.contains(ptr)) {
     
    10151016    maps.remove(ptr);
    10161017    return true;
     1018#endif
    10171019}
    10181020
  • trunk/src/corelib/io/qfsfileengine_p.h

    r2 r18  
    139139    mutable uint could_stat : 1;
    140140    mutable uint tried_stat : 1;
    141 #ifdef Q_OS_UNIX
     141#if defined(Q_OS_UNIX) || defined(Q_OS_OS2)
    142142    mutable uint need_lstat : 1;
    143143    mutable uint is_link : 1;
Note: See TracChangeset for help on using the changeset viewer.