lock_file()
#
Lock a file using a file descriptor.
Prototype
PUBLIC int lock_file(
int fd,
int lock_type
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The file descriptor of the file to lock. |
|
|
The type of lock to apply (e.g., shared or exclusive). |
Return Value
Returns 0
on success, or a negative value on failure.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples