1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
1998-06-09  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/netinet/ip.h (struct ip_options): Define
	__data member only for gcc.  Reported by ak@muc.de.

	* misc/mntent.h: Undo last patch.
	* sysdeps/unix/sysv/linux/fstatvfs.c (fstatvfs): Undo last patch.
	* misc/tst/mntent.c: Adjust code for this change.

	* io/fts.c: Updated from a slightly more recent BSD version.
	* io/fts.h: Likewise.

	* libc.map: Add __libc_stack_end.

	* db2/Makefile (routines): Add lock_region.
	* db2/config.h: Update from db-2.4.14.
	* db2/db.h: Likewise.
	* db2/db_185.h: Likewise.
	* db2/db_int.h: Likewise.
	* db2/bt_close.c: Likewise.
	* db2/bt_compare.c: Likewise.
	* db2/bt_conv.c: Likewise.
	* db2/bt_cursor.c: Likewise.
	* db2/bt_delete.c: Likewise.
	* db2/bt_open.c: Likewise.
	* db2/bt_page.c: Likewise.
	* db2/bt_put.c: Likewise.
	* db2/bt_rec.c: Likewise.
	* db2/bt_recno.c: Likewise.
	* db2/bt_rsearch.c: Likewise.
	* db2/bt_search.c: Likewise.
	* db2/bt_split.c: Likewise.
	* db2/bt_stat.c: Likewise.
	* db2/btree.src: Likewise.
	* db2/btree_auto.c: Likewise.
	* db2/getlong.c: Likewise.
	* db2/db_appinit.c: Likewise.
	* db2/db_apprec.c: Likewise.
	* db2/db_byteorder.c: Likewise.
	* db2/db_err.c: Likewise.
	* db2/db_log2.c: Likewise.
	* db2/db_region.c: Likewise.
	* db2/db_salloc.c: Likewise.
	* db2/db_shash.c: Likewise.
	* db2/db.c: Likewise.
	* db2/db.src: Likewise.
	* db2/db_auto.c: Likewise.
	* db2/db_conv.c: Likewise.
	* db2/db_dispatch.c: Likewise.
	* db2/db_dup.c: Likewise.
	* db2/db_overflow.c: Likewise.
	* db2/db_pr.c: Likewise.
	* db2/db_rec.c: Likewise.
	* db2/db_ret.c: Likewise.
	* db2/db_thread.c: Likewise.
	* db2/db185.c: Likewise.
	* db2/db185_int.h: Likewise.
	* db2/dbm.c: Likewise.
	* db2/hash.c: Likewise.
	* db2/hash.src: Likewise.
	* db2/hash_auto.c: Likewise.
	* db2/hash_conv.c: Likewise.
	* db2/hash_debug.c: Likewise.
	* db2/hash_dup.c: Likewise.
	* db2/hash_func.c: Likewise.
	* db2/hash_page.c: Likewise.
	* db2/hash_rec.c: Likewise.
	* db2/hash_stat.c: Likewise.
	* db2/btree.h: Likewise.
	* db2/btree_ext.h: Likewise.
	* db2/clib_ext.h: Likewise.
	* db2/common_ext.h: Likewise.
	* db2/cxx_int.h: Likewise.
	* db2/db.h.src: Likewise.
	* db2/db_185.h.src: Likewise.
	* db2/db_am.h: Likewise.
	* db2/db_auto.h: Likewise.
	* db2/db_cxx.h: Likewise.
	* db2/db_dispatch.h: Likewise.
	* db2/db_ext.h: Likewise.
	* db2/db_int.h.src: Likewise.
	* db2/db_page.h: Likewise.
	* db2/db_shash.h: Likewise.
	* db2/db_swap.h: Likewise.
	* db2/hash.h: Likewise.
	* db2/hash_ext.h: Likewise.
	* db2/lock.h: Likewise.
	* db2/lock_ext.h: Likewise.
	* db2/log.h: Likewise.
	* db2/log_ext.h: Likewise.
	* db2/mp.h: Likewise.
	* db2/mp_ext.h: Likewise.
	* db2/mutex_ext.h: Likewise.
	* db2/os_ext.h: Likewise.
	* db2/os_func.h: Likewise.
	* db2/queue.h: Likewise.
	* db2/shqueue.h: Likewise.
	* db2/txn.h: Likewise.
	* db2/lock.c: Likewise.
	* db2/lock_conflict.c: Likewise.
	* db2/lock_deadlock.c: Likewise.
	* db2/lock_region.c: Likewise.
	* db2/lock_util.c: Likewise.
	* db2/log.c: Likewise.
	* db2/log.src: Likewise.
	* db2/log_archive.c: Likewise.
	* db2/log_auto.c: Likewise.
	* db2/log_compare.c: Likewise.
	* db2/log_findckp.c: Likewise.
	* db2/log_get.c: Likewise.
	* db2/log_put.c: Likewise.
	* db2/log_rec.c: Likewise.
	* db2/log_register.c: Likewise.
	* db2/mp_bh.c: Likewise.
	* db2/mp_fget.c: Likewise.
	* db2/mp_fopen.c: Likewise.
	* db2/mp_fput.c: Likewise.
	* db2/mp_fset.c: Likewise.
	* db2/mp_open.c: Likewise.
	* db2/mp_pr.c: Likewise.
	* db2/mp_region.c: Likewise.
	* db2/mp_sync.c: Likewise.
	* db2/68020.gcc: Likewise.
	* db2/mutex.c: Likewise.
	* db2/parisc.gcc: Likewise.
	* db2/parisc.hp: Likewise.
	* db2/sco.cc: Likewise.
	* db2/os_abs.c: Likewise.
	* db2/os_alloc.c: Likewise.
	* db2/os_config.c: Likewise.
	* db2/os_dir.c: Likewise.
	* db2/os_fid.c: Likewise.
	* db2/os_fsync.c: Likewise.
	* db2/os_map.c: Likewise.
	* db2/os_oflags.c: Likewise.
	* db2/os_open.c: Likewise.
	* db2/os_rpath.c: Likewise.
	* db2/os_rw.c: Likewise.
	* db2/os_seek.c: Likewise.
	* db2/os_sleep.c: Likewise.
	* db2/os_spin.c: Likewise.
	* db2/os_stat.c: Likewise.
	* db2/os_unlink.c: Likewise.
	* db2/db_archive.c: Likewise.
	* db2/db_checkpoint.c: Likewise.
	* db2/db_deadlock.c: Likewise.
	* db2/db_dump.c: Likewise.
	* db2/db_dump185.c: Likewise.
	* db2/db_load.c: Likewise.
	* db2/db_printlog.c: Likewise.
	* db2/db_recover.c: Likewise.
	* db2/db_stat.c: Likewise.
	* db2/txn.c: Likewise.
	* db2/txn.src: Likewise.
	* db2/txn_auto.c: Likewise.
	* db2/txn_rec.c: Likewise.

	* elf/rtld.c: Move definition of __libc_stack_end to ...
	* sysdeps/generic/dl-sysdep.h: ...here.

	* sysdeps/unix/sysv/linux/fstatvfs.c: Handle nodiratime option.
	* sysdeps/unix/sysv/linux/bits/statvfs.h: Define ST_NODIRATIME.
	* sysdeps/unix/sysv/linux/sys/mount.h: Define MS_NODIRATIME.

1998-06-08 21:44  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/fstatvfs.c: Handle constant option string
	from mntent correctly.

1998-06-06  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* sunrpc/Makefile (generated): Correct typo.

1998-06-04  Philip Blundell  <philb@gnu.org>

	* elf/elf.h (EM_ARM, et al.): New definitions.
	* sysdeps/arm/dl-machine.h: Update for new draft ARM ELF ABI.
This commit is contained in:
Ulrich Drepper
1998-06-09 15:16:55 +00:00
parent 7646e67e6c
commit bf7997b65c
161 changed files with 6930 additions and 4720 deletions

View File

@ -1,23 +1,21 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996, 1997
* Copyright (c) 1996, 1997, 1998
* Sleepycat Software. All rights reserved.
*/
#include "config.h"
#ifndef lint
static const char sccsid[] = "@(#)db_appinit.c 10.38 (Sleepycat) 1/7/98";
static const char sccsid[] = "@(#)db_appinit.c 10.52 (Sleepycat) 6/2/98";
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
@ -34,14 +32,14 @@ static const char sccsid[] = "@(#)db_appinit.c 10.38 (Sleepycat) 1/7/98";
#include "clib_ext.h"
#include "common_ext.h"
static int __db_home __P((DB_ENV *, const char *, int));
static int __db_home __P((DB_ENV *, const char *, u_int32_t));
static int __db_parse __P((DB_ENV *, char *));
static int __db_tmp_dir __P((DB_ENV *, int));
static int __db_tmp_open __P((DB_ENV *, char *, int *));
static int __db_tmp_dir __P((DB_ENV *, u_int32_t));
static int __db_tmp_open __P((DB_ENV *, u_int32_t, char *, int *));
/*
* db_version --
* Return verision information.
* Return version information.
*/
char *
db_version(majverp, minverp, patchp)
@ -65,16 +63,18 @@ db_appinit(db_home, db_config, dbenv, flags)
const char *db_home;
char * const *db_config;
DB_ENV *dbenv;
int flags;
u_int32_t flags;
{
FILE *fp;
int ret;
int mode, ret;
char * const *p;
char *lp, buf[MAXPATHLEN * 2];
/* Validate arguments. */
if (dbenv == NULL)
return (EINVAL);
#ifdef HAVE_SPINLOCKS
#define OKFLAGS \
(DB_CREATE | DB_NOMMAP | DB_THREAD | DB_INIT_LOCK | DB_INIT_LOG | \
@ -89,10 +89,9 @@ db_appinit(db_home, db_config, dbenv, flags)
if ((ret = __db_fchk(dbenv, "db_appinit", flags, OKFLAGS)) != 0)
return (ret);
#define RECOVERY_FLAGS (DB_CREATE | DB_INIT_TXN | DB_INIT_LOG)
if (LF_ISSET(DB_RECOVER | DB_RECOVER_FATAL) &&
LF_ISSET(RECOVERY_FLAGS) != RECOVERY_FLAGS)
return (__db_ferr(dbenv, "db_appinit", 1));
/* Transactions imply logging. */
if (LF_ISSET(DB_INIT_TXN))
LF_SET(DB_INIT_LOG);
/* Convert the db_appinit(3) flags. */
if (LF_ISSET(DB_THREAD))
@ -147,47 +146,48 @@ db_appinit(db_home, db_config, dbenv, flags)
F_SET(dbenv, DB_ENV_APPINIT);
/*
* If we are doing recovery, remove all the regions.
* If we are doing recovery, remove all the old shared memory
* regions.
*/
if (LF_ISSET(DB_RECOVER | DB_RECOVER_FATAL)) {
/* Remove all the old shared memory regions. */
if ((ret = log_unlink(NULL, 1 /* force */, dbenv)) != 0)
if ((ret = log_unlink(NULL, 1, dbenv)) != 0)
goto err;
if ((ret = memp_unlink(NULL, 1 /* force */, dbenv)) != 0)
if ((ret = memp_unlink(NULL, 1, dbenv)) != 0)
goto err;
if ((ret = lock_unlink(NULL, 1 /* force */, dbenv)) != 0)
if ((ret = lock_unlink(NULL, 1, dbenv)) != 0)
goto err;
if ((ret = txn_unlink(NULL, 1 /* force */, dbenv)) != 0)
if ((ret = txn_unlink(NULL, 1, dbenv)) != 0)
goto err;
}
/* Transactions imply logging. */
if (LF_ISSET(DB_INIT_TXN))
LF_SET(DB_INIT_LOG);
/* Default permissions are 0660. */
#undef DB_DEFPERM
#define DB_DEFPERM (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)
/* Initialize the subsystems. */
/*
* Create the new shared regions.
*
* Default permissions are read-write for both owner and group.
*/
mode = __db_omode("rwrw--");
if (LF_ISSET(DB_INIT_LOCK) && (ret = lock_open(NULL,
LF_ISSET(DB_CREATE | DB_THREAD),
DB_DEFPERM, dbenv, &dbenv->lk_info)) != 0)
mode, dbenv, &dbenv->lk_info)) != 0)
goto err;
if (LF_ISSET(DB_INIT_LOG) && (ret = log_open(NULL,
LF_ISSET(DB_CREATE | DB_THREAD),
DB_DEFPERM, dbenv, &dbenv->lg_info)) != 0)
mode, dbenv, &dbenv->lg_info)) != 0)
goto err;
if (LF_ISSET(DB_INIT_MPOOL) && (ret = memp_open(NULL,
LF_ISSET(DB_CREATE | DB_MPOOL_PRIVATE | DB_NOMMAP | DB_THREAD),
DB_DEFPERM, dbenv, &dbenv->mp_info)) != 0)
mode, dbenv, &dbenv->mp_info)) != 0)
goto err;
if (LF_ISSET(DB_INIT_TXN) && (ret = txn_open(NULL,
LF_ISSET(DB_CREATE | DB_THREAD | DB_TXN_NOSYNC),
DB_DEFPERM, dbenv, &dbenv->tx_info)) != 0)
mode, dbenv, &dbenv->tx_info)) != 0)
goto err;
/* Initialize recovery. */
/*
* If the application is running with transactions, initialize the
* function tables. Once that's done, do recovery for any previous
* run.
*/
if (LF_ISSET(DB_INIT_TXN)) {
if ((ret = __bam_init_recover(dbenv)) != 0)
goto err;
@ -199,12 +199,12 @@ db_appinit(db_home, db_config, dbenv, flags)
goto err;
if ((ret = __txn_init_recover(dbenv)) != 0)
goto err;
}
/* Run recovery if necessary. */
if (LF_ISSET(DB_RECOVER | DB_RECOVER_FATAL) && (ret =
__db_apprec(dbenv, LF_ISSET(DB_RECOVER | DB_RECOVER_FATAL))) != 0)
goto err;
if (LF_ISSET(DB_RECOVER | DB_RECOVER_FATAL) &&
(ret = __db_apprec(dbenv,
LF_ISSET(DB_RECOVER | DB_RECOVER_FATAL))) != 0)
goto err;
}
return (ret);
@ -282,21 +282,21 @@ db_appexit(dbenv)
* it in allocated space.
*
* PUBLIC: int __db_appname __P((DB_ENV *,
* PUBLIC: APPNAME, const char *, const char *, int *, char **));
* PUBLIC: APPNAME, const char *, const char *, u_int32_t, int *, char **));
*/
int
__db_appname(dbenv, appname, dir, file, fdp, namep)
__db_appname(dbenv, appname, dir, file, tmp_oflags, fdp, namep)
DB_ENV *dbenv;
APPNAME appname;
const char *dir, *file;
u_int32_t tmp_oflags;
int *fdp;
char **namep;
{
DB_ENV etmp;
size_t len;
int ret, slash, tmp_create, tmp_free;
int data_entry, ret, slash, tmp_create, tmp_free;
const char *a, *b, *c;
int data_entry;
char *p, *start;
a = b = c = NULL;
@ -349,8 +349,8 @@ __db_appname(dbenv, appname, dir, file, fdp, namep)
*
* DB_ENV APPNAME RESULT
* -------------------------------------------
* null DB_APP_TMP <tmp>/<create>
* set DB_APP_TMP DB_HOME/DB_TMP_DIR/<create>
* null DB_APP_TMP* <tmp>/<create>
* set DB_APP_TMP* DB_HOME/DB_TMP_DIR/<create>
*/
retry: switch (appname) {
case DB_APP_NONE:
@ -431,7 +431,14 @@ done: len =
(c == NULL ? 0 : strlen(c) + 1) +
(file == NULL ? 0 : strlen(file) + 1);
if ((start = (char *)__db_malloc(len)) == NULL) {
/*
* Allocate space to hold the current path information, as well as any
* temporary space that we're going to need to create a temporary file
* name.
*/
#define DB_TRAIL "XXXXXX"
if ((start =
(char *)__db_malloc(len + sizeof(DB_TRAIL) + 10)) == NULL) {
__db_err(dbenv, "%s", strerror(ENOMEM));
if (tmp_free)
FREES(etmp.db_tmp_dir);
@ -460,14 +467,15 @@ done: len =
FREES(etmp.db_tmp_dir);
/* Create the file if so requested. */
if (tmp_create) {
ret = __db_tmp_open(dbenv, start, fdp);
if (tmp_create &&
(ret = __db_tmp_open(dbenv, tmp_oflags, start, fdp)) != 0) {
FREES(start);
} else {
*namep = start;
ret = 0;
return (ret);
}
return (ret);
if (namep != NULL)
*namep = start;
return (0);
}
/*
@ -478,7 +486,7 @@ static int
__db_home(dbenv, db_home, flags)
DB_ENV *dbenv;
const char *db_home;
int flags;
u_int32_t flags;
{
const char *p;
@ -532,10 +540,12 @@ __db_parse(dbenv, s)
return (ENOMEM);
tp = local_s;
while ((name = strsep(&tp, " \t")) != NULL && *name == '\0');
while ((name = strsep(&tp, " \t")) != NULL && *name == '\0')
;
if (name == NULL)
goto illegal;
while ((value = strsep(&tp, " \t")) != NULL && *value == '\0');
while ((value = strsep(&tp, " \t")) != NULL && *value == '\0')
;
if (value == NULL) {
illegal: ret = EINVAL;
__db_err(dbenv, "illegal name-value pair: %s", s);
@ -591,7 +601,7 @@ static char *sTempFolder;
static int
__db_tmp_dir(dbenv, flags)
DB_ENV *dbenv;
int flags;
u_int32_t flags;
{
static const char * list[] = { /* Ordered: see db_appinit(3). */
"/var/tmp",
@ -671,49 +681,45 @@ __db_tmp_dir(dbenv, flags)
* Create a temporary file.
*/
static int
__db_tmp_open(dbenv, dir, fdp)
__db_tmp_open(dbenv, flags, path, fdp)
DB_ENV *dbenv;
char *dir;
u_int32_t flags;
char *path;
int *fdp;
{
#ifdef HAVE_SIGFILLSET
sigset_t set, oset;
#endif
u_long pid;
size_t len;
int isdir, ret;
char *trv, buf[MAXPATHLEN];
int mode, isdir, ret;
const char *p;
char *trv;
/*
* Check the target directory; if you have six X's and it doesn't
* exist, this runs for a *very* long time.
*/
if ((ret = __db_exists(dir, &isdir)) != 0) {
__db_err(dbenv, "%s: %s", dir, strerror(ret));
if ((ret = __db_exists(path, &isdir)) != 0) {
__db_err(dbenv, "%s: %s", path, strerror(ret));
return (ret);
}
if (!isdir) {
__db_err(dbenv, "%s: %s", dir, strerror(EINVAL));
__db_err(dbenv, "%s: %s", path, strerror(EINVAL));
return (EINVAL);
}
/* Build the path. */
#define DB_TRAIL "/XXXXXX"
if ((len = strlen(dir)) + sizeof(DB_TRAIL) > sizeof(buf)) {
__db_err(dbenv,
"tmp_open: %s: %s", buf, strerror(ENAMETOOLONG));
return (ENAMETOOLONG);
}
(void)strcpy(buf, dir);
(void)strcpy(buf + len, DB_TRAIL);
buf[len] = PATH_SEPARATOR[0]; /* WIN32 */
for (trv = path; *trv != '\0'; ++trv)
;
*trv = PATH_SEPARATOR[0];
for (p = DB_TRAIL; (*++trv = *p) != '\0'; ++p)
;
/*
* Replace the X's with the process ID. Pid should be a pid_t,
* but we use unsigned long for portability.
*/
for (pid = getpid(),
trv = buf + len + sizeof(DB_TRAIL) - 1; *--trv == 'X'; pid /= 10)
for (pid = getpid(); *--trv == 'X'; pid /= 10)
switch (pid % 10) {
case 0: *trv = '0'; break;
case 1: *trv = '1'; break;
@ -728,30 +734,33 @@ __db_tmp_open(dbenv, dir, fdp)
}
++trv;
/* Set up open flags and mode. */
LF_SET(DB_CREATE | DB_EXCL);
mode = __db_omode("rw----");
/*
* Try and open a file. We block every signal we can get our hands
* Try to open a file. We block every signal we can get our hands
* on so that, if we're interrupted at the wrong time, the temporary
* file isn't left around -- of course, if we drop core in-between
* the calls we'll hang forever, but that's probably okay. ;-}
*/
#ifdef HAVE_SIGFILLSET
(void)sigfillset(&set);
if (LF_ISSET(DB_TEMPORARY))
(void)sigfillset(&set);
#endif
for (;;) {
#ifdef HAVE_SIGFILLSET
(void)sigprocmask(SIG_BLOCK, &set, &oset);
if (LF_ISSET(DB_TEMPORARY))
(void)sigprocmask(SIG_BLOCK, &set, &oset);
#endif
#define DB_TEMPOPEN DB_CREATE | DB_EXCL | DB_TEMPORARY
if ((ret = __db_open(buf,
DB_TEMPOPEN, DB_TEMPOPEN, S_IRUSR | S_IWUSR, fdp)) == 0) {
ret = __db_open(path, flags, flags, mode, fdp);
#ifdef HAVE_SIGFILLSET
if (LF_ISSET(DB_TEMPORARY))
(void)sigprocmask(SIG_SETMASK, &oset, NULL);
#endif
if (ret == 0)
return (0);
}
#ifdef HAVE_SIGFILLSET
(void)sigprocmask(SIG_SETMASK, &oset, NULL);
#endif
/*
* XXX:
* If we don't get an EEXIST error, then there's something
@ -761,7 +770,7 @@ __db_tmp_open(dbenv, dir, fdp)
*/
if (ret != EEXIST) {
__db_err(dbenv,
"tmp_open: %s: %s", buf, strerror(ret));
"tmp_open: %s: %s", path, strerror(ret));
return (ret);
}