[LTP] lapi/fcntl.h: fix O_PATH fallback on alpha

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Tue Jun 2 13:23:53 CEST 2026


Hi XiaoLei Wu,

The fix is correct — arch/alpha/include/uapi/asm/fcntl.h confirms that
alpha defines O_PATH as 040000000, while the asm-generic fallback
010000000 collides with alpha's O_CLOEXEC value, so the bug is real and
the chosen value is right.

One style issue below.

---

> diff --git a/include/lapi/fcntl.h b/include/lapi/fcntl.h
> @@ -137,6 +137,8 @@
>  #ifndef O_PATH
>  # ifdef __sparc__
>  #  define O_PATH 0x1000000
> +# elif defined(__alpha__)
> +#  define O_PATH 040000000
>  # else

The existing arm uses `# ifdef __sparc__`, but the new arm uses
`# elif defined(__alpha__)`.  Within the same #if/#elif chain the
style should be consistent.  Please use `# elif __alpha__` to match
the surrounding code:

  # ifdef __sparc__
  #  define O_PATH 0x1000000
  # elif __alpha__
  #  define O_PATH 040000000
  # else
  #  define O_PATH 010000000
  # endif

---

Commit message looks good: accurate subject, clear rationale, proper
Signed-off-by.

It would be helpful (but not required) to note in the commit body that
the generic value 010000000 maps to O_CLOEXEC on alpha, explaining why
the mismatch causes a silent semantic failure rather than an obvious
error.

Verdict: Needs revision (style fix above)

LTP AI Reviewer


More information about the ltp mailing list