* 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.
+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.
#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
#ifndef _SYS_GMON_H_
#define _SYS_GMON_H_
+#include <sys/cdefs.h>
#include <machine-gmon.h>
/*
* 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
* 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.
*/
};
/*
- * 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 {
#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_ */
-/* 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
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);
#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 */
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 */
char fts_name[1]; /* file name */
} FTSENT;
-#include <sys/cdefs.h>
-
__BEGIN_DECLS
FTSENT *fts_children __P((FTS *, int));
int fts_close __P((FTS *));
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
#include <string.h>
#include <ctype.h>
#include <math.h>
+#include <stdlib.h>
int
fcvt_r (value, ndigit, decpt, sign, buf, len)
void
login(ut)
- struct utmp *ut;
+ const struct utmp *ut;
{
register int fd;
int tty;
int
logout(line)
- register char *line;
+ register const char *line;
{
register int fd;
UTMP ut;
#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;
#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"
#define UT_LINESIZE 8
#define UT_HOSTSIZE 16
+__BEGIN_DECLS
+
struct lastlog {
time_t ll_time;
char ll_line[UT_LINESIZE];
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_ */
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. */
-/* 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.
#include <errno.h>
#include <stdlib.h>
+#include <limits.h>
/* Global state for non-reentrent functions. */
/* 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;
}
#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',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
};
-const char *
+char *
l64a (n)
long n;
{
-/* 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.
Boston, MA 02111-1307, USA. */
#include <stdlib.h>
+#include <limits.h>
int
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;
}
#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
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
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