]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/lfs.h
LibUCW: Entrust generation of ucw/autoconf.h to the configure machinery.
[libucw.git] / ucw / lfs.h
index ede41268691578370d490c229013ac6adc3cd250..593dcf7d727c196e8587ae7162263061fd610d9a 100644 (file)
--- a/ucw/lfs.h
+++ b/ucw/lfs.h
 
 #ifdef CONFIG_LFS
 
 
 #ifdef CONFIG_LFS
 
-#define sh_open open64
-#define sh_seek lseek64
-#define sh_pread pread64
-#define sh_pwrite pwrite64
-#define sh_ftruncate ftruncate64
-#define sh_mmap(a,l,p,f,d,o) mmap64(a,l,p,f,d,o)
-#define sh_pread pread64
-#define sh_pwrite pwrite64
-#define sh_stat stat64
-#define sh_fstat fstat64
-typedef struct stat64 sh_stat_t;
+#define ucw_open open64
+#define ucw_seek lseek64
+#define ucw_pread pread64
+#define ucw_pwrite pwrite64
+#define ucw_ftruncate ftruncate64
+#define ucw_mmap(a,l,p,f,d,o) mmap64(a,l,p,f,d,o)
+#define ucw_pread pread64
+#define ucw_pwrite pwrite64
+#define ucw_stat stat64
+#define ucw_fstat fstat64
+typedef struct stat64 ucw_stat_t;
 
 #else  /* !CONFIG_LFS */
 
 
 #else  /* !CONFIG_LFS */
 
-#define sh_open open
-#define sh_seek(f,o,w) lseek(f,o,w)
-#define sh_ftruncate(f,o) ftruncate(f,o)
-#define sh_mmap(a,l,p,f,d,o) mmap(a,l,p,f,d,o)
-#define sh_pread pread
-#define sh_pwrite pwrite
-#define sh_stat stat
-#define sh_fstat fstat
-typedef struct stat sh_stat_t;
+#define ucw_open open
+#define ucw_seek(f,o,w) lseek(f,o,w)
+#define ucw_ftruncate(f,o) ftruncate(f,o)
+#define ucw_mmap(a,l,p,f,d,o) mmap(a,l,p,f,d,o)
+#define ucw_pread pread
+#define ucw_pwrite pwrite
+#define ucw_stat stat
+#define ucw_fstat fstat
+typedef struct stat ucw_stat_t;
 
 #endif /* !CONFIG_LFS */
 
 #if defined(_POSIX_SYNCHRONIZED_IO) && (_POSIX_SYNCHRONIZED_IO > 0)
 
 #endif /* !CONFIG_LFS */
 
 #if defined(_POSIX_SYNCHRONIZED_IO) && (_POSIX_SYNCHRONIZED_IO > 0)
-#define sh_fdatasync fdatasync
+#define ucw_fdatasync fdatasync
 #else
 #else
-#define sh_fdatasync fsync
+#define ucw_fdatasync fsync
 #endif
 
 #define HAVE_PREAD
 
 #endif
 
 #define HAVE_PREAD
 
-static inline sh_off_t
-sh_file_size(const char *name)
+static inline ucw_off_t
+ucw_file_size(const char *name)
 {
 {
-  int fd = sh_open(name, O_RDONLY);
+  int fd = ucw_open(name, O_RDONLY);
   if (fd < 0)
     die("Cannot open %s: %m", name);
   if (fd < 0)
     die("Cannot open %s: %m", name);
-  sh_off_t len = sh_seek(fd, 0, SEEK_END);
+  ucw_off_t len = ucw_seek(fd, 0, SEEK_END);
   close(fd);
   return len;
 }
   close(fd);
   return len;
 }