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

Skip to content

Commit 50ec5c0

Browse files
committed
Add flock; warn about lockdata system dependency when using fcntl.
1 parent 164c36b commit 50ec5c0

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

Doc/lib/libfcntl.tex

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ \section{Built-in Module \sectcode{fcntl}}
3636
\code{IOCTL}.
3737
\end{funcdesc}
3838

39+
\begin{funcdesc}{flock}{fd\, op}
40+
Perform the lock operation \var{op} on file descriptor \var{fd}.
41+
See the Unix manual for details. (On some systems, this function is
42+
emulated using \code{fcntl}.)
43+
\end{funcdesc}
44+
3945
If the library modules \code{FCNTL} or \code{IOCTL} are missing, you
4046
can find the opcodes in the C include files \code{sys/fcntl} and
4147
\code{sys/ioctl}. You can create the modules yourself with the h2py
@@ -57,4 +63,6 @@ \section{Built-in Module \sectcode{fcntl}}
5763

5864
Note that in the first example the return value variable \code{rv} will
5965
hold an integer value; in the second example it will hold a string
60-
value.
66+
value. The structure lay-out for the \var{lockadata} variable is
67+
system dependent -- therefore using the \code{flock()} call may be
68+
better.

Doc/libfcntl.tex

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ \section{Built-in Module \sectcode{fcntl}}
3636
\code{IOCTL}.
3737
\end{funcdesc}
3838

39+
\begin{funcdesc}{flock}{fd\, op}
40+
Perform the lock operation \var{op} on file descriptor \var{fd}.
41+
See the Unix manual for details. (On some systems, this function is
42+
emulated using \code{fcntl}.)
43+
\end{funcdesc}
44+
3945
If the library modules \code{FCNTL} or \code{IOCTL} are missing, you
4046
can find the opcodes in the C include files \code{sys/fcntl} and
4147
\code{sys/ioctl}. You can create the modules yourself with the h2py
@@ -57,4 +63,6 @@ \section{Built-in Module \sectcode{fcntl}}
5763

5864
Note that in the first example the return value variable \code{rv} will
5965
hold an integer value; in the second example it will hold a string
60-
value.
66+
value. The structure lay-out for the \var{lockadata} variable is
67+
system dependent -- therefore using the \code{flock()} call may be
68+
better.

0 commit comments

Comments
 (0)