Skip to content

Commit 65338d5

Browse files
committed
Allow alias symbols to be mangled ensure inlining happens
1 parent 53b811e commit 65338d5

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed
Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#[no_mangle]
1+
#[inline(always)]
22
pub unsafe extern "C" fn creat64(path: *const ::c_char, mode: ::mode_t) -> ::c_int {
33
::creat(path, mode)
44
}
55

6-
#[no_mangle]
6+
#[inline(always)]
77
pub unsafe extern "C" fn fallocate64(
88
fd: ::c_int,
99
mode: ::c_int,
@@ -13,17 +13,17 @@ pub unsafe extern "C" fn fallocate64(
1313
::fallocate(fd, mode, offset, len)
1414
}
1515

16-
#[no_mangle]
16+
#[inline(always)]
1717
pub unsafe extern "C" fn fgetpos64(stream: *mut ::FILE, pos: *mut ::fpos64_t) -> ::c_int {
1818
::fgetpos(stream, pos.cast())
1919
}
2020

21-
#[no_mangle]
21+
#[inline(always)]
2222
pub unsafe extern "C" fn fopen64(pathname: *const ::c_char, mode: *const ::c_char) -> *mut ::FILE {
2323
::fopen(pathname, mode)
2424
}
2525

26-
#[no_mangle]
26+
#[inline(always)]
2727
pub unsafe extern "C" fn freopen64(
2828
pathname: *const ::c_char,
2929
mode: *const ::c_char,
@@ -32,7 +32,7 @@ pub unsafe extern "C" fn freopen64(
3232
::freopen(pathname, mode, stream)
3333
}
3434

35-
#[no_mangle]
35+
#[inline(always)]
3636
pub unsafe extern "C" fn fseeko64(
3737
stream: *mut ::FILE,
3838
offset: ::off64_t,
@@ -41,17 +41,17 @@ pub unsafe extern "C" fn fseeko64(
4141
::fseeko(stream, offset, whence)
4242
}
4343

44-
#[no_mangle]
44+
#[inline(always)]
4545
pub unsafe extern "C" fn fsetpos64(stream: *mut ::FILE, pos: *const ::fpos64_t) -> ::c_int {
4646
::fsetpos(stream, pos.cast())
4747
}
4848

49-
#[no_mangle]
49+
#[inline(always)]
5050
pub unsafe extern "C" fn fstat64(fildes: ::c_int, buf: *mut ::stat64) -> ::c_int {
5151
::fstat(fildes, buf.cast())
5252
}
5353

54-
#[no_mangle]
54+
#[inline(always)]
5555
pub unsafe extern "C" fn fstatat64(
5656
fd: ::c_int,
5757
path: *const ::c_char,
@@ -61,42 +61,42 @@ pub unsafe extern "C" fn fstatat64(
6161
::fstatat(fd, path, buf.cast(), flag)
6262
}
6363

64-
#[no_mangle]
64+
#[inline(always)]
6565
pub unsafe extern "C" fn fstatfs64(fd: ::c_int, buf: *mut ::statfs64) -> ::c_int {
6666
::fstatfs(fd, buf.cast())
6767
}
6868

69-
#[no_mangle]
69+
#[inline(always)]
7070
pub unsafe extern "C" fn fstatvfs64(fd: ::c_int, buf: *mut ::statvfs64) -> ::c_int {
7171
::fstatvfs(fd, buf.cast())
7272
}
7373

74-
#[no_mangle]
74+
#[inline(always)]
7575
pub unsafe extern "C" fn ftello64(stream: *mut ::FILE) -> ::off64_t {
7676
::ftello(stream)
7777
}
7878

79-
#[no_mangle]
79+
#[inline(always)]
8080
pub unsafe extern "C" fn ftruncate64(fd: ::c_int, length: ::off64_t) -> ::c_int {
8181
::ftruncate(fd, length)
8282
}
8383

84-
#[no_mangle]
84+
#[inline(always)]
8585
pub unsafe extern "C" fn getrlimit64(resource: ::c_int, rlim: *mut ::rlimit64) -> ::c_int {
8686
::getrlimit(resource, rlim.cast())
8787
}
8888

89-
#[no_mangle]
89+
#[inline(always)]
9090
pub unsafe extern "C" fn lseek64(fd: ::c_int, offset: ::off64_t, whence: ::c_int) -> ::off64_t {
9191
::lseek(fd, offset, whence)
9292
}
9393

94-
#[no_mangle]
94+
#[inline(always)]
9595
pub unsafe extern "C" fn lstat64(path: *const ::c_char, buf: *mut ::stat64) -> ::c_int {
9696
::lstat(path, buf.cast())
9797
}
9898

99-
#[no_mangle]
99+
#[inline(always)]
100100
pub unsafe extern "C" fn mmap64(
101101
addr: *mut ::c_void,
102102
length: ::size_t,
@@ -108,7 +108,7 @@ pub unsafe extern "C" fn mmap64(
108108
::mmap(addr, length, prot, flags, fd, offset)
109109
}
110110

111-
#[no_mangle]
111+
#[inline(always)]
112112
pub unsafe extern "C" fn open64(
113113
pathname: *const ::c_char,
114114
flags: ::c_int,
@@ -117,7 +117,7 @@ pub unsafe extern "C" fn open64(
117117
::open(pathname, flags | ::O_LARGEFILE, mode)
118118
}
119119

120-
#[no_mangle]
120+
#[inline(always)]
121121
pub unsafe extern "C" fn openat64(
122122
dirfd: ::c_int,
123123
pathname: *const ::c_char,
@@ -127,7 +127,7 @@ pub unsafe extern "C" fn openat64(
127127
::openat(dirfd, pathname, flags | ::O_LARGEFILE, mode)
128128
}
129129

130-
#[no_mangle]
130+
#[inline(always)]
131131
pub unsafe extern "C" fn posix_fadvise64(
132132
fd: ::c_int,
133133
offset: ::off64_t,
@@ -137,7 +137,7 @@ pub unsafe extern "C" fn posix_fadvise64(
137137
::posix_fadvise(fd, offset, len, advice)
138138
}
139139

140-
#[no_mangle]
140+
#[inline(always)]
141141
pub unsafe extern "C" fn posix_fallocate64(
142142
fd: ::c_int,
143143
offset: ::off64_t,
@@ -146,7 +146,7 @@ pub unsafe extern "C" fn posix_fallocate64(
146146
::posix_fallocate(fd, offset, len)
147147
}
148148

149-
#[no_mangle]
149+
#[inline(always)]
150150
pub unsafe extern "C" fn pread64(
151151
fd: ::c_int,
152152
buf: *mut ::c_void,
@@ -156,7 +156,7 @@ pub unsafe extern "C" fn pread64(
156156
::pread(fd, buf, count, offset)
157157
}
158158

159-
#[no_mangle]
159+
#[inline(always)]
160160
pub unsafe extern "C" fn preadv64(
161161
fd: ::c_int,
162162
iov: *const ::iovec,
@@ -166,7 +166,7 @@ pub unsafe extern "C" fn preadv64(
166166
::preadv(fd, iov, iovcnt, offset)
167167
}
168168

169-
#[no_mangle]
169+
#[inline(always)]
170170
pub unsafe extern "C" fn prlimit64(
171171
pid: ::pid_t,
172172
resource: ::c_int,
@@ -176,7 +176,7 @@ pub unsafe extern "C" fn prlimit64(
176176
::prlimit(pid, resource, new_limit.cast(), old_limit.cast())
177177
}
178178

179-
#[no_mangle]
179+
#[inline(always)]
180180
pub unsafe extern "C" fn pwrite64(
181181
fd: ::c_int,
182182
buf: *const ::c_void,
@@ -186,7 +186,7 @@ pub unsafe extern "C" fn pwrite64(
186186
::pwrite(fd, buf, count, offset)
187187
}
188188

189-
#[no_mangle]
189+
#[inline(always)]
190190
pub unsafe extern "C" fn pwritev64(
191191
fd: ::c_int,
192192
iov: *const ::iovec,
@@ -196,12 +196,12 @@ pub unsafe extern "C" fn pwritev64(
196196
::pwritev(fd, iov, iovcnt, offset)
197197
}
198198

199-
#[no_mangle]
199+
#[inline(always)]
200200
pub unsafe extern "C" fn readdir64(dirp: *mut ::DIR) -> *mut ::dirent64 {
201201
::readdir(dirp).cast()
202202
}
203203

204-
#[no_mangle]
204+
#[inline(always)]
205205
pub unsafe extern "C" fn readdir64_r(
206206
dirp: *mut ::DIR,
207207
entry: *mut ::dirent64,
@@ -210,7 +210,7 @@ pub unsafe extern "C" fn readdir64_r(
210210
::readdir_r(dirp, entry.cast(), result.cast())
211211
}
212212

213-
#[no_mangle]
213+
#[inline(always)]
214214
pub unsafe extern "C" fn sendfile64(
215215
out_fd: ::c_int,
216216
in_fd: ::c_int,
@@ -220,32 +220,32 @@ pub unsafe extern "C" fn sendfile64(
220220
::sendfile(out_fd, in_fd, offset, count)
221221
}
222222

223-
#[no_mangle]
223+
#[inline(always)]
224224
pub unsafe extern "C" fn setrlimit64(resource: ::c_int, rlim: *const ::rlimit64) -> ::c_int {
225225
::setrlimit(resource, rlim.cast())
226226
}
227227

228-
#[no_mangle]
228+
#[inline(always)]
229229
pub unsafe extern "C" fn stat64(pathname: *const ::c_char, statbuf: *mut ::stat64) -> ::c_int {
230230
::stat(pathname, statbuf.cast())
231231
}
232232

233-
#[no_mangle]
233+
#[inline(always)]
234234
pub unsafe extern "C" fn statfs64(pathname: *const ::c_char, buf: *mut ::statfs64) -> ::c_int {
235235
::statfs(pathname, buf.cast())
236236
}
237237

238-
#[no_mangle]
238+
#[inline(always)]
239239
pub unsafe extern "C" fn statvfs64(path: *const ::c_char, buf: *mut ::statvfs64) -> ::c_int {
240240
::statvfs(path, buf.cast())
241241
}
242242

243-
#[no_mangle]
243+
#[inline(always)]
244244
pub unsafe extern "C" fn tmpfile64() -> *mut ::FILE {
245245
::tmpfile()
246246
}
247247

248-
#[no_mangle]
248+
#[inline(always)]
249249
pub unsafe extern "C" fn truncate64(path: *const ::c_char, length: ::off64_t) -> ::c_int {
250250
::truncate(path, length)
251251
}

0 commit comments

Comments
 (0)