home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man2 / seek.2 < prev    next >
Encoding:
Text File  |  1975-06-26  |  958 b   |  61 lines

  1. .th SEEK II 8/5/73
  2. .sh NAME
  3. seek \*- move read/write pointer
  4. .sh SYNOPSIS
  5. (seek = 19.)
  6. .br
  7. (file descriptor in r0)
  8. .ft B
  9. .br
  10. sys seek; offset; ptrname
  11. .s3
  12. seek(fildes, offset, ptrname)
  13. .ft R
  14. .sh DESCRIPTION
  15. The file
  16. descriptor refers to a file open for reading or writing.
  17. The read (resp. write) pointer for the file is set as follows:
  18. .s3
  19. .lp +6 3
  20. if
  21. .it ptrname
  22. is 0, the pointer is set to
  23. .it offset.
  24. .s3
  25. .lp +6 3
  26. if
  27. .it ptrname
  28. is 1, the pointer is set to its current location plus
  29. .it offset.
  30. .s3
  31. .lp +6 3
  32. if
  33. .it ptrname
  34. is 2, the pointer is set to the size of the
  35. file plus
  36. .it offset.
  37. .s3
  38. .lp +6 3
  39. if
  40. .it ptrname
  41. is 3, 4 or 5,
  42. the meaning is as above for
  43. 0, 1 and 2 except that
  44. the offset is
  45. multiplied by 512.
  46. .s3
  47. .i0
  48. If
  49. .it ptrname
  50. is 0 or 3,
  51. .it offset
  52. is unsigned,
  53. otherwise
  54. it is signed.
  55. .sh "SEE ALSO"
  56. open (II), creat (II)
  57. .sh DIAGNOSTICS
  58. The error bit
  59. (c-bit) is set for an undefined file descriptor.
  60. From C, a \*-1 return indicates an error.
  61.