diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-08-26 00:07:26 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-08-26 00:07:26 +0000 |
commit | 08cac4ac19abd40887afbd9d841cd96a8efbbe98 (patch) | |
tree | 4bf358e1cb79b646a43b0fc527436e240ee4edaa /sysdeps | |
parent | 6dbb7062ff2af970c6b8befecf71d7284d5813fb (diff) | |
download | glibc-08cac4ac19abd40887afbd9d841cd96a8efbbe98.zip glibc-08cac4ac19abd40887afbd9d841cd96a8efbbe98.tar.gz glibc-08cac4ac19abd40887afbd9d841cd96a8efbbe98.tar.bz2 |
Update.
1998-08-25 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/generic/dl-cache.c: Move static variable cache and cachesize
to toplevel.
(_dl_unload_cache): New function.
* elf/Versions [libc GLIBC_2.1]: Add _dl_unload_cache.
* elf/dl-open.c (_dl_open): Unload map file before freeing the lock.
* elf/rtld (dl_main): Unload map file before jumping to user code.
* sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Define O_DIRECT.
Correct comment for O_LARGEFILE.
* sysdeps/unix/sysv/linux/bits/fcntl.h: Define O_DIRECT.
Change O_LARGEFILE to correct value.
1998-08-25 14:34 Ulrich Drepper <drepper@cygnus.com>
* libio/iogetline.c (_IO_getline_info): Don't read anything for
N == 0. Patch by HJ Lu.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/dl-cache.c | 22 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/bits/fcntl.h | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/bits/fcntl.h | 7 |
3 files changed, 30 insertions, 5 deletions
diff --git a/sysdeps/generic/dl-cache.c b/sysdeps/generic/dl-cache.c index da7d2e4..f14cf96 100644 --- a/sysdeps/generic/dl-cache.c +++ b/sysdeps/generic/dl-cache.c @@ -44,6 +44,10 @@ struct cache_file } libs[0]; }; +/* This is the starting address and the size of the mmap()ed file. */ +static struct cache_file *cache; +static size_t cachesize; + /* This is the cache ID we expect. Normally it is 3 for glibc linked binaries. */ int _dl_correct_cache_id = 3; @@ -54,8 +58,6 @@ int _dl_correct_cache_id = 3; const char * _dl_load_cache_lookup (const char *name) { - static struct cache_file *cache; - static size_t cachesize; unsigned int i; const char *best; @@ -114,3 +116,19 @@ _dl_load_cache_lookup (const char *name) return best; } + +#ifndef MAP_COPY +/* If the system does not support MAP_COPY we cannot leave the file open + all the time since this would create problems when the file is replaced. + Therefore we provide this function to close the file and open it again + once needed. */ +void +_dl_unload_cache (void) +{ + if (cache != NULL && cache != (struct cache_file *) -1) + { + __munmap (cache, cachesize); + cache = NULL; + } +} +#endif diff --git a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h index 0dc0c47..7cd32a3 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h @@ -43,7 +43,11 @@ #define O_FSYNC O_SYNC #define O_ASYNC 020000 /* fcntl, for BSD compatibility */ -/* XXX missing */ +#ifdef __USE_GNU +# define O_DIRECT 040000 /* Direct disk access. */ +#endif + +/* Not necessary, files are always with 64bit off_t. */ #define O_LARGEFILE 0 /* Values for the second argument to `fcntl'. */ diff --git a/sysdeps/unix/sysv/linux/bits/fcntl.h b/sysdeps/unix/sysv/linux/bits/fcntl.h index 223cb99..c2a8ee9 100644 --- a/sysdeps/unix/sysv/linux/bits/fcntl.h +++ b/sysdeps/unix/sysv/linux/bits/fcntl.h @@ -41,6 +41,10 @@ #define O_FSYNC O_SYNC #define O_ASYNC 020000 +#ifdef __USE_GNU +# define O_DIRECT 040000 /* Direct disk access. */ +#endif + /* For now Linux has synchronisity options for data and read operations. We define the symbols here but let them do the same as O_SYNC since this is a superset. */ @@ -49,9 +53,8 @@ # define O_RSYNC O_SYNC /* Synchronize read operations. */ #endif -/* XXX missing */ #ifdef __USE_LARGEFILE64 -# define O_LARGEFILE 0 +# define O_LARGEFILE 0100000 #endif /* Values for the second argument to `fcntl'. */ |