Comments (11)
On 09/29/16 23:52, Nathan Toone wrote:
Version 1.62.0 will not compile on android due to the fact that the
android bionic runtime does not have a |getsid| function. This is
referenced at
https://github.com/boostorg/log/blob/boost-1.62.0/src/posix/object_name.cpp#L71I am willing to work up a PR and submit it - but am wondering what the
best approach to do for android would be. Should I |#ifndef| just the
|format_id| call there - and use something else instead of |getsid|? Or
should I |#ifndef| the access to |object_name::session| altogether so
that scope isn't even available? Or is there some other approach that
would be better (I don't believe there is an alternative to |getsid| on
android - you just aren't allowed to access it at all).
I don't know Android well enough to pick the correct solution. Ideally,
getsid
should be replaced with some other API on that platform having
a similar effect. I know at least some Android versions support multiple
user logins - there must be a way to discern one session from the other.
If not, then we can only pretend there is only one session system-wide
and all processes are its members.
PS: A quick search shows that there is the __NR_getsid syscall1. I
suspect, it's the libc wrapper that is missing on some SDK versions.
Which one are you using?
from log.
PS: A quick search shows that there is the __NR_getsid syscall1. I
suspect, it's the libc wrapper that is missing on some SDK versions.
Which one are you using?1:
https://android.googlesource.com/platform/bionic/+/1ad10a5/libc/arch-x86/syscalls/getsid.S
And I don't know enough about syscalls to know if that will work or not. All I know is that the header explicitly mentions some functions that are disabled in bionic1. The version I am using is android-15
, but a quick grep
through the android headers seems to show the same functions disabled in all the other versions as well.
I don't know what alternate function would be useful either...what with not being super familiar with getsid
in the first place.
What about writing an inline function that just returns -1
, like described in the man page2?
from log.
On 09/30/16 00:19, Nathan Toone wrote:
PS: A quick search shows that there is the __NR_getsid syscall[1]. I
suspect, it's the libc wrapper that is missing on some SDK versions.
Which one are you using?[1]:
https://android.googlesource.com/platform/bionic/+/1ad10a5/libc/arch-x86/syscalls/getsid.S
And I don't know enough about syscalls to know if that will work or not.
All I know is that the header explicitly mentions some functions that
are disabled in bionic[1]. The version I am using isandroid-15
, but a
quickgrep
through the android headers seems to show the same
functions disabled in all the other versions as well.
I've committed a workaround (93a063c) but I can't test it. Could you try
it on your setup?
from log.
Getting there...now the same thing is happening with getpwuid_r
(it appears in the headers in android API 21 as well, but is commented out prior to that version).
Maybe I'll just build against android-21. 😄
from log.
It will build against android-21 - however, it would be good to support a few versions back than that.
getpwuid_r
doesn't exist as a syscall either...
from log.
On 09/30/16 01:55, Nathan Toone wrote:
It will build against android-21 - however, it would be good to support
a few versions back than that.|getpwuid_r| doesn't exist as a syscall either...
Yes, getpwuid_r
is not that easy to work around. There is getpwuid
,
but it's not thread-safe, at least not according to POSIX. I don't know
how safe it is on Android.
from log.
for getpwuid_r
, couldn't we add a #define BOOST_LOG_ANDROID_SINGLE_USER
in the block you just added, and then only do getpwuid_r
when not defined (falling back to only running the else
block at https://github.com/boostorg/log/blob/develop/src/posix/object_name.cpp#L105 when BOOST_LOG_ANDROID_SINGLE_USER
is defined)?
from log.
An example patch which actually will compile and appears to work can be found at toonetown@4d41ff0
from log.
On 09/30/16 01:59, Andrey Semashev wrote:
On 09/30/16 01:55, Nathan Toone wrote:
It will build against android-21 - however, it would be good to support
a few versions back than that.|getpwuid_r| doesn't exist as a syscall either...
Yes,
getpwuid_r
is not that easy to work around. There isgetpwuid
,
but it's not thread-safe, at least not according to POSIX. I don't know
how safe it is on Android.
I've added another workaround in (d13e6cb). Please, try if it helps.
from log.
On 09/30/16 02:11, Nathan Toone wrote:
An example patch which actually will compile and appears to work can be
found at toonetown/boostorg-log@4d41ff0
toonetown@4d41ff0
Yes, that's basically what I did as well.
from log.
Yes - your fix appears to work now. Thanks! Sorry I wasn't more help... 😉
from log.
Related Issues (20)
- Boost.Log rotation may throw boost::filesystem::filesystem_error HOT 10
- How to add timezone info for log entries and log filename HOT 3
- Formatting TimeStamp HOT 1
- Boost 1.82, boost\Log\trivial unresolved external symbol error if included after curl HOT 3
- Log Formatting [Conan 2.x, C++20, Boost 1.83] HOT 2
- 1.82.0 compiled for XP uses AcquireSRWLockExclusive HOT 2
- How to append log to same log file after program restarts? HOT 1
- CMake integration for Xcode universal 2 builds HOT 1
- boost日志在动态库里被使用,再次在主程序中使用会崩溃 HOT 1
- Boost stopped printing logs after changing the system time HOT 4
- Redundent call to boost_install() HOT 1
- An infinite loop occurs when boost writes to the log file (Debug Mode, Medium size file) HOT 1
- Consider switching dependency from MPL to MP11 HOT 2
- Please consider improving the documentation and examples HOT 1
- Linking failure after upgrading boost to 1.82 from 1.69 HOT 2
- advanced instruction sets HOT 1
- About Scope %f HOT 1
- boost/1.85.0 compile issues with msm::front::state_machine_def on llvm/clang++ 18.1.5 with std=c++20 HOT 4
- GetCurrentThreadId is called everytime even not extracting current_thread_id HOT 8
- Crash when FreeLibrary a dll uses Boost.Log HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log.