Usermode/ld-acess - Fixing elf64 support (and x86-64)
[tpg/acess2.git] / Usermode / Libraries / ld-acess.so_src / lib.c
index 28fb467..27d6ff2 100644 (file)
@@ -47,16 +47,26 @@ int strlen(const char *str)
        return len;
 }
 
+int memcmp(const void *p1, const void *p2, int len)
+{
+       const char      *b1 = p1, *b2 = p2;
+       while(len --)
+       {
+               if(b1 != b2)    return b1 - b2;
+       }
+       return 0;
+}
+
 /**
  * \fn int file_exists(char *filename)
  * \brief Checks if a file exists
  */
-int file_exists(char *filename)
+int file_exists(const char *filename)
 {
         int    fd;
-        //fd = open(filename, OPENFLAG_READ);
-        fd = open(filename, 0);
-        if(fd == -1)   return 0;
-        close(fd);
-        return 1;
+       //fd = open(filename, OPENFLAG_READ);
+       fd = open(filename, 0);
+       if(fd == -1)    return 0;
+       close(fd);
+       return 1;
 }

UCC git Repository :: git.ucc.asn.au