1.0.17.13: grab-bag of SB-SPROF enhancements
[sbcl/tcr.git] / src / runtime / largefile.c
blobb71a77f4051f5c295bc0daebbbd5a9cd90fa3b60
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 */
8 /*
9 * This software is part of the SBCL system. See the README file for
10 * more information.
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.
19 #include <genesis/config.h>
21 #ifdef LISP_FEATURE_LARGEFILE
23 #include <sys/mman.h>
24 #include <sys/types.h>
25 #include <dirent.h>
26 #include <unistd.h>
27 #include <sys/stat.h>
29 off_t
30 lseek_largefile(int fildes, off_t offset, int whence) {
31 return lseek(fildes, offset, whence);
34 int
35 truncate_largefile(const char *path, off_t length) {
36 return truncate(path, length);
39 int
40 ftruncate_largefile(int fd, off_t length) {
41 return ftruncate(fd, length);
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);
49 int
50 stat_largefile(const char *file_name, struct stat *buf) {
51 return stat(file_name, buf);
54 int
55 fstat_largefile(int filedes, struct stat *buf) {
56 return fstat(filedes, buf);
59 int
60 lstat_largefile(const char *file_name, struct stat *buf) {
61 return lstat(file_name, buf);
64 struct dirent64 *
65 readdir_largefile(DIR *dir) {
66 return readdir64(dir);
69 #endif