|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
[ tcl-Bugs-942170 ] HAVE_ST_BLOCKS missing in configureBugs item #942170, was opened at 2004-04-26 10:33
Message generated for change (Comment added) made by matzek You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=942170&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 53. Configuration and Build Tools Group: obsolete: 8.4.6 Status: Open Resolution: Remind Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Stuart Cassoff (stwo) Summary: HAVE_ST_BLOCKS missing in configure Initial Comment: Hi, in the tcl8.4.6 source-code are lines like noadmin@win01:.> find . -type f | xargs grep BLOCKS ./generic/tclTest.c:# ifdef HAVE_ST_BLOCKS ./generic/tclTest.c:# ifdef HAVE_ST_BLOCKS ./generic/tclIOUtil.c:#ifdef HAVE_ST_BLOCKS ./generic/tclIOUtil.c:#ifdef HAVE_ST_BLOCKS ./generic/tclIOUtil.c:#ifdef HAVE_ST_BLOCKS ./generic/tclCmdAH.c:#ifdef HAVE_ST_BLOCKS ths "configure" entries are missing mfg aotto ---------------------------------------------------------------------- Comment By: Matthias Kraft (matzek) Date: 2009-11-06 09:57 Message: So what will Tcl_GetBlocksFromStat() return , if st_blocks is not available? And how does Tcl support me to find out, of which size 1 block in st_blocks is? Don't answer "look at Tcl_GetBlockSizefromStat()"! That's returning st_blksize, and this may or may not the actual block size... Linux "man 2 stat": ---- The st_blocks field indicates the number of blocks allocated to the file, 512-byte units. (This may be smaller than st_size/512 when the file has holes.) The st_blksize field gives the "preferred" blocksize for efficient file system I/O. (Writing to a file in smaller chunks may cause an inefficient read-modify-rewrite.) ---- AIX "man stat.h": ---- st_blksize Size, in bytes of each block of the file. st_blocks Number of blocks actually used by the file (measured in the units specified by the DEV_BSIZE constant). ---- HP-UX "man 5 stat": ---- long st_blksize a filesystem-specific preferred I/O block size for this object. In some filesystem types, this may vary from file to file blkcnt_t st_blocks number of blocks of a filesystem-specific size allocated for this object ---- Solaris "man 2 stat": ---- st_blksize A hint as to the “best” unit size for I/O operations. This field is not defined for block special or character special files. st_blocks The total number of physical blocks of size 512 bytes actually allocated on disk. This field is not defined for block special or character special files. ---- -- Matthias Kraft ---------------------------------------------------------------------- Comment By: Stuart Cassoff (stwo) Date: 2009-11-05 21:02 Message: USE_OBSOLETE_FS_HOOKS enables old code which also uses HAVE_ST_BLOCKS. If HAVE_ST_BLOCKS is enabled then the C function Tcl_Stat and the Tcl command [file stat] will return a 'blocks' field. This has been around since 8.4.0 and seeing as no one seems to be missing it, I'd agree that it should be purged. But! The implementation of TIP 316 has now added: Tcl_GetBlocksFromStat - Returns the st_blocks field as an unsigned wide integer. If HAVE_ST_BLOCKS isn't defined then a guess is made. So perhaps HAVE_ST_BLOCKS should be properly configured and used. The function StoreStatData in generic/tclICmdAH.c could be modified to use the TIP 316 functions. Have all the 'stat' functions/commands return the same fields. As it is now, if HAVE_ST_BLOCKS were to be enabled then the result of [file stat] would contain an 'extra' field. This causes a test failure since the test suite doesn't account for the 'blocks' field either. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2009-11-05 16:57 Message: Support for the obsolete FS hooks is already purged from the HEAD, so if HAVE_ST_BLOCKS is only for their sake, they ought to be purged too. ---------------------------------------------------------------------- Comment By: Matthias Kraft (matzek) Date: 2009-11-05 09:35 Message: Oh ... and the code came in with the implementation of TIP 72. ---------------------------------------------------------------------- Comment By: Matthias Kraft (matzek) Date: 2009-11-05 09:33 Message: Summing up some conversation on the chat about this topic, today: * To enable this code one apparently has to provide the defines HAVE_ST_BLOCKS and USE_OBSOLETE_FS_HOOKS. Neither one is provided via the autoconf stuff. * If I read the commentary in tclIOUtil.c correctly, this was never released and is only in there for backward compatibility for TclPro. * st_blocks itself is relatively useless (IMHO), one have to KNOW the block size of the file system. It is not a part of POSIX, but is an X/Open System Interface. Besides this POSIX documents for sys/stat.h: "The unit for the st_blocks member of the stat structure is not defined within IEEE Std 1003.1-2001. In some implementations it is 512 bytes. It may differ on a file system basis. There is no correlation between values of the st_blocks and st_blksize, and the f_bsize (from <sys/statvfs.h>) structure members. Traditionally, some implementations defined the multiplier for st_blocks in <sys/param.h> as the symbol DEV_BSIZE." -- Matthias Kraft ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=942170&group_id=10894 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Tcl-Bugs mailing list Tcl-Bugs@... https://lists.sourceforge.net/lists/listinfo/tcl-bugs |
| Free embeddable forum powered by Nabble | Forum Help |