Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 134462 Details for
Bug 197191
mmap() does not seem to zero-fill end of maps of files that are ~PAGE_SIZE in length
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Test program to reproduce
test.c (text/plain), 605 bytes, created by
Paul Price
on 2007-10-27 02:57:41 UTC
(
hide
)
Description:
Test program to reproduce
Filename:
MIME Type:
Creator:
Paul Price
Created:
2007-10-27 02:57:41 UTC
Size:
605 bytes
patch
obsolete
>#include <stdio.h> >#include <string.h> >#include <fcntl.h> >#include <unistd.h> >#include <sys/mman.h> >#include <sys/stat.h> > >int main(void) >{ > int fd = open("ppImage.config", O_RDONLY); > struct stat buf; > fstat(fd, &buf); > int nBytes = buf.st_size + 1; > void *file = mmap(0, nBytes, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); > //printf("%ld\n", sysconf(_SC_PAGE_SIZE)); > // printf("%c\n", ((char*)file)[0]); > // ((char*)file)[buf.st_size - 1] = '\0'; > // printf("%zd\n", strlen((char*)file)); > printf("%s\n", (char*)file); > munmap(file, nBytes); > close(fd); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 197191
: 134462 |
134464