Fix make-array transforms.
[sbcl.git] / src / runtime / largefile.c
1 /*
2  * Wrapper functions for SUSv2 large file support. Linux defaults to a
3  * 32-bit off_t and hides the largefile-capable versions of the
4  * syscalls behind preprocessor magic, rather than making them
5  * reliably available using dlsym.
6  */
7
8 /*
9  * This software is part of the SBCL system. See the README file for
10  * more information.
11  *
12  * This software is derived from the CMU CL system, which was
13  * written at Carnegie Mellon University and released into the
14  * public domain. The software is in the public domain and is
15  * provided with absolutely no warranty. See the COPYING and CREDITS
16  * files for more information.
17  */
18
19 #include <genesis/config.h>
20
21 #ifdef LISP_FEATURE_LARGEFILE
22
23 #include <sys/mman.h>
24 #include <sys/types.h>
25 #include <dirent.h>
26 #include <unistd.h>
27 #include <sys/stat.h>
28
29 off_t
30 lseek_largefile(int fildes, off_t offset, int whence) {
31     return lseek(fildes, offset, whence);
32 }
33
34 int
35 truncate_largefile(const char *path, off_t length) {
36     return truncate(path, length);
37 }
38
39 int
40 ftruncate_largefile(int fd, off_t length) {
41     return ftruncate(fd, length);
42 }
43
44 void*
45 mmap_largefile(void *start, size_t length, int prot, int flags, int fd, off_t offset) {
46     return mmap(start, length, prot, flags, fd, offset);
47 }
48
49 int
50 stat_largefile(const char *file_name, struct stat *buf) {
51     return stat(file_name, buf);
52 }
53
54 int
55 fstat_largefile(int filedes, struct stat *buf) {
56     return fstat(filedes, buf);
57 }
58
59 int
60 lstat_largefile(const char *file_name, struct stat *buf) {
61     return lstat(file_name, buf);
62 }
63
64 struct dirent64 *
65 readdir_largefile(DIR *dir) {
66     return readdir64(dir);
67 }
68
69 #endif