summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/accept.S1
-rw-r--r--sysdeps/unix/sysv/linux/bind.S1
-rw-r--r--sysdeps/unix/sysv/linux/gethostid.c4
-rw-r--r--sysdeps/unix/sysv/linux/getpt.c4
-rw-r--r--sysdeps/unix/sysv/linux/getsockname.S1
-rw-r--r--sysdeps/unix/sysv/linux/i386/socket.S6
-rw-r--r--sysdeps/unix/sysv/linux/if_index.c40
-rw-r--r--sysdeps/unix/sysv/linux/listen.S1
-rw-r--r--sysdeps/unix/sysv/linux/ptsname.c2
-rw-r--r--sysdeps/unix/sysv/linux/recvfrom.S1
-rw-r--r--sysdeps/unix/sysv/linux/sendmsg.c6
-rw-r--r--sysdeps/unix/sysv/linux/sendto.S1
-rw-r--r--sysdeps/unix/sysv/linux/setsockopt.S1
-rw-r--r--sysdeps/unix/sysv/linux/statvfs.c4
-rw-r--r--sysdeps/unix/sysv/linux/ttyname.c6
-rw-r--r--sysdeps/unix/sysv/linux/ttyname_r.c10
-rw-r--r--sysdeps/unix/sysv/linux/ulimit.c4
-rw-r--r--sysdeps/unix/sysv/linux/unlockpt.c2
18 files changed, 51 insertions, 44 deletions
diff --git a/sysdeps/unix/sysv/linux/accept.S b/sysdeps/unix/sysv/linux/accept.S
index 196634d46a..431dec0324 100644
--- a/sysdeps/unix/sysv/linux/accept.S
+++ b/sysdeps/unix/sysv/linux/accept.S
@@ -2,4 +2,3 @@
 #define	__socket __libc_accept
 #define	NARGS	3
 #include <socket.S>
-weak_alias (__libc_accept, __accept)
diff --git a/sysdeps/unix/sysv/linux/bind.S b/sysdeps/unix/sysv/linux/bind.S
index 61fb5ebff8..25ff7ecbfd 100644
--- a/sysdeps/unix/sysv/linux/bind.S
+++ b/sysdeps/unix/sysv/linux/bind.S
@@ -1,3 +1,4 @@
 #define	socket	bind
 #define	NARGS	3
+#define NO_WEAK_ALIAS	1
 #include <socket.S>
diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c
index 67e64208b3..f8a3b80481 100644
--- a/sysdeps/unix/sysv/linux/gethostid.c
+++ b/sysdeps/unix/sysv/linux/gethostid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -81,7 +81,7 @@ gethostid ()
 
   /* Getting from the file was not successful.  An intelligent guess for
      a unique number of a host is its IP address.  Return this.  */
-  if (gethostname (hostname, MAXHOSTNAMELEN) < 0 || hostname[0] == '\0')
+  if (__gethostname (hostname, MAXHOSTNAMELEN) < 0 || hostname[0] == '\0')
     /* This also fails.  Return and arbitrary value.  */
     return 0;
 
diff --git a/sysdeps/unix/sysv/linux/getpt.c b/sysdeps/unix/sysv/linux/getpt.c
index 3c0b7a9399..0f5949d1bc 100644
--- a/sysdeps/unix/sysv/linux/getpt.c
+++ b/sysdeps/unix/sysv/linux/getpt.c
@@ -43,7 +43,7 @@ __getpt ()
   /* The new way:  */
   if (have_dev_ptmx)
     {
-      fd = open ("/dev/ptmx", O_RDWR);
+      fd = __open ("/dev/ptmx", O_RDWR);
       if (fd != -1)
 	return fd;
       else
@@ -64,7 +64,7 @@ __getpt ()
       for (j = __ptyname2; *j; ++j)
         {
 	  namebuf[9] = *j;
-	  fd = open (namebuf, O_RDWR);
+	  fd = __open (namebuf, O_RDWR);
 	  if (fd != -1)
 	    return fd;
 	  if (errno != EIO)
diff --git a/sysdeps/unix/sysv/linux/getsockname.S b/sysdeps/unix/sysv/linux/getsockname.S
index c138be9da5..31d37a4f0a 100644
--- a/sysdeps/unix/sysv/linux/getsockname.S
+++ b/sysdeps/unix/sysv/linux/getsockname.S
@@ -1,3 +1,4 @@
 #define	socket	getsockname
 #define	NARGS	3
+#define NO_WEAK_ALIAS	1
 #include <socket.S>
diff --git a/sysdeps/unix/sysv/linux/i386/socket.S b/sysdeps/unix/sysv/linux/i386/socket.S
index 245d37a17f..c25b5b82cc 100644
--- a/sysdeps/unix/sysv/linux/i386/socket.S
+++ b/sysdeps/unix/sysv/linux/i386/socket.S
@@ -32,7 +32,11 @@
    The .S files for the other calls just #define socket and #include this.  */
 
 #ifndef __socket
+#ifndef NO_WEAK_ALIAS
 #define __socket P(__,socket)
+#else
+#define __socket socket
+#endif
 #endif
 
 .globl __socket
@@ -63,4 +67,6 @@ L(pseudo_end):
 
 PSEUDO_END (__socket)
 
+#ifndef NO_WEAK_ALIAS
 weak_alias (__socket, socket)
+#endif
diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c
index de66b5cb21..aa89a38e69 100644
--- a/sysdeps/unix/sysv/linux/if_index.c
+++ b/sysdeps/unix/sysv/linux/if_index.c
@@ -40,7 +40,7 @@ opensock (void)
 
   if (sock_af != -1)
     {
-      fd = socket (sock_af, SOCK_DGRAM, 0);
+      fd = __socket (sock_af, SOCK_DGRAM, 0);
       if (fd != -1)
         return fd;
     }
@@ -48,19 +48,19 @@ opensock (void)
   __libc_lock_lock (lock);
 
   if (sock_af != -1)
-    fd = socket (sock_af, SOCK_DGRAM, 0);
+    fd = __socket (sock_af, SOCK_DGRAM, 0);
 
   if (fd == -1)
     {
-      fd = socket (sock_af = AF_INET6, SOCK_DGRAM, 0);
+      fd = __socket (sock_af = AF_INET6, SOCK_DGRAM, 0);
       if (fd < 0)
-	fd = socket (sock_af = AF_INET, SOCK_DGRAM, 0);
+	fd = __socket (sock_af = AF_INET, SOCK_DGRAM, 0);
       if (fd < 0)
-	fd = socket (sock_af = AF_IPX, SOCK_DGRAM, 0);
+	fd = __socket (sock_af = AF_IPX, SOCK_DGRAM, 0);
       if (fd < 0)
-	fd = socket (sock_af = AF_AX25, SOCK_DGRAM, 0);
+	fd = __socket (sock_af = AF_AX25, SOCK_DGRAM, 0);
       if (fd < 0)
-	fd = socket (sock_af = AF_APPLETALK, SOCK_DGRAM, 0);
+	fd = __socket (sock_af = AF_APPLETALK, SOCK_DGRAM, 0);
     }
 
   __libc_lock_unlock (lock);
@@ -82,15 +82,15 @@ if_nametoindex (const char *ifname)
     return 0;
 
   strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
-  if (ioctl (fd, SIOGIFINDEX, &ifr) < 0)
+  if (__ioctl (fd, SIOGIFINDEX, &ifr) < 0)
     {
       int saved_errno = errno;
-      close (fd);
+      __close (fd);
       if (saved_errno == EINVAL)
 	__set_errno (ENOSYS);
       return 0;
     }
-  close (fd);
+  __close (fd);
   return ifr.ifr_ifindex;
 #endif
 }
@@ -134,7 +134,7 @@ if_nameindex (void)
     {
       ifc.ifc_buf = NULL;
       ifc.ifc_len = 0;
-      if (ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
+      if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
 	{
 	  new_siocgifconf = 0;
 	  rq_len = RQ_IFS * sizeof (struct ifreq);
@@ -149,9 +149,9 @@ if_nameindex (void)
   do
     {
       ifc.ifc_buf = alloca (ifc.ifc_len = rq_len);
-      if ((ifc.ifc_buf == NULL) || (ioctl (fd, SIOCGIFCONF, &ifc) < 0))
+      if (ifc.ifc_buf == NULL || __ioctl (fd, SIOCGIFCONF, &ifc) < 0)
 	{
-	  close (fd);
+	  __close (fd);
 	  return NULL;
 	}
       rq_len *= 2;
@@ -163,7 +163,7 @@ if_nameindex (void)
   idx = malloc ((nifs + 1) * sizeof (struct if_nameindex));
   if (idx == NULL)
     {
-      close (fd);
+      __close (fd);
       return NULL;
     }
 
@@ -172,7 +172,7 @@ if_nameindex (void)
       struct ifreq *ifr = &ifc.ifc_req[i];
       idx[i].if_name = __strdup (ifr->ifr_name);
       if (idx[i].if_name == NULL
-	  || ioctl (fd, SIOGIFINDEX, ifr) < 0)
+	  || __ioctl (fd, SIOGIFINDEX, ifr) < 0)
 	{
 	  int saved_errno = errno;
 	  unsigned int j;
@@ -180,7 +180,7 @@ if_nameindex (void)
 	  for (j =  0; j < i; ++j)
 	    free (idx[j].if_name);
 	  free (idx);
-	  close (fd);
+	  __close (fd);
 	  if (saved_errno == EINVAL)
 	    __set_errno (ENOSYS);
 	  return NULL;
@@ -191,7 +191,7 @@ if_nameindex (void)
   idx[i].if_index = 0;
   idx[i].if_name = NULL;
 
-  close (fd);
+  __close (fd);
   return idx;
 #endif
 }
@@ -224,18 +224,18 @@ if_indextoname (unsigned int ifindex, char *ifname)
 	return NULL;
 
       ifr.ifr_ifindex = ifindex;
-      if (ioctl (fd, SIOGIFNAME, &ifr) < 0)
+      if (__ioctl (fd, SIOGIFNAME, &ifr) < 0)
 	{
 	  if (errno == EINVAL)
 	    siogifname_works = 0;   /* Don't make the same mistake twice. */
 	}
       else
 	{
-	  close (fd);
+	  __close (fd);
 	  return strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
 	}
 
-      close (fd);
+      __close (fd);
 
       __set_errno (serrno);
     }
diff --git a/sysdeps/unix/sysv/linux/listen.S b/sysdeps/unix/sysv/linux/listen.S
index 4c7e435196..115bf2b2d0 100644
--- a/sysdeps/unix/sysv/linux/listen.S
+++ b/sysdeps/unix/sysv/linux/listen.S
@@ -1,3 +1,4 @@
 #define	socket	listen
 #define	NARGS	2
+#define NO_WEAK_ALIAS	1
 #include <socket.S>
diff --git a/sysdeps/unix/sysv/linux/ptsname.c b/sysdeps/unix/sysv/linux/ptsname.c
index 2db8f8d08a..052516c7ac 100644
--- a/sysdeps/unix/sysv/linux/ptsname.c
+++ b/sysdeps/unix/sysv/linux/ptsname.c
@@ -75,7 +75,7 @@ __ptsname_r (fd, buf, buflen)
 #ifdef TIOCGPTN
   if (tiocgptn_works)
     {
-      if (ioctl (fd, TIOCGPTN, &ptyno) == 0)
+      if (__ioctl (fd, TIOCGPTN, &ptyno) == 0)
 	goto gotit;
       else
 	{
diff --git a/sysdeps/unix/sysv/linux/recvfrom.S b/sysdeps/unix/sysv/linux/recvfrom.S
index 93a3110d0a..7d0e2b0ea8 100644
--- a/sysdeps/unix/sysv/linux/recvfrom.S
+++ b/sysdeps/unix/sysv/linux/recvfrom.S
@@ -2,4 +2,3 @@
 #define	__socket __libc_recvfrom
 #define	NARGS	6
 #include <socket.S>
-weak_alias (__libc_recvfrom, __recvfrom)
diff --git a/sysdeps/unix/sysv/linux/sendmsg.c b/sysdeps/unix/sysv/linux/sendmsg.c
index 273add903e..16774c48b1 100644
--- a/sysdeps/unix/sysv/linux/sendmsg.c
+++ b/sysdeps/unix/sysv/linux/sendmsg.c
@@ -63,12 +63,12 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags)
 	     You can send real, effective, or set- uid and gid.
 	     If the user hasn't filled in the buffer, we default to
 	     real uid and gid. */
-	  pid = getpid ();
+	  pid = __getpid ();
 	  if (cc->cmcred_pid != pid)
 	  {
 	      u->pid = pid;
-	      u->uid = getuid ();
-	      u->gid = getgid ();
+	      u->uid = __getuid ();
+	      u->gid = __getgid ();
 	  }
 	  else
 	  {
diff --git a/sysdeps/unix/sysv/linux/sendto.S b/sysdeps/unix/sysv/linux/sendto.S
index 8717b2bac1..f0acb88465 100644
--- a/sysdeps/unix/sysv/linux/sendto.S
+++ b/sysdeps/unix/sysv/linux/sendto.S
@@ -2,4 +2,3 @@
 #define	__socket __libc_sendto
 #define	NARGS	6
 #include <socket.S>
-weak_alias (__libc_sendto, __sendto)
diff --git a/sysdeps/unix/sysv/linux/setsockopt.S b/sysdeps/unix/sysv/linux/setsockopt.S
index 01b2799ae8..09d9109be2 100644
--- a/sysdeps/unix/sysv/linux/setsockopt.S
+++ b/sysdeps/unix/sysv/linux/setsockopt.S
@@ -1,3 +1,4 @@
 #define	socket	setsockopt
 #define	NARGS	5
+#define NO_WEAK_ALIAS	1
 #include <socket.S>
diff --git a/sysdeps/unix/sysv/linux/statvfs.c b/sysdeps/unix/sysv/linux/statvfs.c
index c3df2e6a49..74c4985fe1 100644
--- a/sysdeps/unix/sysv/linux/statvfs.c
+++ b/sysdeps/unix/sysv/linux/statvfs.c
@@ -30,7 +30,7 @@ statvfs (const char *file, struct statvfs *buf)
   int retval;
   int fd;
 
-  fd = open (file, O_RDONLY);
+  fd = __open (file, O_RDONLY);
   if (fd < 0)
     return -1;
 
@@ -39,7 +39,7 @@ statvfs (const char *file, struct statvfs *buf)
 
   /* Close the file while preserving the error number.  */
   save_errno = errno;
-  close (fd);
+  __close (fd);
   __set_errno (save_errno);
 
   return retval;
diff --git a/sysdeps/unix/sysv/linux/ttyname.c b/sysdeps/unix/sysv/linux/ttyname.c
index 7f276b6130..91f0d7a40f 100644
--- a/sysdeps/unix/sysv/linux/ttyname.c
+++ b/sysdeps/unix/sysv/linux/ttyname.c
@@ -72,7 +72,7 @@ getttyname (dev, fd, mydev, myino, save, dostat)
 	      {
 		*dostat = -1;
 		/* Perhaps it helps to free the directory stream buffer.  */
-		(void) closedir (dirstream);
+		(void) __closedir (dirstream);
 		return NULL;
 	      }
 	    *((char *) __mempcpy (name, dev, devlen - 1)) = '/';
@@ -86,14 +86,14 @@ getttyname (dev, fd, mydev, myino, save, dostat)
 #endif
 	   )
 	  {
-	    (void) closedir (dirstream);
+	    (void) __closedir (dirstream);
 	    __ttyname = name;
 	    __set_errno (save);
 	    return name;
 	  }
       }
 
-  (void) closedir (dirstream);
+  (void) __closedir (dirstream);
   __set_errno (save);
   return NULL;
 }
diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c b/sysdeps/unix/sysv/linux/ttyname_r.c
index 9f22f71f31..9c859caa25 100644
--- a/sysdeps/unix/sysv/linux/ttyname_r.c
+++ b/sysdeps/unix/sysv/linux/ttyname_r.c
@@ -46,14 +46,14 @@ getttyname_r (fd, buf, buflen, mydev, myino, save, dostat)
   struct dirent *d;
   size_t devlen = strlen (buf);
 
-  dirstream = opendir (buf);
+  dirstream = __opendir (buf);
   if (dirstream == NULL)
     {
       *dostat = -1;
       return errno;
     }
 
-  while ((d = readdir (dirstream)) != NULL)
+  while ((d = __readdir (dirstream)) != NULL)
     if (((ino_t) d->d_fileno == myino || *dostat)
 	&& strcmp (d->d_name, "stdin")
 	&& strcmp (d->d_name, "stdout")
@@ -65,7 +65,7 @@ getttyname_r (fd, buf, buflen, mydev, myino, save, dostat)
 	if (needed > buflen)
 	  {
 	    *dostat = -1;
-	    (void) closedir (dirstream);
+	    (void) __closedir (dirstream);
 	    __set_errno (ERANGE);
 	    return ERANGE;
 	  }
@@ -81,13 +81,13 @@ getttyname_r (fd, buf, buflen, mydev, myino, save, dostat)
 #endif
 	   )
 	  {
-	    (void) closedir (dirstream);
+	    (void) __closedir (dirstream);
 	    __set_errno (save);
 	    return 0;
 	  }
       }
 
-  (void) closedir (dirstream);
+  (void) __closedir (dirstream);
   __set_errno (save);
   /* It is not clear what to return in this case.  `isatty' says FD
      refers to a TTY but no entry in /dev has this inode.  */
diff --git a/sysdeps/unix/sysv/linux/ulimit.c b/sysdeps/unix/sysv/linux/ulimit.c
index 2d9e86a63a..ec0337428d 100644
--- a/sysdeps/unix/sysv/linux/ulimit.c
+++ b/sysdeps/unix/sysv/linux/ulimit.c
@@ -45,7 +45,7 @@ __ulimit (int cmd, ...)
     {
     case UL_GETFSIZE:
       /* Get limit on file size.  */
-      if (getrlimit (RLIMIT_FSIZE, &limit) == 0)
+      if (__getrlimit (RLIMIT_FSIZE, &limit) == 0)
 	/* Convert from bytes to 512 byte units.  */
 	result =  limit.rlim_cur / 512;
       break;
@@ -63,7 +63,7 @@ __ulimit (int cmd, ...)
       break;
 
     case __UL_GETOPENMAX:
-      result = sysconf (_SC_OPEN_MAX);
+      result = __sysconf (_SC_OPEN_MAX);
       break;
 
     default:
diff --git a/sysdeps/unix/sysv/linux/unlockpt.c b/sysdeps/unix/sysv/linux/unlockpt.c
index a5f0b2a484..e20545fe80 100644
--- a/sysdeps/unix/sysv/linux/unlockpt.c
+++ b/sysdeps/unix/sysv/linux/unlockpt.c
@@ -33,7 +33,7 @@ unlockpt (fd)
   int serrno = errno;
   int unlock = 0;
 
-  if (ioctl (fd, TIOCSPTLCK, &unlock))
+  if (__ioctl (fd, TIOCSPTLCK, &unlock))
     {
       if (errno == EINVAL)
 	{