Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ff1492

Browse files
author
Skip Montanaro
committed
Add O_SHLOCK & O_EXLOCK. Closes patch #1103951.
1 parent 7726dc0 commit 5ff1492

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

Doc/lib/libos.tex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,9 @@ \subsection{File Descriptor Operations \label{os-fd-ops}}
594594

595595

596596
The following data items are available for use in constructing the
597-
\var{flags} parameter to the \function{open()} function.
597+
\var{flags} parameter to the \function{open()} function. Some items will
598+
not be available on all platforms. For descriptions of their availability
599+
and use, consult \manpage{open}{2}.
598600

599601
\begin{datadesc}{O_RDONLY}
600602
\dataline{O_WRONLY}
@@ -614,6 +616,8 @@ \subsection{File Descriptor Operations \label{os-fd-ops}}
614616
\dataline{O_NDELAY}
615617
\dataline{O_NONBLOCK}
616618
\dataline{O_NOCTTY}
619+
\dataline{O_SHLOCK}
620+
\dataline{O_EXLOCK}
617621
More options for the \var{flag} argument to the \function{open()} function.
618622
Availability: Macintosh, \UNIX.
619623
\end{datadesc}

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ Core and builtins
8181
Extension Modules
8282
-----------------
8383

84+
- Patch #1103951: Expose O_SHLOCK and O_EXLOCK in the posix module if
85+
available on the platform.
86+
8487
- Bug #1166660: The readline module could segfault if hook functions
8588
were set in a different thread than that which called readline.
8689

Modules/posixmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7718,6 +7718,12 @@ all_ins(PyObject *d)
77187718
#ifdef O_LARGEFILE
77197719
if (ins(d, "O_LARGEFILE", (long)O_LARGEFILE)) return -1;
77207720
#endif
7721+
#ifdef O_SHLOCK
7722+
if (ins(d, "O_SHLOCK", (long)O_SHLOCK)) return -1;
7723+
#endif
7724+
#ifdef O_EXLOCK
7725+
if (ins(d, "O_EXLOCK", (long)O_EXLOCK)) return -1;
7726+
#endif
77217727

77227728
/* MS Windows */
77237729
#ifdef O_NOINHERIT

0 commit comments

Comments
 (0)