1 use crate::off64_t;
2 use crate::prelude::*;
3
4 // In-sync with ../linux/musl/lfs64.rs except for fallocate64, prlimit64 and sendfile64
5
6 #[inline]
creat64(path: *const c_char, mode: crate::mode_t) -> c_int7 pub unsafe extern "C" fn creat64(path: *const c_char, mode: crate::mode_t) -> c_int {
8 crate::creat(path, mode)
9 }
10
11 #[inline]
fgetpos64(stream: *mut crate::FILE, pos: *mut crate::fpos64_t) -> c_int12 pub unsafe extern "C" fn fgetpos64(stream: *mut crate::FILE, pos: *mut crate::fpos64_t) -> c_int {
13 crate::fgetpos(stream, pos as *mut _)
14 }
15
16 #[inline]
fopen64(pathname: *const c_char, mode: *const c_char) -> *mut crate::FILE17 pub unsafe extern "C" fn fopen64(pathname: *const c_char, mode: *const c_char) -> *mut crate::FILE {
18 crate::fopen(pathname, mode)
19 }
20
21 #[inline]
freopen64( pathname: *const c_char, mode: *const c_char, stream: *mut crate::FILE, ) -> *mut crate::FILE22 pub unsafe extern "C" fn freopen64(
23 pathname: *const c_char,
24 mode: *const c_char,
25 stream: *mut crate::FILE,
26 ) -> *mut crate::FILE {
27 crate::freopen(pathname, mode, stream)
28 }
29
30 #[inline]
fseeko64( stream: *mut crate::FILE, offset: off64_t, whence: c_int, ) -> c_int31 pub unsafe extern "C" fn fseeko64(
32 stream: *mut crate::FILE,
33 offset: off64_t,
34 whence: c_int,
35 ) -> c_int {
36 crate::fseeko(stream, offset, whence)
37 }
38
39 #[inline]
fsetpos64(stream: *mut crate::FILE, pos: *const crate::fpos64_t) -> c_int40 pub unsafe extern "C" fn fsetpos64(stream: *mut crate::FILE, pos: *const crate::fpos64_t) -> c_int {
41 crate::fsetpos(stream, pos as *mut _)
42 }
43
44 #[inline]
fstat64(fildes: c_int, buf: *mut crate::stat64) -> c_int45 pub unsafe extern "C" fn fstat64(fildes: c_int, buf: *mut crate::stat64) -> c_int {
46 crate::fstat(fildes, buf as *mut _)
47 }
48
49 #[inline]
fstatat64( fd: c_int, path: *const c_char, buf: *mut crate::stat64, flag: c_int, ) -> c_int50 pub unsafe extern "C" fn fstatat64(
51 fd: c_int,
52 path: *const c_char,
53 buf: *mut crate::stat64,
54 flag: c_int,
55 ) -> c_int {
56 crate::fstatat(fd, path, buf as *mut _, flag)
57 }
58
59 #[inline]
fstatfs64(fd: c_int, buf: *mut crate::statfs64) -> c_int60 pub unsafe extern "C" fn fstatfs64(fd: c_int, buf: *mut crate::statfs64) -> c_int {
61 crate::fstatfs(fd, buf as *mut _)
62 }
63
64 #[inline]
fstatvfs64(fd: c_int, buf: *mut crate::statvfs64) -> c_int65 pub unsafe extern "C" fn fstatvfs64(fd: c_int, buf: *mut crate::statvfs64) -> c_int {
66 crate::fstatvfs(fd, buf as *mut _)
67 }
68
69 #[inline]
ftello64(stream: *mut crate::FILE) -> off64_t70 pub unsafe extern "C" fn ftello64(stream: *mut crate::FILE) -> off64_t {
71 crate::ftello(stream)
72 }
73
74 #[inline]
ftruncate64(fd: c_int, length: off64_t) -> c_int75 pub unsafe extern "C" fn ftruncate64(fd: c_int, length: off64_t) -> c_int {
76 crate::ftruncate(fd, length)
77 }
78
79 #[inline]
getrlimit64(resource: c_int, rlim: *mut crate::rlimit64) -> c_int80 pub unsafe extern "C" fn getrlimit64(resource: c_int, rlim: *mut crate::rlimit64) -> c_int {
81 crate::getrlimit(resource, rlim as *mut _)
82 }
83
84 #[inline]
lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t85 pub unsafe extern "C" fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t {
86 crate::lseek(fd, offset, whence)
87 }
88
89 #[inline]
lstat64(path: *const c_char, buf: *mut crate::stat64) -> c_int90 pub unsafe extern "C" fn lstat64(path: *const c_char, buf: *mut crate::stat64) -> c_int {
91 crate::lstat(path, buf as *mut _)
92 }
93
94 #[inline]
mmap64( addr: *mut c_void, length: size_t, prot: c_int, flags: c_int, fd: c_int, offset: off64_t, ) -> *mut c_void95 pub unsafe extern "C" fn mmap64(
96 addr: *mut c_void,
97 length: size_t,
98 prot: c_int,
99 flags: c_int,
100 fd: c_int,
101 offset: off64_t,
102 ) -> *mut c_void {
103 crate::mmap(addr, length, prot, flags, fd, offset)
104 }
105
106 // These functions are variadic in the C ABI since the `mode` argument is "optional". Variadic
107 // `extern "C"` functions are unstable in Rust so we cannot write a shim function for these
108 // entrypoints. See https://github.com/rust-lang/rust/issues/44930.
109 //
110 // These aliases are mostly fine though, neither function takes a LFS64-namespaced type as an
111 // argument, nor do their names clash with any declared types.
112 pub use crate::{open as open64, openat as openat64};
113
114 #[inline]
posix_fadvise64( fd: c_int, offset: off64_t, len: off64_t, advice: c_int, ) -> c_int115 pub unsafe extern "C" fn posix_fadvise64(
116 fd: c_int,
117 offset: off64_t,
118 len: off64_t,
119 advice: c_int,
120 ) -> c_int {
121 crate::posix_fadvise(fd, offset, len, advice)
122 }
123
124 #[inline]
posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int125 pub unsafe extern "C" fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int {
126 crate::posix_fallocate(fd, offset, len)
127 }
128
129 #[inline]
pread64( fd: c_int, buf: *mut c_void, count: size_t, offset: off64_t, ) -> ssize_t130 pub unsafe extern "C" fn pread64(
131 fd: c_int,
132 buf: *mut c_void,
133 count: size_t,
134 offset: off64_t,
135 ) -> ssize_t {
136 crate::pread(fd, buf, count, offset)
137 }
138
139 #[inline]
preadv64( fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off64_t, ) -> ssize_t140 pub unsafe extern "C" fn preadv64(
141 fd: c_int,
142 iov: *const crate::iovec,
143 iovcnt: c_int,
144 offset: off64_t,
145 ) -> ssize_t {
146 crate::preadv(fd, iov, iovcnt, offset)
147 }
148
149 #[inline]
pwrite64( fd: c_int, buf: *const c_void, count: size_t, offset: off64_t, ) -> ssize_t150 pub unsafe extern "C" fn pwrite64(
151 fd: c_int,
152 buf: *const c_void,
153 count: size_t,
154 offset: off64_t,
155 ) -> ssize_t {
156 crate::pwrite(fd, buf, count, offset)
157 }
158
159 #[inline]
pwritev64( fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off64_t, ) -> ssize_t160 pub unsafe extern "C" fn pwritev64(
161 fd: c_int,
162 iov: *const crate::iovec,
163 iovcnt: c_int,
164 offset: off64_t,
165 ) -> ssize_t {
166 crate::pwritev(fd, iov, iovcnt, offset)
167 }
168
169 #[inline]
readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64170 pub unsafe extern "C" fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64 {
171 crate::readdir(dirp) as *mut _
172 }
173
174 #[inline]
readdir64_r( dirp: *mut crate::DIR, entry: *mut crate::dirent64, result: *mut *mut crate::dirent64, ) -> c_int175 pub unsafe extern "C" fn readdir64_r(
176 dirp: *mut crate::DIR,
177 entry: *mut crate::dirent64,
178 result: *mut *mut crate::dirent64,
179 ) -> c_int {
180 crate::readdir_r(dirp, entry as *mut _, result as *mut _)
181 }
182
183 #[inline]
setrlimit64(resource: c_int, rlim: *const crate::rlimit64) -> c_int184 pub unsafe extern "C" fn setrlimit64(resource: c_int, rlim: *const crate::rlimit64) -> c_int {
185 crate::setrlimit(resource, rlim as *mut _)
186 }
187
188 #[inline]
stat64(pathname: *const c_char, statbuf: *mut crate::stat64) -> c_int189 pub unsafe extern "C" fn stat64(pathname: *const c_char, statbuf: *mut crate::stat64) -> c_int {
190 crate::stat(pathname, statbuf as *mut _)
191 }
192
193 #[inline]
statfs64(pathname: *const c_char, buf: *mut crate::statfs64) -> c_int194 pub unsafe extern "C" fn statfs64(pathname: *const c_char, buf: *mut crate::statfs64) -> c_int {
195 crate::statfs(pathname, buf as *mut _)
196 }
197
198 #[inline]
statvfs64(path: *const c_char, buf: *mut crate::statvfs64) -> c_int199 pub unsafe extern "C" fn statvfs64(path: *const c_char, buf: *mut crate::statvfs64) -> c_int {
200 crate::statvfs(path, buf as *mut _)
201 }
202
203 #[inline]
tmpfile64() -> *mut crate::FILE204 pub unsafe extern "C" fn tmpfile64() -> *mut crate::FILE {
205 crate::tmpfile()
206 }
207
208 #[inline]
truncate64(path: *const c_char, length: off64_t) -> c_int209 pub unsafe extern "C" fn truncate64(path: *const c_char, length: off64_t) -> c_int {
210 crate::truncate(path, length)
211 }
212