Skip to content

Commit bdf0d0f

Browse files
author
Xavier de Gaye
committed
Issue python#28762: lockf() is available on Android API level 24, but the
F_LOCK macro is not defined in android-ndk-r13.
1 parent 437a5d2 commit bdf0d0f

4 files changed

Lines changed: 45 additions & 4 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ Tests
8484
Build
8585
-----
8686

87+
- Issue #28762: lockf() is available on Android API level 24, but the F_LOCK
88+
macro is not defined in android-ndk-r13.
89+
8790
- Issue #28538: Fix the compilation error that occurs because if_nameindex() is
8891
available on Android API level 24, but the if_nameindex structure is not
8992
defined.

configure

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11198,7 +11198,7 @@ for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
1119811198
futimens futimes gai_strerror getentropy \
1119911199
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
1120011200
getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
11201-
initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \
11201+
initgroups kill killpg lchmod lchown linkat lstat lutimes mmap \
1120211202
memrchr mbrtowc mkdirat mkfifo \
1120311203
mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
1120411204
posix_fallocate posix_fadvise pread \
@@ -12686,6 +12686,35 @@ else
1268612686
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1268712687
$as_echo "no" >&6; }
1268812688

12689+
fi
12690+
rm -f core conftest.err conftest.$ac_objext \
12691+
conftest$ac_exeext conftest.$ac_ext
12692+
12693+
# Issue #28762: lockf() is available on Android API level 24, but the F_LOCK
12694+
# macro is not defined in android-ndk-r13.
12695+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lockf" >&5
12696+
$as_echo_n "checking for lockf... " >&6; }
12697+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12698+
/* end confdefs.h. */
12699+
#include <unistd.h>
12700+
int
12701+
main ()
12702+
{
12703+
lockf(0, F_LOCK, 0);
12704+
;
12705+
return 0;
12706+
}
12707+
_ACEOF
12708+
if ac_fn_c_try_link "$LINENO"; then :
12709+
12710+
$as_echo "#define HAVE_LOCKF 1" >>confdefs.h
12711+
12712+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12713+
$as_echo "yes" >&6; }
12714+
else
12715+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12716+
$as_echo "no" >&6; }
12717+
1268912718
fi
1269012719
rm -f core conftest.err conftest.$ac_objext \
1269112720
conftest$ac_exeext conftest.$ac_ext

configure.ac

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3384,7 +3384,7 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
33843384
futimens futimes gai_strerror getentropy \
33853385
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
33863386
getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
3387-
initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \
3387+
initgroups kill killpg lchmod lchown linkat lstat lutimes mmap \
33883388
memrchr mbrtowc mkdirat mkfifo \
33893389
mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
33903390
posix_fallocate posix_fadvise pread \
@@ -3761,6 +3761,15 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
37613761
[AC_MSG_RESULT(no)
37623762
])
37633763

3764+
# Issue #28762: lockf() is available on Android API level 24, but the F_LOCK
3765+
# macro is not defined in android-ndk-r13.
3766+
AC_MSG_CHECKING(for lockf)
3767+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h> ]],[[lockf(0, F_LOCK, 0);]])],
3768+
[AC_DEFINE(HAVE_LOCKF, 1, Define to 1 if you have the 'lockf' function and the F_LOCK macro.)
3769+
AC_MSG_RESULT(yes)],
3770+
[AC_MSG_RESULT(no)
3771+
])
3772+
37643773
# On OSF/1 V5.1, getaddrinfo is available, but a define
37653774
# for [no]getaddrinfo in netdb.h.
37663775
AC_MSG_CHECKING(for getaddrinfo)

pyconfig.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@
472472
/* Define to 1 if you have the <ieeefp.h> header file. */
473473
#undef HAVE_IEEEFP_H
474474

475-
/* Define to 1 if you have the `if_nameindex' function. */
475+
/* Define to 1 if you have the 'if_nameindex' function. */
476476
#undef HAVE_IF_NAMEINDEX
477477

478478
/* Define if you have the 'inet_aton' function. */
@@ -574,7 +574,7 @@
574574
/* Define to 1 if you have the <linux/tipc.h> header file. */
575575
#undef HAVE_LINUX_TIPC_H
576576

577-
/* Define to 1 if you have the `lockf' function. */
577+
/* Define to 1 if you have the 'lockf' function and the F_LOCK macro. */
578578
#undef HAVE_LOCKF
579579

580580
/* Define to 1 if you have the `log1p' function. */

0 commit comments

Comments
 (0)