Giter Site home page Giter Site logo

Comments (8)

rsta2 avatar rsta2 commented on September 8, 2024

Maybe not that much work for a basic subset of the POSIX socket features, which can be realized using Circle. Circle does support the AF_INET address family only and only a subset of functions and only very few socket options. But this could be extended in some way, if there is some need for it.

Providing POSIX sockets makes probably only sense with a C standard library implementation available. @smuehlst is currently working on porting newlib onto Circle. With the right toolchain his very interesting project will allow to use the features of the C++ standard library too. This will make porting applications onto Circle much easier.

I thought about, if this POSIX socket support could be implemented as a separate library project to be included as a sub-module into the project of @smuehlst. But because the file functions in newlib and the socket functions use the same file descriptor pool and because there are functions which are used in both domains (e.g. close()) this might be not doable.

I have seen that there is some socket support in newlib (e.g. for Linux targets). I don't know how difficult it is, to port this to Circle. Perhaps @smuehlst is reading this and can answer this question.

from circle.

MaPePeR avatar MaPePeR commented on September 8, 2024

For a c standard library in circle this comes to my mind: https://www.fefe.de/dietlibc/
I don't really know anything about that, but from my basic understanding it might be a very good choice for circle?

EDIT: thinking about it its probably useless, because it uses syscalls and we don't have any system it could call?

from circle.

vanvught avatar vanvught commented on September 8, 2024

Using newlib is a very good choice. It is well documented and it is available with most Linux distributions. For the latter, there is no need to build your own toolchain with newlib support. Of course when you are eager to build newlib with the special flags for the Raspberry Pi ARM version, then you can build your own environment -> http://www.raspberrypi-dmx.org/raspberry-pi-dmx512-rdm/development-environment

from circle.

rsta2 avatar rsta2 commented on September 8, 2024

newlib has system call stubs too, which have to be implemented to use the full features. @smuehlst has already done this to some degree. Many functions are already working, including features of the C++ standard library. I'm sure he will get this running and there is no need for a different code base.

from circle.

smuehlst avatar smuehlst commented on September 8, 2024

newlib indeed has support for socket() for some platforms, so I agree with @rsta2 that it could be feasible to expose Circle's networking features through the POSIX networking interface. I will need to do more research on how that could be implemented.

from circle.

MaPePeR avatar MaPePeR commented on September 8, 2024

Ah. i didn't really know about newlib and misunderstood it. (I thought this was a working title for something you were working on 😅) Sounds like its probably a much better choice than dietlibc - especially if you already started on making it work.

Sticking to existing/ancient interfaces could make it a lot easier to use code with circle - but i don't know if that is a real requirement at all, so POSIX-sockets was just a random thought i had.

from circle.

rsta2 avatar rsta2 commented on September 8, 2024

Using the C and/or C++ standard libraries can make bare metal programming and especially porting existing applications much easier. That's why I'm supporting this project with Circle. Adding POSIX sockets to this is a good idea. So thanks for that!

from circle.

rsta2 avatar rsta2 commented on September 8, 2024

I think, this is discussed in smuehlst/circle-stdlib#31 now. So this can be closed.

from circle.

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.