1 // In-sync with ../linux/musl/lfs64.rs except for fallocate64, prlimit64 and sendfile64
2 
3 #[inline]
creat64(path: *const ::c_char, mode: ::mode_t) -> ::c_int4 pub unsafe extern "C" fn creat64(path: *const ::c_char, mode: ::mode_t) -> ::c_int {
5     ::creat(path, mode)
6 }
7 
8 #[inline]
fgetpos64(stream: *mut ::FILE, pos: *mut ::fpos64_t) -> ::c_int9 pub unsafe extern "C" fn fgetpos64(stream: *mut ::FILE, pos: *mut ::fpos64_t) -> ::c_int {
10     ::fgetpos(stream, pos as *mut _)
11 }
12 
13 #[inline]
fopen64(pathname: *const ::c_char, mode: *const ::c_char) -> *mut ::FILE14 pub unsafe extern "C" fn fopen64(pathname: *const ::c_char, mode: *const ::c_char) -> *mut ::FILE {
15     ::fopen(pathname, mode)
16 }
17 
18 #[inline]
freopen64( pathname: *const ::c_char, mode: *const ::c_char, stream: *mut ::FILE, ) -> *mut ::FILE19 pub unsafe extern "C" fn freopen64(
20     pathname: *const ::c_char,
21     mode: *const ::c_char,
22     stream: *mut ::FILE,
23 ) -> *mut ::FILE {
24     ::freopen(pathname, mode, stream)
25 }
26 
27 #[inline]
fseeko64( stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int, ) -> ::c_int28 pub unsafe extern "C" fn fseeko64(
29     stream: *mut ::FILE,
30     offset: ::off64_t,
31     whence: ::c_int,
32 ) -> ::c_int {
33     ::fseeko(stream, offset, whence)
34 }
35 
36 #[inline]
fsetpos64(stream: *mut ::FILE, pos: *const ::fpos64_t) -> ::c_int37 pub unsafe extern "C" fn fsetpos64(stream: *mut ::FILE, pos: *const ::fpos64_t) -> ::c_int {
38     ::fsetpos(stream, pos as *mut _)
39 }
40 
41 #[inline]
fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int42 pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int {
43     ::fstat(fildes, buf as *mut _)
44 }
45 
46 #[inline]
fstatat64( fd: ::c_int, path: *const ::c_char, buf: *mut ::stat64, flag: ::c_int, ) -> ::c_int47 pub unsafe extern "C" fn fstatat64(
48     fd: ::c_int,
49     path: *const ::c_char,
50     buf: *mut ::stat64,
51     flag: ::c_int,
52 ) -> ::c_int {
53     ::fstatat(fd, path, buf as *mut _, flag)
54 }
55 
56 #[inline]
fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int57 pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int {
58     ::fstatfs(fd, buf as *mut _)
59 }
60 
61 #[inline]
fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int62 pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int {
63     ::fstatvfs(fd, buf as *mut _)
64 }
65 
66 #[inline]
ftello64(stream: *mut ::FILE) -> ::off64_t67 pub unsafe extern "C" fn ftello64(stream: *mut ::FILE) -> ::off64_t {
68     ::ftello(stream)
69 }
70 
71 #[inline]
ftruncate64(fd: ::c_int, length: ::off64_t) -> ::c_int72 pub unsafe extern "C" fn ftruncate64(fd: ::c_int, length: ::off64_t) -> ::c_int {
73     ::ftruncate(fd, length)
74 }
75 
76 #[inline]
getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int77 pub unsafe extern "C" fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int {
78     ::getrlimit(resource, rlim as *mut _)
79 }
80 
81 #[inline]
lseek64(fd: ::c_int, offset: ::off64_t, whence: ::c_int) -> ::off64_t82 pub unsafe extern "C" fn lseek64(fd: ::c_int, offset: ::off64_t, whence: ::c_int) -> ::off64_t {
83     ::lseek(fd, offset, whence)
84 }
85 
86 #[inline]
lstat64(path: *const ::c_char, buf: *mut ::stat64) -> ::c_int87 pub unsafe extern "C" fn lstat64(path: *const ::c_char, buf: *mut ::stat64) -> ::c_int {
88     ::lstat(path, buf as *mut _)
89 }
90 
91 #[inline]
mmap64( addr: *mut ::c_void, length: ::size_t, prot: ::c_int, flags: ::c_int, fd: ::c_int, offset: ::off64_t, ) -> *mut ::c_void92 pub unsafe extern "C" fn mmap64(
93     addr: *mut ::c_void,
94     length: ::size_t,
95     prot: ::c_int,
96     flags: ::c_int,
97     fd: ::c_int,
98     offset: ::off64_t,
99 ) -> *mut ::c_void {
100     ::mmap(addr, length, prot, flags, fd, offset)
101 }
102 
103 // These functions are variadic in the C ABI since the `mode` argument is "optional".  Variadic
104 // `extern "C"` functions are unstable in Rust so we cannot write a shim function for these
105 // entrypoints.  See https://github.com/rust-lang/rust/issues/44930.
106 //
107 // These aliases are mostly fine though, neither function takes a LFS64-namespaced type as an
108 // argument, nor do their names clash with any declared types.
109 pub use open as open64;
110 pub use openat as openat64;
111 
112 #[inline]
posix_fadvise64( fd: ::c_int, offset: ::off64_t, len: ::off64_t, advice: ::c_int, ) -> ::c_int113 pub unsafe extern "C" fn posix_fadvise64(
114     fd: ::c_int,
115     offset: ::off64_t,
116     len: ::off64_t,
117     advice: ::c_int,
118 ) -> ::c_int {
119     ::posix_fadvise(fd, offset, len, advice)
120 }
121 
122 #[inline]
posix_fallocate64( fd: ::c_int, offset: ::off64_t, len: ::off64_t, ) -> ::c_int123 pub unsafe extern "C" fn posix_fallocate64(
124     fd: ::c_int,
125     offset: ::off64_t,
126     len: ::off64_t,
127 ) -> ::c_int {
128     ::posix_fallocate(fd, offset, len)
129 }
130 
131 #[inline]
pread64( fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: ::off64_t, ) -> ::ssize_t132 pub unsafe extern "C" fn pread64(
133     fd: ::c_int,
134     buf: *mut ::c_void,
135     count: ::size_t,
136     offset: ::off64_t,
137 ) -> ::ssize_t {
138     ::pread(fd, buf, count, offset)
139 }
140 
141 #[inline]
preadv64( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off64_t, ) -> ::ssize_t142 pub unsafe extern "C" fn preadv64(
143     fd: ::c_int,
144     iov: *const ::iovec,
145     iovcnt: ::c_int,
146     offset: ::off64_t,
147 ) -> ::ssize_t {
148     ::preadv(fd, iov, iovcnt, offset)
149 }
150 
151 #[inline]
pwrite64( fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: ::off64_t, ) -> ::ssize_t152 pub unsafe extern "C" fn pwrite64(
153     fd: ::c_int,
154     buf: *const ::c_void,
155     count: ::size_t,
156     offset: ::off64_t,
157 ) -> ::ssize_t {
158     ::pwrite(fd, buf, count, offset)
159 }
160 
161 #[inline]
pwritev64( fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off64_t, ) -> ::ssize_t162 pub unsafe extern "C" fn pwritev64(
163     fd: ::c_int,
164     iov: *const ::iovec,
165     iovcnt: ::c_int,
166     offset: ::off64_t,
167 ) -> ::ssize_t {
168     ::pwritev(fd, iov, iovcnt, offset)
169 }
170 
171 #[inline]
readdir64(dirp: *mut ::DIR) -> *mut ::dirent64172 pub unsafe extern "C" fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64 {
173     ::readdir(dirp) as *mut _
174 }
175 
176 #[inline]
readdir64_r( dirp: *mut ::DIR, entry: *mut ::dirent64, result: *mut *mut ::dirent64, ) -> ::c_int177 pub unsafe extern "C" fn readdir64_r(
178     dirp: *mut ::DIR,
179     entry: *mut ::dirent64,
180     result: *mut *mut ::dirent64,
181 ) -> ::c_int {
182     ::readdir_r(dirp, entry as *mut _, result as *mut _)
183 }
184 
185 #[inline]
setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int186 pub unsafe extern "C" fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int {
187     ::setrlimit(resource, rlim as *mut _)
188 }
189 
190 #[inline]
stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int191 pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int {
192     ::stat(pathname, statbuf as *mut _)
193 }
194 
195 #[inline]
statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int196 pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int {
197     ::statfs(pathname, buf as *mut _)
198 }
199 
200 #[inline]
statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int201 pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int {
202     ::statvfs(path, buf as *mut _)
203 }
204 
205 #[inline]
tmpfile64() -> *mut ::FILE206 pub unsafe extern "C" fn tmpfile64() -> *mut ::FILE {
207     ::tmpfile()
208 }
209 
210 #[inline]
truncate64(path: *const ::c_char, length: ::off64_t) -> ::c_int211 pub unsafe extern "C" fn truncate64(path: *const ::c_char, length: ::off64_t) -> ::c_int {
212     ::truncate(path, length)
213 }
214