Git Product home page Git Product logo

Comments (5)

DanAlbert avatar DanAlbert commented on August 22, 2024

Those arc4random functions were removed from BSD (from which we derive our implementations). The motivation for this is that the responsibility of stirring/adding randomness is not the user's job. That task should be done by the implementation/the kernel. The implementation is self-stirring, randomness comes from the kernel.

getdtablesize was removed from POSIX. Should replace with sysconf(_SC_OPEN_MAX).

The getdents change actually matches glibc. Form their man page:

Glibc does not provide a wrapper for this system call; call it using syscall(2). You will need to define the linux_dirent structure yourself. However, you probably want to use readdir(3) instead.

And at the top:

DESCRIPTION
This is not the function you are interested in. Look at readdir(3) for the POSIX conforming C library interface.

If for some reason readdir is not sufficient for firefox, use syscall(__NR_getdents). You should take a look at how it's being used though. If it isn't already written that way, that means that it is Android (or at least non-GNU Linux) specific code because glibc would require it to be written that way anyway. There is probably a better way to write it.

from ndk.

froydnj avatar froydnj commented on August 22, 2024

Thanks for the explanation! I assume this reasoning is behind the "Removed from all versions of NDK libc, m, and dl all symbols which the platform versions of those libs do not support." release note?

from ndk.

DanAlbert avatar DanAlbert commented on August 22, 2024

Correct. There's a non-zero chance that some of the things that were removed shouldn't have been (see #1), so don't hesitate to file bugs if you find other things that seem like they should be there.

from ndk.

timofey-retailnext avatar timofey-retailnext commented on August 22, 2024

Thanks for explanation,
are there any specific reasons why removed arc4random_* functions still exist in stdlib.h ?

ex. {NDK-r12b}/platforms/android-19/arch-arm/include/stdlib.h lines 119-120:
extern void arc4random_stir(void);
extern void arc4random_addrandom(unsigned char *, int);

from ndk.

DanAlbert avatar DanAlbert commented on August 22, 2024

Because our headers are and have always been incorrect. Recently they're more wrong than they used to be since the shared libraries, which were also wrong, were fixed.

We're trying to fix this (#120), but until recently even we didn't have a good idea of what functions were available in each API level/architecture. The shared libraries in the NDK (as of r12) are should all be a correct representation of the world now though.

from ndk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.