update from main archive 961008

Wed Oct  9 00:30:33 1996  Ulrich Drepper  <drepper@cygnus.com>

	* inet/getnetgrent_r.c: Correct netgroup implementation.  A
	specification of a netgroup can also name another netgroup.
	* nss/nss_files/files-netgrp.c: Likewise.
	* inet/netgroup.h: Add fields to hold additional information.

Tue Oct  8 21:51:14 1996  Arnold D. Robbins  <arnold@skeeve.atl.ga.us>

	* posix/getopt.c: Implement POSIX -W option handling.  When the
	option string contains "W;" -W foo is handled like --foo.

Tue Oct  8 12:27:26 1996  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/i386/clone.S: Define _ERRNO_H before
	inclusing <errnos.h> so we really get error symbols defined.
	* sysdeps/unix/sysv/linux/m68k/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.

	* sunrpc/auth_unix.c (authunix_create_default): Don't use fixed
	size array for getgroups call.  Instead get maximal number via
	sysconf.  But discard list to NGRPS elements before calling XDR
	function since Sun's code cannot handle longer lists.
	Based on a patch by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.

	* sysdeps/stub/e_j0l.c: Define y0l as well.
	* sysdeps/stub/e_j1l.c: Define y1l as well.
	* sysdeps/stub/e_jnl.c: Define ynl as well.

	* posix/unistd.h: Correct prototype for execlp.

	* sysdeps/unix/sysv/linux/posix_opt.h: Define _POSIX_NO_TRUNC.

Mon Oct  7 22:18:03 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makeconfig (sysdep-library-path): New variable.
	(built-program-cmd): Use it here to properly build a colon
	separated library path.

Mon Oct  7 22:11:55 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* crypt/md5-crypt.c (md5_crypt_r): Add missing parens around &
	within comparison.  Fix comments.
	(md5_crypt): Fix comment.

Tue Oct  8 05:10:49 1996  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/errnos.h: Only include <linux/errnos.h>
	when _ERRNO_H is defined.
	[!_ERRNO_H && __need_Emath]: Define value for EDOM and ERANGE.
	Should there ever be a Linux port where the numeric values are
	not 33 and 34 this file must change.

Mon Oct  7 13:54:04 1996  Ulrich Drepper  <drepper@cygnus.com>

	* libio/iofgets.c (_IO_fgets): Use _IO_flockfile instead of
	__flockfile.

Mon Oct  7 11:01:45 1996  Andreas Jaeger  <aj@arthur.pfalz.de>

	* string/tst-strlen.c (main): Provide prototype.
	* malloc/mallocbug.c: Likewise.
	* io/test-utime.c: Likewise.

	* sysdeps/generic/crypt-entry.c: Correct typo.

Mon Oct  7 13:42:20 1996  Ulrich Drepper  <drepper@cygnus.com>

	* elf/dl-open.c (_dl_open): Check against _dl_sysdep_start to
	test for libc.a.  Checking _DYNAMIC is of no worth here.
	Suggested by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.

	* nss/nss_files/files-parse.c: Define LOOKUP_NAME even if
 	EXTERN_PARSER is defined.

Sat Oct  5 17:05:36 1996  Andreas Jaeger  <aj@arthur.pfalz.de>

	* Rules (dep-dummy-lib): Correct prototype for __dummy__.

	* crypt/md5-crypt.c: Fix typos in comments.

	* gmon/gmon.c: Provide prototypes.
	* db/makedb.c: Likewise.
	* locale/programs/xmalloc.c: Likewise.
	* stdio-common/bug11.c (main): Likewise.
	* stdio-common/bug7.c (main): Likewise.
	* stdio-common/bug8.c (main): Likewise.
	* stdio-common/bug9.c (main): Likewise.
	* stdio-common/scanf1.c (main): Likewise.
	* stdio-common/scanf2.c (main): Likewise.
	* stdio-common/scanf5.c (main): Likewise.
	* stdio-common/scanf6.c (main): Likewise.
	* stdio-common/scanf7.c (main): Likewise.
	* stdio-common/scanf8.c (main): Likewise.
	* stdio-common/temptest.c (main): Likewise.
	* stdio-common/test-fwrite.c (main): Likewise.
	* stdio-common/tst-printf.c: Likewise.
	* stdio-common/tstdiomisc.c: Likewise.
	* stdio-common/tstgetln.c (main): Likewise.
	* stdlib/testmb.c (main): Likewise.

	* stdio-common/scanf4.c (main): Correct prototype, remove unused
	variable n.

	* stdio-common/scanf3.c (main): Correct prototype, change
	declaration of s to reduce warnings.
	* stdio-common/bug10.c (main): Likewise.

	* stdio-common/tfformat.c: Provide prototype, remove unused
	reference to dump_stats, add braces in sprint_doubles.
	* stdio-common/tiformat.c: Likewise.

	* stdio-common/test_rdwr.c (main): Parameter `where' is long in
	printf call.

Mon Oct  7 14:04:26 1996  NIIBE Yutaka  <gniibe@mri.co.jp>

	* sysdeps/unix/sysv/linux/sys/soundcard.h: Fix typo.

	* shadow/putspent.c: Don't write colon after flag field.

	* sysdeps/unix/sysv/linux/net/if_ppp.h: New file.  Wrapper around
	kernel header.
	* sysdeps/unix/sysv/linux/net/ppp-comp.h: Likewise.
	* sysdeps/unix/sysv/linux/net/ppp_defs.h: Likewise.
	* sysdeps/unix/sysv/linux/Dist: Mention new files.

Mon Oct  7 00:58:19 1996  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/i386/i586/strchr.S: Correct handling of first bytes to
	get pointer aligned.  Reported by Matthias Urlichs <smurf@noris.de>.

	* sysdeps/posix/euidaccess.c [_LIBC]: Avoid calling get?id functions
	by using __libc_enable_secure variable.

	* sysdeps/libm-i387/s_copysignl.S: Correct loading of return value.
This commit is contained in:
Ulrich Drepper 1996-10-08 23:39:20 +00:00
parent 6428aed93c
commit 11336c165c
56 changed files with 9704 additions and 9135 deletions

137
ChangeLog
View File

@ -1,3 +1,138 @@
Wed Oct 9 00:30:33 1996 Ulrich Drepper <drepper@cygnus.com>
* inet/getnetgrent_r.c: Correct netgroup implementation. A
specification of a netgroup can also name another netgroup.
* nss/nss_files/files-netgrp.c: Likewise.
* inet/netgroup.h: Add fields to hold additional information.
Tue Oct 8 21:51:14 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
* posix/getopt.c: Implement POSIX -W option handling. When the
option string contains "W;" -W foo is handled like --foo.
Tue Oct 8 12:27:26 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/i386/clone.S: Define _ERRNO_H before
inclusing <errnos.h> so we really get error symbols defined.
* sysdeps/unix/sysv/linux/m68k/clone.S: Likewise.
* sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
* sunrpc/auth_unix.c (authunix_create_default): Don't use fixed
size array for getgroups call. Instead get maximal number via
sysconf. But discard list to NGRPS elements before calling XDR
function since Sun's code cannot handle longer lists.
Based on a patch by Thorsten Kukuk <kukuk@weber.uni-paderborn.de>.
* sysdeps/stub/e_j0l.c: Define y0l as well.
* sysdeps/stub/e_j1l.c: Define y1l as well.
* sysdeps/stub/e_jnl.c: Define ynl as well.
* posix/unistd.h: Correct prototype for execlp.
* sysdeps/unix/sysv/linux/posix_opt.h: Define _POSIX_NO_TRUNC.
Mon Oct 7 22:18:03 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makeconfig (sysdep-library-path): New variable.
(built-program-cmd): Use it here to properly build a colon
separated library path.
Mon Oct 7 22:11:55 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* crypt/md5-crypt.c (md5_crypt_r): Add missing parens around &
within comparison. Fix comments.
(md5_crypt): Fix comment.
Tue Oct 8 05:10:49 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/errnos.h: Only include <linux/errnos.h>
when _ERRNO_H is defined.
[!_ERRNO_H && __need_Emath]: Define value for EDOM and ERANGE.
Should there ever be a Linux port where the numeric values are
not 33 and 34 this file must change.
Mon Oct 7 13:54:04 1996 Ulrich Drepper <drepper@cygnus.com>
* libio/iofgets.c (_IO_fgets): Use _IO_flockfile instead of
__flockfile.
Mon Oct 7 11:01:45 1996 Andreas Jaeger <aj@arthur.pfalz.de>
* string/tst-strlen.c (main): Provide prototype.
* malloc/mallocbug.c: Likewise.
* io/test-utime.c: Likewise.
* sysdeps/generic/crypt-entry.c: Correct typo.
Mon Oct 7 13:42:20 1996 Ulrich Drepper <drepper@cygnus.com>
* elf/dl-open.c (_dl_open): Check against _dl_sysdep_start to
test for libc.a. Checking _DYNAMIC is of no worth here.
Suggested by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>.
* nss/nss_files/files-parse.c: Define LOOKUP_NAME even if
EXTERN_PARSER is defined.
Sat Oct 5 17:05:36 1996 Andreas Jaeger <aj@arthur.pfalz.de>
* Rules (dep-dummy-lib): Correct prototype for __dummy__.
* crypt/md5-crypt.c: Fix typos in comments.
* gmon/gmon.c: Provide prototypes.
* db/makedb.c: Likewise.
* locale/programs/xmalloc.c: Likewise.
* stdio-common/bug11.c (main): Likewise.
* stdio-common/bug7.c (main): Likewise.
* stdio-common/bug8.c (main): Likewise.
* stdio-common/bug9.c (main): Likewise.
* stdio-common/scanf1.c (main): Likewise.
* stdio-common/scanf2.c (main): Likewise.
* stdio-common/scanf5.c (main): Likewise.
* stdio-common/scanf6.c (main): Likewise.
* stdio-common/scanf7.c (main): Likewise.
* stdio-common/scanf8.c (main): Likewise.
* stdio-common/temptest.c (main): Likewise.
* stdio-common/test-fwrite.c (main): Likewise.
* stdio-common/tst-printf.c: Likewise.
* stdio-common/tstdiomisc.c: Likewise.
* stdio-common/tstgetln.c (main): Likewise.
* stdlib/testmb.c (main): Likewise.
* stdio-common/scanf4.c (main): Correct prototype, remove unused
variable n.
* stdio-common/scanf3.c (main): Correct prototype, change
declaration of s to reduce warnings.
* stdio-common/bug10.c (main): Likewise.
* stdio-common/tfformat.c: Provide prototype, remove unused
reference to dump_stats, add braces in sprint_doubles.
* stdio-common/tiformat.c: Likewise.
* stdio-common/test_rdwr.c (main): Parameter `where' is long in
printf call.
Mon Oct 7 14:04:26 1996 NIIBE Yutaka <gniibe@mri.co.jp>
* sysdeps/unix/sysv/linux/sys/soundcard.h: Fix typo.
* shadow/putspent.c: Don't write colon after flag field.
* sysdeps/unix/sysv/linux/net/if_ppp.h: New file. Wrapper around
kernel header.
* sysdeps/unix/sysv/linux/net/ppp-comp.h: Likewise.
* sysdeps/unix/sysv/linux/net/ppp_defs.h: Likewise.
* sysdeps/unix/sysv/linux/Dist: Mention new files.
Mon Oct 7 00:58:19 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/i386/i586/strchr.S: Correct handling of first bytes to
get pointer aligned. Reported by Matthias Urlichs <smurf@noris.de>.
* sysdeps/posix/euidaccess.c [_LIBC]: Avoid calling get?id functions
by using __libc_enable_secure variable.
Tue Oct 8 13:58:31 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* hurd/ports-get.c (_hurd_ports_get): If the requested port is
@ -32,7 +167,7 @@ Sun Oct 6 02:05:52 1996 Ulrich Drepper <drepper@cygnus.com>
values to make `long double' functions available.
(distribute): Add $(long-m-yes:=.c).
* sysdeps/libm-i387/s_ceill.S: Correct loading of return value.
* sysdeps/libm-i387/s_copysignl.S: Correct loading of return value.
Use long double instruction.
* sysdeps/libm-ieee754/e_atanhl.c (huge): Correct constant.

View File

@ -369,10 +369,12 @@ ifneq (yes,$(build-shared))
built-program-cmd = $(built-program-file)
else
comma = ,
sysdep-library-path = \
$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
$(filter -Wl$(comma)-rpath-link=%,\
$(sysdep-LDFLAGS)))))
define built-program-cmd
LD_LIBRARY_PATH=$(rpath-link)$(patsubst -Wl$(comma)-rpath-link=%,:%,\
$(filter -Wl$(comma)-rpath-link=%,\
$(sysdep-LDFLAGS))) \
LD_LIBRARY_PATH=$(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
$(elf-objpfx)$(rtld-installed-name) $(built-program-file)
endef
endif

2
Rules
View File

@ -72,7 +72,7 @@ $(AR) cr$(verbose) $@ $<
endef
$(common-objpfx)dummy.c:
rm -f $@
echo 'void __dummy__ () { }' > $@
echo 'void __dummy__ (void) { }' > $@
$(common-objpfx)empty.c:
cp -f /dev/null $@
common-generated := $(common-generated) dummy.o dummy.c empty.c empty.o

View File

@ -52,6 +52,7 @@ static void usage __P ((int status)) __attribute__ ((noreturn));
static int process_input __P ((FILE *input, const char *inname, DB *output,
int to_lowercase, int be_quiet));
static int print_database __P ((DB *db));
int main __P ((int argc, char *argv[]));
int

View File

@ -23,7 +23,11 @@ Cambridge, MA 02139, USA. */
#include <errno.h>
weak_extern (_DYNAMIC)
extern ElfW(Addr) _dl_sysdep_start (void **start_argptr,
void (*dl_main) (const ElfW(Phdr) *phdr,
ElfW(Word) phnum,
ElfW(Addr) *user_entry));
weak_extern (_dl_sysdep_start)
extern int __libc_multiple_libcs; /* Defined in init-first.c. */
@ -141,7 +145,7 @@ _dl_open (const char *file, int mode)
(*(void (*) (int, char **, char **)) init) (__libc_argc, __libc_argv,
__environ);
if (_DYNAMIC == NULL)
if (_dl_sysdep_start == NULL)
/* We must be the static _dl_open in libc.a. A static program that
has loaded a dynamic object now has competition. */
__libc_multiple_libcs = 1;

View File

@ -58,6 +58,11 @@ static int s_scale;
#define ERR(s) write(2, s, sizeof(s) - 1)
void moncontrol __P ((int mode));
static void write_hist __P ((int fd));
static void write_call_graph __P ((int fd));
static void write_bb_counts __P ((int fd));
/*
* Control profiling
* profiling is what mcount checks to see if

View File

@ -31,6 +31,16 @@ static service_user *nip;
/* Remember the first service_entry, it's always the same. */
static service_user *startp;
/* A netgroup can consist of names of other netgroups. We have to
track which netgroups were read and which still have to be read. */
struct name_list
{
const char *name;
struct name_list *next;
};
struct name_list *known_groups;
struct name_list *needed_groups;
/* The lookup function for the first entry of this service. */
extern int __nss_netgroup_lookup (service_user **nip, const char *name,
@ -62,30 +72,79 @@ setup (void **fctp, const char *func_name, int all)
return no_more;
}
int
setnetgrent (const char *group)
/* Free used memory. */
static void
free_memory (void)
{
while (known_groups != NULL)
{
struct name_list *tmp = known_groups;
known_groups = known_groups->next;
free (tmp->name);
free (tmp);
}
while (needed_groups != NULL)
{
struct name_list *tmp = needed_groups;
needed_groups = needed_groups->next;
free (tmp->name);
free (tmp);
}
}
static int
internal_setnetgrent (const char *group)
{
enum nss_status (*fct) (const char *);
enum nss_status status = NSS_STATUS_UNAVAIL;
struct name_list *new_elem;
int no_more;
__libc_lock_lock (lock);
/* Cycle through all the services and run their setnetgrent functions. */
no_more = setup ((void **) &fct, "setnetgrent", 1);
while (! no_more)
{
/* Ignore status, we force check in __NSS_NEXT. */
/* Ignore status, we force check in `__nss_next'. */
status = (*fct) (group);
no_more = __nss_next (&nip, "setnetgrent", (void **) &fct, status, 0);
}
__libc_lock_unlock (lock);
/* Add the current group to the list of known groups. */
new_elem = (struct name_list *) malloc (sizeof (struct name_list));
if (new_elem == NULL || (new_elem->name = strdup (group)) == NULL)
{
if (new_elem != NULL)
free (new_elem);
status == NSS_STATUS_UNAVAIL;
}
else
{
new_elem->next = known_groups;
known_groups = new_elem;
}
return status == NSS_STATUS_SUCCESS;
}
int
setnetgrent (const char *group)
{
int result;
__libc_lock_lock (lock);
/* Free list of all netgroup names from last run. */
free_memory ();
result = internal_setnetgrent (group);
__libc_lock_unlock (lock);
return result;
}
void
endnetgrent (void)
@ -103,13 +162,16 @@ endnetgrent (void)
no_more = setup ((void **) &fct, "endnetgrent", 1);
while (! no_more)
{
/* Ignore status, we force check in __NSS_NEXT. */
/* Ignore status, we force check in `__nss_next'. */
(void) (*fct) ();
no_more = (nip == old_nip
|| __nss_next (&nip, "endnetgrent", (void **) &fct, 0, 1));
}
/* Now free list of all netgroup names from last run. */
free_memory ();
__libc_lock_unlock (lock);
}
@ -135,14 +197,63 @@ __getnetgrent_r (char **hostp, char **userp, char **domainp,
{
status = (*fct) (&result, buffer, buflen);
if (status == NSS_STATUS_RETURN)
{
/* This was the last one for this group. Look at next group
if available. */
int found = 0;
while (needed_groups != NULL && ! found)
{
struct name_list *tmp = needed_groups;
needed_groups = needed_groups->next;
tmp->next = known_groups;
known_groups = tmp;
found = internal_setnetgrent (known_groups->name);
}
if (found)
continue;
}
else if (status == NSS_STATUS_SUCCESS && result.type == group_val)
{
/* The last entry was a name of another netgroup. */
struct name_list *namep;
/* Ignore if we've seen the name before. */
for (namep = known_groups; namep != NULL; namep = namep->next)
if (strcmp (result.val.group, namep->name) == 0)
break;
if (namep != NULL)
/* Really ignore. */
continue;
namep = (struct name_list *) malloc (sizeof (struct name_list));
if (namep == NULL
|| (namep->name = strdup (result.val.group)) == NULL)
{
/* We are out of memory. */
if (namep != NULL)
free (namep);
status = NSS_STATUS_RETURN;
}
else
{
namep->next = needed_groups;
needed_groups = namep;
/* And get the next entry. */
continue;
}
}
no_more = __nss_next (&nip, "getnetgrent_r", (void **) &fct, status, 0);
}
if (status == NSS_STATUS_SUCCESS)
{
*hostp = result.host;
*userp = result.user;
*domainp = result.domain;
*hostp = result.val.triple.host;
*userp = result.val.triple.user;
*domainp = result.val.triple.domain;
}
__libc_lock_unlock (lock);
@ -161,6 +272,10 @@ innetgr (const char *netgroup, const char *host, const char *user,
int (*getfct) (struct __netgrent *, char *, int);
int result = 0;
int no_more;
struct name_list *known = NULL;
struct name_list *needed = NULL;
const char *current_group = netgroup;
int real_entry = 0;
__libc_lock_lock (lock);
@ -168,51 +283,117 @@ innetgr (const char *netgroup, const char *host, const char *user,
not work further. We can do some optimization here. Since all
services must provide the `setnetgrent' function we can do all
the work during one walk through the service list. */
no_more = setup ((void **) &setfct, "setnetgrent", 1);
while (! no_more)
while (1)
{
enum nss_status status;
/* Open netgroup. */
status = (*setfct) (netgroup);
if (status == NSS_STATUS_SUCCESS
&& __nss_lookup (&nip, "getnetgrent_r", (void **) &getfct) == 0)
no_more = setup ((void **) &setfct, "setnetgrent", 1);
while (! no_more)
{
char buffer[1024];
struct __netgrent entry;
enum nss_status status;
while ((*getfct) (&entry, buffer, sizeof buffer)
== NSS_STATUS_SUCCESS)
/* Open netgroup. */
status = (*setfct) (current_group);
if (status == NSS_STATUS_SUCCESS
&& __nss_lookup (&nip, "getnetgrent_r", (void **) &getfct) == 0)
{
if ((entry.host == NULL || host == NULL
|| strcmp (entry.host, host) == 0)
&& (entry.user == NULL || user == NULL
|| strcmp (entry.user, user) == 0)
&& (entry.domain == NULL || domain == NULL
|| strcmp (entry.domain, domain) == 0))
char buffer[1024];
struct __netgrent entry;
while ((*getfct) (&entry, buffer, sizeof buffer)
== NSS_STATUS_SUCCESS)
{
result = 1;
break;
if (entry.type == group_val)
{
/* Make sure we haven't seen the name before. */
struct name_list *namep;
for (namep = known; namep != NULL; namep = namep->next)
if (strcmp (entry.val.group, namep->name) == 0)
break;
if (namep == NULL
&& strcmp (netgroup, entry.val.group) != 0)
{
namep =
(struct name_list *) malloc (sizeof (*namep));
if (namep == NULL
|| ((namep->name = strdup (entry.val.group))
== NULL))
{
/* Out of memory, simply return. */
if (namep != NULL)
free (namep);
result = -1;
break;
}
namep->next = needed;
needed = namep;
}
}
else
{
real_entry = 1;
if ((entry.val.triple.host == NULL || host == NULL
|| strcmp (entry.val.triple.host, host) == 0)
&& (entry.val.triple.user == NULL || user == NULL
|| strcmp (entry.val.triple.user, user) == 0)
&& (entry.val.triple.domain == NULL || domain == NULL
|| strcmp (entry.val.triple.domain, domain) == 0))
{
result = 1;
break;
}
}
}
if (result != 0)
break;
/* If we found one service which does know the given
netgroup we don't try further. */
status = NSS_STATUS_RETURN;
}
if (result != 0)
break;
/* Free all resources of the service. */
if (__nss_lookup (&nip, "endnetgrent", (void **) &endfct) == 0)
(*endfct) ();
/* If we found one service which does know the given
netgroup we don't try further. */
status = NSS_STATUS_RETURN;
/* Look for the next service. */
no_more = __nss_next (&nip, "setnetgrent",
(void **) &setfct, status, 0);
}
/* Free all resources of the service. */
if (__nss_lookup (&nip, "endnetgrent", (void **) &endfct) == 0)
(*endfct) ();
if (result == 0 && needed != NULL)
{
struct name_list *tmp = needed;
needed = tmp->next;
tmp->next = known;
known = tmp;
current_group = known->name;
continue;
}
/* Look for the next service. */
no_more = __nss_next (&nip, "setnetgrent", (void **) &setfct, status, 0);
/* No way out. */
break;
}
__libc_lock_unlock (lock);
return result;
/* Free the memory. */
while (known != NULL)
{
struct name_list *tmp = known;
known = known->next;
free (tmp->name);
free (tmp);
}
while (needed != NULL)
{
struct name_list *tmp = needed;
needed = needed->next;
free (tmp->name);
free (tmp);
}
return result == 1;
}

View File

@ -22,9 +22,20 @@ Boston, MA 02111-1307, USA. */
struct __netgrent
{
const char *host;
const char *user;
const char *domain;
enum { triple_val, group_val } type;
union
{
struct
{
const char *host;
const char *user;
const char *domain;
}
triple;
const char *group;
} val;
};
#endif /* netgroup.h */

View File

@ -16,10 +16,11 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <utime.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
#include <utime.h>
int
main (int argc, char *argv[])

View File

@ -37,7 +37,7 @@ _IO_fgets (buf, n, fp)
if (n <= 0)
return NULL;
__libc_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
__flockfile (fp);
_IO_flockfile (fp);
count = _IO_getline (fp, buf, n - 1, '\n', 1);
if (count == 0 || (fp->_IO_file_flags & _IO_ERR_SEEN))
result = NULL;

View File

@ -1,5 +1,5 @@
/* xmalloc.c -- malloc with out of memory checking
Copyright (C) 1990, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -29,6 +29,7 @@
#if STDC_HEADERS || _LIBC
#include <stdlib.h>
static VOID *fixup_null_alloc __P ((size_t n));
#else
VOID *calloc ();
VOID *malloc ();

View File

@ -193,7 +193,31 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
++cp;
if (*cp != '(')
return first ? NSS_STATUS_NOTFOUND : NSS_STATUS_RETURN;
{
/* We have a list of other netgroups. */
char *name = cp;
while (*cp != '\0' && ! isspace (*cp))
++cp;
if (name != cp)
{
/* It is another netgroup name. */
int last = *cp == '\0';
result->type = group_val;
result->val.group = name;
*cp = '\0';
if (! last)
++cp;
*cursor = cp;
first = 0;
return NSS_STATUS_SUCCESS;
}
return first ? NSS_STATUS_NOTFOUND : NSS_STATUS_RETURN;
}
/* Match host name. */
host = ++cp;
@ -225,15 +249,17 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
else
{
memcpy (buffer, host, cp - host);
result->type = triple_val;
buffer[(user - host) - 1] = '\0';
result->host = *host == ',' ? NULL : buffer;
result->val.triple.host = *host == ',' ? NULL : buffer;
buffer[(domain - host) - 1] = '\0';
result->user = *user == ',' ? NULL : buffer + (user - host);
result->val.triple.user = *user == ',' ? NULL : buffer + (user - host);
buffer[(cp - host) - 1] = '\0';
result->domain = *domain == ')' ? NULL : buffer + (domain - host);
result->val.triple.domain =
*domain == ')' ? NULL : buffer + (domain - host);
status = NSS_STATUS_SUCCESS;

View File

@ -219,6 +219,7 @@ parse_list (char *line, struct parser_data *data, int datalen)
return list;
}
#endif /* TRAILING_LIST_MEMBER */
#endif /* EXTERN_PARSER */
@ -234,7 +235,6 @@ parse_list (char *line, struct parser_data *data, int datalen)
break; \
}
#endif
/* This is defined by db-*.c to include "../nss_db/db-XXX.c" instead. */
#ifndef GENERIC

View File

@ -693,6 +693,130 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optopt = c;
return '?';
}
/* Convenience. Treat POSIX -W foo same as long option --foo */
if (temp[0] == 'W' && temp[1] == ';')
{
char *nameend;
const struct option *p;
const struct option *pfound = NULL;
int exact = 0;
int ambig = 0;
int indfound;
int option_index;
/* This is an option that requires an argument. */
if (*nextchar != '\0')
{
optarg = nextchar;
/* If we end this ARGV-element by taking the rest as an arg,
we must advance to the next element now. */
optind++;
}
else if (optind == argc)
{
if (opterr)
{
/* 1003.2 specifies the format of this message. */
fprintf (stderr,
gettext ("%s: option requires an argument -- %c\n"),
argv[0], c);
}
optopt = c;
if (optstring[0] == ':')
c = ':';
else
c = '?';
}
else
/* We already incremented `optind' once;
increment it again when taking next ARGV-elt as argument. */
optarg = argv[optind++];
/* optarg is now the argument, see if it's in the
table of longopts. */
for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
/* Do nothing. */ ;
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
if (nameend - nextchar == strlen (p->name))
{
/* Exact match found. */
pfound = p;
indfound = option_index;
exact = 1;
break;
}
else if (pfound == NULL)
{
/* First nonexact match found. */
pfound = p;
indfound = option_index;
}
else
/* Second or later nonexact match found. */
ambig = 1;
}
if (ambig && !exact)
{
if (opterr)
fprintf (stderr, gettext ("%s: option `-W %s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
return '?';
}
if (pfound != NULL)
{
option_index = indfound;
if (*nameend)
{
/* Don't test has_arg with >, because some C compilers don't
allow it to be used on enums. */
if (pfound->has_arg)
optarg = nameend + 1;
else
{
if (opterr)
fprintf (stderr,
gettext ("%s: option `-W %s' doesn't allow an argument\n"),
argv[0], pfound->name);
nextchar += strlen (nextchar);
return '?';
}
}
else if (pfound->has_arg == 1)
{
if (optind < argc)
optarg = argv[optind++];
else
{
if (opterr)
fprintf (stderr,
gettext ("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : '?';
}
}
nextchar += strlen (nextchar);
if (longind != NULL)
*longind = option_index;
if (pfound->flag)
{
*(pfound->flag) = pfound->val;
return 0;
}
return pfound->val;
}
nextchar = NULL;
return 'W'; /* Let the application handle it. */
}
if (temp[1] == ':')
{
if (temp[2] == ':')

View File

@ -334,7 +334,7 @@ extern int execvp __P ((__const char *__file, char *__const __argv[]));
/* Execute FILE, searching in the `PATH' environment variable if
it contains no slashes, with all arguments after FILE until a
NULL pointer and environment from `environ'. */
extern int execlp __P ((__const char *__file, ...));
extern int execlp __P ((__const char *__file, __const char *__arg, ...));
#ifdef __USE_MISC

View File

@ -66,10 +66,8 @@ putspent (const struct spwd *p, FILE *stream)
&& putc (':', stream) == EOF))
++errors;
if ((p->sp_flag != ~0ul
&& fprintf (stream, "%ld:", p->sp_flag) < 0)
|| (p->sp_flag == ~0ul
&& putc (':', stream) == EOF))
if (p->sp_flag != ~0ul
&& fprintf (stream, "%ld", p->sp_flag) < 0)
++errors;
if (putc ('\n', stream) == EOF)

View File

@ -1,13 +1,13 @@
#include <stdio.h>
int main(int arc, char *argv)
int
main(int arc, char *argv)
{
int n, res;
unsigned int val;
char *s;
char s[] = "111";
int result = 0;
s = "111";
n = 0;
res = sscanf(s, "%u %n", &val, &n);
@ -23,4 +23,3 @@ int main(int arc, char *argv)
return result;
}

View File

@ -1,7 +1,8 @@
#include <stdio.h>
#include <string.h>
main ()
int
main (int argc, char *argv[])
{
int ret;
char buf [1024] = "Ooops";

View File

@ -3,12 +3,12 @@
#include <stdio.h>
int
main ()
main (int argc, char *argv[])
{
int lose = 0;
char filename[] = "/tmp/foo";
FILE *fp;
fp = fopen (filename, "w+");
fprintf (fp, "Hello world!\n");
fflush (fp);

View File

@ -1,7 +1,8 @@
#include <stdio.h>
#include <string.h>
main()
int
main(int argc, char *argv[])
{
char buf[100];
int point, x, y;
@ -23,4 +24,4 @@ main()
puts (status ? "Test failed" : "Test passed");
return status;
}
}

View File

@ -2,7 +2,7 @@
#include <string.h>
int
main()
main(int argc, char *argv[])
{
char buf[100];
int a, b;

View File

@ -2,7 +2,7 @@
#include <stdlib.h>
int
main()
main(int argc, char *argv[])
{
int i,n,r;

View File

@ -1,7 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
main()
int
main(int argc, char *argv[])
{
int point, x, y;
@ -21,4 +22,4 @@ main()
if (point != 1 || x != 1234 || y != 9876)
abort ();
return 0;
}
}

View File

@ -1,13 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
int main(int arc, char *argv)
int
main(int arc, char *argv[])
{
int n, res;
unsigned int val;
char *s;
s = "111";
char s[] = "111";
val = n = -1;
res = sscanf(s, "%u %n", &val, &n);

View File

@ -1,8 +1,9 @@
#include <stdio.h>
int main(int arc, char *argv)
int
main(int arc, char *argv[])
{
int n, res;
int res;
unsigned int val;
FILE *fp = fopen ("/dev/null", "r");

View File

@ -1,7 +1,7 @@
#include <stdio.h>
int
main()
main(int argc, char *argv[])
{
int a, b;

View File

@ -1,7 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
main ()
int
main (int argc, char *argv[])
{
int n = -1;
char c = '!';

View File

@ -1,7 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
main ()
int
main (int argc, char *argv[])
{
long long int n;
int ret;

View File

@ -2,7 +2,8 @@
#include <string.h>
#include <stdlib.h>
main ()
int
main (int argc, char *argv[])
{
int ret;
char buf [1024] = "Ooops";

View File

@ -1,11 +1,10 @@
#include <ansidecl.h>
#include <stdio.h>
#include <string.h>
char *files[500];
int
main ()
main (int argc, char *argv[])
{
char buf[FILENAME_MAX];
char *fn;
@ -13,7 +12,7 @@ main ()
int i;
for (i = 0; i < 500; i++) {
fn = __stdio_gen_tempname(buf, sizeof (buf), (CONST char *) NULL,
fn = __stdio_gen_tempname(buf, sizeof (buf), (const char *) NULL,
"file", 0, (size_t *) NULL, (FILE **) NULL);
if (fn == NULL) {
printf ("__stdio_gen_tempname failed\n");

View File

@ -2,7 +2,7 @@
#include <string.h>
int
main ()
main (int argc, char *argv[])
{
FILE *f = tmpfile ();
char obuf[99999], ibuf[sizeof obuf];
@ -23,7 +23,7 @@ main ()
memset (obuf, 'z', sizeof obuf);
memset (ibuf, 'y', sizeof ibuf);
if (fwrite (obuf, sizeof obuf, 1, f) != 1)
{
perror ("fwrite");

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -98,7 +98,7 @@ DEFUN(main, (argc, argv), int argc AND char **argv)
}
else
{
printf("ftell returns %u; should be %u.\n", where, replace_from);
printf("ftell returns %lu; should be %u.\n", where, replace_from);
lose = 1;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <ansidecl.h>
#ifdef BSD
#include </usr/include/stdio.h>
#define EXIT_SUCCESS 0
@ -28,9 +27,12 @@ Cambridge, MA 02139, USA. */
#include <float.h>
void rfg1 (void);
void rfg2 (void);
void
DEFUN(fmtchk, (fmt), CONST char *fmt)
fmtchk (const char *fmt)
{
(void) fputs(fmt, stdout);
(void) printf(":\t`");
@ -39,7 +41,7 @@ DEFUN(fmtchk, (fmt), CONST char *fmt)
}
void
DEFUN(fmtst1chk, (fmt), CONST char *fmt)
fmtst1chk (const char *fmt)
{
(void) fputs(fmt, stdout);
(void) printf(":\t`");
@ -48,7 +50,7 @@ DEFUN(fmtst1chk, (fmt), CONST char *fmt)
}
void
DEFUN(fmtst2chk, (fmt), CONST char *fmt)
fmtst2chk (const char *fmt)
{
(void) fputs(fmt, stdout);
(void) printf(":\t`");
@ -80,7 +82,7 @@ DEFUN(fmtst2chk, (fmt), CONST char *fmt)
*/
void
DEFUN_VOID(fp_test)
fp_test (void)
{
int i, j, k, l;
char buf[7];
@ -125,7 +127,7 @@ DEFUN_VOID(fp_test)
}
int
DEFUN_VOID(main)
main (int argc, char *argv[])
{
static char shortstr[] = "Hi, Z.";
static char longstr[] = "Good morning, Doctor Chandra. This is Hal. \
@ -247,7 +249,8 @@ I am ready for my first lesson today.";
}
}
rfg1 ()
void
rfg1 (void)
{
char buf[100];
@ -272,7 +275,8 @@ rfg1 ()
return 0;
}
rfg2 ()
void
rfg2 (void)
{
int prec;
char buf[100];

View File

@ -1,7 +1,7 @@
#include <stdio.h>
int
t1 ()
t1 (void)
{
int n = -1;
sscanf ("abc ", "abc %n", &n);
@ -11,7 +11,7 @@ t1 ()
}
int
t2 ()
t2 (void)
{
int result = 0;
int n;
@ -36,7 +36,7 @@ t2 ()
}
int
main ()
main (int argc, char *argv[])
{
int result = 0;

View File

@ -24,7 +24,7 @@ Cambridge, MA 02139, USA. */
#endif
int
main ()
main (int argc, char *argv[])
{
char *buf = NULL;
size_t size = 0;

View File

@ -2,7 +2,7 @@
#include <stdlib.h>
int
main ()
main (int argc, char *argv[])
{
wchar_t w[10];
char c[10];

View File

@ -2,7 +2,7 @@
#include <string.h>
int
main()
main(int argc, char *argv[])
{
static const lens[16] = { 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4 };
char buf[24];

View File

@ -43,7 +43,10 @@ static char sccsid[] = "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro";
*
*/
#include <limits.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/params.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
@ -171,16 +174,21 @@ authunix_create_default()
char machname[MAX_MACHINE_NAME + 1];
register int uid;
register int gid;
int gids[NGRPS];
int max_nr_groups = sysconf (_SC_NGROUP_MAX);
gid_t gids[max_nr_groups];
if (gethostname(machname, MAX_MACHINE_NAME) == -1)
abort();
machname[MAX_MACHINE_NAME] = 0;
uid = geteuid();
gid = getegid();
if ((len = getgroups(NGRPS, gids)) < 0)
if ((len = getgroups(max_nr_groups, gids)) < 0)
abort();
return (authunix_create(machname, uid, gid, len, gids));
/* This braindamaged Sun code forces us here to truncate the
list of groups to NGRPS members since the code in
authuxprot.c transforms a fixed array. Grrr. */
return (authunix_create(machname, uid, gid, MIN (NGRPS, len), gids));
}
/*

View File

@ -32,7 +32,7 @@ static const char md5_salt_prefix[] = "$1$";
/* Prototypes for the MD5 encryption replacement functions. */
extern char *md5_crypt_r (const char *key, const char *salt, char *buffer,
int buflen);
extern char *md5_crpyt (const char *key, const char *salt);
extern char *md5_crypt (const char *key, const char *salt);
/* We recognize an intended call of the MD5 crypt replacement function

View File

@ -68,21 +68,18 @@ ENTRY (strchr)
andl $3, %edi /* mask alignment bits */
jz L11 /* alignment is 0 => start loop */
movb %dl, %cl /* 0 is needed below */
jp L0 /* exactly two bits set */
movb (%eax), %cl /* load single byte */
cmpb (%eax), %dl /* is byte == C? */
xorb (%eax), %cl /* is byte the one we are looking for? */
jz L2 /* yes => return pointer */
je L2 /* aligned => return pointer */
cmpb $0, %cl /* is byte NUL? */
xorb %dl, %cl /* load single byte and test for NUL */
je L3 /* yes => return NULL */
incl %eax /* increment pointer */
xorl $3, %edi /* was alignment == 3? */
L0: movb (%eax), %cl /* load single byte */
je L11 /* yes => start loop */
movb 1(%eax), %cl /* load single byte */
incl %eax
cmpb %cl, %dl /* is byte == C? */
je L2 /* aligned => return pointer */
@ -90,8 +87,12 @@ L0: movb (%eax), %cl /* load single byte */
cmpb $0, %cl /* is byte NUL? */
je L3 /* yes => return NULL */
movb 1(%eax), %cl /* load single byte */
incl %eax /* increment pointer */
incl %eax
decl %edi
jne L11
L0: movb (%eax), %cl /* load single byte */
cmpb %cl, %dl /* is byte == C? */
je L2 /* aligned => return pointer */

View File

@ -137,8 +137,12 @@ euidaccess (path, mode)
int granted;
#ifdef _LIBC
uid_t uid = getuid (), euid = geteuid ();
gid_t gid = getgid (), egid = getegid ();
uid_t euid;
gid_t egid;
if (! __libc_enable_secure)
/* If we are not set-uid or set-gid, access does the same. */
return access (path, mode);
#else
if (have_ids == 0)
{
@ -148,11 +152,11 @@ euidaccess (path, mode)
euid = geteuid ();
egid = getegid ();
}
#endif
if (uid == euid && gid == egid)
/* If we are not set-uid or set-gid, access does the same. */
return access (path, mode);
#endif
if (stat (path, &stats))
return -1;
@ -165,6 +169,12 @@ euidaccess (path, mode)
if (mode == F_OK)
return 0; /* The file exists. */
#ifdef _LIBC
/* Now we need the IDs. */
euid = geteuid ();
egid = getegid ();
#endif
/* The super-user can read and write any file, and execute any file
that anyone can execute. */
if (euid == 0 && ((mode & X_OK) == 0

View File

@ -9,3 +9,12 @@ __ieee754_j0l (long double x)
}
stub_warning (__ieee754_j0l)
long double
__ieee754_y0l (long double x)
{
fputs ("__ieee754_y0l not implemented\n", stderr);
return 0.0;
}
stub_warning (__ieee754_y0l)

View File

@ -9,3 +9,12 @@ __ieee754_j1l (long double x)
}
stub_warning (__ieee754_j1l)
long double
__ieee754_y1l (long double x)
{
fputs ("__ieee754_y1l not implemented\n", stderr);
return 0.0;
}
stub_warning (__ieee754_y1l)

View File

@ -2,10 +2,19 @@
#include <stdio.h>
long double
__ieee754_jnl (long double x)
__ieee754_jnl (int n, long double x)
{
fputs ("__ieee754_jnl not implemented\n", stderr);
return 0.0;
}
stub_warning (__ieee754_jnl)
long double
__ieee754_ynl (int n, long double x)
{
fputs ("__ieee754_ynl not implemented\n", stderr);
return 0.0;
}
stub_warning (__ieee754_ynl)

View File

@ -1,6 +1,9 @@
init-first.h
sysctl.c
net/if.h
net/if_ppp.h
net/ppp-comp.h
net/ppp_defs.h
nfs/nfs.h
sys/acct.h
sys/io.h

View File

@ -20,6 +20,7 @@ Cambridge, MA 02139, USA. */
and invokes a function in the right context after its all over. */
#include <sysdep.h>
#define _ERRNO_H 1
#include <errnos.h>
/* int clone(int (*fn)(), void *child_stack, int flags, int nargs, ...) */

View File

@ -17,6 +17,10 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef _ERRNO_H
#undef EDOM
#undef ERANGE
#include <linux/errno.h>
#ifndef __ASSEMBLER__
@ -35,5 +39,14 @@ extern int *__errno_location __P ((void)) __attribute__ ((__const__));
#define __set_errno(val) errno = (val)
#endif
#endif
#endif /* __USE_REENTRANT && (!_LIBC || _LIBC_REENTRANT) */
#endif /* !__ASSEMBLER */
#endif /* _ERRNO_H */
#if !defined (_ERRNO_H) && defined (__need_Emath)
/* This is ugly but the kernel header is not clean enough. We must
define only the values EDOM and ERANGE in case __need_Emath is
defined. The value is the same for all Linux ports. */
#define EDOM 33 /* Math argument out of domain of function. */
#define ERANGE 34 /* Math result not representable. */
#endif /* !_ERRNO_H && __need_Emath */

View File

@ -20,6 +20,7 @@ Cambridge, MA 02139, USA. */
and invokes a function in the right context after its all over. */
#include <sysdep.h>
#define _ERRNO_H 1
#include <errnos.h>
/* int clone(int (*fn)(), void *child_stack, int flags, int nargs, ...) */

View File

@ -20,6 +20,7 @@ Cambridge, MA 02139, USA. */
and invokes a function in the right context after its all over. */
#include <sysdep.h>
#define _ERRNO_H 1
#include <errnos.h>
/* int clone (int (*fn) (), void *child_stack, int flags, int nargs, ...) */

View File

@ -0,0 +1 @@
#include <linux/if_ppp.h>

View File

@ -0,0 +1 @@
#include <linux/ppp-comp.h>

View File

@ -0,0 +1 @@
#include <linux/ppp_defs.h>

View File

@ -60,4 +60,7 @@ Boston, MA 02111-1307, USA. */
using the value _POSIX_VDISABLE. */
#define _POSIX_VDISABLE '\0'
/* Filenames are not silently truncated. */
#define _POSIX_NO_TRUNC 1
#endif /* posix_opt.h */

View File

@ -1 +1 @@
#include <linux/soundard.h>
#include <linux/soundcard.h>