logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

seekdir.3p (3568B)


  1. '\" et
  2. .TH SEEKDIR "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. seekdir
  12. \(em set the position of a directory stream
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <dirent.h>
  17. .P
  18. void seekdir(DIR *\fIdirp\fP, long \fIloc\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIseekdir\fR()
  23. function shall set the position of the next
  24. \fIreaddir\fR()
  25. operation on the directory stream specified by
  26. .IR dirp
  27. to the position specified by
  28. .IR loc .
  29. The value of
  30. .IR loc
  31. should have been returned from an earlier call to
  32. \fItelldir\fR()
  33. using the same directory stream. The new position reverts to the one
  34. associated with the directory stream when
  35. \fItelldir\fR()
  36. was performed.
  37. .P
  38. If the value of
  39. .IR loc
  40. was not obtained from an earlier call to
  41. \fItelldir\fR(),
  42. or if a call to
  43. \fIrewinddir\fR()
  44. occurred between the call to
  45. \fItelldir\fR()
  46. and the call to
  47. \fIseekdir\fR(),
  48. the results of subsequent calls to
  49. \fIreaddir\fR()
  50. are unspecified.
  51. .SH "RETURN VALUE"
  52. The
  53. \fIseekdir\fR()
  54. function shall not return a value.
  55. .SH ERRORS
  56. No errors are defined.
  57. .LP
  58. .IR "The following sections are informative."
  59. .SH EXAMPLES
  60. None.
  61. .SH "APPLICATION USAGE"
  62. None.
  63. .SH RATIONALE
  64. The original standard developers perceived that there were restrictions
  65. on the use of the
  66. \fIseekdir\fR()
  67. and
  68. \fItelldir\fR()
  69. functions related to implementation details, and for that reason these
  70. functions need not be supported on all POSIX-conforming systems. They
  71. are required on implementations supporting the XSI option.
  72. .P
  73. One of the perceived problems of implementation is that returning to a
  74. given point in a directory is quite difficult to describe formally, in
  75. spite of its intuitive appeal, when systems that use B-trees, hashing
  76. functions, or other similar mechanisms to order their directories are
  77. considered. The definition of
  78. \fIseekdir\fR()
  79. and
  80. \fItelldir\fR()
  81. does not specify whether, when using these interfaces, a given
  82. directory entry will be seen at all, or more than once.
  83. .P
  84. On systems not supporting these functions, their capability can
  85. sometimes be accomplished by saving a filename found by
  86. \fIreaddir\fR()
  87. and later using
  88. \fIrewinddir\fR()
  89. and a loop on
  90. \fIreaddir\fR()
  91. to relocate the position from which the filename was saved.
  92. .SH "FUTURE DIRECTIONS"
  93. None.
  94. .SH "SEE ALSO"
  95. .IR "\fIfdopendir\fR\^(\|)",
  96. .IR "\fIreaddir\fR\^(\|)",
  97. .IR "\fItelldir\fR\^(\|)"
  98. .P
  99. The Base Definitions volume of POSIX.1\(hy2017,
  100. .IR "\fB<dirent.h>\fP",
  101. .IR "\fB<sys_types.h>\fP"
  102. .\"
  103. .SH COPYRIGHT
  104. Portions of this text are reprinted and reproduced in electronic form
  105. from IEEE Std 1003.1-2017, Standard for Information Technology
  106. -- Portable Operating System Interface (POSIX), The Open Group Base
  107. Specifications Issue 7, 2018 Edition,
  108. Copyright (C) 2018 by the Institute of
  109. Electrical and Electronics Engineers, Inc and The Open Group.
  110. In the event of any discrepancy between this version and the original IEEE and
  111. The Open Group Standard, the original IEEE and The Open Group Standard
  112. is the referee document. The original Standard can be obtained online at
  113. http://www.opengroup.org/unix/online.html .
  114. .PP
  115. Any typographical or formatting errors that appear
  116. in this page are most likely
  117. to have been introduced during the conversion of the source files to
  118. man page format. To report such errors, see
  119. https://www.kernel.org/doc/man-pages/reporting_bugs.html .