gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r11865 - in Extractor/src: include main


From: gnunet
Subject: [GNUnet-SVN] r11865 - in Extractor/src: include main
Date: Tue, 22 Jun 2010 12:10:53 +0200

Author: durner
Date: 2010-06-22 12:10:53 +0200 (Tue, 22 Jun 2010)
New Revision: 11865

Modified:
   Extractor/src/include/plibc.h
   Extractor/src/main/extractor.c
Log:
use plibc sysconf for mmap alignment

Modified: Extractor/src/include/plibc.h
===================================================================
--- Extractor/src/include/plibc.h       2010-06-22 08:16:13 UTC (rev 11864)
+++ Extractor/src/include/plibc.h       2010-06-22 10:10:53 UTC (rev 11865)
@@ -22,7 +22,7 @@
  * @brief PlibC header
  * @attention This file is usually not installed under Unix,
  *            so ship it with your application
- * @version $Revision: 56 $
+ * @version $Revision: 60 $
  */
 
 #ifndef _PLIBC_H_
@@ -51,7 +51,8 @@
 #endif
 
 #include <windows.h>
-#include <Ws2tcpip.h>
+#include <ws2tcpip.h>
+#include <sys/types.h>
 #include <time.h>
 #include <stdio.h>
 #include <sys/types.h>
@@ -70,10 +71,6 @@
 #define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + \
   (double)((x).LowPart))
 
-#define socklen_t int
-#define ssize_t int
-#define off_t int
-
 struct stat64
 {
     _dev_t st_dev;
@@ -89,6 +86,13 @@
     __time64_t st_ctime;
 };
 
+typedef unsigned int sa_family_t;
+
+struct sockaddr_un {
+  short sun_family; /*AF_UNIX*/
+  char sun_path[108]; /*path name */
+};
+
 #ifndef pid_t
        #define pid_t int
 #endif
@@ -105,6 +109,12 @@
   #define MSG_DONTWAIT 0
 #endif
 
+enum
+{
+  _SC_PAGESIZE = 30,
+  _SC_PAGE_SIZE = 30
+};
+
 /* Thanks to the Cygwin project */
 #define ENOCSI 43      /* No CSI structure available */
 #define EL2HLT 44      /* Level 2 halted */
@@ -386,6 +396,7 @@
 int _win_rename(const char *oldname, const char *newname);
 int _win_stat(const char *path, struct stat *buffer);
 int _win_stat64(const char *path, struct stat64 *buffer);
+long _win_sysconf(int name);
 int _win_unlink(const char *filename);
 int _win_write(int fildes, const void *buf, size_t nbyte);
 int _win_read(int fildes, void *buf, size_t nbyte);
@@ -487,6 +498,7 @@
  #define RENAME(o, n) rename(o, n)
  #define STAT(p, b) stat(p, b)
  #define STAT64(p, b) stat64(p, b)
+ #define SYSCONF(n) sysconf(n)
  #define UNLINK(f) unlink(f)
  #define WRITE(f, b, n) write(f, b, n)
  #define READ(f, b, n) read(f, b, n)
@@ -581,6 +593,7 @@
  #define RENAME(o, n) _win_rename(o, n)
  #define STAT(p, b) _win_stat(p, b)
  #define STAT64(p, b) _win_stat64(p, b)
+ #define SYSCONF(n) _win_sysconf(n)
  #define UNLINK(f) _win_unlink(f)
  #define WRITE(f, b, n) _win_write(f, b, n)
  #define READ(f, b, n) _win_read(f, b, n)

Modified: Extractor/src/main/extractor.c
===================================================================
--- Extractor/src/main/extractor.c      2010-06-22 08:16:13 UTC (rev 11864)
+++ Extractor/src/main/extractor.c      2010-06-22 10:10:53 UTC (rev 11865)
@@ -2250,12 +2250,7 @@
        (fstatbuf.st_size > fsize) &&
        (fstatbuf.st_size > MAX_READ) )
     {
-#ifndef WINDOWS
-      pg = sysconf (_SC_PAGE_SIZE);
-#else
-      GetSystemInfo(&sys);
-      pg = sys.dwPageSize;
-#endif
+      pg = SYSCONF (_SC_PAGE_SIZE);
       if ( (pg > 0) &&
           (pg < MAX_READ) )
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]