Add an x-ref to where the O_ constants are documented and move the SEEK_ constants after lseek().
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 11d9607..0c2cab7 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -643,6 +643,16 @@
    the file. Availability: Unix, Windows.
 
 
+.. data:: SEEK_SET
+          SEEK_CUR
+          SEEK_END
+
+   Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
+   respectively. Availability: Windows, Unix.
+
+   .. versionadded:: 2.5
+
+
 .. function:: open(file, flags[, mode])
 
    Open the file *file* and set various flags according to *flags* and possibly its
@@ -652,7 +662,7 @@
 
    For a description of the flag and mode values, see the C run-time documentation;
    flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) are defined in
-   this module too (see below).
+   this module too (see :ref:`open-constants`).
 
    .. note::
 
@@ -725,6 +735,12 @@
       :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its
       :meth:`~file.write` method.
 
+
+.. _open-constants:
+
+``open()`` flag constants
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
 The following constants are options for the *flags* parameter to the
 :func:`~os.open` function.  They can be combined using the bitwise OR operator
 ``|``.  Some of them are not available on all platforms.  For descriptions of
@@ -776,16 +792,6 @@
    the C library.
 
 
-.. data:: SEEK_SET
-          SEEK_CUR
-          SEEK_END
-
-   Parameters to the :func:`lseek` function. Their values are 0, 1, and 2,
-   respectively. Availability: Windows, Unix.
-
-   .. versionadded:: 2.5
-
-
 .. _os-file-dir:
 
 Files and Directories