aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-01-23 10:00:23 +0000
committerRoland McGrath <roland@gnu.org>1996-01-23 10:00:23 +0000
commit1d8dc4293f772369e2da018ba5f1bf6e67967f3a (patch)
treee3b745c6fd5c1de37f20768079a419cebacdd41e
parent* misc/Makefile (headers): Rename queue.h to sys/queue.h. (diff)
downloadglibc-1d8dc4293f772369e2da018ba5f1bf6e67967f3a.tar.gz
glibc-1d8dc4293f772369e2da018ba5f1bf6e67967f3a.tar.bz2
glibc-1d8dc4293f772369e2da018ba5f1bf6e67967f3a.zip
Mon Jan 22 10:40:40 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>cvs/libc-960123
* sysdeps/posix/getcwd.c [__GNU_LIBRARY__]: Include unistd.h. * io/fts.h (FTSENT): Define fts_compar member with prototype. * hurd/hurd.h: Use prototype in getcttyid decl. * stdlib/l64a.c: Fix typo in last change. * stdlib/drand48-iter.c: Test limits.h macros instead of sizeof for determining size of types. * stdlib/srand48_r.c: Likewise. * misc/utmp.h: Declare login, logout, logwtmp. * misc/logout.c: Declare argument as pointer to const. * misc/login.c: Likewise. * misc/logwtmp.c: Likewise. Include time.h, string.h. * misc/efgcvt_r.c: Include stdlib.h. * io/mknod.c: Include sys/types.h. * gmon/sys/gmon.h: Declare monstartup, _mcleanup. * csu/gmon-start.c (_start, etext): Declare with prototypes. * stdio-common/vfscanf.c (%[): Fix range handling.
-rw-r--r--ChangeLog30
-rw-r--r--csu/gmon-start.c7
-rw-r--r--gmon/sys/gmon.h20
-rw-r--r--hurd/hurd.h4
-rw-r--r--io/fts.h6
-rw-r--r--io/mknod.c1
-rw-r--r--misc/efgcvt_r.c1
-rw-r--r--misc/login.c2
-rw-r--r--misc/logout.c2
-rw-r--r--misc/logwtmp.c7
-rw-r--r--misc/utmp.h17
-rw-r--r--stdio-common/vfscanf.c8
-rw-r--r--stdlib/drand48-iter.c24
-rw-r--r--stdlib/l64a.c4
-rw-r--r--stdlib/srand48_r.c24
-rw-r--r--sysdeps/posix/getcwd.c2
-rw-r--r--sysdeps/unix/syscalls.list4
17 files changed, 107 insertions, 56 deletions
diff --git a/ChangeLog b/ChangeLog
index 761fb90342..dcc409cd35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+Mon Jan 22 10:40:40 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
+
+ * sysdeps/posix/getcwd.c [__GNU_LIBRARY__]: Include unistd.h.
+
+ * io/fts.h (FTSENT): Define fts_compar member with prototype.
+
+ * hurd/hurd.h: Use prototype in getcttyid decl.
+
+ * stdlib/l64a.c: Fix typo in last change.
+
+ * stdlib/drand48-iter.c: Test limits.h macros instead of sizeof
+ for determining size of types.
+ * stdlib/srand48_r.c: Likewise.
+
+ * misc/utmp.h: Declare login, logout, logwtmp.
+ * misc/logout.c: Declare argument as pointer to const.
+ * misc/login.c: Likewise.
+ * misc/logwtmp.c: Likewise.
+ Include time.h, string.h.
+
+ * misc/efgcvt_r.c: Include stdlib.h.
+
+ * io/mknod.c: Include sys/types.h.
+
+ * gmon/sys/gmon.h: Declare monstartup, _mcleanup.
+
+ * csu/gmon-start.c (_start, etext): Declare with prototypes.
+
+ * stdio-common/vfscanf.c (%[): Fix range handling.
+
Sun Jan 21 00:55:25 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* misc/Makefile (headers): Rename queue.h to sys/queue.h.
diff --git a/csu/gmon-start.c b/csu/gmon-start.c
index 2ebbbf1704..aaff084fbd 100644
--- a/csu/gmon-start.c
+++ b/csu/gmon-start.c
@@ -23,12 +23,7 @@ Cambridge, MA 02139, USA. */
#include <unistd.h>
/* Beginning and end of our code segment. */
-extern void _start (), etext ();
-
-/* These functions are defined in gmon/gmon.c;
- they do all the work of setting up and cleaning up profiling. */
-extern void monstartup (u_long, u_long);
-extern void _mcleanup (void);
+extern void _start (void), etext (void);
#ifndef HAVE_INITFINI
/* This function gets called at startup by the normal constructor
diff --git a/gmon/sys/gmon.h b/gmon/sys/gmon.h
index 6a682d0b10..7064a43cb9 100644
--- a/gmon/sys/gmon.h
+++ b/gmon/sys/gmon.h
@@ -36,6 +36,7 @@
#ifndef _SYS_GMON_H_
#define _SYS_GMON_H_
+#include <sys/cdefs.h>
#include <machine-gmon.h>
/*
@@ -75,7 +76,7 @@ struct gmonhdr {
* calls $0,(r0)
* calls $0,(r0)
*
- * which is separated by only three bytes, thus HASHFRACTION is
+ * which is separated by only three bytes, thus HASHFRACTION is
* calculated as:
*
* HASHFRACTION = 3 / (2 * 2 - 1) = 1
@@ -83,9 +84,9 @@ struct gmonhdr {
* Note that the division above rounds down, thus if MIN_SUBR_FRACTION
* is less than three, this algorithm will not work!
*
- * In practice, however, call instructions are rarely at a minimal
+ * In practice, however, call instructions are rarely at a minimal
* distance. Hence, we will define HASHFRACTION to be 2 across all
- * architectures. This saves a reasonable amount of space for
+ * architectures. This saves a reasonable amount of space for
* profiling data structures without (in practice) sacrificing
* any granularity.
*/
@@ -106,7 +107,7 @@ struct tostruct {
};
/*
- * a raw arc, with pointers to the calling site and
+ * a raw arc, with pointers to the calling site and
* the called site and a count.
*/
struct rawarc {
@@ -156,4 +157,15 @@ extern struct gmonparam _gmonparam;
#define GPROF_FROMS 2 /* struct: from location hash bucket */
#define GPROF_TOS 3 /* struct: destination/count structure */
#define GPROF_GMONPARAM 4 /* struct: profiling parameters (see above) */
+
+__BEGIN_DECLS
+
+/* Set up data structures and start profiling. */
+void monstartup __P ((u_long lowpc, u_long highpc));
+
+/* Clean up profiling and write out gmon.out. */
+void _mcleanup __P ((void));
+
+__END_DECLS
+
#endif /* !_SYS_GMON_H_ */
diff --git a/hurd/hurd.h b/hurd/hurd.h
index 17b5c45d89..55be1579fb 100644
--- a/hurd/hurd.h
+++ b/hurd/hurd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1994, 1995, 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
@@ -146,7 +146,7 @@ extern error_t _hurd_ports_set (unsigned int which, mach_port_t newport);
extern process_t getproc (void);
extern file_t getcwdir (void), getcrdir (void);
extern auth_t getauth (void);
-extern mach_port_t getcttyid ();
+extern mach_port_t getcttyid (void);
extern int setproc (process_t);
extern int setcwdir (file_t), setcrdir (file_t);
extern int setcttyid (mach_port_t);
diff --git a/io/fts.h b/io/fts.h
index 84dbe14bc7..643a027c2c 100644
--- a/io/fts.h
+++ b/io/fts.h
@@ -36,6 +36,8 @@
#ifndef _FTS_H_
#define _FTS_H_
+#include <sys/cdefs.h>
+
typedef struct {
struct _ftsent *fts_cur; /* current node */
struct _ftsent *fts_child; /* linked list of children */
@@ -45,7 +47,7 @@ typedef struct {
int fts_rfd; /* fd for root */
int fts_pathlen; /* sizeof(path) */
int fts_nitems; /* elements in the sort array */
- int (*fts_compar)(); /* compare function */
+ int (*fts_compar) __P((const void *, const void *)); /* compare fn */
#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */
#define FTS_LOGICAL 0x002 /* logical walk */
@@ -111,8 +113,6 @@ typedef struct _ftsent {
char fts_name[1]; /* file name */
} FTSENT;
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
FTSENT *fts_children __P((FTS *, int));
int fts_close __P((FTS *));
diff --git a/io/mknod.c b/io/mknod.c
index b41582cae3..95ebe5a6d2 100644
--- a/io/mknod.c
+++ b/io/mknod.c
@@ -16,6 +16,7 @@ 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 <sys/types.h>
#include <sys/stat.h>
/* This definition is only used if inlining fails for this function; see
diff --git a/misc/efgcvt_r.c b/misc/efgcvt_r.c
index 2da5e55b0b..6bead573a7 100644
--- a/misc/efgcvt_r.c
+++ b/misc/efgcvt_r.c
@@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */
#include <string.h>
#include <ctype.h>
#include <math.h>
+#include <stdlib.h>
int
fcvt_r (value, ndigit, decpt, sign, buf, len)
diff --git a/misc/login.c b/misc/login.c
index 911c2892d2..5b71082c52 100644
--- a/misc/login.c
+++ b/misc/login.c
@@ -45,7 +45,7 @@ static char sccsid[] = "@(#)login.c 8.1 (Berkeley) 6/4/93";
void
login(ut)
- struct utmp *ut;
+ const struct utmp *ut;
{
register int fd;
int tty;
diff --git a/misc/logout.c b/misc/logout.c
index 11da24f1c8..40ae25456f 100644
--- a/misc/logout.c
+++ b/misc/logout.c
@@ -48,7 +48,7 @@ typedef struct utmp UTMP;
int
logout(line)
- register char *line;
+ register const char *line;
{
register int fd;
UTMP ut;
diff --git a/misc/logwtmp.c b/misc/logwtmp.c
index 5b3c8ded11..7734ca9624 100644
--- a/misc/logwtmp.c
+++ b/misc/logwtmp.c
@@ -37,21 +37,20 @@ static char sccsid[] = "@(#)logwtmp.c 8.1 (Berkeley) 6/4/93";
#include <sys/types.h>
#include <sys/file.h>
-#include <sys/time.h>
#include <sys/stat.h>
+#include <time.h>
+#include <string.h>
#include <unistd.h>
#include <utmp.h>
void
logwtmp(line, name, host)
- char *line, *name, *host;
+ const char *line, *name, *host;
{
struct utmp ut;
struct stat buf;
int fd;
- time_t time();
- char *strncpy();
if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0)
return;
diff --git a/misc/utmp.h b/misc/utmp.h
index 15c4e4fd3d..cfd9438f5f 100644
--- a/misc/utmp.h
+++ b/misc/utmp.h
@@ -41,6 +41,8 @@
#ifndef _UTMP_H_
#define _UTMP_H_
+#include <sys/cdefs.h>
+
#define _PATH_UTMP "/var/run/utmp"
#define _PATH_WTMP "/var/log/wtmp"
#define _PATH_LASTLOG "/var/log/lastlog"
@@ -49,6 +51,8 @@
#define UT_LINESIZE 8
#define UT_HOSTSIZE 16
+__BEGIN_DECLS
+
struct lastlog {
time_t ll_time;
char ll_line[UT_LINESIZE];
@@ -62,4 +66,17 @@ struct utmp {
long ut_time;
};
+
+/* Write the given entry into utmp and wtmp. */
+extern void login __P ((const struct utmp *));
+
+/* Write the utmp entry to say the user on UT_LINE has logged out. */
+extern int logout __P ((const char *ut_line));
+
+/* Append to wtmp an entry for the current time and the given info. */
+extern void logwtmp __P ((const char *ut_line, const char *ut_name,
+ const char *ut_host));
+
+__END_DECLS
+
#endif /* !_UTMP_H_ */
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index c7ea4bb5e0..dd635c9f34 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -724,13 +724,13 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
while ((fc = *f++) != '\0' && fc != ']')
{
- if (*f == '-' && f[1] != '\0' && f[1] != ']' && fc <= f[1])
+ if (fc == '-' && *f != '\0' && *f != ']' &&
+ (unsigned char) f[-2] <= (unsigned char) *f)
{
/* Add all characters from the one before the '-'
up to (but not including) the next format char. */
- f++;
- while (fc < *f)
- wp[fc++] = 1;
+ for (fc = f[-2]; fc < *f; ++fc)
+ wp[fc] = 1;
}
else
/* Add the character to the flag map. */
diff --git a/stdlib/drand48-iter.c b/stdlib/drand48-iter.c
index b98f4026ea..967c404706 100644
--- a/stdlib/drand48-iter.c
+++ b/stdlib/drand48-iter.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <stdlib.h>
+#include <limits.h>
/* Global state for non-reentrent functions. */
@@ -40,18 +41,15 @@ __drand48_iterate (xsubi, buffer)
/* Initialize buffer, if not yet done. */
if (!buffer->init)
{
- if (sizeof (unsigned short int) == 2)
- {
- buffer->a[2] = 0x5;
- buffer->a[1] = 0xdeec;
- buffer->a[0] = 0xe66d;
- }
- else
- {
- buffer->a[2] = 0x5deecUL;
- buffer->a[1] = 0xe66d0000UL;
- buffer->a[0] = 0;
- }
+#if (USHRT_MAX == 0xffffU)
+ buffer->a[2] = 0x5;
+ buffer->a[1] = 0xdeec;
+ buffer->a[0] = 0xe66d;
+#else
+ buffer->a[2] = 0x5deecUL;
+ buffer->a[1] = 0xe66d0000UL;
+ buffer->a[0] = 0;
+#endif
buffer->c = 0xb;
buffer->init = 1;
}
diff --git a/stdlib/l64a.c b/stdlib/l64a.c
index ac2cb64804..914f0b5ded 100644
--- a/stdlib/l64a.c
+++ b/stdlib/l64a.c
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */
#include <stdlib.h>
/* Conversion table. */
-static const char conv_tab[64] =
+static const char conv_table[64] =
{
'.', '/', '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', 'A', 'B', 'C', 'D',
@@ -32,7 +32,7 @@ static const char conv_tab[64] =
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
};
-const char *
+char *
l64a (n)
long n;
{
diff --git a/stdlib/srand48_r.c b/stdlib/srand48_r.c
index 8720854249..44cee6ddc1 100644
--- a/stdlib/srand48_r.c
+++ b/stdlib/srand48_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
@@ -18,6 +18,7 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdlib.h>
+#include <limits.h>
int
srand48_r (seedval, buffer)
@@ -28,18 +29,15 @@ srand48_r (seedval, buffer)
if (sizeof (long) > 4)
seedval &= 0xffffffffl;
- if (sizeof (unsigned short int) == 2)
- {
- buffer->X[2] = seedval >> 16;
- buffer->X[1] = seedval & 0xffffl;
- buffer->X[0] = 0x330e;
- }
- else
- {
- buffer->X[2] = seedval;
- buffer->X[1] = 0x330e0000UL;
- buffer->X[0] = 0;
- }
+#if (USHRT_MAX == 0xffffU)
+ buffer->X[2] = seedval >> 16;
+ buffer->X[1] = seedval & 0xffffl;
+ buffer->X[0] = 0x330e;
+#else
+ buffer->X[2] = seedval;
+ buffer->X[1] = 0x330e0000UL;
+ buffer->X[0] = 0;
+#endif
return 0;
}
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index 11577ebdbf..0724ef59a2 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -80,7 +80,7 @@ extern int errno;
#endif /* USG */
#endif /* POSIX or DIRENT or __GNU_LIBRARY__ */
-#ifdef HAVE_UNISTD_H
+#if defined (HAVE_UNISTD_H) || defined (__GNU_LIBRARY__)
#include <unistd.h>
#endif
diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list
index 2f5c524abe..7fba017fc0 100644
--- a/sysdeps/unix/syscalls.list
+++ b/sysdeps/unix/syscalls.list
@@ -8,7 +8,7 @@ chown - chown 3 __chown chown
chroot - chroot 1 chroot
close - close 1 __close close
dup - dup 2 __dup dup
-dup2 - dup2 2 __dup2 dup2
+dup2 - dup2 2 __dup2 dup2
fchdir - fchdir 1 fchdir
fcntl - fcntl 3 __fcntl fcntl
fsync - fsync 1 fsync
@@ -24,7 +24,7 @@ ioctl - ioctl 3 __ioctl ioctl
kill - kill 2 __kill kill
link - link 2 __link link
lseek - lseek 3 __lseek lseek
-mkdir - mkdir 2 __mkdir mkdir
+mkdir - mkdir 2 __mkdir mkdir
open - open 3 __open open
profil - profil 4 profil
ptrace - ptrace 4 ptrace