summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/pwd_grp/Makefile.in51
-rw-r--r--libc/pwd_grp/__parsegrent.c8
-rw-r--r--libc/pwd_grp/__parsepwent.c8
-rw-r--r--libc/pwd_grp/__parsespent.c8
-rw-r--r--libc/pwd_grp/__pgsreader.c8
-rw-r--r--libc/pwd_grp/fgetgrent.c8
-rw-r--r--libc/pwd_grp/fgetgrent_r.c8
-rw-r--r--libc/pwd_grp/fgetpwent.c8
-rw-r--r--libc/pwd_grp/fgetpwent_r.c8
-rw-r--r--libc/pwd_grp/fgetspent.c8
-rw-r--r--libc/pwd_grp/fgetspent_r.c8
-rw-r--r--libc/pwd_grp/getgrent.c8
-rw-r--r--libc/pwd_grp/getgrent_r.c12
-rw-r--r--libc/pwd_grp/getgrgid.c8
-rw-r--r--libc/pwd_grp/getgrgid_r.c8
-rw-r--r--libc/pwd_grp/getgrnam.c8
-rw-r--r--libc/pwd_grp/getgrnam_r.c8
-rw-r--r--libc/pwd_grp/getpw.c12
-rw-r--r--libc/pwd_grp/getpwent.c8
-rw-r--r--libc/pwd_grp/getpwent_r.c8
-rw-r--r--libc/pwd_grp/getpwnam.c8
-rw-r--r--libc/pwd_grp/getpwnam_r.c8
-rw-r--r--libc/pwd_grp/getpwuid.c8
-rw-r--r--libc/pwd_grp/getpwuid_r.c8
-rw-r--r--libc/pwd_grp/getspent.c8
-rw-r--r--libc/pwd_grp/getspent_r.c8
-rw-r--r--libc/pwd_grp/getspnam.c8
-rw-r--r--libc/pwd_grp/getspnam_r.c8
-rw-r--r--libc/pwd_grp/initgroups.c8
-rw-r--r--libc/pwd_grp/lckpwdf.c46
-rw-r--r--libc/pwd_grp/putgrent.c12
-rw-r--r--libc/pwd_grp/putpwent.c8
-rw-r--r--libc/pwd_grp/putspent.c8
-rw-r--r--libc/pwd_grp/pwd_grp.c191
-rw-r--r--libc/pwd_grp/pwd_grp_internal.c11
-rw-r--r--libc/pwd_grp/sgetspent.c8
-rw-r--r--libc/pwd_grp/sgetspent_r.c8
37 files changed, 418 insertions, 157 deletions
diff --git a/libc/pwd_grp/Makefile.in b/libc/pwd_grp/Makefile.in
index 3475d2331..253040e05 100644
--- a/libc/pwd_grp/Makefile.in
+++ b/libc/pwd_grp/Makefile.in
@@ -1,49 +1,32 @@
# Makefile for uClibc
#
# Copyright (C) 2000 by Lineo, inc.
-# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-MSRC:=pwd_grp.c
-MOBJ:= fgetpwent_r.o fgetgrent_r.o fgetpwent.o fgetgrent.o \
- getpwnam_r.o getgrnam_r.o getpwuid_r.o getgrgid_r.o \
- getpwuid.o getgrgid.o getpwnam.o getgrnam.o getpw.o \
- getpwent_r.o getgrent_r.o getpwent.o getgrent.o \
- initgroups.o putpwent.o putgrent.o \
- __parsepwent.o __parsegrent.o __pgsreader.o
+PWDGRP_DIR := $(top_srcdir)libc/pwd_grp
+PWDGRP_OUT := $(top_builddir)libc/pwd_grp
-ifeq ($(HAS_SHADOW),y)
-MOBJ+= fgetspent_r.o fgetspent.o sgetspent_r.o getspnam_r.o \
- getspnam.o getspent_r.o getspent.o sgetspent.o \
- putspent.o __parsespent.o # getspuid_r.o getspuid.o
-endif
-
-PWDGRP_DIR:=$(top_srcdir)libc/pwd_grp
-PWDGRP_OUT:=$(top_builddir)libc/pwd_grp
-
-PWDGRP_MSRC:=$(PWDGRP_DIR)/$(MSRC)
-PWDGRP_MOBJ:=$(patsubst %.o,$(PWDGRP_OUT)/%.o,$(MOBJ))
+CSRC := $(notdir $(wildcard $(PWDGRP_DIR)/*.c))
+CSRC := $(filter-out pwd_grp.c pwd_grp_internal.c,$(CSRC))
-PWDGRP_DEF:=$(patsubst %,-DL_%,$(subst .o,,$(notdir $(PWDGRP_MOBJ))))
-
-$(PWDGRP_MOBJ): $(PWDGRP_MSRC)
- $(compile.m)
-
-$(PWDGRP_MOBJ:.o=.os): $(PWDGRP_MSRC)
- $(compile.m)
+ifneq ($(HAS_SHADOW),y)
+SHADOW_CSRC := \
+ fgetspent_r.c fgetspent.c getspent_r.c getspent.c \
+ getspnam_r.c getspnam.c lckpwdf.c putspent.c \
+ sgetspent_r.c sgetspent.c __parsespent.c
+# getspuid_r.c getspuid.c
+CSRC := $(filter-out $(SHADOW_CSRC),$(CSRC))
+endif
-libc-a-y+=$(PWDGRP_MOBJ)
-libc-a-$(HAS_SHADOW)+=$(PWDGRP_OUT)/lckpwdf.o
-libc-so-y+=$(PWDGRP_MOBJ:.o=.os)
-libc-so-$(HAS_SHADOW)+=$(PWDGRP_OUT)/lckpwdf.os
+PWDGRP_SRC := $(patsubst %.c,$(PWDGRP_DIR)/%.c,$(CSRC))
+PWDGRP_OBJ := $(patsubst %.c,$(PWDGRP_OUT)/%.o,$(CSRC))
-CFLAGS-multi-y+=$(PWDGRP_DEF)
-libc-multi-y+=$(PWDGRP_MSRC)
-libc-multi-$(HAS_SHADOW)+=$(PWDGRP_DIR)/lckpwdf.c
+libc-y += $(PWDGRP_OBJ)
-objclean-y+=pwdgrp_objclean
+objclean-y += pwdgrp_objclean
pwdgrp_objclean:
$(RM) $(PWDGRP_OUT)/*.{o,os}
diff --git a/libc/pwd_grp/__parsegrent.c b/libc/pwd_grp/__parsegrent.c
new file mode 100644
index 000000000..e3ac4ad7b
--- /dev/null
+++ b/libc/pwd_grp/__parsegrent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L___parsegrent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/__parsepwent.c b/libc/pwd_grp/__parsepwent.c
new file mode 100644
index 000000000..2804a0a2f
--- /dev/null
+++ b/libc/pwd_grp/__parsepwent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L___parsepwent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/__parsespent.c b/libc/pwd_grp/__parsespent.c
new file mode 100644
index 000000000..08321d075
--- /dev/null
+++ b/libc/pwd_grp/__parsespent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L___parsespent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/__pgsreader.c b/libc/pwd_grp/__pgsreader.c
new file mode 100644
index 000000000..ac39ce94f
--- /dev/null
+++ b/libc/pwd_grp/__pgsreader.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L___pgsreader
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/fgetgrent.c b/libc/pwd_grp/fgetgrent.c
new file mode 100644
index 000000000..695aee119
--- /dev/null
+++ b/libc/pwd_grp/fgetgrent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_fgetgrent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/fgetgrent_r.c b/libc/pwd_grp/fgetgrent_r.c
new file mode 100644
index 000000000..ea97af72f
--- /dev/null
+++ b/libc/pwd_grp/fgetgrent_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_fgetgrent_r
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/fgetpwent.c b/libc/pwd_grp/fgetpwent.c
new file mode 100644
index 000000000..ddcc7ffb7
--- /dev/null
+++ b/libc/pwd_grp/fgetpwent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_fgetpwent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/fgetpwent_r.c b/libc/pwd_grp/fgetpwent_r.c
new file mode 100644
index 000000000..8b9350347
--- /dev/null
+++ b/libc/pwd_grp/fgetpwent_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_fgetpwent_r
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/fgetspent.c b/libc/pwd_grp/fgetspent.c
new file mode 100644
index 000000000..b7c1ef24f
--- /dev/null
+++ b/libc/pwd_grp/fgetspent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_fgetspent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/fgetspent_r.c b/libc/pwd_grp/fgetspent_r.c
new file mode 100644
index 000000000..7196d80e9
--- /dev/null
+++ b/libc/pwd_grp/fgetspent_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_fgetspent_r
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getgrent.c b/libc/pwd_grp/getgrent.c
new file mode 100644
index 000000000..808e4e817
--- /dev/null
+++ b/libc/pwd_grp/getgrent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getgrent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getgrent_r.c b/libc/pwd_grp/getgrent_r.c
new file mode 100644
index 000000000..5f0b7c295
--- /dev/null
+++ b/libc/pwd_grp/getgrent_r.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+
+#ifdef __USE_GNU
+# define L_getgrent_r
+# include "pwd_grp.c"
+#endif
diff --git a/libc/pwd_grp/getgrgid.c b/libc/pwd_grp/getgrgid.c
new file mode 100644
index 000000000..96ce9039d
--- /dev/null
+++ b/libc/pwd_grp/getgrgid.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getgrgid
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getgrgid_r.c b/libc/pwd_grp/getgrgid_r.c
new file mode 100644
index 000000000..a962f4cec
--- /dev/null
+++ b/libc/pwd_grp/getgrgid_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getgrgid_r
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getgrnam.c b/libc/pwd_grp/getgrnam.c
new file mode 100644
index 000000000..3b47d9a9f
--- /dev/null
+++ b/libc/pwd_grp/getgrnam.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getgrnam
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getgrnam_r.c b/libc/pwd_grp/getgrnam_r.c
new file mode 100644
index 000000000..592a66c47
--- /dev/null
+++ b/libc/pwd_grp/getgrnam_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getgrnam_r
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getpw.c b/libc/pwd_grp/getpw.c
new file mode 100644
index 000000000..943da3f26
--- /dev/null
+++ b/libc/pwd_grp/getpw.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+
+#ifdef __USE_GNU
+# define L_getpw
+# include "pwd_grp.c"
+#endif
diff --git a/libc/pwd_grp/getpwent.c b/libc/pwd_grp/getpwent.c
new file mode 100644
index 000000000..a617bc8b2
--- /dev/null
+++ b/libc/pwd_grp/getpwent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getpwent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getpwent_r.c b/libc/pwd_grp/getpwent_r.c
new file mode 100644
index 000000000..9f00b05f4
--- /dev/null
+++ b/libc/pwd_grp/getpwent_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getpwent_r
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getpwnam.c b/libc/pwd_grp/getpwnam.c
new file mode 100644
index 000000000..d00640b54
--- /dev/null
+++ b/libc/pwd_grp/getpwnam.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getpwnam
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getpwnam_r.c b/libc/pwd_grp/getpwnam_r.c
new file mode 100644
index 000000000..a4440e756
--- /dev/null
+++ b/libc/pwd_grp/getpwnam_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getpwnam_r
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getpwuid.c b/libc/pwd_grp/getpwuid.c
new file mode 100644
index 000000000..16ac50f72
--- /dev/null
+++ b/libc/pwd_grp/getpwuid.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getpwuid
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getpwuid_r.c b/libc/pwd_grp/getpwuid_r.c
new file mode 100644
index 000000000..21d39ed7f
--- /dev/null
+++ b/libc/pwd_grp/getpwuid_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getpwuid_r
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getspent.c b/libc/pwd_grp/getspent.c
new file mode 100644
index 000000000..5699b67d6
--- /dev/null
+++ b/libc/pwd_grp/getspent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getspent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getspent_r.c b/libc/pwd_grp/getspent_r.c
new file mode 100644
index 000000000..da147a523
--- /dev/null
+++ b/libc/pwd_grp/getspent_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getspent_r
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getspnam.c b/libc/pwd_grp/getspnam.c
new file mode 100644
index 000000000..19e40c737
--- /dev/null
+++ b/libc/pwd_grp/getspnam.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getspnam
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/getspnam_r.c b/libc/pwd_grp/getspnam_r.c
new file mode 100644
index 000000000..053b697ea
--- /dev/null
+++ b/libc/pwd_grp/getspnam_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_getspnam_r
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/initgroups.c b/libc/pwd_grp/initgroups.c
new file mode 100644
index 000000000..d02be5e02
--- /dev/null
+++ b/libc/pwd_grp/initgroups.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_initgroups
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/lckpwdf.c b/libc/pwd_grp/lckpwdf.c
index f99e9f026..69d2c6718 100644
--- a/libc/pwd_grp/lckpwdf.c
+++ b/libc/pwd_grp/lckpwdf.c
@@ -19,10 +19,6 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define sigfillset __sigfillset_internal
-#define sigaction __sigaction
-#define alarm __alarm
-
#include <features.h>
#include <fcntl.h>
#include <signal.h>
@@ -30,6 +26,18 @@
#include <unistd.h>
#include <sys/file.h>
#include <paths.h>
+#include <shadow.h>
+
+libc_hidden_proto(memset)
+libc_hidden_proto(open)
+libc_hidden_proto(fcntl)
+libc_hidden_proto(close)
+libc_hidden_proto(sigfillset)
+libc_hidden_proto(sigaction)
+libc_hidden_proto(sigprocmask)
+libc_hidden_proto(sigaddset)
+libc_hidden_proto(sigemptyset)
+libc_hidden_proto(alarm)
#ifdef __UCLIBC_HAS_THREADS__
# include <pthread.h>
@@ -46,7 +54,7 @@ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
static int lock_fd = -1;
/* Prototypes for local functions. */
-static void noop_handler __P ((int __sig));
+static void noop_handler (int __sig);
int lckpwdf (void)
@@ -65,7 +73,7 @@ int lckpwdf (void)
LOCK;
- lock_fd = __open (_PATH_PASSWD, O_WRONLY);
+ lock_fd = open (_PATH_PASSWD, O_WRONLY);
if (lock_fd == -1) {
/* Cannot create lock file. */
UNLOCK;
@@ -73,18 +81,18 @@ int lckpwdf (void)
}
/* Make sure file gets correctly closed when process finished. */
- flags = __fcntl (lock_fd, F_GETFD, 0);
+ flags = fcntl (lock_fd, F_GETFD, 0);
if (flags == -1) {
/* Cannot get file flags. */
- __close(lock_fd);
+ close(lock_fd);
lock_fd = -1;
UNLOCK;
return -1;
}
flags |= FD_CLOEXEC; /* Close on exit. */
- if (__fcntl (lock_fd, F_SETFD, flags) < 0) {
+ if (fcntl (lock_fd, F_SETFD, flags) < 0) {
/* Cannot set new flags. */
- __close(lock_fd);
+ close(lock_fd);
lock_fd = -1;
UNLOCK;
return -1;
@@ -98,7 +106,7 @@ int lckpwdf (void)
It is important that we don't change the signal state. We must
restore the old signal behaviour. */
- __memset (&new_act, '\0', sizeof (struct sigaction));
+ memset (&new_act, '\0', sizeof (struct sigaction));
new_act.sa_handler = noop_handler;
sigfillset (&new_act.sa_mask);
new_act.sa_flags = 0ul;
@@ -106,7 +114,7 @@ int lckpwdf (void)
/* Install new action handler for alarm and save old. */
if (sigaction (SIGALRM, &new_act, &saved_act) < 0) {
/* Cannot install signal handler. */
- __close(lock_fd);
+ close(lock_fd);
lock_fd = -1;
UNLOCK;
return -1;
@@ -115,9 +123,9 @@ int lckpwdf (void)
/* Now make sure the alarm signal is not blocked. */
sigemptyset (&new_set);
sigaddset (&new_set, SIGALRM);
- if (__sigprocmask (SIG_UNBLOCK, &new_set, &saved_set) < 0) {
+ if (sigprocmask (SIG_UNBLOCK, &new_set, &saved_set) < 0) {
sigaction (SIGALRM, &saved_act, NULL);
- __close(lock_fd);
+ close(lock_fd);
lock_fd = -1;
UNLOCK;
return -1;
@@ -128,24 +136,24 @@ int lckpwdf (void)
alarm (TIMEOUT);
/* Try to get the lock. */
- __memset (&fl, '\0', sizeof (struct flock));
+ memset (&fl, '\0', sizeof (struct flock));
fl.l_type = F_WRLCK;
fl.l_whence = SEEK_SET;
- result = __fcntl (lock_fd, F_SETLKW, &fl);
+ result = fcntl (lock_fd, F_SETLKW, &fl);
/* Clear alarm. */
alarm (0);
/* Restore old set of handled signals. We don't need to know
about the current one.*/
- __sigprocmask (SIG_SETMASK, &saved_set, NULL);
+ sigprocmask (SIG_SETMASK, &saved_set, NULL);
/* Restore old action handler for alarm. We don't need to know
about the current one. */
sigaction (SIGALRM, &saved_act, NULL);
if (result < 0) {
- __close(lock_fd);
+ close(lock_fd);
lock_fd = -1;
UNLOCK;
return -1;
@@ -166,7 +174,7 @@ int ulckpwdf (void)
}
else {
LOCK;
- result = __close (lock_fd);
+ result = close (lock_fd);
/* Mark descriptor as unused. */
lock_fd = -1;
UNLOCK;
diff --git a/libc/pwd_grp/putgrent.c b/libc/pwd_grp/putgrent.c
new file mode 100644
index 000000000..20a6faf98
--- /dev/null
+++ b/libc/pwd_grp/putgrent.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <features.h>
+
+#ifdef __USE_GNU
+# define L_putgrent
+# include "pwd_grp.c"
+#endif
diff --git a/libc/pwd_grp/putpwent.c b/libc/pwd_grp/putpwent.c
new file mode 100644
index 000000000..045462e9e
--- /dev/null
+++ b/libc/pwd_grp/putpwent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_putpwent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/putspent.c b/libc/pwd_grp/putspent.c
new file mode 100644
index 000000000..d6b5b2891
--- /dev/null
+++ b/libc/pwd_grp/putspent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_putspent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/pwd_grp.c b/libc/pwd_grp/pwd_grp.c
index 0f7c564f0..ef78fed88 100644
--- a/libc/pwd_grp/pwd_grp.c
+++ b/libc/pwd_grp/pwd_grp.c
@@ -1,7 +1,8 @@
/*
- * Copyright (C) 2003 Manuel Novoa III
+ * Copyright (C) 2003 Manuel Novoa III <mjn3@uclibc.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
/* Nov 6, 2003 Initial version.
@@ -18,12 +19,6 @@
*
*/
-#define setgroups __setgroups
-#define strtoul __strtoul
-#define rewind __rewind
-#define fgets_unlocked __fgets_unlocked
-
-#define _GNU_SOURCE
#include <features.h>
#include <stdio.h>
#include <stdlib.h>
@@ -43,16 +38,24 @@
#include <pthread.h>
#endif
-extern int __getspnam_r (__const char *__name, struct spwd *__result_buf,
- char *__buffer, size_t __buflen,
- struct spwd **__result) attribute_hidden;
-
-extern int __getpwuid_r (__uid_t __uid,
- struct passwd *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen,
- struct passwd **__restrict __result) attribute_hidden;
-
-extern int __fputc_unlocked_internal(int c, FILE *stream) attribute_hidden;
+libc_hidden_proto(strchr)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strcpy)
+libc_hidden_proto(strlen)
+libc_hidden_proto(setgroups)
+libc_hidden_proto(strtoul)
+libc_hidden_proto(rewind)
+libc_hidden_proto(fgets_unlocked)
+libc_hidden_proto(__fputc_unlocked)
+libc_hidden_proto(sprintf)
+libc_hidden_proto(fopen)
+libc_hidden_proto(fclose)
+libc_hidden_proto(fprintf)
+#ifdef __UCLIBC_HAS_XLOCALE__
+libc_hidden_proto(__ctype_b_loc)
+#else
+libc_hidden_proto(__ctype_b)
+#endif
/**********************************************************************/
/* Sizes for staticly allocated buffers. */
@@ -89,7 +92,8 @@ extern int __pgsreader(int (*__parserfunc)(void *d, char *line), void *data,
/**********************************************************************/
#ifdef L_fgetpwent_r
-int attribute_hidden __fgetpwent_r(FILE *__restrict stream, struct passwd *__restrict resultbuf,
+libc_hidden_proto(fgetpwent_r)
+int fgetpwent_r(FILE *__restrict stream, struct passwd *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct passwd **__restrict result)
{
@@ -103,13 +107,14 @@ int attribute_hidden __fgetpwent_r(FILE *__restrict stream, struct passwd *__res
return rv;
}
-strong_alias(__fgetpwent_r,fgetpwent_r)
+libc_hidden_def(fgetpwent_r)
#endif
/**********************************************************************/
#ifdef L_fgetgrent_r
-int attribute_hidden __fgetgrent_r(FILE *__restrict stream, struct group *__restrict resultbuf,
+libc_hidden_proto(fgetgrent_r)
+int fgetgrent_r(FILE *__restrict stream, struct group *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct group **__restrict result)
{
@@ -123,13 +128,14 @@ int attribute_hidden __fgetgrent_r(FILE *__restrict stream, struct group *__rest
return rv;
}
-strong_alias(__fgetgrent_r,fgetgrent_r)
+libc_hidden_def(fgetgrent_r)
#endif
/**********************************************************************/
#ifdef L_fgetspent_r
-int attribute_hidden __fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
+libc_hidden_proto(fgetspent_r)
+int fgetspent_r(FILE *__restrict stream, struct spwd *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct spwd **__restrict result)
{
@@ -143,7 +149,7 @@ int attribute_hidden __fgetspent_r(FILE *__restrict stream, struct spwd *__restr
return rv;
}
-strong_alias(__fgetspent_r,fgetspent_r)
+libc_hidden_def(fgetspent_r)
#endif
/**********************************************************************/
@@ -153,10 +159,7 @@ strong_alias(__fgetspent_r,fgetspent_r)
/**********************************************************************/
#ifdef L_fgetpwent
-extern int __fgetpwent_r (FILE *__restrict __stream,
- struct passwd *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen,
- struct passwd **__restrict __result) attribute_hidden;
+libc_hidden_proto(fgetpwent_r)
struct passwd *fgetpwent(FILE *stream)
{
@@ -164,7 +167,7 @@ struct passwd *fgetpwent(FILE *stream)
static struct passwd resultbuf;
struct passwd *result;
- __fgetpwent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
+ fgetpwent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
return result;
}
@@ -172,10 +175,7 @@ struct passwd *fgetpwent(FILE *stream)
/**********************************************************************/
#ifdef L_fgetgrent
-extern int __fgetgrent_r (FILE *__restrict __stream,
- struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen,
- struct group **__restrict __result) attribute_hidden;
+libc_hidden_proto(fgetgrent_r)
struct group *fgetgrent(FILE *stream)
{
@@ -183,7 +183,7 @@ struct group *fgetgrent(FILE *stream)
static struct group resultbuf;
struct group *result;
- __fgetgrent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
+ fgetgrent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
return result;
}
@@ -191,9 +191,7 @@ struct group *fgetgrent(FILE *stream)
/**********************************************************************/
#ifdef L_fgetspent
-extern int __fgetspent_r (FILE *__stream, struct spwd *__result_buf,
- char *__buffer, size_t __buflen,
- struct spwd **__result) attribute_hidden;
+libc_hidden_proto(fgetspent_r)
struct spwd *fgetspent(FILE *stream)
{
@@ -201,7 +199,7 @@ struct spwd *fgetspent(FILE *stream)
static struct spwd resultbuf;
struct spwd *result;
- __fgetspent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
+ fgetspent_r(stream, &resultbuf, buffer, sizeof(buffer), &result);
return result;
}
@@ -209,7 +207,8 @@ struct spwd *fgetspent(FILE *stream)
/**********************************************************************/
#ifdef L_sgetspent_r
-int attribute_hidden __sgetspent_r(const char *string, struct spwd *result_buf,
+libc_hidden_proto(sgetspent_r)
+int sgetspent_r(const char *string, struct spwd *result_buf,
char *buffer, size_t buflen, struct spwd **result)
{
int rv = ERANGE;
@@ -223,10 +222,10 @@ int attribute_hidden __sgetspent_r(const char *string, struct spwd *result_buf,
}
if (string != buffer) {
- if (__strlen(string) >= buflen) {
+ if (strlen(string) >= buflen) {
goto DO_ERANGE;
}
- __strcpy(buffer, string);
+ strcpy(buffer, string);
}
if (!(rv = __parsespent(result_buf, buffer))) {
@@ -236,7 +235,7 @@ int attribute_hidden __sgetspent_r(const char *string, struct spwd *result_buf,
DONE:
return rv;
}
-strong_alias(__sgetspent_r,sgetspent_r)
+libc_hidden_def(sgetspent_r)
#endif
/**********************************************************************/
@@ -246,40 +245,36 @@ strong_alias(__sgetspent_r,sgetspent_r)
#endif
#ifdef L_getpwnam_r
-#define GETXXKEY_R_FUNC_HIDDEN __getpwnam_r
#define GETXXKEY_R_FUNC getpwnam_r
#define GETXXKEY_R_PARSER __parsepwent
#define GETXXKEY_R_ENTTYPE struct passwd
-#define GETXXKEY_R_TEST(ENT) (!__strcmp((ENT)->pw_name, key))
+#define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->pw_name, key))
#define DO_GETXXKEY_R_KEYTYPE const char *__restrict
#define DO_GETXXKEY_R_PATHNAME _PATH_PASSWD
#include "pwd_grp_internal.c"
#endif
#ifdef L_getgrnam_r
-#define GETXXKEY_R_FUNC_HIDDEN __getgrnam_r
#define GETXXKEY_R_FUNC getgrnam_r
#define GETXXKEY_R_PARSER __parsegrent
#define GETXXKEY_R_ENTTYPE struct group
-#define GETXXKEY_R_TEST(ENT) (!__strcmp((ENT)->gr_name, key))
+#define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->gr_name, key))
#define DO_GETXXKEY_R_KEYTYPE const char *__restrict
#define DO_GETXXKEY_R_PATHNAME _PATH_GROUP
#include "pwd_grp_internal.c"
#endif
#ifdef L_getspnam_r
-#define GETXXKEY_R_FUNC_HIDDEN __getspnam_r
#define GETXXKEY_R_FUNC getspnam_r
#define GETXXKEY_R_PARSER __parsespent
#define GETXXKEY_R_ENTTYPE struct spwd
-#define GETXXKEY_R_TEST(ENT) (!__strcmp((ENT)->sp_namp, key))
+#define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->sp_namp, key))
#define DO_GETXXKEY_R_KEYTYPE const char *__restrict
#define DO_GETXXKEY_R_PATHNAME _PATH_SHADOW
#include "pwd_grp_internal.c"
#endif
#ifdef L_getpwuid_r
-#define GETXXKEY_R_FUNC_HIDDEN __getpwuid_r
#define GETXXKEY_R_FUNC getpwuid_r
#define GETXXKEY_R_PARSER __parsepwent
#define GETXXKEY_R_ENTTYPE struct passwd
@@ -290,7 +285,6 @@ strong_alias(__sgetspent_r,sgetspent_r)
#endif
#ifdef L_getgrgid_r
-#define GETXXKEY_R_FUNC_HIDDEN __getgrgid_r
#define GETXXKEY_R_FUNC getgrgid_r
#define GETXXKEY_R_PARSER __parsegrent
#define GETXXKEY_R_ENTTYPE struct group
@@ -303,13 +297,15 @@ strong_alias(__sgetspent_r,sgetspent_r)
/**********************************************************************/
#ifdef L_getpwuid
+libc_hidden_proto(getpwuid_r)
+
struct passwd *getpwuid(uid_t uid)
{
static char buffer[PWD_BUFFER_SIZE];
static struct passwd resultbuf;
struct passwd *result;
- __getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result);
+ getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result);
return result;
}
@@ -317,9 +313,7 @@ struct passwd *getpwuid(uid_t uid)
/**********************************************************************/
#ifdef L_getgrgid
-extern int __getgrgid_r (__gid_t __gid, struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen,
- struct group **__restrict __result) attribute_hidden;
+libc_hidden_proto(getgrgid_r)
struct group *getgrgid(gid_t gid)
{
@@ -327,7 +321,7 @@ struct group *getgrgid(gid_t gid)
static struct group resultbuf;
struct group *result;
- __getgrgid_r(gid, &resultbuf, buffer, sizeof(buffer), &result);
+ getgrgid_r(gid, &resultbuf, buffer, sizeof(buffer), &result);
return result;
}
@@ -339,6 +333,9 @@ struct group *getgrgid(gid_t gid)
* to have been created as a reentrant version of the non-standard
* functions getspuid. Why getspuid was added, I do not know. */
+libc_hidden_proto(getpwuid_r)
+libc_hidden_proto(getspnam_r)
+
int getspuid_r(uid_t uid, struct spwd *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct spwd **__restrict result)
@@ -349,8 +346,8 @@ int getspuid_r(uid_t uid, struct spwd *__restrict resultbuf,
char pwd_buff[PWD_BUFFER_SIZE];
*result = NULL;
- if (!(rv = __getpwuid_r(uid, &password, pwd_buff, sizeof(pwd_buff), &pp))) {
- rv = __getspnam_r(password.pw_name, resultbuf, buffer, buflen, result);
+ if (!(rv = getpwuid_r(uid, &password, pwd_buff, sizeof(pwd_buff), &pp))) {
+ rv = getspnam_r(password.pw_name, resultbuf, buffer, buflen, result);
}
return rv;
@@ -363,6 +360,8 @@ int getspuid_r(uid_t uid, struct spwd *__restrict resultbuf,
/* This function is non-standard and is currently not built.
* Why it was added, I do not know. */
+libc_hidden_proto(getspuid_r)
+
struct spwd *getspuid(uid_t uid)
{
static char buffer[PWD_BUFFER_SIZE];
@@ -377,10 +376,7 @@ struct spwd *getspuid(uid_t uid)
/**********************************************************************/
#ifdef L_getpwnam
-extern int __getpwnam_r (__const char *__restrict __name,
- struct passwd *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen,
- struct passwd **__restrict __result) attribute_hidden;
+libc_hidden_proto(getpwnam_r)
struct passwd *getpwnam(const char *name)
{
@@ -388,7 +384,7 @@ struct passwd *getpwnam(const char *name)
static struct passwd resultbuf;
struct passwd *result;
- __getpwnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
+ getpwnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
return result;
}
@@ -396,10 +392,7 @@ struct passwd *getpwnam(const char *name)
/**********************************************************************/
#ifdef L_getgrnam
-extern int __getgrnam_r (__const char *__restrict __name,
- struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen,
- struct group **__restrict __result) attribute_hidden;
+libc_hidden_proto(getgrnam_r)
struct group *getgrnam(const char *name)
{
@@ -407,7 +400,7 @@ struct group *getgrnam(const char *name)
static struct group resultbuf;
struct group *result;
- __getgrnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
+ getgrnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
return result;
}
@@ -415,13 +408,15 @@ struct group *getgrnam(const char *name)
/**********************************************************************/
#ifdef L_getspnam
+libc_hidden_proto(getspnam_r)
+
struct spwd *getspnam(const char *name)
{
static char buffer[PWD_BUFFER_SIZE];
static struct spwd resultbuf;
struct spwd *result;
- __getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
+ getspnam_r(name, &resultbuf, buffer, sizeof(buffer), &result);
return result;
}
@@ -429,6 +424,8 @@ struct spwd *getspnam(const char *name)
/**********************************************************************/
#ifdef L_getpw
+libc_hidden_proto(getpwuid_r)
+
int getpw(uid_t uid, char *buf)
{
struct passwd resultbuf;
@@ -437,8 +434,8 @@ int getpw(uid_t uid, char *buf)
if (!buf) {
__set_errno(EINVAL);
- } else if (!__getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result)) {
- if (__sprintf(buf, "%s:%s:%lu:%lu:%s:%s:%s\n",
+ } else if (!getpwuid_r(uid, &resultbuf, buffer, sizeof(buffer), &result)) {
+ if (sprintf(buf, "%s:%s:%lu:%lu:%s:%s:%s\n",
resultbuf.pw_name, resultbuf.pw_passwd,
(unsigned long)(resultbuf.pw_uid),
(unsigned long)(resultbuf.pw_gid),
@@ -487,7 +484,8 @@ void endpwent(void)
}
-int attribute_hidden __getpwent_r(struct passwd *__restrict resultbuf,
+libc_hidden_proto(getpwent_r)
+int getpwent_r(struct passwd *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct passwd **__restrict result)
{
@@ -515,7 +513,7 @@ int attribute_hidden __getpwent_r(struct passwd *__restrict resultbuf,
return rv;
}
-strong_alias(__getpwent_r,getpwent_r)
+libc_hidden_def(getpwent_r)
#endif
/**********************************************************************/
@@ -542,7 +540,8 @@ void endgrent(void)
UNLOCK;
}
-int attribute_hidden __getgrent_r(struct group *__restrict resultbuf,
+libc_hidden_proto(getgrent_r)
+int getgrent_r(struct group *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
struct group **__restrict result)
{
@@ -570,7 +569,7 @@ int attribute_hidden __getgrent_r(struct group *__restrict resultbuf,
return rv;
}
-strong_alias(__getgrent_r,getgrent_r)
+libc_hidden_def(getgrent_r)
#endif
/**********************************************************************/
@@ -597,7 +596,8 @@ void endspent(void)
UNLOCK;
}
-int attribute_hidden __getspent_r(struct spwd *resultbuf, char *buffer,
+libc_hidden_proto(getspent_r)
+int getspent_r(struct spwd *resultbuf, char *buffer,
size_t buflen, struct spwd **result)
{
int rv;
@@ -624,15 +624,13 @@ int attribute_hidden __getspent_r(struct spwd *resultbuf, char *buffer,
return rv;
}
-strong_alias(__getspent_r,getspent_r)
+libc_hidden_def(getspent_r)
#endif
/**********************************************************************/
#ifdef L_getpwent
-
-extern int __getpwent_r (struct passwd *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen,
- struct passwd **__restrict __result) attribute_hidden;
+
+libc_hidden_proto(getpwent_r)
struct passwd *getpwent(void)
{
@@ -640,7 +638,7 @@ struct passwd *getpwent(void)
static struct passwd pwd;
struct passwd *result;
- __getpwent_r(&pwd, line_buff, sizeof(line_buff), &result);
+ getpwent_r(&pwd, line_buff, sizeof(line_buff), &result);
return result;
}
@@ -648,9 +646,7 @@ struct passwd *getpwent(void)
/**********************************************************************/
#ifdef L_getgrent
-extern int __getgrent_r (struct group *__restrict __resultbuf,
- char *__restrict __buffer, size_t __buflen,
- struct group **__restrict __result) attribute_hidden;
+libc_hidden_proto(getgrent_r)
struct group *getgrent(void)
{
@@ -658,7 +654,7 @@ struct group *getgrent(void)
static struct group gr;
struct group *result;
- __getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
+ getgrent_r(&gr, line_buff, sizeof(line_buff), &result);
return result;
}
@@ -666,8 +662,7 @@ struct group *getgrent(void)
/**********************************************************************/
#ifdef L_getspent
-extern int __getspent_r (struct spwd *__result_buf, char *__buffer,
- size_t __buflen, struct spwd **__result) attribute_hidden;
+libc_hidden_proto(getspent_r)
struct spwd *getspent(void)
{
@@ -675,7 +670,7 @@ struct spwd *getspent(void)
static struct spwd spwd;
struct spwd *result;
- __getspent_r(&spwd, line_buff, sizeof(line_buff), &result);
+ getspent_r(&spwd, line_buff, sizeof(line_buff), &result);
return result;
}
@@ -683,9 +678,7 @@ struct spwd *getspent(void)
/**********************************************************************/
#ifdef L_sgetspent
-extern int __sgetspent_r (__const char *__string, struct spwd *__result_buf,
- char *__buffer, size_t __buflen,
- struct spwd **__result) attribute_hidden;
+libc_hidden_proto(sgetspent_r)
struct spwd *sgetspent(const char *string)
{
@@ -693,7 +686,7 @@ struct spwd *sgetspent(const char *string)
static struct spwd spwd;
struct spwd *result;
- __sgetspent_r(string, &spwd, line_buff, sizeof(line_buff), &result);
+ sgetspent_r(string, &spwd, line_buff, sizeof(line_buff), &result);
return result;
}
@@ -726,7 +719,7 @@ int initgroups(const char *user, gid_t gid)
assert(group.gr_mem); /* Must have at least a NULL terminator. */
if (group.gr_gid != gid) {
for (m=group.gr_mem ; *m ; m++) {
- if (!__strcmp(*m, user)) {
+ if (!strcmp(*m, user)) {
if (!(num_groups & 7)) {
gid_t *tmp = (gid_t *)
realloc(group_list,
@@ -809,7 +802,7 @@ int putgrent(const struct group *__restrict p, FILE *__restrict f)
do {
if (!*m) {
- if (__fputc_unlocked_internal('\n', f) >= 0) {
+ if (__fputc_unlocked('\n', f) >= 0) {
rv = 0;
}
break;
@@ -875,7 +868,7 @@ int putspent(const struct spwd *p, FILE *stream)
goto DO_UNLOCK;
}
- if (__fputc_unlocked_internal('\n', stream) > 0) {
+ if (__fputc_unlocked('\n', stream) > 0) {
rv = 0;
}
@@ -919,7 +912,7 @@ int attribute_hidden __parsepwent(void *data, char *line)
/* NOTE: glibc difference - glibc allows omission of
* ':' seperators after the gid field if all remaining
* entries are empty. We require all separators. */
- if (!(line = __strchr(line, ':'))) {
+ if (!(line = strchr(line, ':'))) {
break;
}
} else {
@@ -971,7 +964,7 @@ int attribute_hidden __parsegrent(void *data, char *line)
if (i < 2) {
*((char **) p) = line;
- if (!(line = __strchr(line, ':'))) {
+ if (!(line = strchr(line, ':'))) {
break;
}
*line++ = 0;
@@ -1071,7 +1064,7 @@ int attribute_hidden __parsespent(void *data, char * line)
p = ((char *) ((struct spwd *) data)) + sp_off[i];
if (i < 2) {
*((char **) p) = line;
- if (!(line = __strchr(line, ':'))) {
+ if (!(line = strchr(line, ':'))) {
break;
}
} else {
@@ -1148,7 +1141,7 @@ int attribute_hidden __pgsreader(int (*__parserfunc)(void *d, char *line), void
break;
}
- line_len = __strlen(line_buff) - 1; /* strlen() must be > 0. */
+ line_len = strlen(line_buff) - 1; /* strlen() must be > 0. */
if (line_buff[line_len] == '\n') {
line_buff[line_len] = 0;
} else if (line_len + 2 == buflen) { /* line too long */
diff --git a/libc/pwd_grp/pwd_grp_internal.c b/libc/pwd_grp/pwd_grp_internal.c
index 8520cf45b..712b788ad 100644
--- a/libc/pwd_grp/pwd_grp_internal.c
+++ b/libc/pwd_grp/pwd_grp_internal.c
@@ -1,7 +1,8 @@
/*
- * Copyright (C) 2003 Manuel Novoa III
+ * Copyright (C) 2003 Manuel Novoa III <mjn3@uclibc.org>
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
- * Licensed under LGPL v2.1, see the file COPYING.LIB in this tarball for details.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
/* Nov 6, 2003 Initial version.
@@ -18,7 +19,6 @@
*
*/
-#define _GNU_SOURCE
#include <features.h>
#include <stdio.h>
#include <stdlib.h>
@@ -55,7 +55,8 @@
/**********************************************************************/
#ifdef GETXXKEY_R_FUNC
-int attribute_hidden GETXXKEY_R_FUNC_HIDDEN(DO_GETXXKEY_R_KEYTYPE key,
+libc_hidden_proto(GETXXKEY_R_FUNC)
+int GETXXKEY_R_FUNC(DO_GETXXKEY_R_KEYTYPE key,
GETXXKEY_R_ENTTYPE *__restrict resultbuf,
char *__restrict buffer, size_t buflen,
GETXXKEY_R_ENTTYPE **__restrict result)
@@ -89,7 +90,7 @@ int attribute_hidden GETXXKEY_R_FUNC_HIDDEN(DO_GETXXKEY_R_KEYTYPE key,
return rv;
}
-strong_alias(GETXXKEY_R_FUNC_HIDDEN,GETXXKEY_R_FUNC)
+libc_hidden_def(GETXXKEY_R_FUNC)
#endif
/**********************************************************************/
diff --git a/libc/pwd_grp/sgetspent.c b/libc/pwd_grp/sgetspent.c
new file mode 100644
index 000000000..877a2478a
--- /dev/null
+++ b/libc/pwd_grp/sgetspent.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_sgetspent
+#include "pwd_grp.c"
diff --git a/libc/pwd_grp/sgetspent_r.c b/libc/pwd_grp/sgetspent_r.c
new file mode 100644
index 000000000..131e0bd36
--- /dev/null
+++ b/libc/pwd_grp/sgetspent_r.c
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define L_sgetspent_r
+#include "pwd_grp.c"