QNX 6.3.0 gcc 3.3.1

git-svn-id: svn://db.shs.com.ru/pip@212 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2016-07-26 13:08:49 +00:00
parent 4c30988c77
commit d951871dec
4 changed files with 46 additions and 22 deletions

View File

@@ -268,24 +268,32 @@ PIVector<PIFile::FileInfo> PIDir::entries() {
}
#else
# ifdef QNX
struct dirent * de = 0;
DIR * dir = 0;
dir = opendir(p.data());
if (dir) {
for (;;) {
de = readdir(dir);
if (!de) break;
l << PIFile::fileInfo(dp + PIString(de->d_name));
}
closedir(dir);
}
# else
dirent ** list;
int cnt = scandir(
# ifndef QNX
p.data(), &list
# else
const_cast<char*>(p.data()), 0
# endif
, 0,
# if defined(MAC_OS) || defined(ANDROID) || defined(BLACKBERRY)
int cnt = scandir(p.data(), &list, 0,
# if defined(MAC_OS) || defined(ANDROID) || defined(BLACKBERRY) || defined(QNX)
alphasort);
# else
# else
versionsort);
# endif
# endif
for (int i = 0; i < cnt; ++i) {
l << PIFile::fileInfo(dp + PIString(list[i]->d_name));
free(list[i]);
}
free(list);
# endif
#endif
// piCout << "end entries from" << p;
return l;

View File

@@ -21,8 +21,18 @@
#include "piconfig.h"
#include "pisysteminfo.h"
#ifdef QNX
# include <net/if.h>
# include <net/if_dl.h>
# include <hw/nicinfo.h>
# include <netdb.h>
# include <sys/socket.h>
# include <sys/time.h>
# include <sys/types.h>
# include <sys/ioctl.h>
# include <netinet/in.h>
# include <arpa/inet.h>
# include <ifaddrs.h>
# include <fcntl.h>
# ifdef BLACKBERRY
# include <netinet/in.h>
# else
@@ -304,14 +314,14 @@ void PIEthernet::applyTimeout(int fd, int opt, double ms) {
if (fd == 0) return;
//piCoutObj << "setReadIsBlocking" << yes;
#ifdef WINDOWS
DWORD tm = ms;
DWORD _tm = ms;
#else
double s = ms / 1000.;
timeval tm;
tm.tv_sec = piFloord(s); s -= tm.tv_sec;
tm.tv_usec = s * 1000000.;
timeval _tm;
_tm.tv_sec = piFloord(s); s -= _tm.tv_sec;
_tm.tv_usec = s * 1000000.;
#endif
ethSetsockopt(fd, SOL_SOCKET, opt, &tm, sizeof(tm));
ethSetsockopt(fd, SOL_SOCKET, opt, &_tm, sizeof(_tm));
}