1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-06-19 16:01:03 +03:00
Files
argp
assert
benchtests
bits
catgets
conf
conform
crypt
csu
ctype
debug
dirent
dlfcn
elf
gmon
gnulib
grp
gshadow
hesiod
hurd
iconv
iconvdata
include
inet
intl
io
libidn
libio
locale
localedata
login
mach
malloc
manual
math
misc
nis
nptl
nptl_db
nscd
nss
po
posix
pwd
resolv
resource
rt
scripts
setjmp
shadow
signal
socket
soft-fp
stdio-common
stdlib
streams
string
sunrpc
sysdeps
aarch64
alpha
arm
generic
gnu
hppa
i386
ia64
ieee754
init_array
m68k
mach
microblaze
mips
nptl
posix
powerpc
pthread
s390
sh
sparc
tile
unix
alpha
arm
bsd
i386
inet
mips
powerpc
sh
sysv
linux
aarch64
alpha
arm
bits
generic
hppa
i386
ia64
m68k
microblaze
mips
net
netash
netatalk
netax25
neteconet
netinet
netipx
netiucv
netpacket
netrom
netrose
nfs
powerpc
s390
scsi
sh
sparc
sys
tile
wordsize-64
x86
x86_64
Implies
Makefile
Versions
_G_config.h
_exit.c
a.out.h
accept.S
accept4.c
adjtime.c
aio_sigqueue.c
arch-fork.h
bind.S
check_native.c
check_pf.c
clock.c
clock_getcpuclockid.c
clock_getres.c
clock_gettime.c
clock_nanosleep.c
clock_settime.c
cmsg_nxthdr.c
configure
configure.ac
connect.S
device-nrs.h
dl-brk.c
dl-execstack.c
dl-fxstatat64.c
dl-getcwd.c
dl-librecon.h
dl-openat64.c
dl-opendir.c
dl-origin.c
dl-osinfo.h
dl-sbrk.c
dl-sysdep.c
dl-sysdep.h
dl-vdso.c
dl-vdso.h
dl-writev.h
epoll_pwait.c
errqueue.h
eventfd.c
eventfd_read.c
eventfd_write.c
execve.c
exit-thread.h
faccessat.c
fallocate.c
fallocate64.c
fatal-prepare.h
fchmodat.c
fchownat.c
fcntl.c
fd_to_filename.h
fexecve.c
fips-private.h
fpathconf.c
fstatfs64.c
fstatvfs.c
fstatvfs64.c
ftime.c
ftruncate64.c
futimens.c
futimes.c
futimesat.c
fxstat.c
fxstat64.c
fxstatat.c
fxstatat64.c
gai_sigqueue.c
getclktck.c
getcwd.c
getdents.c
getdents64.c
getdirentries.c
getdirentries64.c
getdtsz.c
gethostid.c
getipv4sourcefilter.c
getloadavg.c
getlogin.c
getlogin_r.c
getpagesize.c
getpeername.S
getpriority.c
getpt.c
getrlimit64.c
getsockname.S
getsockopt.S
getsourcefilter.c
getsysstats.c
grantpt.c
if_index.c
ifaddrs.c
ifreq.c
internal_accept4.S
internal_recvmmsg.S
internal_sendmmsg.S
internal_statvfs.c
internal_statvfs64.c
ipc_priv.h
kernel-features.h
kernel-posix-cpu-timers.h
kernel_sigaction.h
kernel_stat.h
kernel_termios.h
ldd-rewrite.sed
lddlibc4.c
ldsodefs.h
libc_fatal.c
linkat.c
linux_fsinfo.h
listen.S
llseek.c
local-setxid.h
lseek64.c
lutimes.c
lxstat.c
lxstat64.c
makedev.c
malloc-sysdep.h
mkdirat.c
mmap64.c
mq_close.c
mq_getattr.c
mq_notify.c
mq_open.c
mq_receive.c
mq_send.c
mq_unlink.c
msgctl.c
msgget.c
msgrcv.c
msgsnd.c
netlinkaccess.h
nice.c
not-cancel.h
nscd_setup_thread.c
ntp_gettime.c
ntp_gettimex.c
open64.c
openat.c
openat64.c
opendir.c
opensock.c
pathconf.c
pathconf.h
paths.h
posix_fadvise.c
posix_fadvise64.c
posix_fallocate.c
posix_fallocate64.c
posix_madvise.c
ppoll.c
pread.c
pread64.c
preadv.c
preadv64.c
prlimit.c
prof-freq.c
profil.c
pselect.c
pthread_sigmask.c
ptrace.c
ptsname.c
pwrite.c
pwrite64.c
pwritev.c
pwritev64.c
readahead.c
readdir64.c
readdir64_r.c
readlinkat.c
readonly-area.c
readv.c
reboot.c
recv.S
recvfrom.S
recvmmsg.c
recvmsg.S
remove.c
renameat.c
sa_len.c
sched_getaffinity.c
sched_getcpu.c
sched_setaffinity.c
segfault.c
semctl.c
semget.c
semop.c
semtimedop.c
send.S
sendmmsg.c
sendmsg.S
sendto.S
setegid.c
seteuid.c
setgid.c
setgroups.c
sethostid.c
setipv4sourcefilter.c
setregid.c
setresgid.c
setresuid.c
setreuid.c
setrlimit64.c
setsockopt.S
setsourcefilter.c
setuid.c
shm_open.c
shm_unlink.c
shmat.c
shmctl.c
shmdt.c
shmget.c
shutdown.S
sigaction.c
siglist.h
signal.c
signalfd.c
sigpending.c
sigprocmask.c
sigqueue.c
sigreturn.c
sigset-cvt-mask.h
sigstack.c
sigsuspend.c
sigtimedwait.c
sigwait.c
sigwaitinfo.c
sizes.h
sleep.c
socketcall.h
socketpair.S
speed.c
statfs64.c
statvfs.c
statvfs64.c
symlinkat.c
sync_file_range.c
syscalls.list
sysconf.c
sysctl.c
sysctl.mk
syslog.c
system.c
tcdrain.c
tcflow.c
tcflush.c
tcgetattr.c
tcgetpgrp.c
tcsendbrk.c
tcsetattr.c
tcsetpgrp.c
termio.h
testrtsig.h
time.c
times.c
timespec_get.c
truncate64.c
tst-clone.c
tst-fanotify.c
tst-getcpu.c
ttyname.c
ttyname_r.c
ualarm.c
umount.S
umount2.S
unlinkat.c
unlockpt.c
updwtmp.c
usleep.c
ustat.c
utimensat.c
utimes.c
utmp_file.c
vfork.c
wait.c
wait3.c
waitid.c
waitpid.c
writev.c
xmknod.c
xmknodat.c
xstat.c
xstat64.c
xstatconv.c
xstatconv.h
x86_64
Implies
Makefile
Subdirs
clock_gettime.c
clock_nanosleep.c
clock_settime.c
confstr.h
get_child_max.c
getlogin.c
getlogin_r.c
getpagesize.c
grantpt.c
ifreq.c
make-syscalls.sh
s-proto-cancel.S
s-proto.S
setxid.h
sockatmark.c
stime.c
syscall-template.S
syscall.S
syscalls.list
sysdep.h
wordsize-32
wordsize-64
x86
x86_64
sysvipc
termios
time
timezone
wcsmbs
wctype
.gitattributes
.gitignore
BUGS
CANCEL-FCT-WAIVE
CANCEL-FILE-WAIVE
CONFORMANCE
COPYING
COPYING.LIB
ChangeLog
ChangeLog.1
ChangeLog.10
ChangeLog.11
ChangeLog.12
ChangeLog.13
ChangeLog.14
ChangeLog.15
ChangeLog.16
ChangeLog.17
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8
ChangeLog.9
ChangeLog.old-ports
ChangeLog.old-ports-aarch64
ChangeLog.old-ports-aix
ChangeLog.old-ports-alpha
ChangeLog.old-ports-am33
ChangeLog.old-ports-arm
ChangeLog.old-ports-cris
ChangeLog.old-ports-hppa
ChangeLog.old-ports-ia64
ChangeLog.old-ports-linux-generic
ChangeLog.old-ports-m68k
ChangeLog.old-ports-microblaze
ChangeLog.old-ports-mips
ChangeLog.old-ports-powerpc
ChangeLog.old-ports-tile
INSTALL
LICENSES
Makeconfig
Makefile
Makefile.in
Makerules
NAMESPACE
NEWS
PROJECTS
README
Rules
WUR-REPORT
abi-tags
aclocal.m4
config.h.in
config.make.in
configure
configure.ac
cppflags-iterator.mk
extra-lib.mk
extra-modules.mk
libc-abis
o-iterator.mk
shlib-versions
test-skeleton.c
version.h
glibc/sysdeps/unix/sysv/linux/posix_madvise.c

38 lines
1.4 KiB
C

/* Copyright (C) 2007-2014 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 Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <sysdep.h>
#include <sys/mman.h>
int
posix_madvise (void *addr, size_t len, int advice)
{
/* We have one problem: the kernel's MADV_DONTNEED does not
correspond to POSIX's POSIX_MADV_DONTNEED. The former simply
discards changes made to the memory without writing it back to
disk, if this would be necessary. The POSIX behavior does not
allow this. There is no functionality mapping the POSIX behavior
so far so we ignore that advice for now. */
if (advice == POSIX_MADV_DONTNEED)
return 0;
INTERNAL_SYSCALL_DECL (err);
int result = INTERNAL_SYSCALL (madvise, err, 3, addr, len, advice);
return INTERNAL_SYSCALL_ERRNO (result, err);
}