def sys_fstat64(self, fd, buf):
try:<EOL><INDENT>stat = self._get_fd(fd).stat()<EOL><DEDENT>except FdError as e:<EOL><INDENT>logger.info("<STR_LIT>")<EOL>return -e.err<EOL><DEDENT>def add(width, val):<EOL><INDENT>fformat = {<NUM_LIT:2>: '<STR_LIT:H>', <NUM_LIT:4>: '<STR_LIT:L>', <NUM_LIT:8>: '<STR_LIT>'}[width]<EOL>return struct.pack('<STR_LIT:<>' + fformat, val)<EOL><DEDENT>def to_timespec(ts):<EOL><INDENT>return struct.pack('<STR_LIT>', int(ts), int(ts % <NUM_LIT:1> * <NUM_LIT>))<EOL><DEDENT>bufstat = add(<NUM_LIT:8>, stat.st_dev)        <EOL>bufstat += add(<NUM_LIT:8>, stat.st_ino)        <EOL>bufstat += add(<NUM_LIT:4>, stat.st_mode)       <EOL>bufstat += add(<NUM_LIT:4>, stat.st_nlink)      <EOL>bufstat += add(<NUM_LIT:4>, stat.st_uid)        <EOL>bufstat += add(<NUM_LIT:4>, stat.st_gid)        <EOL>bufstat += add(<NUM_LIT:8>, stat.st_rdev)       <EOL>bufstat += add(<NUM_LIT:8>, <NUM_LIT:0>)                  <EOL>bufstat += add(<NUM_LIT:8>, stat.st_size)       <EOL>bufstat += add(<NUM_LIT:4>, stat.st_blksize)    <EOL>bufstat += add(<NUM_LIT:4>, <NUM_LIT:0>)                  <EOL>bufstat += add(<NUM_LIT:8>, stat.st_blocks)     <EOL>bufstat += to_timespec(stat.st_atime)  <EOL>bufstat += to_timespec(stat.st_mtime)  <EOL>bufstat += to_timespec(stat.st_ctime)  <EOL>bufstat += add(<NUM_LIT:4>, <NUM_LIT:0>)                   <EOL>bufstat += add(<NUM_LIT:4>, <NUM_LIT:0>)                   <EOL>self.current.write_bytes(buf, bufstat)<EOL>return <NUM_LIT:0><EOL>
Determines information about a file based on its file descriptor (for Linux 64 bits).
:rtype: int
:param fd: the file descriptor of the file that is being inquired.
:param buf: a buffer where data about the file will be stored.
:return: C{0} on success, EBADF when called with bad fd
:todo: Fix device number.