diff options
author | Roland McGrath <roland@gnu.org> | 1995-11-26 17:32:10 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1995-11-26 17:32:10 +0000 |
commit | fbaad1494f7fa9e52c391a926d1c3a015604eb58 (patch) | |
tree | b40487798dd252bb73ced92f96a842e598d0ef05 | |
parent | f44820454cd5266a807041bd5e5ae36b4f4f6d84 (diff) | |
download | glibc-fbaad1494f7fa9e52c391a926d1c3a015604eb58.tar.gz glibc-fbaad1494f7fa9e52c391a926d1c3a015604eb58.tar.xz glibc-fbaad1494f7fa9e52c391a926d1c3a015604eb58.zip |
Sun Nov 26 02:00:02 1995 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* misc/syslog.c (vsyslog) [USE_IN_LIBIO]: Adapted for libio. Thu Nov 23 02:21:55 1995 Ulrich Drepper <drepper@gnu.ai.mit.edu> * sysdeps/unix/sysv/linux/{mlock,munlock,mlockall,munlockall}.S: New files. * sysdeps/unix/sysv/linux/mman.h: Add prototypes for new functions mlock, munlock, mlockall, and munlockall.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | misc/syslog.c | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/mlock.S | 24 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/mlockall.S | 24 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/munlock.S | 24 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/munlockall.S | 24 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sys/mman.h | 24 |
7 files changed, 133 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog index 1317bd786a..2ae4f584e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Sun Nov 26 02:00:02 1995 Ulrich Drepper <drepper@gnu.ai.mit.edu> + + * misc/syslog.c (vsyslog) [USE_IN_LIBIO]: Adapted for libio. + +Thu Nov 23 02:21:55 1995 Ulrich Drepper <drepper@gnu.ai.mit.edu> + + * sysdeps/unix/sysv/linux/{mlock,munlock,mlockall,munlockall}.S: + New files. + * sysdeps/unix/sysv/linux/mman.h: Add prototypes for new functions + mlock, munlock, mlockall, and munlockall. + Thu Nov 23 18:26:52 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * configure.in (--enable-libio): Set $stdio based on $enableval, diff --git a/misc/syslog.c b/misc/syslog.c index ba994eeeb8..068a89e919 100644 --- a/misc/syslog.c +++ b/misc/syslog.c @@ -122,8 +122,14 @@ vsyslog(pri, fmt, ap) f = open_memstream (&buf, &bufsize); prioff = fprintf (f, "<%d>", pri); (void) time (&now); +#ifdef USE_IN_LIBIO + f->_IO_write_ptr += strftime (f->_IO_write_ptr, + f->_IO_write_end - f->_IO_write_ptr, + "%h %e %T ", localtime (&now)); +#else f->__bufp += strftime (f->__bufp, f->__put_limit - f->__bufp, "%h %e %T ", localtime (&now)); +#endif msgoff = ftell (f); if (LogTag == NULL) LogTag = __progname; diff --git a/sysdeps/unix/sysv/linux/mlock.S b/sysdeps/unix/sysv/linux/mlock.S new file mode 100644 index 0000000000..b14f51deba --- /dev/null +++ b/sysdeps/unix/sysv/linux/mlock.S @@ -0,0 +1,24 @@ +/* Copyright (C) 1995 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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <sysdep.h> + +SYSCALL__ (mlock, 2) + ret + +weak_alias (__mlock, mlock) diff --git a/sysdeps/unix/sysv/linux/mlockall.S b/sysdeps/unix/sysv/linux/mlockall.S new file mode 100644 index 0000000000..939ec01f0b --- /dev/null +++ b/sysdeps/unix/sysv/linux/mlockall.S @@ -0,0 +1,24 @@ +/* Copyright (C) 1995 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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <sysdep.h> + +SYSCALL__ (mlockall, 1) + ret + +weak_alias (__mlockall, mlockall) diff --git a/sysdeps/unix/sysv/linux/munlock.S b/sysdeps/unix/sysv/linux/munlock.S new file mode 100644 index 0000000000..50fe9332ee --- /dev/null +++ b/sysdeps/unix/sysv/linux/munlock.S @@ -0,0 +1,24 @@ +/* Copyright (C) 1995 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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <sysdep.h> + +SYSCALL__ (munlock, 2) + ret + +weak_alias (__munlock, munlock) diff --git a/sysdeps/unix/sysv/linux/munlockall.S b/sysdeps/unix/sysv/linux/munlockall.S new file mode 100644 index 0000000000..7d8aeb4683 --- /dev/null +++ b/sysdeps/unix/sysv/linux/munlockall.S @@ -0,0 +1,24 @@ +/* Copyright (C) 1995 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., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#include <sysdep.h> + +SYSCALL__ (munlockall, 0) + ret + +weak_alias (__munlockall, munlockall) diff --git a/sysdeps/unix/sysv/linux/sys/mman.h b/sysdeps/unix/sysv/linux/sys/mman.h index b05738d8e4..9f0ef72100 100644 --- a/sysdeps/unix/sysv/linux/sys/mman.h +++ b/sysdeps/unix/sysv/linux/sys/mman.h @@ -17,10 +17,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* These are the bits used by 4.4 BSD and its derivatives. On systems - (such as GNU) where these facilities are not system services but can be - emulated in the C library, these are the definitions we emulate. */ - #ifndef _SYS_MMAN_H #define _SYS_MMAN_H 1 @@ -70,6 +66,10 @@ Cambridge, MA 02139, USA. */ #define MADV_WILLNEED 3 /* Will need these pages. */ #define MADV_DONTNEED 4 /* Don't need these pages. */ +/* Flags to `mlockall'. */ +#define MCL_CURRENT 1 /* Lock all current mappings. */ +#define MCL_FUTURE 2 /* Lock all future mappings. */ + #include <sys/cdefs.h> __BEGIN_DECLS @@ -106,6 +106,22 @@ int msync __P ((__caddr_t __addr, size_t __len)); for the region starting at ADDR and extending LEN bytes. */ int madvise __P ((__caddr_t __addr, size_t __len, int __advice)); +/* Cause all currently mapped pages of the process to be memory resident + until unlocked by a call to the `munlockall', until the process exits, + or until the process calls `execve'. */ +int mlockall __P ((int __flags)); + +/* All currently mapped pages of the process' address space become + unlocked. */ +int munlockall __P ((void)); + +/* Guarantee all whole pages mapped by the range [ADDR,ADDR+LEN) to + be memory resident. */ +int mlock __P ((__caddr_t __addr, size_t __len)); + +/* Unlock whole pages previously mapped by the range [ADDR,ADDR+LEN). */ +int munlock __P ((__caddr_t __addr, size_t __len)); + __END_DECLS |