LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 11-15-2005, 07:57 PM   #1
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
Question mmap() bug? - has anyone noticed this?


mmap( ) is supposed to update the access time when using PROT_READ. I discovered that, on my system (FreeBSD 5.4), it doesn't. The test is easy to do: cp uses mmap( ) if the file's size is less than 8mb (check /usr/src/bin/cp/utils.c)

Code:
$ ls -lu /usr/src/kerberos5/README
-rw-r--r--  1 root  wheel  267 Oct 29 18:23 /usr/src/kerberos5/README
$ cp /usr/src/kerberos5/README /tmp
$ ls -lu /usr/src/kerberos5/README
-rw-r--r--  1 root  wheel  267 Oct 29 18:23 /usr/src/kerberos5/README
$ md5 /usr/src/kerberos5/README
MD5 (/usr/src/kerberos5/README) = 3ebe0c3e90e87e987a03435858dfe535
$ ls -lu /usr/src/kerberos5/README
-rw-r--r--  1 root  wheel  267 Nov 15 22:00 /usr/src/kerberos5/README
My mount flags don't contain "noatime", but they're irrelevant because the atime is updated when using read( ).
Code:
$ grep /usr /etc/fstab
/dev/ad0s2d             /usr            ufs     rw              2       2
I've found another bug where mmap( ) accepts a zero length (POSIX states that mmap shall fail), while munmap( ) does complain about it.

http://www.opengroup.org/onlinepubs/...ions/mmap.html


Can anyone test it in different systems and share the results?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
i have noticed something fatenabu Mandriva 4 09-08-2005 12:59 PM
kernel BUG at mmap.c:1159! housemusic42 Linux - General 3 03-22-2004 03:49 PM
Has anyone noticed this in Mandrake 9.1? guitargeek General 7 04-01-2003 11:45 AM
Has anyone else noticed... finegan Slackware 5 07-01-2002 11:02 AM
anyone noticed undeadlinux? tundra Linux - Distributions 4 06-22-2002 04:10 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 02:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration