<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 25, 2020 at 4:18 AM Joel Sherrill <<a href="mailto:joel@rtems.org">joel@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 24, 2020 at 5:33 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">email subject can be shortened. almost everything is a discussion :)<br>
<br>
On Tue, Mar 24, 2020 at 3:49 PM Eshan Dhawan <<a href="mailto:eshandhawan51@gmail.com" target="_blank">eshandhawan51@gmail.com</a>> wrote:<br>
><br>
> Hello everyone,<br>
> I have identified sources to port headers and methods to RTEMS and Newlib. I have given priority to FreeBSD for the choice of source. But method not present in FreeBSD can be ported from alternative sources like NetBSD and musl.<br>
><br>
Considering the simplicity, you may want to compare musl vs freebsd as well.<br>
<br>
> -> Missing methods of math.h: I have compiled a list of methods and their sources. Some need to be implemented from scratch.<br>
> list: Math.h missing functions<br>
><br>
> -> sys/ipc.h: This header and its function can be ported from FreeBSD.<br>
> ipc.h : <a href="https://github.com/freebsd/freebsd/blob/master/sys/sys/ipc.h" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd/blob/master/sys/sys/ipc.h</a><br>
> ftok.c: <a href="https://github.com/freebsd/freebsd/blob/master/lib/libc/gen/ftok.c" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/libc/gen/ftok.c</a></blockquote><div><br></div><div>sys/ipc.h has a lot in it. If you head down the path of adding sys/ipc.h, you need to evaluate what else is in the file. </div><div><br></div><div>Adding support for the System V style SHM, Semaphores, or Message Queues is possible (I think) but is definitely harder than the likely value to the community.</div></div></div></blockquote><div>I would like to know missing headers and methods that would be more valuable to the community  <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
><br>
> ->fmtmsg.h: its implementation is also present in FreeBSD.<br>
> <a href="https://github.com/freebsd/freebsd/blob/master/include/fmtmsg.h" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd/blob/master/include/fmtmsg.h</a><br>
> <a href="https://github.com/freebsd/freebsd/blob/master/lib/libc/gen/fmtmsg.c" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/libc/gen/fmtmsg.c</a></blockquote><div><br></div><div>By my recollection, this would be a discrete thing to add to Newlib.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
><br>
> ->spawn.h: Its implementation is in FreeBSD.<br>
> <a href="https://github.com/freebsd/freebsd/blob/master/lib/libc/gen/posix_spawn.c" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/libc/gen/posix_spawn.c</a><br>
><br>
I'm worried about the large number of includes there. It may easily<br>
lead you to trouble chasing down transitive include headers, like what<br>
happened with Vaibhav before with search.h support.<br></blockquote><div><br></div><div>posix_spawn() cannot be supported by RTEMS. It is a new safer way to do</div><div>fork/exec. Don't spent any time on this. It will never work on RTEMS.</div><div><br></div><div>It is also a HUGE amount of methods and constants. :( </div></div></div></blockquote><div>Ok I will remove it from the proposal  <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> -> pselect() from <sys/select.h> : its implementation is also from FreeBSD<br>
> <a href="https://github.com/freebsd/freebsd/blob/master/lib/libc/sys/pselect.c" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd/blob/master/lib/libc/sys/pselect.c</a></blockquote><div><br></div><div>This would be added to rtems-libbsd. There may be specific technical challenges</div><div>why it is not present. Or it could just be an oversight.</div></div></div></blockquote><div>I haven't dig that deep.   <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
><br>
> -> confstr() from <unistd.h>: Its implementation is from FreeBSD<br>
> <a href="https://github.com/udp/freebsd-libc/blob/master/gen/confstr.c" rel="noreferrer" target="_blank">https://github.com/udp/freebsd-libc/blob/master/gen/confstr.c</a>.<br></blockquote><div><br></div><div>The implementation of this would go in RTEMS. </div><div><br></div><div>It is possible that the FreeBSD code is a guide but this cannot be a direct</div><div>copy to port. Each value defined by POSIX as fetchable must be properly</div><div>defined for RTEMS. You would need to make a table of all the "names"</div><div>that can be looked up in your proposal. </div></div></div></blockquote><div>what would be better writing it from scratch of just doing minor tweaks in the FreeBSD code <br></div><div>We also have an option to take code from musl <br></div><div><a href="https://git.musl-libc.org/cgit/musl/tree/src/conf/confstr.c">https://git.musl-libc.org/cgit/musl/tree/src/conf/confstr.c</a><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>FWIW I think the FreeBSD version is more right than wrong for RTEMS </div><div>but it can't be 100% right and needs analysis.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
><br>
> I would like everyone to review it and provide your suggestions.<br>
><br>
include details in your proposal also.<br></blockquote><div><br></div><div>+1 <br></div><div>I have already added these detatils to the proposal <br></div><div>but will change spawn.h <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> Thanks<br>
> -Eshan<br>
</blockquote></div></div>
</blockquote></div></div>