Skip to content

uapi/samples: guard renameat2 flag macros

Masaharu Noguchi linux-fsdevel lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyIn review
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- uapi change now checks the macro values and undefines mismatches
- sample code always undefines the macros up front and documents why

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2uapi: fcntl: guard AT_RENAME_* aliasesinclude/uapi/linux/fcntl.h+14 -11 reply
2/2samples: vfs: avoid libc AT_RENAME_* redefinitionssamples/vfs/test-statx.c+9 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] uapi/samples: guard renameat2 flag macros

Including <linux/fcntl.h> after libc headers leaves the renameat2 flag macros stuck with libc's values, and our sample code in turn redefines them when it includes the uapi header. This little series makes the uapi header resilient to prior definitions and ensures the sample drops any libc remnants before pulling in the kernel constants.

Changes since v1 (based on feedback from David Laight):
- uapi change now checks the macro values and undefines mismatches
- sample code always undefines the macros up front and documents why

Masaharu Noguchi (2):
uapi: fcntl: guard AT_RENAME_* aliases
samples: vfs: avoid libc AT_RENAME_* redefinitions

 include/uapi/linux/fcntl.h | 15 ++++++++++++++-
 samples/vfs/test-statx.c   |  9 +++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

base-commit: e9a6fb0bcdd7609be6969112f3fbfcce3b1d4a7c

Signature · 1 line
2.51.1