[all-commits] [llvm/llvm-project] cdc2b9: [libc] Add sys/file.h and flock function. (#222737)

Alexey Samsonov via All-commits all-commits at lists.llvm.org
Thu Sep 10 14:52:55 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cdc2b9445ae4f2c2f9ba19cba2cf249d1fbd2faa
      https://github.com/llvm/llvm-project/commit/cdc2b9445ae4f2c2f9ba19cba2cf249d1fbd2faa
  Author: Alexey Samsonov <vonosmas at gmail.com>
  Date:   2026-09-10 (Thu, 10 Sep 2026)

  Changed paths:
    M libc/config/linux/aarch64/entrypoints.txt
    M libc/config/linux/aarch64/headers.txt
    M libc/config/linux/riscv/entrypoints.txt
    M libc/config/linux/riscv/headers.txt
    M libc/config/linux/x86_64/entrypoints.txt
    M libc/config/linux/x86_64/headers.txt
    M libc/hdr/CMakeLists.txt
    A libc/hdr/sys_file_macros.h
    M libc/include/CMakeLists.txt
    M libc/include/llvm-libc-macros/CMakeLists.txt
    M libc/include/llvm-libc-macros/linux/CMakeLists.txt
    A libc/include/llvm-libc-macros/linux/sys-file-macros.h
    A libc/include/llvm-libc-macros/sys-file-macros.h
    A libc/include/sys/file.yaml
    M libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
    A libc/src/__support/OSUtil/linux/syscall_wrappers/flock.h
    M libc/src/sys/CMakeLists.txt
    A libc/src/sys/file/CMakeLists.txt
    A libc/src/sys/file/flock.h
    A libc/src/sys/file/linux/CMakeLists.txt
    A libc/src/sys/file/linux/flock.cpp
    M libc/test/src/sys/CMakeLists.txt
    A libc/test/src/sys/file/CMakeLists.txt
    A libc/test/src/sys/file/linux/CMakeLists.txt
    A libc/test/src/sys/file/linux/flock_test.cpp

  Log Message:
  -----------
  [libc] Add sys/file.h and flock function. (#222737)

`flock` is a BSD function that manages advisory locks on opened files
(see https://man7.org/linux/man-pages/man2/flock.2.html)

It has enough differences from `fcntl`-based locking mechanism, and is
provided and used on Linux platforms.

* Add `<sys/file.h>` public header on Linux platforms with `flock`
declaration
  and proper macro used for `op` function argument.
* Provide a Linux implementation, which is a simple syscall wrapper
around
  `SYS_flock` syscall.

Assisted by: automated tooling, human-reviewed



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list