<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I don't see how that can possibly be anything but a typo.<br>
    <br>
    I am going to commit a fix on the grounds of obvious.<br>
    <br>
    Thanks.<br>
    <br>
    --joel<br>
    <div class="moz-cite-prefix">On 5/22/2014 5:08 PM, Tom Smith wrote:<br>
    </div>
    <blockquote
cite="mid:CAPzmA6ceqfoQbQm2gY56j1sMiYAuPxQu8R9f_CLbc6yQ+WX8fw@mail.gmail.com"
      type="cite">
      <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>
</code></pre>
          <pre style="font-size:13px;padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0)"><code>
</code></pre>
          <div class="gmail_quote">2014-05-23 1:00 GMT+08:00 <span
              dir="ltr"><<a moz-do-not-send="true"
                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 moz-do-not-send="true"
                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 moz-do-not-send="true"
                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 moz-do-not-send="true"
                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 moz-do-not-send="true"
                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 moz-do-not-send="true"
                href="mailto:thomas73.kim@gmail.com">thomas73.kim@gmail.com</a>><br>
              To: "<a moz-do-not-send="true"
                href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a>"
              <<a moz-do-not-send="true"
                href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a>><br>
              Subject: Is there a bug using select() ?<br>
              Message-ID:<br>
                      <<a moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
                href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>><br>
              To: <a moz-do-not-send="true"
                href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
              Subject: Re: Is there a bug using select() ?<br>
              Message-ID: <<a moz-do-not-send="true"
                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 moz-do-not-send="true"
                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 moz-do-not-send="true"
                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 moz-do-not-send="true"
                href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
              <a moz-do-not-send="true"
                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>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Joel Sherrill, Ph.D.             Director of Research & Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a>        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985</pre>
  </body>
</html>