SHARE
TWEET

Untitled

a guest Jan 13th, 2020 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # ponieważ fseeko nie przyjmuje - przynajmniej w NetBSD - negatywnych offsetów
  2. # a setFilePos używa fseeko: https://github.com/nim-lang/Nim/blob/version-1-0/lib/system/io.nim#L571
  3.  
  4. import streams
  5.  
  6. proc c_lseek(f: FileHandle, offset: int64, whence: cint): cint {.
  7.     importc: "lseek", header: "<unistd.h>", tags: [].}
  8.  
  9. var offset: int64 = -2125381424
  10. var file = open("/dev/kmem")
  11. var fh   = getFileHandle(file)
  12. discard c_lseek(fh, offset, 0)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top