Explorar el Código

Minor fixes to perftest for other OSes.

I compiled perftest manually on Ubuntu, and ran into a couple compile
errors. Also, perftest doesn't need to link directly against libminocaos.
Evan Green hace 7 años
padre
commit
385064f7ff

+ 0 - 2
apps/testapps/perftest/Makefile

@@ -54,8 +54,6 @@ OBJS = copy.o     \
        stat.o     \
        write.o    \
 
-DYNLIBS = -lminocaos
-
 DIRS = perflib
 
 include $(SRCROOT)/os/minoca.mk

+ 1 - 6
apps/testapps/perftest/build.ck

@@ -29,7 +29,6 @@ from menv import application, sharedLibrary;
 
 function build() {
     var app;
-    var dynlibs;
     var entries;
     var includes;
     var libSources;
@@ -63,17 +62,13 @@ function build() {
         "perflib/perflib.c"
     ];
 
-    dynlibs = [
-        "apps/osbase:libminocaos"
-    ];
-
     includes = [
         "$S/apps/libc/include"
     ];
 
     app = {
         "label": "perftest",
-        "inputs": sources + dynlibs,
+        "inputs": sources,
         "orderonly": [":perflib"],
         "includes": includes
     };

+ 1 - 0
apps/testapps/perftest/create.c

@@ -32,6 +32,7 @@ Environment:
 
 #include <stdio.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <unistd.h>
 

+ 6 - 1
apps/testapps/perftest/dlopen.c

@@ -193,8 +193,13 @@ Return Value:
     //
 
     while (PtIsTimedTestRunning() != 0) {
-        Handle = dlopen(LibraryName, 0);
+        Handle = dlopen(LibraryName, RTLD_NOW | RTLD_GLOBAL);
         if (Handle == NULL) {
+            fprintf(stderr,
+                    "Failed to open %s: %s\n",
+                    LibraryName,
+                    dlerror());
+
             Result->Status = ENOENT;
             break;
         }

+ 2 - 1
apps/testapps/perftest/exec.c

@@ -34,9 +34,10 @@ Environment:
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/wait.h>
+#include <time.h>
 #include <unistd.h>
-#include <string.h>
 
 #include "perftest.h"
 

+ 2 - 1
apps/testapps/perftest/rename.c

@@ -30,9 +30,10 @@ Environment:
 // ------------------------------------------------------------------- Includes
 //
 
+#include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <errno.h>
 #include <sys/stat.h>
 #include <unistd.h>
 

+ 1 - 0
apps/testapps/perftest/stat.c

@@ -31,6 +31,7 @@ Environment:
 //
 
 #include <errno.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include <stdio.h>

+ 2 - 1
apps/testapps/perftest/write.c

@@ -30,9 +30,10 @@ Environment:
 // ------------------------------------------------------------------- Includes
 //
 
+#include <errno.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <errno.h>
 #include <sys/stat.h>
 #include <unistd.h>