<div dir="ltr"><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13px"><code>AC_CACHE_CHECK([whether CPU supports SMP],
rtems_cv_HAS_POSIX_API,
[dnl
case "$RTEMS_CPU" in
*)
if test "${RTEMS_HAS_SMP}" = "yes"; then
rtems_cv_HAS_SMP="yes";
else
rtems_cv_HAS_SMP="disabled";
fi
;;
esac])</code></pre><div class="gmail_extra"><br><pre style="font-size:13px;padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><code>should rtems_cv_HAS_POSIX_API be </code><span style="font-family:arial">rtems_cv_HAS_SMP ?</span></pre>
<pre style="font-size:13px;padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><code><br></code></pre><pre style="font-size:13px;padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><code><br></code></pre>
<div class="gmail_quote">2014-05-23 1:00 GMT+08:00 <span dir="ltr"><<a href="mailto:rtems-users-request@rtems.org" target="_blank">rtems-users-request@rtems.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Send rtems-users mailing list submissions to<br>
<a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:rtems-users-request@rtems.org">rtems-users-request@rtems.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:rtems-users-owner@rtems.org">rtems-users-owner@rtems.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of rtems-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Is there a bug using select() ? (Thomas Kim)<br>
2. Re: Is there a bug using select() ? (Sebastian Huber)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 22 May 2014 18:09:27 +0900<br>
From: Thomas Kim <<a href="mailto:thomas73.kim@gmail.com">thomas73.kim@gmail.com</a>><br>
To: "<a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a>" <<a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a>><br>
Subject: Is there a bug using select() ?<br>
Message-ID:<br>
<<a href="mailto:CADY8aTDk89AvKHsOwx0cWhxZ6mnSS0JH1AVJE-1pgfNQrXTvig@mail.gmail.com">CADY8aTDk89AvKHsOwx0cWhxZ6mnSS0JH1AVJE-1pgfNQrXTvig@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Dear Sir,<br>
<br>
I am tring to integrate POSIX application on RTEMS.<br>
our POSIX application use select() for I/O multiplexing mechanism.<br>
At this time, select() always return "-1" value, it mean "bad file number".<br>
<br>
Therefore, I tested simple test code using select() function in below;<br>
Is it a bug using select() ? and, Is there how to do fix this problem ?<br>
<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
void test_select(void)<br>
{<br>
int fd[2];<br>
int i;<br>
int n;<br>
int state;<br>
<br>
char buf[255];<br>
<br>
struct timeval tv;<br>
<br>
fd_set readfds, writefds;<br>
<br>
mkdir ("tmp", S_IRWXU|S_IRWXG|S_IRWXO);<br>
<br>
if ((fd[0] = open("/tmp/testfile", O_CREAT | O_RDONLY)) == -1)<br>
{<br>
printf("file open error : ");<br>
exit(0);<br>
}<br>
if ((fd[1] = open("/tmp/testfile2", O_CREAT | O_RDONLY)) == -1)<br>
{<br>
printf("file open error : ");<br>
exit(0);<br>
}<br>
<br>
memset (buf, 0x00, 255);<br>
<br>
for(;;)<br>
{<br>
FD_ZERO(&readfds);<br>
FD_SET(fd[0], &readfds);<br>
FD_SET(fd[1], &readfds);<br>
<br>
state = select(fd[1]+1, &readfds, NULL, NULL, NULL);<br>
switch(state)<br>
{<br>
case -1:<br>
perror("select error : ");<br>
exit(0);<br>
break;<br>
<br>
default :<br>
for (i = 0; i < 2; i++)<br>
{<br>
if (FD_ISSET(fd[i], &readfds))<br>
{<br>
while ((n = read(fd[i], buf, 255)) > 0)<br>
printf("(%d) [%d] %s", state, i, buf);<br>
}<br>
}<br>
memset (buf, 0x00, 255);<br>
break;<br>
}<br>
usleep(1000);<br>
}<br>
}<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
<br>
Best Regards.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.rtems.org/pipermail/rtems-users/attachments/20140522/f60445da/attachment-0001.html" target="_blank">http://www.rtems.org/pipermail/rtems-users/attachments/20140522/f60445da/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 22 May 2014 11:24:09 +0200<br>
From: Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>><br>
To: <a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
Subject: Re: Is there a bug using select() ?<br>
Message-ID: <<a href="mailto:537DC239.6090702@embedded-brains.de">537DC239.6090702@embedded-brains.de</a>><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
On 2014-05-22 11:09, Thomas Kim wrote:<br>
> I am tring to integrate POSIX application on RTEMS.<br>
> our POSIX application use select() for I/O multiplexing mechanism.<br>
> At this time, select() always return "-1" value, it mean "bad file number".<br>
><br>
> Therefore, I tested simple test code using select() function in below;<br>
> Is it a bug using select() ? and, Is there how to do fix this problem ?<br>
><br>
<br>
The select() function works only with sockets on RTEMS. With the new network<br>
stack it is also possible to use select() for normal files:<br>
<br>
<a href="http://git.rtems.org/rtems-libbsd/" target="_blank">http://git.rtems.org/rtems-libbsd/</a><br>
<br>
The new network stack supports also kqueue().<br>
<br>
--<br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone : +49 89 189 47 41-16<br>
Fax : +49 89 189 47 41-09<br>
E-Mail : <a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a><br>
PGP : Public key available on request.<br>
<br>
Diese Nachricht ist keine gesch?ftliche Mitteilung im Sinne des EHUG.<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
rtems-users mailing list<br>
<a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
<a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
<br>
<br>
End of rtems-users Digest, Vol 92, Issue 18<br>
*******************************************<br>
</blockquote></div><br></div></div>