Lazarus

Programming => Networking and Web Programming => Topic started by: ytkim on April 07, 2018, 08:24:27 pm

Title: Android - socket accept function (A/libc: Fatal signal 31 (SIGSYS))
Post by: ytkim on April 07, 2018, 08:24:27 pm
I am writing an Android program using indy Component. Since the Android oreo version, the accept function does not work because of security.

This can be found at https://android.googlesource.com/platform/bionic.git/+/master/libc/SYSCALLS.TXT.

I want to know how to use the accept4 function. Or I want to know how to use server sockets in Android on oreo version.

Thank you.

tool, laz4Android
indy, 10.2.0.3
Title: Re: Android - socket accept function (A/libc: Fatal signal 31 (SIGSYS))
Post by: madmai on April 29, 2018, 03:52:20 am
hi, can explain me how uses indy compnents in laz4droid?, thanks in advance
Title: Re: Android - socket accept function (A/libc: Fatal signal 31 (SIGSYS))
Post by: Remy Lebeau on May 04, 2018, 03:39:01 am
I am writing an Android program using indy Component. Since the Android oreo version, the accept function does not work because of security.

Are you referring to this?

Android 8.0 Behavior Changes | Security (https://developer.android.com/about/versions/oreo/android-8.0-changes#security-all)

Quote
Android 8.0 (API level 26) applies a Secure Computing (SECCOMP) filter to all apps. The list of allowed syscalls is restricted to those exposed through bionic. Although there are several other syscalls provided for backwards compatibility, we recommend against their use.

This can be found at https://android.googlesource.com/platform/bionic.git/+/master/libc/SYSCALLS.TXT.

accept4() (https://android.googlesource.com/platform/bionic/+/master/libc/bionic/accept4.cpp) is on that list, and accept() is just a wrapper for accept4() (https://android.googlesource.com/platform/bionic/+/master/libc/bionic/accept.cpp), so it should work.  So what is the actual problem?

I want to know how to use the accept4 function. Or I want to know how to use server sockets in Android on oreo version.

Are you saying that Indy's TIdTCPServer and TIdSimpleServer components do not work on Android OREO?

indy, 10.2.0.3

That is a VERY old version of Indy, and predates any support for Android in Indy.  At the time of this writing, the latest version is 10.6.2.5455.  You really need to upgrade.  Indy 10.6.2 is available in Lazarus' Online Package Manager (http://wiki.freepascal.org/Online_Package_Manager).
TinyPortal © 2005-2018