]> xenbits.xensource.com Git - people/liuw/mini-os.git/commitdiff
stubdom: turn off_t 64bit on x86
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 8 Aug 2008 09:45:30 +0000 (10:45 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 8 Aug 2008 09:45:30 +0000 (10:45 +0100)
We can decide to make off_t 64bit instead of implementing the LFS
tricks.  Name corresponding functions foo64 to permit simple caml
programs linking.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
include/fcntl.h
include/posix/sys/mman.h
include/posix/sys/stat.h [new file with mode: 0644]
lib/sys.c

index 0615790e5329e7844e538f6656dd6c0277941836..cc59b3caa979538fa2aaa7b50e43aaffe2c5485e 100644 (file)
@@ -91,8 +91,9 @@ struct flock64 {
 #define F_LINUX_SPECIFIC_BASE  1024
 */
 
-int open(const char *path, int flags, ...);
-int fcntl(int fd, int cmd, ...);
 #endif
 
+int open(const char *path, int flags, ...) asm("open64");
+int fcntl(int fd, int cmd, ...);
+
 #endif
index 46def46141297e6d30d68beff3d89b1d2379dec3..cfd6586c7f85f91433c166c2d785c7d9cdf3c2eb 100644 (file)
@@ -14,7 +14,7 @@
 
 #define MAP_FAILED     ((void*)0)
 
-void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset);
+void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) asm("mmap64");
 int munmap(void *start, size_t length);
 #define munlock(addr, len) ((void)addr, (void)len, 0)
 #define mlock(addr, len) ((void)addr, (void)len, 0)
diff --git a/include/posix/sys/stat.h b/include/posix/sys/stat.h
new file mode 100644 (file)
index 0000000..0c13bea
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef _POSIX_SYS_STAT_H
+#define _POSIX_SYS_STAT_H
+
+#include_next <sys/stat.h>
+int fstat(int fd, struct stat *buf) asm("fstat64");
+
+#endif /* _POSIX_SYS_STAT_H */
index 457bde3c8d81607ba5e670399d18baa3474ea0fe..7b6de7e6d70ecf015b38c4c52c723d5d3879a90c 100644 (file)
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -204,9 +204,6 @@ int open(const char *pathname, int flags, ...)
     files[fd].file.offset = 0;
     return fd;
 }
-#if defined(__x86_64__) || defined(__ia64__)
-__typeof__(open) open64 __attribute__((__alias__("open")));
-#endif
 
 int isatty(int fd)
 {
@@ -347,9 +344,6 @@ off_t lseek(int fd, off_t offset, int whence)
     }
     return files[fd].file.offset;
 }
-#if defined(__x86_64__) || defined(__ia64__)
-__typeof__(lseek) lseek64 __attribute__((__alias__("lseek")));
-#endif
 
 int fsync(int fd) {
     switch (files[fd].type) {
@@ -1120,9 +1114,6 @@ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset
         return map_frames_ex(&zero, n, 0, 0, 1, DOMID_SELF, 0, 0);
     } else ASSERT(0);
 }
-#if defined(__x86_64__) || defined(__ia64__)
-__typeof__(mmap) mmap64 __attribute__((__alias__("mmap")));
-#endif
 
 int munmap(void *start, size_t length)
 {