I have encountered a problem with the file creation date whe rewriting a file.

In a C compile project with make, make considered to recompile a test.o file.
make called the compiler and test.o was rewritten but the file creation date of 
test.o was NOT updated which drove make into trouble.
I stripped it down and can reproduce this behavior with following shell:

#!/bin/sh
echo "int main(int argc, char ** argv) { return (1); }" >test.c
CMD="/opt/studio11/SUNWspro/bin/cc -O -c -o test.o test.c"

# determine filesize if test.o
        $CMD ;
        O_SIZE=`ls -l test.o | awk '{print $5}'`

# create a file test.o filled with zero - length is length of compiler output
        dd if=/dev/zero of=test.o bs=$O_SIZE count=1

#  set specific date an show
        touch 06060606 test.o
        echo "`ls -l test.o` `md5sum <test.o`"

# COMPILE and show
        echo $CMD;  $CMD
        echo "`ls -l test.o` `md5sum <test.o`"
exit
##########################################################################
OUTPUT IS:
# $ sh doit
# 1+0 records in
# 1+0 records out
# -rw-r--r--   1 x2k      x2k         1720 Jun  6 06:06 test.o 
540f34fd91d826aed8a7db434b3e58f2
# /opt/studio11/SUNWspro/bin/cc  -O -c -o test.o test.c
# -rw-r--r--   1 x2k      x2k         1720 Jun  6 06:06 test.o 
be306e32076d49268f889e4d95183f39

#############################################################################
System Info:

                       Solaris 10 1/06 s10s_u1wos_19a SPARC
           Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                           Assembled 07 December 2005

/dev/dsk/c0t1d0s0       /export/home    ufs     
rw,intr,largefiles,logging,xattr,onerror=panic,dev=800080       1158162319

PKG=SPROcc
VERSION=11.0,REV=2005.10.13
PATCH_INFO_121015-02=Installed: Fri Jun 16 10:49:43 CEST 2006 From: xxxxxxxxx   
  Obsoletes:  Requires: Incompatibles:
################################################################################
When trussing the cc you see something like:
# 12538:  open("test.o", O_RDWR|O_CREAT, 0666)            = 3
# 12538:  fcntl(3, F_GETFD, 0x007CE180)                   = 0
# 12538:  llseek(3, 0, SEEK_END)                          = 1720
# 12538:  munmap(0xFF310000, 8192)                        = 0
# 12538:  munmap(0xFF310000, 8192)                        = 0
# 12538:  fcntl(3, F_FREESP, 0xFFBFF2F4)                  = 0
# 12538:  mmap(0x00000000, 1720, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 
0xFF310000
# 12538:  memcntl(0xFF310000, 1720, MC_SYNC, MS_SYNC, 0, 0) = 0
# 12538:  munmap(0xFF310000, 1720)                        = 0
# 12538:  close(3)                                        = 0
##############################################################################
removing logging and largefiles options from mount does not help.
This behaviour is not seen on NFS, TMPFS, LOFS ..
I have tried to enter this story into the bug database but cant find any entry 
up to now.
What is going wrong with ufs  - any ideas?
Thanks in advance
 
 
This message posted from opensolaris.org
_______________________________________________
ufs-discuss mailing list
[email protected]

Reply via email to