[GHC] #16099: expose st_blksize field from fstat syscall

GHC ghc-devs at haskell.org
Thu Dec 27 17:36:24 UTC 2018


#16099: expose st_blksize field from fstat syscall
----------------------------------------+---------------------------------
           Reporter:  flip101           |             Owner:  (none)
               Type:  feature request   |            Status:  new
           Priority:  low               |         Milestone:
          Component:  libraries/unix    |           Version:  8.6.3
           Keywords:                    |  Operating System:  POSIX
       Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
          Test Case:                    |        Blocked By:
           Blocking:                    |   Related Tickets:
Differential Rev(s):                    |         Wiki Page:
----------------------------------------+---------------------------------
 The libc manual talks about buffer sizes.

 https://www.gnu.org/software/libc/manual/html_node/Controlling-
 Buffering.html

 They advise:
 Actually, you can get an even better value to use for the buffer size by
 means of the fstat system call: it is found in the st_blksize field of the
 file attributes. See Attribute Meanings.

 It's just that the st_blksize field it stepped over in the haskell
 definition of it:

 https://github.com/haskell/unix/blob/8d188ed8067af17dfcc2cd6cbbfda7294ba17e17/System/Posix/Files/Common.hsc#L280-L283

 Which goes directly from filesize to accesstime

 See also https://linux.die.net/man/2/fstat

 Would be nice to expose the additional fields as well

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16099>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list