|
| 1 | +#[no_mangle] |
| 2 | +pub unsafe extern "C" fn creat64(path: *const ::c_char, mode: ::mode_t) -> ::c_int { |
| 3 | + ::creat(path, mode) |
| 4 | +} |
| 5 | + |
| 6 | +#[no_mangle] |
| 7 | +pub unsafe extern "C" fn fallocate64( |
| 8 | + fd: ::c_int, |
| 9 | + mode: ::c_int, |
| 10 | + offset: ::off64_t, |
| 11 | + len: ::off64_t, |
| 12 | +) -> ::c_int { |
| 13 | + ::fallocate(fd, mode, offset, len) |
| 14 | +} |
| 15 | + |
| 16 | +#[no_mangle] |
| 17 | +pub unsafe extern "C" fn fgetpos64(stream: *mut ::FILE, pos: *mut ::fpos64_t) -> ::c_int { |
| 18 | + ::fgetpos(stream, pos.cast()) |
| 19 | +} |
| 20 | + |
| 21 | +#[no_mangle] |
| 22 | +pub unsafe extern "C" fn fopen64(pathname: *const ::c_char, mode: *const ::c_char) -> *mut ::FILE { |
| 23 | + ::fopen(pathname, mode) |
| 24 | +} |
| 25 | + |
| 26 | +#[no_mangle] |
| 27 | +pub unsafe extern "C" fn freopen64( |
| 28 | + pathname: *const ::c_char, |
| 29 | + mode: *const ::c_char, |
| 30 | + stream: *mut ::FILE, |
| 31 | +) -> *mut ::FILE { |
| 32 | + ::freopen(pathname, mode, stream) |
| 33 | +} |
| 34 | + |
| 35 | +#[no_mangle] |
| 36 | +pub unsafe extern "C" fn fseeko64( |
| 37 | + stream: *mut ::FILE, |
| 38 | + offset: ::off64_t, |
| 39 | + whence: ::c_int, |
| 40 | +) -> ::c_int { |
| 41 | + ::fseeko(stream, offset, whence) |
| 42 | +} |
| 43 | + |
| 44 | +#[no_mangle] |
| 45 | +pub unsafe extern "C" fn fsetpos64(stream: *mut ::FILE, pos: *const ::fpos64_t) -> ::c_int { |
| 46 | + ::fsetpos(stream, pos.cast()) |
| 47 | +} |
| 48 | + |
| 49 | +#[no_mangle] |
| 50 | +pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int { |
| 51 | + ::fstat(fildes, buf.cast()) |
| 52 | +} |
| 53 | + |
| 54 | +#[no_mangle] |
| 55 | +pub unsafe extern "C" fn fstatat64( |
| 56 | + fd: ::c_int, |
| 57 | + path: *const ::c_char, |
| 58 | + buf: *mut ::stat64, |
| 59 | + flag: ::c_int, |
| 60 | +) -> ::c_int { |
| 61 | + ::fstatat(fd, path, buf.cast(), flag) |
| 62 | +} |
| 63 | + |
| 64 | +#[no_mangle] |
| 65 | +pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int { |
| 66 | + ::fstatfs(fd, buf.cast()) |
| 67 | +} |
| 68 | + |
| 69 | +#[no_mangle] |
| 70 | +pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int { |
| 71 | + ::fstatvfs(fd, buf.cast()) |
| 72 | +} |
| 73 | + |
| 74 | +#[no_mangle] |
| 75 | +pub unsafe extern "C" fn ftello64(stream: *mut ::FILE) -> ::off64_t { |
| 76 | + ::ftello(stream) |
| 77 | +} |
| 78 | + |
| 79 | +#[no_mangle] |
| 80 | +pub unsafe extern "C" fn ftruncate64(fd: ::c_int, length: ::off64_t) -> ::c_int { |
| 81 | + ::ftruncate(fd, length) |
| 82 | +} |
| 83 | + |
| 84 | +#[no_mangle] |
| 85 | +pub unsafe extern "C" fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int { |
| 86 | + ::getrlimit(resource, rlim.cast()) |
| 87 | +} |
| 88 | + |
| 89 | +#[no_mangle] |
| 90 | +pub unsafe extern "C" fn lseek64(fd: ::c_int, offset: ::off64_t, whence: ::c_int) -> ::off64_t { |
| 91 | + ::lseek(fd, offset, whence) |
| 92 | +} |
| 93 | + |
| 94 | +#[no_mangle] |
| 95 | +pub unsafe extern "C" fn lstat64(path: *const ::c_char, buf: *mut ::stat64) -> ::c_int { |
| 96 | + ::lstat(path, buf.cast()) |
| 97 | +} |
| 98 | + |
| 99 | +#[no_mangle] |
| 100 | +pub unsafe extern "C" fn mmap64( |
| 101 | + addr: *mut ::c_void, |
| 102 | + length: ::size_t, |
| 103 | + prot: ::c_int, |
| 104 | + flags: ::c_int, |
| 105 | + fd: ::c_int, |
| 106 | + offset: ::off64_t, |
| 107 | +) -> *mut ::c_void { |
| 108 | + ::mmap(addr, length, prot, flags, fd, offset) |
| 109 | +} |
| 110 | + |
| 111 | +#[no_mangle] |
| 112 | +pub unsafe extern "C" fn open64( |
| 113 | + pathname: *const ::c_char, |
| 114 | + flags: ::c_int, |
| 115 | + mode: ::mode_t, |
| 116 | +) -> ::c_int { |
| 117 | + ::open(pathname, flags | ::O_LARGEFILE, mode) |
| 118 | +} |
| 119 | + |
| 120 | +#[no_mangle] |
| 121 | +pub unsafe extern "C" fn openat64( |
| 122 | + dirfd: ::c_int, |
| 123 | + pathname: *const ::c_char, |
| 124 | + flags: ::c_int, |
| 125 | + mode: ::mode_t, |
| 126 | +) -> ::c_int { |
| 127 | + ::openat(dirfd, pathname, flags | ::O_LARGEFILE, mode) |
| 128 | +} |
| 129 | + |
| 130 | +#[no_mangle] |
| 131 | +pub unsafe extern "C" fn posix_fadvise64( |
| 132 | + fd: ::c_int, |
| 133 | + offset: ::off64_t, |
| 134 | + len: ::off64_t, |
| 135 | + advice: ::c_int, |
| 136 | +) -> ::c_int { |
| 137 | + ::posix_fadvise(fd, offset, len, advice) |
| 138 | +} |
| 139 | + |
| 140 | +#[no_mangle] |
| 141 | +pub unsafe extern "C" fn posix_fallocate64( |
| 142 | + fd: ::c_int, |
| 143 | + offset: ::off64_t, |
| 144 | + len: ::off64_t, |
| 145 | +) -> ::c_int { |
| 146 | + ::posix_fallocate(fd, offset, len) |
| 147 | +} |
| 148 | + |
| 149 | +#[no_mangle] |
| 150 | +pub unsafe extern "C" fn pread64( |
| 151 | + fd: ::c_int, |
| 152 | + buf: *mut ::c_void, |
| 153 | + count: ::size_t, |
| 154 | + offset: ::off64_t, |
| 155 | +) -> ::ssize_t { |
| 156 | + ::pread(fd, buf, count, offset) |
| 157 | +} |
| 158 | + |
| 159 | +#[no_mangle] |
| 160 | +pub unsafe extern "C" fn preadv64( |
| 161 | + fd: ::c_int, |
| 162 | + iov: *const ::iovec, |
| 163 | + iovcnt: ::c_int, |
| 164 | + offset: ::off64_t, |
| 165 | +) -> ::ssize_t { |
| 166 | + ::preadv(fd, iov, iovcnt, offset) |
| 167 | +} |
| 168 | + |
| 169 | +#[no_mangle] |
| 170 | +pub unsafe extern "C" fn prlimit64( |
| 171 | + pid: ::pid_t, |
| 172 | + resource: ::c_int, |
| 173 | + new_limit: *const ::rlimit64, |
| 174 | + old_limit: *mut ::rlimit64, |
| 175 | +) -> ::c_int { |
| 176 | + ::prlimit(pid, resource, new_limit.cast(), old_limit.cast()) |
| 177 | +} |
| 178 | + |
| 179 | +#[no_mangle] |
| 180 | +pub unsafe extern "C" fn pwrite64( |
| 181 | + fd: ::c_int, |
| 182 | + buf: *const ::c_void, |
| 183 | + count: ::size_t, |
| 184 | + offset: ::off64_t, |
| 185 | +) -> ::ssize_t { |
| 186 | + ::pwrite(fd, buf, count, offset) |
| 187 | +} |
| 188 | + |
| 189 | +#[no_mangle] |
| 190 | +pub unsafe extern "C" fn pwritev64( |
| 191 | + fd: ::c_int, |
| 192 | + iov: *const ::iovec, |
| 193 | + iovcnt: ::c_int, |
| 194 | + offset: ::off64_t, |
| 195 | +) -> ::ssize_t { |
| 196 | + ::pwritev(fd, iov, iovcnt, offset) |
| 197 | +} |
| 198 | + |
| 199 | +#[no_mangle] |
| 200 | +pub unsafe extern "C" fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64 { |
| 201 | + ::readdir(dirp).cast() |
| 202 | +} |
| 203 | + |
| 204 | +#[no_mangle] |
| 205 | +pub unsafe extern "C" fn readdir64_r( |
| 206 | + dirp: *mut ::DIR, |
| 207 | + entry: *mut ::dirent64, |
| 208 | + result: *mut *mut ::dirent64, |
| 209 | +) -> ::c_int { |
| 210 | + ::readdir_r(dirp, entry.cast(), result.cast()) |
| 211 | +} |
| 212 | + |
| 213 | +#[no_mangle] |
| 214 | +pub unsafe extern "C" fn sendfile64( |
| 215 | + out_fd: ::c_int, |
| 216 | + in_fd: ::c_int, |
| 217 | + offset: *mut ::off64_t, |
| 218 | + count: ::size_t, |
| 219 | +) -> ::ssize_t { |
| 220 | + ::sendfile(out_fd, in_fd, offset, count) |
| 221 | +} |
| 222 | + |
| 223 | +#[no_mangle] |
| 224 | +pub unsafe extern "C" fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int { |
| 225 | + ::setrlimit(resource, rlim.cast()) |
| 226 | +} |
| 227 | + |
| 228 | +#[no_mangle] |
| 229 | +pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int { |
| 230 | + ::stat(pathname, statbuf.cast()) |
| 231 | +} |
| 232 | + |
| 233 | +#[no_mangle] |
| 234 | +pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int { |
| 235 | + ::statfs(pathname, buf.cast()) |
| 236 | +} |
| 237 | + |
| 238 | +#[no_mangle] |
| 239 | +pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int { |
| 240 | + ::statvfs(path, buf.cast()) |
| 241 | +} |
| 242 | + |
| 243 | +#[no_mangle] |
| 244 | +pub unsafe extern "C" fn tmpfile64() -> *mut ::FILE { |
| 245 | + ::tmpfile() |
| 246 | +} |
| 247 | + |
| 248 | +#[no_mangle] |
| 249 | +pub unsafe extern "C" fn truncate64(path: *const ::c_char, length: ::off64_t) -> ::c_int { |
| 250 | + ::truncate(path, length) |
| 251 | +} |
0 commit comments