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)
- Undesired time based rotation HOT 3
- Separating loggers and sinks HOT 8
- compilation error in set_formatter method HOT 2
- Combining expressions with parse_filter
- Logger is unbuffered HOT 3
- Detected memory leaks when use boost.log in sharted library. HOT 3
- log lib failed to build due to ERROR: AddressSanitizer: allocator is out of memory trying to allocate on MSVC in asan mode HOT 1
- logging may substantially exceed total_size HOT 9
- Build for Android fails with "error: unable to find library -lrt" HOT 2
- clang-15 warning: definition of implicit copy assignment operator for 'value_ref<jb::severity_level>' is deprecated because it has a user-declared copy constructor
- Performance issue: Boost.Log does a huge work when filtering records HOT 4
- Redirect log records to specific sink only HOT 4
- Max file rotating under the same target directory HOT 1
- BOOST_LOG_TRIVIAL cannot find overloaded `operator<<()` when it's declared in global scope HOT 2
- using BOOST_LOG_TRIVIAL << with string greater than max_size_decor results in bufferoverlfow detected HOT 3
- An infinite loop occurs when boost writes to the log file HOT 4
- Timezone information with text file backend HOT 2
- 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
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.