Skip to content

Commit db1f7b1

Browse files
committed
zend_test fix copy_file_range test for linux 32 bits
close GH-13708
1 parent 334419e commit db1f7b1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ext/zend_test/test.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,9 +1128,12 @@ PHP_ZEND_TEST_API void bug_gh9090_void_int_char_var(int i, char *fmt, ...) {
11281128
/**
11291129
* This function allows us to simulate early return of copy_file_range by setting the limit_copy_file_range ini setting.
11301130
*/
1131-
PHP_ZEND_TEST_API ssize_t copy_file_range(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned int flags)
1131+
#ifdef __MUSL__
1132+
typedef off_t off64_t;
1133+
#endif
1134+
PHP_ZEND_TEST_API ssize_t copy_file_range(int fd_in, off64_t *off_in, int fd_out, off64_t *off_out, size_t len, unsigned int flags)
11321135
{
1133-
ssize_t (*original_copy_file_range)(int, off_t *, int, off_t *, size_t, unsigned int) = dlsym(RTLD_NEXT, "copy_file_range");
1136+
ssize_t (*original_copy_file_range)(int, off64_t *, int, off64_t *, size_t, unsigned int) = dlsym(RTLD_NEXT, "copy_file_range");
11341137
if (ZT_G(limit_copy_file_range) >= Z_L(0)) {
11351138
len = ZT_G(limit_copy_file_range);
11361139
}

0 commit comments

Comments
 (0)