mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 02:40:08 +00:00
update from main archive 961209
Tue Dec 10 02:17:31 1996 Ulrich Drepper <drepper@cygnus.com> * stdio-common/printf_fp.c (__guess_grouping): Fix of by one error in computation of number of groups. Patch sent by Harald Schreiber <Harald.Schreiber@post.rwth-aachen.de>. Tue Dec 10 01:50:07 1996 Ulrich Drepper <drepper@cygnus.com> * version.h: Set version to 1.99. * Make-dist (routines): Add malloc and new-malloc. * Makeconfig: Allow Makefiles to set $(CPPFLAGS-$(<F)) and $(CPPFLAGS-$(@F)) to be added to CPPFLAGS. Same for $(CFLAGS-$(@F)) and CFLAGS. * gmon/sys/gmon_out.h: Add __BEGIN_DECLS/__END_DECLS. Unify layout. * io/sys/poll.h: Likewise. * sysdeps/stub/sys/ipb_buf.h: Likewise. * sysdeps/unix/sysv/linux/i386/sys/perm.h: Likewise. * sysdeps/unix/sysv/linux/i386/sys/vm86.h: Likewise. * sysdeps/unix/sysv/linux/sys/ipc_buf.h: Likewise. * sysdeps/unix/sysv/linux/sys/kdaemon.h: Likewise. * sysdeps/unix/sysv/linux/sys/klog.h: Likewise. * sysdeps/unix/sysv/linux/sys/mman.h: Likewise. * sysdeps/unix/sysv/linux/sys/module.h: Likewise. * sysdeps/unix/sysv/linux/sys/mount.h: Likewise. * sysdeps/unix/sysv/linux/sys/msq_buf.h: Likewise. * sysdeps/unix/sysv/linux/sys/param.h: Likewise. * sysdeps/unix/sysv/linux/sys/procfs.h: Likewise. * sysdeps/unix/sysv/linux/sys/ptrace.h: Likewise. * sysdeps/unix/sysv/linux/sys/reboot.h: Likewise. * sysdeps/unix/sysv/linux/sys/sem_buf.h: Likewise. * sysdeps/unix/sysv/linux/sys/shm_buf.h: Likewise. * sysdeps/unix/sysv/linux/sys/socketcall.h: Likewise. * sysdeps/unix/sysv/linux/sys/swap.h: Likewise. * sysdeps/unix/sysv/linux/sys/sysctl.h: Likewise. * sysdeps/unix/sysv/linux/sys/sysinfo.h: Likewise. * sysdeps/unix/sysv/linux/sys/sysmacros.h: Likewise. * sysdeps/unix/sysv/linux/sys/timex.h: Likewise. * sysvipc/sys/sem.h: Likewise. * sysvipc/sys/shm.h: Likewise. * new-malloc/Makefile: Set CPPFLAGS-malloc.o. * new-malloc/malloc.c: Remove problem with 64 bits pointers. Add statistics for threads. * new-malloc/malloc.h: Likewise. * new-malloc/thread-m.h: Likewise. * time/strftime.c: Declare tzname if if HAVE_TZNAME is defined. * time/strptime.c: Update copyright. Mon Dec 9 14:51:10 1996 Ulrich Drepper <drepper@cygnus.com> * Make-dist: Make sure both malloc directories get distributed. Sun Dec 8 23:14:10 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * libio/iogets.c (_IO_gets): Fix early returns to not leave the stream locked. Sat Dec 7 22:08:09 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/sys/module.h: Enclose declarations in __BEGIN_DECLS/__END_DECLS. Sat Dec 7 14:23:12 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * login/utmp_file.c: Consistently set file_offset to the position after the entry just read.
This commit is contained in:
parent
f5c1ec414e
commit
8a4b65b469
73
ChangeLog
73
ChangeLog
@ -1,3 +1,76 @@
|
||||
Tue Dec 10 02:17:31 1996 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* stdio-common/printf_fp.c (__guess_grouping): Fix of by one
|
||||
error in computation of number of groups.
|
||||
Patch sent by Harald Schreiber <Harald.Schreiber@post.rwth-aachen.de>.
|
||||
|
||||
Tue Dec 10 01:50:07 1996 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* version.h: Set version to 1.99.
|
||||
|
||||
* Make-dist (routines): Add malloc and new-malloc.
|
||||
|
||||
* Makeconfig: Allow Makefiles to set $(CPPFLAGS-$(<F)) and
|
||||
$(CPPFLAGS-$(@F)) to be added to CPPFLAGS.
|
||||
Same for $(CFLAGS-$(@F)) and CFLAGS.
|
||||
|
||||
* gmon/sys/gmon_out.h: Add __BEGIN_DECLS/__END_DECLS. Unify
|
||||
layout.
|
||||
* io/sys/poll.h: Likewise.
|
||||
* sysdeps/stub/sys/ipb_buf.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/i386/sys/perm.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/ipc_buf.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/kdaemon.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/klog.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/mman.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/module.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/mount.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/msq_buf.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/param.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/procfs.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/ptrace.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/reboot.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/sem_buf.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/shm_buf.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/socketcall.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/swap.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/sysctl.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/sysinfo.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/sysmacros.h: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sys/timex.h: Likewise.
|
||||
* sysvipc/sys/sem.h: Likewise.
|
||||
* sysvipc/sys/shm.h: Likewise.
|
||||
|
||||
* new-malloc/Makefile: Set CPPFLAGS-malloc.o.
|
||||
* new-malloc/malloc.c: Remove problem with 64 bits pointers.
|
||||
Add statistics for threads.
|
||||
* new-malloc/malloc.h: Likewise.
|
||||
* new-malloc/thread-m.h: Likewise.
|
||||
|
||||
* time/strftime.c: Declare tzname if if HAVE_TZNAME is defined.
|
||||
|
||||
* time/strptime.c: Update copyright.
|
||||
|
||||
Mon Dec 9 14:51:10 1996 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* Make-dist: Make sure both malloc directories get distributed.
|
||||
|
||||
Sun Dec 8 23:14:10 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* libio/iogets.c (_IO_gets): Fix early returns to not leave the
|
||||
stream locked.
|
||||
|
||||
Sat Dec 7 22:08:09 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* sysdeps/unix/sysv/linux/sys/module.h: Enclose declarations in
|
||||
__BEGIN_DECLS/__END_DECLS.
|
||||
|
||||
Sat Dec 7 14:23:12 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* login/utmp_file.c: Consistently set file_offset to the position
|
||||
after the entry just read.
|
||||
|
||||
Mon Dec 9 03:39:30 1996 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* config.make.in (defines): Add @USE_NEW_MALLOC@.
|
||||
|
@ -47,6 +47,9 @@ subdirs := $(filter-out $(add-ons),$(subdirs))
|
||||
# Make sure both stdio and libio get in, whichever is in use.
|
||||
subdirs += stdio libio
|
||||
|
||||
# The same must be true for the malloc directories.
|
||||
subdirs += malloc new-malloc
|
||||
|
||||
sysdep-Subdir-files := $(wildcard $(addsuffix /Subdirs,$(sysdep_dirs)))
|
||||
ifdef sysdep-Subdir-files
|
||||
subdirs := $(sort $(subdirs) \
|
||||
|
@ -446,9 +446,10 @@ libio-include = -I$(..)libio
|
||||
|
||||
# These are the variables that the implicit compilation rules use.
|
||||
CPPFLAGS = $(+includes) $(defines) -include $(..)libc-symbols.h \
|
||||
$(sysdep-CPPFLAGS) $(CPPFLAGS-$(suffix $@))
|
||||
$(sysdep-CPPFLAGS) $(CPPFLAGS-$(suffix $@)) $(CPPFLAGS-$(<F)) \
|
||||
$(CPPFLAGS-$(@F))
|
||||
override CFLAGS = $(+cflags) $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) \
|
||||
$(CFLAGS-$(<F))
|
||||
$(CFLAGS-$(<F)) $(CFLAGS-$(@F))
|
||||
|
||||
|
||||
# This is the macro that the implicit linking rules use.
|
||||
|
@ -25,12 +25,16 @@
|
||||
a sequence of records. Each record starts with a one-byte tag
|
||||
identifying the type of records, followed by records specific data. */
|
||||
|
||||
#ifndef _SYS_GMON_OUT_H_
|
||||
#define _SYS_GMON_OUT_H_
|
||||
#ifndef _SYS_GMON_OUT_H
|
||||
|
||||
#define _SYS_GMON_OUT_H 1
|
||||
#include <features.h>
|
||||
|
||||
#define GMON_MAGIC "gmon" /* magic cookie */
|
||||
#define GMON_VERSION 1 /* version number */
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Raw header as it appears on file (without padding). This header
|
||||
* always comes first in gmon.out and is then followed by a series
|
||||
@ -62,4 +66,6 @@ struct gmon_cg_arc_record {
|
||||
int count; /* number of arc traversals */
|
||||
};
|
||||
|
||||
#endif /* !_SYS_GMON_OUT_H_ */
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_GMON_OUT_H */
|
||||
|
@ -18,9 +18,11 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _SYS_POLL_H
|
||||
#define _SYS_POLL_H
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#define _SYS_POLL_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Data structure describing a polling request. */
|
||||
struct pollfd
|
||||
@ -51,8 +53,6 @@ struct pollfd
|
||||
#define NPOLLFILE 30
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Poll the file descriptors described by the NFDS structures starting at
|
||||
FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
|
||||
an event to occur; if TIMEOUT is -1, block until an event occurs.
|
||||
@ -64,4 +64,4 @@ extern int poll __P ((struct pollfd *__fds, unsigned long int __nfds,
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/poll.h */
|
||||
#endif /* _SYS_POLL_H */
|
||||
|
@ -31,13 +31,17 @@ _IO_gets (buf)
|
||||
{
|
||||
_IO_size_t count;
|
||||
int ch;
|
||||
char *retval;
|
||||
|
||||
__libc_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
||||
_IO_stdin);
|
||||
_IO_flockfile (_IO_stdin);
|
||||
ch = _IO_getc_unlocked (_IO_stdin);
|
||||
if (ch == EOF)
|
||||
return NULL;
|
||||
{
|
||||
retval = NULL;
|
||||
goto unlock_return;
|
||||
}
|
||||
if (ch == '\n')
|
||||
count = 0;
|
||||
else
|
||||
@ -45,11 +49,16 @@ _IO_gets (buf)
|
||||
buf[0] = (char)ch;
|
||||
count = _IO_getline (_IO_stdin, buf + 1, INT_MAX, '\n', 0) + 1;
|
||||
if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
|
||||
return NULL;
|
||||
{
|
||||
retval = NULL;
|
||||
goto unlock_return;
|
||||
}
|
||||
}
|
||||
__libc_cleanup_region_end (1);
|
||||
buf[count] = 0;
|
||||
return buf;
|
||||
retval = buf;
|
||||
unlock_return:
|
||||
__libc_cleanup_region_end (1);
|
||||
return retval;
|
||||
}
|
||||
|
||||
weak_alias (_IO_gets, gets)
|
||||
|
@ -134,7 +134,7 @@ getutent_r_file (struct utmp *buffer, struct utmp **result)
|
||||
nbytes = read (file_fd, &last_entry, sizeof (struct utmp));
|
||||
flock (file_fd, LOCK_UN);
|
||||
|
||||
if (nbytes!= sizeof (struct utmp))
|
||||
if (nbytes != sizeof (struct utmp))
|
||||
{
|
||||
file_offset = -1l;
|
||||
*result = NULL;
|
||||
@ -174,6 +174,7 @@ getutline_r_file (const struct utmp *line, struct utmp *buffer,
|
||||
*result = NULL;
|
||||
return -1;
|
||||
}
|
||||
file_offset += sizeof (struct utmp);
|
||||
|
||||
/* Stop if we found a user or login entry. */
|
||||
if (
|
||||
@ -184,8 +185,6 @@ getutline_r_file (const struct utmp *line, struct utmp *buffer,
|
||||
#endif
|
||||
!strncmp (line->ut_line, last_entry.ut_line, sizeof line->ut_line))
|
||||
break;
|
||||
|
||||
file_offset += sizeof (struct utmp);
|
||||
}
|
||||
|
||||
memcpy (buffer, &last_entry, sizeof (struct utmp));
|
||||
@ -214,11 +213,10 @@ internal_getutid_r (const struct utmp *id, struct utmp *buffer)
|
||||
file_offset = -1l;
|
||||
return -1;
|
||||
}
|
||||
file_offset += sizeof (struct utmp);
|
||||
|
||||
if (id->ut_type == buffer->ut_type)
|
||||
break;
|
||||
|
||||
file_offset += sizeof (struct utmp);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -236,14 +234,14 @@ internal_getutid_r (const struct utmp *id, struct utmp *buffer)
|
||||
file_offset = -1l;
|
||||
return -1;
|
||||
}
|
||||
file_offset += sizeof (struct utmp);
|
||||
|
||||
if (( buffer->ut_type == INIT_PROCESS
|
||||
|| buffer->ut_type == LOGIN_PROCESS
|
||||
|| buffer->ut_type == USER_PROCESS
|
||||
|| buffer->ut_type == DEAD_PROCESS)
|
||||
&& strncmp (buffer->ut_id, id->ut_id, sizeof id->ut_id) == 0)
|
||||
break;
|
||||
|
||||
file_offset += sizeof (struct utmp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -347,7 +345,10 @@ pututline_file (const struct utmp *data)
|
||||
pbuf = NULL;
|
||||
}
|
||||
else
|
||||
pbuf = (struct utmp *) data;
|
||||
{
|
||||
file_offset += sizeof (struct utmp);
|
||||
pbuf = (struct utmp *) data;
|
||||
}
|
||||
|
||||
/* And unlock the file. */
|
||||
(void) flock (file_fd, LOCK_UN);
|
||||
|
@ -37,4 +37,5 @@ routines = $(dist-routines) obstack
|
||||
|
||||
include ../Rules
|
||||
|
||||
CPPFLAGS-malloc.o += -DMALLOC_DEBUG
|
||||
CFLAGS-obstack.c = -Wno-strict-prototypes
|
||||
|
450
malloc/malloc.c
450
malloc/malloc.c
@ -266,12 +266,6 @@
|
||||
|
||||
|
||||
|
||||
/* Macros for handling mutexes and thread-specific data. This is
|
||||
included first, because some thread-related header files (such as
|
||||
pthread.h) should be included before any others. */
|
||||
#include "thread-m.h"
|
||||
|
||||
|
||||
/* Preliminaries */
|
||||
|
||||
#ifndef __STD_C
|
||||
@ -300,6 +294,11 @@
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* Macros for handling mutexes and thread-specific data. This is
|
||||
included early, because some thread-related header files (such as
|
||||
pthread.h) should be included before any others. */
|
||||
#include "thread-m.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -597,9 +596,13 @@ do { \
|
||||
/* #define HAVE_USR_INCLUDE_MALLOC_H */
|
||||
|
||||
#if HAVE_USR_INCLUDE_MALLOC_H
|
||||
#include "/usr/include/malloc.h"
|
||||
# include "/usr/include/malloc.h"
|
||||
#else
|
||||
#include "malloc.h"
|
||||
# ifdef _LIBC
|
||||
# include "malloc.h"
|
||||
# else
|
||||
# include "ptmalloc.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -1106,6 +1109,10 @@ typedef struct malloc_chunk* mbinptr;
|
||||
typedef struct _arena {
|
||||
mbinptr av[2*NAV + 2];
|
||||
struct _arena *next;
|
||||
size_t size;
|
||||
#if THREAD_STATS
|
||||
long stat_lock_direct, stat_lock_loop, stat_lock_wait;
|
||||
#endif
|
||||
mutex_t mutex;
|
||||
} arena;
|
||||
|
||||
@ -1116,8 +1123,10 @@ typedef struct _arena {
|
||||
multiple threads. */
|
||||
|
||||
typedef struct _heap_info {
|
||||
arena *ar_ptr;
|
||||
size_t size;
|
||||
arena *ar_ptr; /* Arena for this heap. */
|
||||
struct _heap_info *prev; /* Previous heap. */
|
||||
size_t size; /* Current size in bytes. */
|
||||
size_t pad; /* Make sure the following data is properly aligned. */
|
||||
} heap_info;
|
||||
|
||||
|
||||
@ -1128,11 +1137,17 @@ typedef struct _heap_info {
|
||||
#if __STD_C
|
||||
static void chunk_free(arena *ar_ptr, mchunkptr p);
|
||||
static mchunkptr chunk_alloc(arena *ar_ptr, INTERNAL_SIZE_T size);
|
||||
static int arena_trim(arena *ar_ptr, size_t pad);
|
||||
static int main_trim(size_t pad);
|
||||
#ifndef NO_THREADS
|
||||
static int heap_trim(heap_info *heap, size_t pad);
|
||||
#endif
|
||||
#else
|
||||
static void chunk_free();
|
||||
static mchunkptr chunk_alloc();
|
||||
static int arena_trim();
|
||||
static int main_trim();
|
||||
#ifndef NO_THREADS
|
||||
static int heap_trim();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -1371,6 +1386,10 @@ static arena main_arena = {
|
||||
IAV(120), IAV(121), IAV(122), IAV(123), IAV(124), IAV(125), IAV(126), IAV(127)
|
||||
},
|
||||
NULL, /* next */
|
||||
0, /* size */
|
||||
#if THREAD_STATS
|
||||
0, 0, 0, /* stat_lock_direct, stat_lock_loop, stat_lock_wait */
|
||||
#endif
|
||||
MUTEX_INITIALIZER /* mutex */
|
||||
};
|
||||
|
||||
@ -1378,14 +1397,13 @@ static arena main_arena = {
|
||||
|
||||
/* Thread specific data */
|
||||
|
||||
#ifndef NO_THREADS
|
||||
static tsd_key_t arena_key;
|
||||
static mutex_t list_lock = MUTEX_INITIALIZER;
|
||||
#endif
|
||||
|
||||
#if THREAD_STATS
|
||||
static int stat_n_arenas = 0;
|
||||
static int stat_n_heaps = 0;
|
||||
static long stat_lock_direct = 0;
|
||||
static long stat_lock_loop = 0;
|
||||
#define THREAD_STAT(x) x
|
||||
#else
|
||||
#define THREAD_STAT(x) do ; while(0)
|
||||
@ -1404,14 +1422,13 @@ static char* sbrk_base = (char*)(-1);
|
||||
/* The maximum memory obtained from system via sbrk */
|
||||
static unsigned long max_sbrked_mem = 0;
|
||||
|
||||
/* The maximum via either sbrk or mmap */
|
||||
/* The maximum via either sbrk or mmap (too difficult to track with threads) */
|
||||
#ifdef NO_THREADS
|
||||
static unsigned long max_total_mem = 0;
|
||||
|
||||
/* internal working copy of mallinfo */
|
||||
static struct mallinfo current_mallinfo = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
#endif
|
||||
|
||||
/* The total memory obtained from system via sbrk */
|
||||
#define sbrked_mem (current_mallinfo.arena)
|
||||
#define sbrked_mem (main_arena.size)
|
||||
|
||||
/* Tracking mmaps */
|
||||
|
||||
@ -1438,17 +1455,19 @@ ptmalloc_init __MALLOC_P((void))
|
||||
static int first = 1;
|
||||
|
||||
#if defined(_LIBC)
|
||||
/* Initialize the pthread. */
|
||||
/* Initialize the pthreads interface. */
|
||||
if (__pthread_initialize != NULL)
|
||||
__pthread_initialize ();
|
||||
__pthread_initialize();
|
||||
#endif
|
||||
|
||||
if(first) {
|
||||
first = 0;
|
||||
#ifndef NO_THREADS
|
||||
mutex_init(&main_arena.mutex);
|
||||
mutex_init(&list_lock);
|
||||
tsd_key_create(&arena_key, NULL);
|
||||
tsd_setspecific(arena_key, (Void_t *)&main_arena);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1511,8 +1530,10 @@ static mchunkptr mmap_chunk(size) size_t size;
|
||||
mmapped_mem += size;
|
||||
if ((unsigned long)mmapped_mem > (unsigned long)max_mmapped_mem)
|
||||
max_mmapped_mem = mmapped_mem;
|
||||
#ifdef NO_THREADS
|
||||
if ((unsigned long)(mmapped_mem + sbrked_mem) > (unsigned long)max_total_mem)
|
||||
max_total_mem = mmapped_mem + sbrked_mem;
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
|
||||
@ -1576,8 +1597,10 @@ static mchunkptr mremap_chunk(p, new_size) mchunkptr p; size_t new_size;
|
||||
mmapped_mem += new_size;
|
||||
if ((unsigned long)mmapped_mem > (unsigned long)max_mmapped_mem)
|
||||
max_mmapped_mem = mmapped_mem;
|
||||
#ifdef NO_THREADS
|
||||
if ((unsigned long)(mmapped_mem + sbrked_mem) > (unsigned long)max_total_mem)
|
||||
max_total_mem = mmapped_mem + sbrked_mem;
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
|
||||
@ -1629,7 +1652,7 @@ new_heap(size) size_t size;
|
||||
}
|
||||
|
||||
/* Grow or shrink a heap. size is automatically rounded up to a
|
||||
multiple of the page size. */
|
||||
multiple of the page size if it is positive. */
|
||||
|
||||
static int
|
||||
#if __STD_C
|
||||
@ -1650,7 +1673,7 @@ grow_heap(h, diff) heap_info *h; long diff;
|
||||
return -2;
|
||||
} else {
|
||||
new_size = (long)h->size + diff;
|
||||
if(new_size < 0)
|
||||
if(new_size < (long)sizeof(*h))
|
||||
return -1;
|
||||
if(mprotect((char *)h + new_size, -diff, PROT_NONE) != 0)
|
||||
return -2;
|
||||
@ -1659,6 +1682,10 @@ grow_heap(h, diff) heap_info *h; long diff;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Delete a heap. */
|
||||
|
||||
#define delete_heap(heap) munmap((char*)(heap), HEAP_MAX_SIZE)
|
||||
|
||||
/* arena_get() acquires an arena and locks the corresponding mutex.
|
||||
First, try the one last locked successfully by this thread. (This
|
||||
is the common case and handled with a macro for speed.) Then, loop
|
||||
@ -1669,7 +1696,7 @@ grow_heap(h, diff) heap_info *h; long diff;
|
||||
Void_t *vptr = NULL; \
|
||||
ptr = (arena *)tsd_getspecific(arena_key, vptr); \
|
||||
if(ptr && !mutex_trylock(&ptr->mutex)) { \
|
||||
THREAD_STAT(stat_lock_direct++); \
|
||||
THREAD_STAT(++(ptr->stat_lock_direct)); \
|
||||
} else { \
|
||||
ptr = arena_get2(ptr, (size)); \
|
||||
} \
|
||||
@ -1688,21 +1715,16 @@ arena_get2(a_tsd, size) arena *a_tsd; size_t size;
|
||||
int i;
|
||||
unsigned long misalign;
|
||||
|
||||
/* Check the list for unlocked arenas. */
|
||||
/* Check the singly-linked list for unlocked arenas. */
|
||||
if(a_tsd) {
|
||||
for(a = a_tsd->next; a; a = a->next) {
|
||||
if(!mutex_trylock(&a->mutex))
|
||||
goto done;
|
||||
}
|
||||
for(a = &main_arena; a != a_tsd; a = a->next) {
|
||||
if(!mutex_trylock(&a->mutex))
|
||||
goto done;
|
||||
}
|
||||
} else {
|
||||
for(a = &main_arena; a; a = a->next) {
|
||||
if(!mutex_trylock(&a->mutex))
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
for(a = &main_arena; a != a_tsd; a = a->next) {
|
||||
if(!mutex_trylock(&a->mutex))
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Nothing immediately available, so generate a new arena. */
|
||||
@ -1712,6 +1734,7 @@ arena_get2(a_tsd, size) arena *a_tsd; size_t size;
|
||||
a = h->ar_ptr = (arena *)(h+1);
|
||||
for(i=0; i<NAV; i++)
|
||||
init_bin(a, i);
|
||||
a->size = h->size;
|
||||
mutex_init(&a->mutex);
|
||||
i = mutex_lock(&a->mutex); /* remember result */
|
||||
|
||||
@ -1721,20 +1744,19 @@ arena_get2(a_tsd, size) arena *a_tsd; size_t size;
|
||||
if (misalign > 0)
|
||||
ptr += MALLOC_ALIGNMENT - misalign;
|
||||
top(a) = (mchunkptr)ptr;
|
||||
set_head(top(a), (h->size - (ptr-(char*)h)) | PREV_INUSE);
|
||||
set_head(top(a), (((char*)h + h->size) - ptr) | PREV_INUSE);
|
||||
|
||||
/* Add the new arena to the list. */
|
||||
(void)mutex_lock(&list_lock);
|
||||
a->next = main_arena.next;
|
||||
main_arena.next = a;
|
||||
THREAD_STAT(stat_n_arenas++);
|
||||
(void)mutex_unlock(&list_lock);
|
||||
|
||||
if(i) /* locking failed; keep arena for further attempts later */
|
||||
return 0;
|
||||
|
||||
done:
|
||||
THREAD_STAT(stat_lock_loop++);
|
||||
THREAD_STAT(++(a->stat_lock_loop));
|
||||
tsd_setspecific(arena_key, (Void_t *)a);
|
||||
return a;
|
||||
}
|
||||
@ -1817,23 +1839,19 @@ static void do_check_free_chunk(ar_ptr, p) arena *ar_ptr; mchunkptr p;
|
||||
/* Check whether it claims to be free ... */
|
||||
assert(!inuse(p));
|
||||
|
||||
/* Unless a special marker, must have OK fields */
|
||||
if ((long)sz >= (long)MINSIZE)
|
||||
{
|
||||
assert((sz & MALLOC_ALIGN_MASK) == 0);
|
||||
assert(aligned_OK(chunk2mem(p)));
|
||||
/* ... matching footer field */
|
||||
assert(next->prev_size == sz);
|
||||
/* ... and is fully consolidated */
|
||||
assert(prev_inuse(p));
|
||||
assert (next == top(ar_ptr) || inuse(next));
|
||||
/* Must have OK size and fields */
|
||||
assert((long)sz >= (long)MINSIZE);
|
||||
assert((sz & MALLOC_ALIGN_MASK) == 0);
|
||||
assert(aligned_OK(chunk2mem(p)));
|
||||
/* ... matching footer field */
|
||||
assert(next->prev_size == sz);
|
||||
/* ... and is fully consolidated */
|
||||
assert(prev_inuse(p));
|
||||
assert (next == top(ar_ptr) || inuse(next));
|
||||
|
||||
/* ... and has minimally sane links */
|
||||
assert(p->fd->bk == p);
|
||||
assert(p->bk->fd == p);
|
||||
}
|
||||
else /* markers are always of size SIZE_SZ */
|
||||
assert(sz == SIZE_SZ);
|
||||
/* ... and has minimally sane links */
|
||||
assert(p->fd->bk == p);
|
||||
assert(p->bk->fd == p);
|
||||
}
|
||||
|
||||
#if __STD_C
|
||||
@ -1848,6 +1866,9 @@ static void do_check_inuse_chunk(ar_ptr, p) arena *ar_ptr; mchunkptr p;
|
||||
/* Check whether it claims to be in use ... */
|
||||
assert(inuse(p));
|
||||
|
||||
/* ... whether its size is OK (it might be a fencepost) ... */
|
||||
assert(chunksize(p) >= MINSIZE || next->size == (0|PREV_INUSE));
|
||||
|
||||
/* ... and is surrounded by OK chunks.
|
||||
Since more things can be checked with free chunks than inuse ones,
|
||||
if an inuse chunk borders them and debug is on, it's worth doing them.
|
||||
@ -2066,14 +2087,16 @@ static void malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
|
||||
if ((unsigned long)sbrked_mem > (unsigned long)max_sbrked_mem)
|
||||
max_sbrked_mem = sbrked_mem;
|
||||
#ifdef NO_THREADS
|
||||
if ((unsigned long)(mmapped_mem + sbrked_mem) >
|
||||
(unsigned long)max_total_mem)
|
||||
max_total_mem = mmapped_mem + sbrked_mem;
|
||||
#endif
|
||||
|
||||
#ifndef NO_THREADS
|
||||
} else { /* ar_ptr != &main_arena */
|
||||
|
||||
heap_info *heap;
|
||||
heap_info *old_heap, *heap;
|
||||
size_t old_heap_size;
|
||||
|
||||
if(old_top_size < MINSIZE) /* this should never happen */
|
||||
return;
|
||||
@ -2081,9 +2104,11 @@ static void malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
/* First try to extend the current heap. */
|
||||
if(MINSIZE + nb <= old_top_size)
|
||||
return;
|
||||
heap = heap_for_ptr(old_top);
|
||||
if(grow_heap(heap, MINSIZE + nb - old_top_size) == 0) {
|
||||
top_size = heap->size - ((char *)old_top - (char *)heap);
|
||||
old_heap = heap_for_ptr(old_top);
|
||||
old_heap_size = old_heap->size;
|
||||
if(grow_heap(old_heap, MINSIZE + nb - old_top_size) == 0) {
|
||||
ar_ptr->size += old_heap->size - old_heap_size;
|
||||
top_size = ((char *)old_heap + old_heap->size) - (char *)old_top;
|
||||
set_head(old_top, top_size | PREV_INUSE);
|
||||
return;
|
||||
}
|
||||
@ -2093,6 +2118,8 @@ static void malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
if(!heap)
|
||||
return;
|
||||
heap->ar_ptr = ar_ptr;
|
||||
heap->prev = old_heap;
|
||||
ar_ptr->size += heap->size;
|
||||
|
||||
/* Set up the new top, so we can safely use chunk_free() below. */
|
||||
top(ar_ptr) = chunk_at_offset(heap, sizeof(*heap));
|
||||
@ -2106,19 +2133,19 @@ static void malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
|
||||
/* Setup fencepost and free the old top chunk. */
|
||||
if(old_top) {
|
||||
/* Keep size a multiple of MALLOC_ALIGNMENT. */
|
||||
old_top_size = (old_top_size - 3*SIZE_SZ) & ~MALLOC_ALIGN_MASK;
|
||||
/* If possible, release the rest. */
|
||||
if (old_top_size >= MINSIZE) {
|
||||
set_head(chunk_at_offset(old_top, old_top_size ),
|
||||
SIZE_SZ|PREV_INUSE);
|
||||
set_head(chunk_at_offset(old_top, old_top_size+SIZE_SZ),
|
||||
SIZE_SZ|PREV_INUSE);
|
||||
/* The fencepost takes at least MINSIZE bytes, because it might
|
||||
become the top chunk again later. Note that a footer is set
|
||||
up, too, although the chunk is marked in use. */
|
||||
old_top_size -= MINSIZE;
|
||||
set_head(chunk_at_offset(old_top, old_top_size + 2*SIZE_SZ), 0|PREV_INUSE);
|
||||
if(old_top_size >= MINSIZE) {
|
||||
set_head(chunk_at_offset(old_top, old_top_size), (2*SIZE_SZ)|PREV_INUSE);
|
||||
set_foot(chunk_at_offset(old_top, old_top_size), (2*SIZE_SZ));
|
||||
set_head_size(old_top, old_top_size);
|
||||
chunk_free(ar_ptr, old_top);
|
||||
} else {
|
||||
set_head(old_top, SIZE_SZ|PREV_INUSE);
|
||||
set_head(chunk_at_offset(old_top, SIZE_SZ), SIZE_SZ|PREV_INUSE);
|
||||
set_head(old_top, (old_top_size + 2*SIZE_SZ)|PREV_INUSE);
|
||||
set_foot(old_top, (old_top_size + 2*SIZE_SZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2130,13 +2157,14 @@ static void malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
|
||||
|
||||
/*
|
||||
Malloc Algorthim:
|
||||
Malloc Algorithm:
|
||||
|
||||
The requested size is first converted into a usable form, `nb'.
|
||||
This currently means to add 4 bytes overhead plus possibly more to
|
||||
obtain 8-byte alignment and/or to obtain a size of at least
|
||||
MINSIZE (currently 16 bytes), the smallest allocatable size.
|
||||
(All fits are considered `exact' if they are within MINSIZE bytes.)
|
||||
MINSIZE (currently 16, 24, or 32 bytes), the smallest allocatable
|
||||
size. (All fits are considered `exact' if they are within MINSIZE
|
||||
bytes.)
|
||||
|
||||
From there, the first successful of the following steps is taken:
|
||||
|
||||
@ -2486,7 +2514,16 @@ void fREe(mem) Void_t* mem;
|
||||
#endif
|
||||
|
||||
ar_ptr = arena_for_ptr(p);
|
||||
#if THREAD_STATS
|
||||
if(!mutex_trylock(&ar_ptr->mutex))
|
||||
++(ar_ptr->stat_lock_direct);
|
||||
else {
|
||||
(void)mutex_lock(&ar_ptr->mutex);
|
||||
++(ar_ptr->stat_lock_wait);
|
||||
}
|
||||
#else
|
||||
(void)mutex_lock(&ar_ptr->mutex);
|
||||
#endif
|
||||
chunk_free(ar_ptr, p);
|
||||
(void)mutex_unlock(&ar_ptr->mutex);
|
||||
}
|
||||
@ -2528,8 +2565,24 @@ chunk_free(ar_ptr, p) arena *ar_ptr; mchunkptr p;
|
||||
|
||||
set_head(p, sz | PREV_INUSE);
|
||||
top(ar_ptr) = p;
|
||||
if ((unsigned long)(sz) >= (unsigned long)trim_threshold)
|
||||
arena_trim(ar_ptr, top_pad);
|
||||
|
||||
#ifndef NO_THREADS
|
||||
if(ar_ptr == &main_arena) {
|
||||
#endif
|
||||
if ((unsigned long)(sz) >= (unsigned long)trim_threshold)
|
||||
main_trim(top_pad);
|
||||
#ifndef NO_THREADS
|
||||
} else {
|
||||
heap_info *heap = heap_for_ptr(p);
|
||||
|
||||
assert(heap->ar_ptr == ar_ptr);
|
||||
|
||||
/* Try to get rid of completely empty heaps, if possible. */
|
||||
if((unsigned long)(sz) >= (unsigned long)trim_threshold ||
|
||||
p == chunk_at_offset(heap, sizeof(*heap)))
|
||||
heap_trim(heap, top_pad);
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2670,7 +2723,17 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
|
||||
#endif
|
||||
|
||||
ar_ptr = arena_for_ptr(oldp);
|
||||
#if THREAD_STATS
|
||||
if(!mutex_trylock(&ar_ptr->mutex))
|
||||
++(ar_ptr->stat_lock_direct);
|
||||
else {
|
||||
(void)mutex_lock(&ar_ptr->mutex);
|
||||
++(ar_ptr->stat_lock_wait);
|
||||
}
|
||||
#else
|
||||
(void)mutex_lock(&ar_ptr->mutex);
|
||||
#endif
|
||||
|
||||
/* As in malloc(), remember this arena for the next allocation. */
|
||||
tsd_setspecific(arena_key, (Void_t *)ar_ptr);
|
||||
|
||||
@ -2899,7 +2962,7 @@ Void_t* mEMALIGn(alignment, bytes) size_t alignment; size_t bytes;
|
||||
*/
|
||||
|
||||
brk = (char*)mem2chunk(((unsigned long)(m + alignment - 1)) & -alignment);
|
||||
if ((long)(brk - (char*)(p)) < (long) MINSIZE) brk = brk + alignment;
|
||||
if ((long)(brk - (char*)(p)) < (long)MINSIZE) brk = brk + alignment;
|
||||
|
||||
newp = (mchunkptr)brk;
|
||||
leadsize = brk - (char*)(p);
|
||||
@ -3090,16 +3153,18 @@ int malloc_trim(pad) size_t pad;
|
||||
int res;
|
||||
|
||||
(void)mutex_lock(&main_arena.mutex);
|
||||
res = arena_trim(&main_arena, pad);
|
||||
res = main_trim(pad);
|
||||
(void)mutex_unlock(&main_arena.mutex);
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Trim the main arena. */
|
||||
|
||||
static int
|
||||
#if __STD_C
|
||||
arena_trim(arena *ar_ptr, size_t pad)
|
||||
main_trim(size_t pad)
|
||||
#else
|
||||
arena_trim(ar_ptr, pad) arena *ar_ptr; size_t pad;
|
||||
main_trim(pad) size_t pad;
|
||||
#endif
|
||||
{
|
||||
mchunkptr top_chunk; /* The current top chunk */
|
||||
@ -3110,44 +3175,89 @@ arena_trim(ar_ptr, pad) arena *ar_ptr; size_t pad;
|
||||
|
||||
unsigned long pagesz = malloc_getpagesize;
|
||||
|
||||
top_chunk = top(ar_ptr);
|
||||
top_chunk = top(&main_arena);
|
||||
top_size = chunksize(top_chunk);
|
||||
extra = ((top_size - pad - MINSIZE + (pagesz-1)) / pagesz - 1) * pagesz;
|
||||
|
||||
if (extra < (long)pagesz) /* Not enough memory to release */
|
||||
return 0;
|
||||
|
||||
#ifndef NO_THREADS
|
||||
if(ar_ptr == &main_arena) {
|
||||
#endif
|
||||
/* Test to make sure no one else called sbrk */
|
||||
current_brk = (char*)(MORECORE (0));
|
||||
if (current_brk != (char*)(top_chunk) + top_size)
|
||||
return 0; /* Apparently we don't own memory; must fail */
|
||||
|
||||
/* Test to make sure no one else called sbrk */
|
||||
new_brk = (char*)(MORECORE (-extra));
|
||||
|
||||
if (new_brk == (char*)(MORECORE_FAILURE)) { /* sbrk failed? */
|
||||
/* Try to figure out what we have */
|
||||
current_brk = (char*)(MORECORE (0));
|
||||
if (current_brk != (char*)(top_chunk) + top_size)
|
||||
return 0; /* Apparently we don't own memory; must fail */
|
||||
|
||||
new_brk = (char*)(MORECORE (-extra));
|
||||
|
||||
if (new_brk == (char*)(MORECORE_FAILURE)) { /* sbrk failed? */
|
||||
/* Try to figure out what we have */
|
||||
current_brk = (char*)(MORECORE (0));
|
||||
top_size = current_brk - (char*)top_chunk;
|
||||
if (top_size >= (long)MINSIZE) /* if not, we are very very dead! */
|
||||
{
|
||||
sbrked_mem = current_brk - sbrk_base;
|
||||
set_head(top_chunk, top_size | PREV_INUSE);
|
||||
}
|
||||
check_chunk(ar_ptr, top_chunk);
|
||||
return 0;
|
||||
top_size = current_brk - (char*)top_chunk;
|
||||
if (top_size >= (long)MINSIZE) /* if not, we are very very dead! */
|
||||
{
|
||||
sbrked_mem = current_brk - sbrk_base;
|
||||
set_head(top_chunk, top_size | PREV_INUSE);
|
||||
}
|
||||
sbrked_mem -= extra;
|
||||
check_chunk(&main_arena, top_chunk);
|
||||
return 0;
|
||||
}
|
||||
sbrked_mem -= extra;
|
||||
|
||||
/* Success. Adjust top accordingly. */
|
||||
set_head(top_chunk, (top_size - extra) | PREV_INUSE);
|
||||
check_chunk(&main_arena, top_chunk);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef NO_THREADS
|
||||
} else {
|
||||
if(grow_heap(heap_for_ptr(top_chunk), -extra) != 0)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
#if __STD_C
|
||||
heap_trim(heap_info *heap, size_t pad)
|
||||
#else
|
||||
heap_trim(heap, pad) heap_info *heap; size_t pad;
|
||||
#endif
|
||||
{
|
||||
unsigned long pagesz = malloc_getpagesize;
|
||||
arena *ar_ptr = heap->ar_ptr;
|
||||
mchunkptr top_chunk = top(ar_ptr), p, bck, fwd;
|
||||
heap_info *prev_heap;
|
||||
long new_size, top_size, extra;
|
||||
|
||||
/* Can this heap go away completely ? */
|
||||
while(top_chunk == chunk_at_offset(heap, sizeof(*heap))) {
|
||||
prev_heap = heap->prev;
|
||||
p = chunk_at_offset(prev_heap, prev_heap->size - (MINSIZE-2*SIZE_SZ));
|
||||
assert(p->size == (0|PREV_INUSE)); /* must be fencepost */
|
||||
p = prev_chunk(p);
|
||||
new_size = chunksize(p) + (MINSIZE-2*SIZE_SZ);
|
||||
assert(new_size>0 && new_size<(long)2*MINSIZE);
|
||||
if(!prev_inuse(p))
|
||||
new_size += p->prev_size;
|
||||
assert(new_size>0 && new_size<HEAP_MAX_SIZE);
|
||||
if(new_size + (HEAP_MAX_SIZE - prev_heap->size) < pad + MINSIZE + pagesz)
|
||||
break;
|
||||
ar_ptr->size -= heap->size;
|
||||
delete_heap(heap);
|
||||
heap = prev_heap;
|
||||
if(!prev_inuse(p)) { /* consolidate backward */
|
||||
p = prev_chunk(p);
|
||||
unlink(p, bck, fwd);
|
||||
}
|
||||
assert(((unsigned long)((char*)p + new_size) & (pagesz-1)) == 0);
|
||||
assert( ((char*)p + new_size) == ((char*)heap + heap->size) );
|
||||
top(ar_ptr) = top_chunk = p;
|
||||
set_head(top_chunk, new_size | PREV_INUSE);
|
||||
check_chunk(ar_ptr, top_chunk);
|
||||
}
|
||||
top_size = chunksize(top_chunk);
|
||||
extra = ((top_size - pad - MINSIZE + (pagesz-1))/pagesz - 1) * pagesz;
|
||||
if(extra < (long)pagesz)
|
||||
return 0;
|
||||
/* Try to shrink. */
|
||||
if(grow_heap(heap, -extra) != 0)
|
||||
return 0;
|
||||
ar_ptr->size -= extra;
|
||||
|
||||
/* Success. Adjust top accordingly. */
|
||||
set_head(top_chunk, (top_size - extra) | PREV_INUSE);
|
||||
@ -3155,6 +3265,8 @@ arena_trim(ar_ptr, pad) arena *ar_ptr; size_t pad;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@ -3194,11 +3306,15 @@ size_t malloc_usable_size(mem) Void_t* mem;
|
||||
|
||||
|
||||
|
||||
/* Utility to update current_mallinfo for malloc_stats and mallinfo() */
|
||||
/* Utility to update mallinfo for malloc_stats() and mallinfo() */
|
||||
|
||||
static void malloc_update_mallinfo __MALLOC_P ((void))
|
||||
static void
|
||||
#if __STD_C
|
||||
malloc_update_mallinfo(arena *ar_ptr, struct mallinfo *mi)
|
||||
#else
|
||||
malloc_update_mallinfo(ar_ptr, mi) arena *ar_ptr; struct mallinfo *mi;
|
||||
#endif
|
||||
{
|
||||
arena *ar_ptr = &main_arena;
|
||||
int i, navail;
|
||||
mbinptr b;
|
||||
mchunkptr p;
|
||||
@ -3219,7 +3335,7 @@ static void malloc_update_mallinfo __MALLOC_P ((void))
|
||||
#if MALLOC_DEBUG
|
||||
check_free_chunk(ar_ptr, p);
|
||||
for (q = next_chunk(p);
|
||||
q < top(ar_ptr) && inuse(q) && (long)chunksize(q) >= (long)MINSIZE;
|
||||
q != top(ar_ptr) && inuse(q) && (long)chunksize(q) > 0;
|
||||
q = next_chunk(q))
|
||||
check_inuse_chunk(ar_ptr, q);
|
||||
#endif
|
||||
@ -3228,62 +3344,132 @@ static void malloc_update_mallinfo __MALLOC_P ((void))
|
||||
}
|
||||
}
|
||||
|
||||
current_mallinfo.ordblks = navail;
|
||||
current_mallinfo.uordblks = sbrked_mem - avail;
|
||||
current_mallinfo.fordblks = avail;
|
||||
current_mallinfo.hblks = n_mmaps;
|
||||
current_mallinfo.hblkhd = mmapped_mem;
|
||||
current_mallinfo.keepcost = chunksize(top(ar_ptr));
|
||||
mi->arena = ar_ptr->size;
|
||||
mi->ordblks = navail;
|
||||
mi->uordblks = ar_ptr->size - avail;
|
||||
mi->fordblks = avail;
|
||||
mi->hblks = n_mmaps;
|
||||
mi->hblkhd = mmapped_mem;
|
||||
mi->keepcost = chunksize(top(ar_ptr));
|
||||
|
||||
(void)mutex_unlock(&ar_ptr->mutex);
|
||||
}
|
||||
|
||||
#if !defined(NO_THREADS) && MALLOC_DEBUG > 1
|
||||
|
||||
/* Print the complete contents of a single heap to stderr. */
|
||||
|
||||
static void
|
||||
#if __STD_C
|
||||
dump_heap(heap_info *heap)
|
||||
#else
|
||||
dump_heap(heap) heap_info *heap;
|
||||
#endif
|
||||
{
|
||||
char *ptr;
|
||||
mchunkptr p;
|
||||
|
||||
fprintf(stderr, "Heap %p, size %10lx:\n", heap, (long)heap->size);
|
||||
ptr = (heap->ar_ptr != (arena*)(heap+1)) ?
|
||||
(char*)(heap + 1) : (char*)(heap + 1) + sizeof(arena);
|
||||
p = (mchunkptr)(((unsigned long)ptr + MALLOC_ALIGN_MASK) &
|
||||
~MALLOC_ALIGN_MASK);
|
||||
for(;;) {
|
||||
fprintf(stderr, "chunk %p size %10lx", p, (long)p->size);
|
||||
if(p == top(heap->ar_ptr)) {
|
||||
fprintf(stderr, " (top)\n");
|
||||
break;
|
||||
} else if(p->size == (0|PREV_INUSE)) {
|
||||
fprintf(stderr, " (fence)\n");
|
||||
break;
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
p = next_chunk(p);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
malloc_stats:
|
||||
|
||||
Prints on stderr the amount of space obtain from the system (both
|
||||
via sbrk and mmap), the maximum amount (which may be more than
|
||||
current if malloc_trim and/or munmap got called), the maximum
|
||||
number of simultaneous mmap regions used, and the current number
|
||||
For all arenas seperately and in total, prints on stderr the
|
||||
amount of space obtained from the system, and the current number
|
||||
of bytes allocated via malloc (or realloc, etc) but not yet
|
||||
freed. (Note that this is the number of bytes allocated, not the
|
||||
number requested. It will be larger than the number requested
|
||||
because of alignment and bookkeeping overhead.)
|
||||
because of alignment and bookkeeping overhead.) When not compiled
|
||||
for multiple threads, the maximum amount of allocated memory
|
||||
(which may be more than current if malloc_trim and/or munmap got
|
||||
called) is also reported. When using mmap(), prints the maximum
|
||||
number of simultaneous mmap regions used, too.
|
||||
|
||||
*/
|
||||
|
||||
void malloc_stats()
|
||||
{
|
||||
malloc_update_mallinfo();
|
||||
fprintf(stderr, "max system bytes = %10u\n",
|
||||
(unsigned int)(max_total_mem));
|
||||
fprintf(stderr, "system bytes = %10u\n",
|
||||
(unsigned int)(sbrked_mem + mmapped_mem));
|
||||
fprintf(stderr, "in use bytes = %10u\n",
|
||||
(unsigned int)(current_mallinfo.uordblks + mmapped_mem));
|
||||
int i;
|
||||
arena *ar_ptr;
|
||||
struct mallinfo mi;
|
||||
unsigned int in_use_b = mmapped_mem, system_b = in_use_b;
|
||||
#if THREAD_STATS
|
||||
long stat_lock_direct = 0, stat_lock_loop = 0, stat_lock_wait = 0;
|
||||
#endif
|
||||
|
||||
for(i=0, ar_ptr = &main_arena; ar_ptr; ar_ptr = ar_ptr->next, i++) {
|
||||
malloc_update_mallinfo(ar_ptr, &mi);
|
||||
fprintf(stderr, "Arena %d:\n", i);
|
||||
fprintf(stderr, "system bytes = %10u\n", (unsigned int)mi.arena);
|
||||
fprintf(stderr, "in use bytes = %10u\n", (unsigned int)mi.uordblks);
|
||||
system_b += mi.arena;
|
||||
in_use_b += mi.uordblks;
|
||||
#if THREAD_STATS
|
||||
stat_lock_direct += ar_ptr->stat_lock_direct;
|
||||
stat_lock_loop += ar_ptr->stat_lock_loop;
|
||||
stat_lock_wait += ar_ptr->stat_lock_wait;
|
||||
#endif
|
||||
#if !defined(NO_THREADS) && MALLOC_DEBUG > 1
|
||||
if(ar_ptr != &main_arena) {
|
||||
heap_info *heap = heap_for_ptr(top(ar_ptr));
|
||||
while(heap) { dump_heap(heap); heap = heap->prev; }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
fprintf(stderr, "Total (incl. mmap):\n");
|
||||
fprintf(stderr, "system bytes = %10u\n", system_b);
|
||||
fprintf(stderr, "in use bytes = %10u\n", in_use_b);
|
||||
#ifdef NO_THREADS
|
||||
fprintf(stderr, "max system bytes = %10u\n", (unsigned int)max_total_mem);
|
||||
#endif
|
||||
#if HAVE_MMAP
|
||||
fprintf(stderr, "max mmap regions = %10u\n",
|
||||
(unsigned int)max_n_mmaps);
|
||||
fprintf(stderr, "max mmap regions = %10u\n", (unsigned int)max_n_mmaps);
|
||||
#endif
|
||||
#if THREAD_STATS
|
||||
fprintf(stderr, "arenas created = %10d\n", stat_n_arenas);
|
||||
fprintf(stderr, "heaps created = %10d\n", stat_n_heaps);
|
||||
fprintf(stderr, "heaps created = %10d\n", stat_n_heaps);
|
||||
fprintf(stderr, "locked directly = %10ld\n", stat_lock_direct);
|
||||
fprintf(stderr, "locked in loop = %10ld\n", stat_lock_loop);
|
||||
fprintf(stderr, "locked waiting = %10ld\n", stat_lock_wait);
|
||||
fprintf(stderr, "locked total = %10ld\n",
|
||||
stat_lock_direct + stat_lock_loop + stat_lock_wait);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
mallinfo returns a copy of updated current mallinfo.
|
||||
The information reported is for the arena last used by the thread.
|
||||
*/
|
||||
|
||||
struct mallinfo mALLINFo()
|
||||
{
|
||||
malloc_update_mallinfo();
|
||||
return current_mallinfo;
|
||||
struct mallinfo mi;
|
||||
Void_t *vptr = NULL;
|
||||
|
||||
tsd_getspecific(arena_key, vptr);
|
||||
malloc_update_mallinfo((vptr ? (arena*)vptr : &main_arena), &mi);
|
||||
return mi;
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _MALLOC_H
|
||||
#define _MALLOC_H 1
|
||||
#define _MALLOC_H 1
|
||||
|
||||
/*
|
||||
`ptmalloc', a malloc implementation for multiple threads without
|
||||
@ -50,9 +50,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Used by libc internals. */
|
||||
#define __malloc_size_t size_t
|
||||
#define __malloc_ptrdiff_t ptrdiff_t
|
||||
/* Used by GNU libc internals. */
|
||||
#define __malloc_size_t size_t
|
||||
#define __malloc_ptrdiff_t ptrdiff_t
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) || defined (__cplusplus) || defined (__GNUC__)
|
||||
@ -166,4 +166,4 @@ extern void malloc_stats __MALLOC_P ((void));
|
||||
}; /* end of extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* !defined(_PTMALLOC_H_) */
|
||||
#endif /* !defined(_MALLOC_H) */
|
||||
|
@ -19,8 +19,8 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* One out of _LIBC, USE_PTHREADS, USE_THR * or USE_SPROC should be
|
||||
defined, otherwise the token NO_THREADS * and dummy implementations
|
||||
/* One out of _LIBC, USE_PTHREADS, USE_THR, or USE_SPROC should be
|
||||
defined, otherwise the token NO_THREADS and dummy implementations
|
||||
of the macros will be defined. */
|
||||
|
||||
#ifndef _THREAD_M_H
|
||||
@ -43,14 +43,11 @@ typedef pthread_key_t tsd_key_t;
|
||||
#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
|
||||
|
||||
#define tsd_key_create(key, destr) \
|
||||
if (__pthread_key_create != NULL) { \
|
||||
__pthread_key_create(key, destr); } else { *(key) = (tsd_key_t) 0; }
|
||||
if (__pthread_key_create != NULL) { __pthread_key_create(key, destr); }
|
||||
#define tsd_setspecific(key, data) \
|
||||
if (__pthread_setspecific != NULL) { \
|
||||
__pthread_setspecific(key, data); } else { (key) = (tsd_key_t) data; }
|
||||
if (__pthread_setspecific != NULL) { __pthread_setspecific(key, data); }
|
||||
#define tsd_getspecific(key, vptr) \
|
||||
(vptr = (__pthread_getspecific != NULL ? \
|
||||
__pthread_getspecific(key) : (tsd_key_t *) (key)))
|
||||
(vptr = (__pthread_getspecific != NULL ? __pthread_getspecific(key) : NULL))
|
||||
|
||||
#define mutex_init(m) \
|
||||
(__pthread_mutex_init != NULL ? __pthread_mutex_init (m, NULL) : 0)
|
||||
@ -167,9 +164,9 @@ typedef int mutex_t;
|
||||
#define mutex_unlock(m) (0)
|
||||
|
||||
typedef void *tsd_key_t;
|
||||
#define tsd_key_create(key, destr) (*(key) = NULL)
|
||||
#define tsd_setspecific(key, data) ((key) = data)
|
||||
#define tsd_getspecific(key, vptr) (vptr = (key))
|
||||
#define tsd_key_create(key, destr) do {} while(0)
|
||||
#define tsd_setspecific(key, data) do {} while(0)
|
||||
#define tsd_getspecific(key, vptr) (vptr = NULL)
|
||||
|
||||
#endif /* defined(NO_THREADS) */
|
||||
|
||||
|
@ -988,7 +988,7 @@ __guess_grouping (unsigned int intdig_max, const char *grouping,
|
||||
else if (*grouping == 0)
|
||||
{
|
||||
/* Same grouping repeats. */
|
||||
groups += intdig_max / grouping[-1];
|
||||
groups += (intdig_max - 1) / grouping[-1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,27 @@
|
||||
/* Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
|
||||
/* 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.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_IPC_BUF_H
|
||||
#define _SYS_IPC_BUF_H
|
||||
|
||||
#define _SYS_IPC_BUF_H 1
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Mode bits for `msgget', `semget', and `shmget'. */
|
||||
@ -52,4 +53,4 @@ struct ipc_perm
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/ipc_buf.h */
|
||||
#endif /* _SYS_IPC_BUF_H */
|
||||
|
@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_PERM_H
|
||||
|
||||
@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Set port input/output permissions. */
|
||||
extern int ioperm __P ((unsigned long __from, unsigned long __num,
|
||||
extern int ioperm __P ((unsigned long int __from, unsigned long int __num,
|
||||
int __turn_on));
|
||||
|
||||
|
||||
@ -33,4 +33,4 @@ extern int iopl __P ((int __level));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/perm.h */
|
||||
#endif /* _SYS_PERM_H */
|
||||
|
@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_VM86_H
|
||||
|
||||
@ -31,4 +31,4 @@ extern int vm86 __P ((struct vm86_struct *__info));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/vm86.h */
|
||||
#endif /* _SYS_VM86_H */
|
||||
|
@ -1,26 +1,27 @@
|
||||
/* Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
|
||||
/* 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.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_IPC_BUF_H
|
||||
#define _SYS_IPC_BUF_H
|
||||
|
||||
#define _SYS_IPC_BUF_H 1
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Mode bits for `msgget', `semget', and `shmget'. */
|
||||
@ -81,4 +82,4 @@ extern int __ipc __P ((int __call, int __first, int __second, int __third,
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/ipc_buf.h */
|
||||
#endif /* _SYS_IPC_BUF_H */
|
||||
|
@ -1,9 +1,33 @@
|
||||
/* Copyright (C) 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
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
/* Interfaces to control the various kernel daemons. */
|
||||
|
||||
#ifndef _SYS_KDAEMON_H
|
||||
#define _SYS_KDAEMON_H
|
||||
|
||||
#define _SYS_KDAEMON_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Start, flush, or tune the kernel's buffer flushing daemon. */
|
||||
extern int bdflush (int func, long data);
|
||||
extern int bdflush __P ((int __func, long int __data));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_KDAEMON_H */
|
||||
|
@ -21,10 +21,14 @@
|
||||
#define _SYS_KLOG_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Control the kernel's logging facility. This corresponds exactly to
|
||||
the kernel's syslog system call, but that name is easily confused
|
||||
with the user-level syslog facility, which is something completely
|
||||
different. */
|
||||
extern int klogctl __P ((int __type, char *__bufp, int __len));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SYS_KLOG_H */
|
||||
|
@ -100,4 +100,4 @@ extern __caddr_t mremap __P ((__caddr_t __addr, size_t __old_len,
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif /* sys/mman.h */
|
||||
#endif /* _SYS_MMAN_H */
|
||||
|
@ -1,3 +1,21 @@
|
||||
/* Copyright (C) 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
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_MODULE_H
|
||||
|
||||
#define _SYS_MODULE_H 1
|
||||
@ -8,17 +26,19 @@
|
||||
|
||||
#include <linux/module.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Return number of kernel symbols if TABLE == NULL, otherwise, return
|
||||
kernel symbols in TABLE. TABLE must be large enough to hold all
|
||||
kernel symbols. */
|
||||
extern int get_kernel_syms __P ((struct kernel_sym * table));
|
||||
extern int get_kernel_syms __P ((struct kernel_sym *__table));
|
||||
|
||||
/* Create a new module of name MODULE_NAME and of size SIZE bytes.
|
||||
The return address is the starting address of the new module or -1L
|
||||
if the module cannot be created (the return value needs to be cast
|
||||
to (long) to detect the error condition). */
|
||||
extern unsigned long create_module __P ((__const char * module_name,
|
||||
size_t size));
|
||||
extern unsigned long int create_module __P ((__const char *__module_name,
|
||||
size_t __size));
|
||||
|
||||
/* Initialize the module called MODULE_NAME with the CONTENTSSIZE
|
||||
bytes starting at address CONTENTS. CONTENTS normally contains the
|
||||
@ -28,12 +48,14 @@ extern unsigned long create_module __P ((__const char * module_name,
|
||||
ROUTINES.cleanup is executed. SYMTAB is NULL if the module does
|
||||
not want to export symbols by itself, or a pointer to a symbol
|
||||
table if the module wants to register its own symbols. */
|
||||
extern int init_module __P ((__const char * module_name,
|
||||
__const void * contents, size_t contentssize,
|
||||
struct mod_routines * routines,
|
||||
struct symbol_table * symtab));
|
||||
extern int init_module __P ((__const char *__module_name,
|
||||
__const void *__contents, size_t __contentssize,
|
||||
struct mod_routines *__routines,
|
||||
struct symbol_table *__symtab));
|
||||
|
||||
/* Delete the module named MODULE_NAME from the kernel. */
|
||||
extern int delete_module __P ((__const char *module_name));
|
||||
extern int delete_module __P ((__const char *__module_name));
|
||||
|
||||
#endif /* _SYS_MODULE_H */
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/module.h */
|
||||
|
@ -1,38 +1,36 @@
|
||||
/* Header file for mounting/unmount Linux filesystems.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 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
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_MOUNT_H
|
||||
#define _SYS_MOUNT_H
|
||||
|
||||
#define _SYS_MOUNT_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Mount a filesystem. */
|
||||
extern int mount __P ((__const char *__special_file,
|
||||
__const char *__dir,
|
||||
__const char *__fstype,
|
||||
unsigned long int __rwflag,
|
||||
__const void *__data));
|
||||
extern int mount __P ((__const char *__special_file, __const char *__dir,
|
||||
__const char *__fstype, unsigned long int __rwflag,
|
||||
__const void *__data));
|
||||
|
||||
/* Unmount a filesystem. */
|
||||
extern int umount __P ((__const char *__special_file));
|
||||
extern int umount __P ((__const char *__special_file));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@ -1,26 +1,27 @@
|
||||
/* Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
|
||||
/* 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.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_MSQ_BUF_H
|
||||
#define _SYS_MSQ_BUF_H
|
||||
|
||||
#define _SYS_MSQ_BUF_H 1
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Define options for message queue functions. */
|
||||
@ -58,19 +59,20 @@ struct msqid_ds
|
||||
#define MSG_INFO 12
|
||||
|
||||
/* buffer for msgctl calls IPC_INFO, MSG_INFO */
|
||||
struct msginfo {
|
||||
int msgpool;
|
||||
int msgmap;
|
||||
int msgmax;
|
||||
int msgmnb;
|
||||
int msgmni;
|
||||
int msgssz;
|
||||
int msgtql;
|
||||
ushort msgseg;
|
||||
struct msginfo
|
||||
{
|
||||
int msgpool;
|
||||
int msgmap;
|
||||
int msgmax;
|
||||
int msgmnb;
|
||||
int msgmni;
|
||||
int msgssz;
|
||||
int msgtql;
|
||||
ushort msgseg;
|
||||
};
|
||||
|
||||
#endif /* __USE_MISC */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/msq_buf.h */
|
||||
#endif /* _SYS_MSQ_BUF_H */
|
||||
|
@ -1,23 +1,24 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_PARAM_H
|
||||
#define _SYS_PARAM_H
|
||||
|
||||
#define _SYS_PARAM_H 1
|
||||
|
||||
#include <limits.h>
|
||||
#include <linux/limits.h>
|
||||
|
@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_PROCFS_H
|
||||
|
||||
@ -31,6 +31,8 @@ Boston, MA 02111-1307, USA. */
|
||||
#include <asm/user.h>
|
||||
#include <asm/elf.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
struct elf_siginfo
|
||||
{
|
||||
int si_signo; /* signal number */
|
||||
@ -102,5 +104,6 @@ struct elf_prpsinfo
|
||||
typedef struct elf_prstatus prstatus_t;
|
||||
typedef struct elf_prpsinfo prpsinfo_t;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/procfs.h */
|
||||
|
@ -18,8 +18,8 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _SYS_PTRACE_H
|
||||
#define _SYS_PTRACE_H
|
||||
|
||||
#define _SYS_PTRACE_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
@ -91,8 +91,8 @@ enum __ptrace_request
|
||||
appear (those that are used for the particular request) as:
|
||||
pid_t PID, void *ADDR, int DATA, void *ADDR2
|
||||
after REQUEST. */
|
||||
extern int ptrace __P ((enum __ptrace_request __request __DOTS));
|
||||
extern int ptrace __P ((enum __ptrace_request __request, ...));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/ptrace.h */
|
||||
#endif /* _SYS_PTRACE_H */
|
||||
|
@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
/* This file should define RB_* macros to be used as flag
|
||||
bits in the argument to the `reboot' system call. */
|
||||
@ -40,4 +40,4 @@ Boston, MA 02111-1307, USA. */
|
||||
/* Reboot or halt the system. */
|
||||
extern int reboot __P ((int __howto));
|
||||
|
||||
#endif /* sys/reboot.h */
|
||||
#endif /* _SYS_REBOOT_H */
|
||||
|
@ -1,26 +1,27 @@
|
||||
/* Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
|
||||
/* 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.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_SEM_BUF_H
|
||||
#define _SYS_SEM_BUF_H
|
||||
|
||||
#define _SYS_SEM_BUF_H 1
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Flags for `semop'. */
|
||||
@ -66,21 +67,22 @@ union semun
|
||||
#define SEM_STAT 18
|
||||
#define SEM_INFO 19
|
||||
|
||||
struct seminfo {
|
||||
int semmap;
|
||||
int semmni;
|
||||
int semmns;
|
||||
int semmnu;
|
||||
int semmsl;
|
||||
int semopm;
|
||||
int semume;
|
||||
int semusz;
|
||||
int semvmx;
|
||||
int semaem;
|
||||
struct seminfo
|
||||
{
|
||||
int semmap;
|
||||
int semmni;
|
||||
int semmns;
|
||||
int semmnu;
|
||||
int semmsl;
|
||||
int semopm;
|
||||
int semume;
|
||||
int semusz;
|
||||
int semvmx;
|
||||
int semaem;
|
||||
};
|
||||
|
||||
#endif /* __USE_MISC */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sem_buf.h */
|
||||
#endif /* _SYS_SEM_BUF_H */
|
||||
|
@ -1,26 +1,27 @@
|
||||
/* 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.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_SHM_BUF_H
|
||||
#define _SYS_SHM_BUF_H
|
||||
|
||||
#define _SYS_SHM_BUF_H 1
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Permission flag for shmget. */
|
||||
@ -65,25 +66,27 @@ struct shmid_ds
|
||||
#define SHM_DEST 01000 /* segment will be destroyed on last detach */
|
||||
#define SHM_LOCKED 02000 /* segment will not be swapped */
|
||||
|
||||
struct shminfo {
|
||||
int shmmax;
|
||||
int shmmin;
|
||||
int shmmni;
|
||||
int shmseg;
|
||||
int shmall;
|
||||
struct shminfo
|
||||
{
|
||||
int shmmax;
|
||||
int shmmin;
|
||||
int shmmni;
|
||||
int shmseg;
|
||||
int shmall;
|
||||
};
|
||||
|
||||
struct shm_info {
|
||||
int used_ids;
|
||||
ulong shm_tot; /* total allocated shm */
|
||||
ulong shm_rss; /* total resident shm */
|
||||
ulong shm_swp; /* total swapped shm */
|
||||
ulong swap_attempts;
|
||||
ulong swap_successes;
|
||||
struct shm_info
|
||||
{
|
||||
int used_ids;
|
||||
ulong shm_tot; /* total allocated shm */
|
||||
ulong shm_rss; /* total resident shm */
|
||||
ulong shm_swp; /* total swapped shm */
|
||||
ulong swap_attempts;
|
||||
ulong swap_successes;
|
||||
};
|
||||
|
||||
#endif /* __USE_MISC */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/shm_buf.h */
|
||||
#endif /* _SYS_SHM_BUF_H */
|
||||
|
@ -1,23 +1,25 @@
|
||||
/* ID for functions called via socketcall system call.
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 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
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_SOCKETCALL_H
|
||||
#define _SYS_SOCKETCALL_H
|
||||
|
||||
#define _SYS_SOCKETCALL_H 1
|
||||
|
||||
/* Define unique numbers for the operations permitted on socket. Linux
|
||||
uses a single system call for all these functions. The relevant code
|
||||
@ -43,4 +45,4 @@ Boston, MA 02111-1307, USA. */
|
||||
#define SOCKOP_sendmsg 16
|
||||
#define SOCKOP_recvmsg 17
|
||||
|
||||
#endif
|
||||
#endif /* _SYS_SOCKETCALL_H */
|
||||
|
@ -1,30 +1,31 @@
|
||||
/* Calls to enable and disable swapping on specified locations. Linux version.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 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
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef __SYS_SWAP_H
|
||||
#ifndef _SYS_SWAP_H
|
||||
|
||||
#define __SYS_SWAP_H 1
|
||||
#define _SYS_SWAP_H 1
|
||||
#include <features.h>
|
||||
|
||||
/* Get constants from kernel headers. */
|
||||
#include <linux/swap.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Make the block special device PATH available to the system for swapping.
|
||||
This call is restricted to the super-user. */
|
||||
@ -33,5 +34,6 @@ extern int swapon __P ((__const char *__path, int __flags));
|
||||
/* Stop using block special device PATH for swapping. */
|
||||
extern int swapoff __P ((__const char *__path));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/swap.h */
|
||||
#endif /* _SYS_SWAP_H */
|
||||
|
@ -1,24 +1,24 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_SYSCTL_H
|
||||
#define _SYS_SYSCTL_H 1
|
||||
|
||||
#define _SYS_SYSCTL_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
@ -33,4 +33,4 @@ extern int sysctl __P ((int *__name, int __nlen, void *__oldval,
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sysctl.h */
|
||||
#endif /* _SYS_SYSCTL_H */
|
||||
|
@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_SYSINFO_H
|
||||
|
||||
@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */
|
||||
/* Get sysinfo structure from kernel header. */
|
||||
#include <linux/kernel.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Returns information on overall system statistics. */
|
||||
extern int sysinfo __P ((struct sysinfo *__info));
|
||||
|
||||
@ -45,4 +47,6 @@ extern int get_phys_pages __P ((void));
|
||||
extern int __get_avphys_pages __P ((void));
|
||||
extern int get_avphys_pages __P ((void));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sysinfo.h */
|
||||
|
@ -1,23 +1,24 @@
|
||||
/* Definitions of macros to access `dev_t' values.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 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
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_SYSMACROS_H
|
||||
|
||||
#define _SYS_SYSMACROS_H 1
|
||||
|
||||
/* Get definition from kernel header. */
|
||||
@ -28,4 +29,4 @@ Boston, MA 02111-1307, USA. */
|
||||
#define minor(dev) MINOR ((unsigned int) (dev))
|
||||
#define makedev(major, minor) MKDEV (major, minor)
|
||||
|
||||
#endif /* sys/sysmacros.h */
|
||||
#endif /* _SYS_SYSMACROS_H */
|
||||
|
@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_TIMEX_H
|
||||
|
||||
|
@ -1,26 +1,27 @@
|
||||
/* Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
|
||||
/* 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.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_SEM_H
|
||||
#define _SYS_SEM_H
|
||||
|
||||
#define _SYS_SEM_H 1
|
||||
#include <features.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Get common definition of System V style IPC. */
|
||||
@ -56,4 +57,4 @@ extern int semop __P ((int __semid, struct sembuf *__sops,
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/sem.h */
|
||||
#endif /* _SYS_SEM_H */
|
||||
|
@ -1,26 +1,27 @@
|
||||
/* Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
|
||||
/* 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.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#ifndef _SYS_SHM_H
|
||||
#define _SYS_SHM_H
|
||||
|
||||
#define _SYS_SHM_H 1
|
||||
#include <features.h>
|
||||
|
||||
#include <unistd.h> /* for `getpagesize' declaration */
|
||||
#include <sys/types.h>
|
||||
|
||||
@ -53,4 +54,4 @@ extern int shmdt __P ((char *__shmaddr));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* sys/shm.h */
|
||||
#endif /* _SYS_SHM_H */
|
||||
|
@ -45,6 +45,9 @@
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
#if HAVE_TZNAME
|
||||
extern char *tzname[];
|
||||
#endif
|
||||
|
||||
/* Do multibyte processing if multibytes are supported, unless
|
||||
multibyte sequences are safe in formats. Multibyte sequences are
|
||||
|
@ -1,22 +1,22 @@
|
||||
/* strptime - Convert a string representation of time to a time value.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
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. */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <langinfo.h>
|
||||
|
Loading…
Reference in New Issue
Block a user