#4328: New APIs added to POSIX Standard (2021)

Joel Sherrill joel at rtems.org
Fri Mar 19 19:27:06 UTC 2021


On Fri, Mar 19, 2021 at 1:08 PM Gedare Bloom <gedare at rtems.org> wrote:

> On Fri, Mar 19, 2021 at 11:16 AM Matthew Joyce <mfjoyce2004 at gmail.com>
> wrote:
> >
> > Dr. Joel,
> >
> > Thanks very much...I'll keep working to get a sense of what goes
> > where! In the meantime, where can I look to get the ground truth of
> > which methods are "in RTEMS" as opposed to those in newlib?
> >
> There is only one ground truth:
> git://git.rtems.org/rtems.git
>
> And for newlib
>
> git://sourceware.org/git/newlib-cygwin.git
>
> That said, searching for the function name symbols in compiled
> libraries is a good first step to rule out newlib. Then, you can
> 'grep' the RTEMS source code for the function names to see if they
> exist there.
>

rtems/cpukit to be specitic. It won't be implemented anywhere else.

And clearly we both have forgotten that networking APIs are in the
rtems-libbsd repository.

https://git.rtems.org/rtems-libbsd/

I suspect ppoll() might already be in there. Or at least supported by
FreeBSD.

You should clone everything and grep the sources. newlib already has
qsort_r. This is the nm I used:

$ ~/rtems-work/tools/6/bin/sparc-rtems6-nm
~/rtems-work/tools/6/sparc-rtems6/lib/libc.a | grep qsort_r
lib_a-bsd_qsort_r.o:
00000000 T __bsd_qsort_r
lib_a-qsort_r.o:
00000000 T qsort_r

Notice the last line has "T qsort_r" which says it is defined.

grep -r in the newlib source shows it is in ./libc/search/qsort_r.c

dladdr() looks to be prototyped in RTEMS but hidden behind an ifdef like it
wasn't ported from NetBSD so that looks possible. It is in rtems.

Those two examples should help you figure out why you missed
finding some things that were implemented.

I need to figure out what this next POSIX version is to be called
so I can update the tracking spreadsheet that generates the RTEMS
POSIX Compliance Guide, :)

--joel

>
> > Thanks again!
> >
> > Matt
> >
> > On Fri, Mar 19, 2021 at 1:58 PM Joel Sherrill <joel at rtems.org> wrote:
> > >
> > > Keep devel@ on the list. :)
> > >
> > > On Fri, Mar 19, 2021 at 7:51 AM Matthew Joyce <mfjoyce2004 at gmail.com>
> wrote:
> > >>
> > >> Sir,
> > >>
> > >> Thank you for the link! I see that you're right, those last four are
> > >> in newlib, plus memmem(). I updated those in the Google Sheet.
> > >>
> > >> Now I see the newlib part, but where are you referring to specifically
> > >> when you say RTEMS, as in "POSIX support comes from a mix of RTEMS and
> > >> newlib"?
> > >
> > >
> > > POSIX is a HUGE HUGE standard and references other standards. One
> > > it references and pulls in is the C99 Standard C Library which is libc
> and
> > > libm. RTEMS mostly does not implement this functionality and relies on
> > > another open source project for those APIs. Newlib is an open source
> > > C Library used by RTEMS, Cygwin, and most embedded systems GNU tools
> > > chains.
> > >
> > > Most of the POSIX header files with RTEMS are actually in Newlib even
> > > if they originated with RTEMS. Many are shared with Cygwin.
> > >
> > > So methods like the string, memory, and *printf come from Newlib since
> they
> > > are in C99. We provide POSIX like threading, signals, core file
> access, and
> > > much more.
> > >
> > > It's a complementary relationship but it takes a bit to figure out when
> > > something should be in one or the other. The line gets blurred at
> times.
> > >
> > > Say you added a new CPU architecture implementation of a math
> > > method (like Eshan did last year), then it goes in newlib. But he also
> > > added some POSIX methods which go in RTEMS. In either case,
> > > we like tests for them in RTEMS to show they work in our environment.
> > >
> > > --joel
> > >
> > >
> > >
> > >>
> > >> Thanks again!
> > >>
> > >> Matt
> > >>
> > >> On Fri, Mar 19, 2021 at 1:13 PM Joel Sherrill <joel at rtems.org> wrote:
> > >> >
> > >> >
> > >> >
> > >> > On Fri, Mar 19, 2021, 6:40 AM Joel Sherrill <joel at rtems.org> wrote:
> > >> >>
> > >> >>
> > >> >>
> > >> >> On Fri, Mar 19, 2021, 5:48 AM Matthew Joyce <mfjoyce2004 at gmail.com>
> wrote:
> > >> >>>
> > >> >>>
> https://docs.google.com/spreadsheets/d/1reCNOIZC5JTwQENgl-hvG8THfQqNtlUDVy_07PYodic/edit?usp=sharing
> > >> >>>
> > >> >>> Hello,
> > >> >>>
> > >> >>> As suggested by Dr. Sherril, I've taken an initial look through
> this
> > >> >>> document https://www.opengroup.org/austin/docs/austin_1110.pdf
> and
> > >> >>> added the new methods  to a Googe Sheet, linked above.
> > >> >>>
> > >> >>> None of them appear to be in the RTEMS POSIX API Users Guide, but
> > >> >>> maybe that's not the right place to look. I'll stand by for your
> > >> >>> feedback regarding what's possible / desirable to add to RTEMS.
> > >> >>
> > >> >>
> > >> >> It is possible they are in our C Library or Math Library.  Or just
> not in the manual. The POSIX manual tends to be sparse since you can always
> use man pages or the POSIX standard.
> > >> >>
> > >> >> Since you have RTEMS and tools built. Find one of the libc.a and
> libm.a files in the tools install and librtemscpu.a in the RTEMS build or
> install. Then try a command something like this:
> > >> >>
> > >> >> CPU-rtems6-nm LIBRARY | grep SYMBOL
> > >> >>
> > >> >> If you see it list with T then it is in the text section and there.
> > >> >
> > >> >
> > >> > Following up, I initially answered from my phone and didn't look at
> source.  I am still on my phone but looked through the list and think the
> last four methods are probably the only ones currently supported.
> > >> >
> > >> >
> https://sourceware.org/git/?p=newlib-cygwin.git;a=tree;f=newlib/libc/string;h=ceeec602cdd0e6b5c6b002b741bda9b41da4e441;hb=HEAD
> > >> >
> > >> > POSIX support comes from a mix of RTEMS and newlib. That's key to
> this type of project.
> > >> >
> > >> > --joel
> > >> >>
> > >> >>
> > >> >>
> > >> >>>
> > >> >>> Thanks very much for your time!
> > >> >>>
> > >> >>> Sincerely,
> > >> >>>
> > >> >>> Matt
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210319/30108dcb/attachment.html>


More information about the devel mailing list