OSDN Git Service

hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / common / poll.c
index c957f1e..c76df96 100644 (file)
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define getdtablesize __getdtablesize
-#define select __select
-
 #include "syscalls.h"
 #include <sys/poll.h>
 
 #ifdef __NR_poll
-#define __NR___poll __NR_poll
-attribute_hidden _syscall3(int, __poll, struct pollfd *, fds,
+_syscall3(int, poll, struct pollfd *, fds,
        unsigned long int, nfds, int, timeout);
 #else
 
@@ -37,6 +33,11 @@ attribute_hidden _syscall3(int, __poll, struct pollfd *, fds,
 #include <sys/param.h>
 #include <unistd.h>
 
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memset)
+libc_hidden_proto(getdtablesize)
+libc_hidden_proto(select)
+
 /* uClinux 2.0 doesn't have poll, emulate it using select */
 
 /* Poll the file descriptors described by the NFDS structures starting at
@@ -45,7 +46,7 @@ attribute_hidden _syscall3(int, __poll, struct pollfd *, fds,
    Returns the number of file descriptors with events, zero if timed out,
    or -1 for errors.  */
 
-int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
 {
     static int max_fd_size;
     struct timeval tv;
@@ -65,9 +66,9 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
 
     /* We can't call FD_ZERO, since FD_ZERO only works with sets
        of exactly __FD_SETSIZE size.  */
-    __memset (rset, 0, bytes);
-    __memset (wset, 0, bytes);
-    __memset (xset, 0, bytes);
+    memset (rset, 0, bytes);
+    memset (wset, 0, bytes);
+    memset (xset, 0, bytes);
 
     for (f = fds; f < &fds[nfds]; ++f)
     {
@@ -89,13 +90,13 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
                nwset = alloca (nbytes);
                nxset = alloca (nbytes);
 
-               __memset ((char *) nrset + bytes, 0, nbytes - bytes);
-               __memset ((char *) nwset + bytes, 0, nbytes - bytes);
-               __memset ((char *) nxset + bytes, 0, nbytes - bytes);
+               memset ((char *) nrset + bytes, 0, nbytes - bytes);
+               memset ((char *) nwset + bytes, 0, nbytes - bytes);
+               memset ((char *) nxset + bytes, 0, nbytes - bytes);
 
-               rset = __memcpy (nrset, rset, bytes);
-               wset = __memcpy (nwset, wset, bytes);
-               xset = __memcpy (nxset, xset, bytes);
+               rset = memcpy (nrset, rset, bytes);
+               wset = memcpy (nwset, wset, bytes);
+               xset = memcpy (nxset, xset, bytes);
 
                bytes = nbytes;
            }
@@ -129,9 +130,9 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
            struct timeval sngl_tv;
 
            /* Clear the original set.  */
-           __memset (rset, 0, bytes);
-           __memset (wset, 0, bytes);
-           __memset (xset, 0, bytes);
+           memset (rset, 0, bytes);
+           memset (wset, 0, bytes);
+           memset (xset, 0, bytes);
 
            /* This means we don't wait for input.  */
            sngl_tv.tv_sec = 0;
@@ -148,9 +149,9 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
                {
                    int n;
 
-                   __memset (sngl_rset, 0, bytes);
-                   __memset (sngl_wset, 0, bytes);
-                   __memset (sngl_xset, 0, bytes);
+                   memset (sngl_rset, 0, bytes);
+                   memset (sngl_wset, 0, bytes);
+                   memset (sngl_xset, 0, bytes);
 
                    if (f->events & POLLIN)
                        FD_SET (f->fd, sngl_rset);
@@ -204,4 +205,5 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
 }
 
 #endif
-strong_alias(__poll,poll)
+libc_hidden_proto(poll)
+libc_hidden_def(poll)