tools/nolibc/sys: make open() take a vararg on the 3rd argument
authorWilly Tarreau <w@1wt.eu>
Mon, 7 Feb 2022 16:23:36 +0000 (17:23 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 24 Feb 2022 17:56:45 +0000 (09:56 -0800)
commit3edfdacd944a5f9d2fe488fd545d70955e5d9aab
tree76f4c133716704a9d10b6b7a2638b90012969853
parent642921ee0c889eab32016fe8336d6a1a1759b81a
tools/nolibc/sys: make open() take a vararg on the 3rd argument

Let's pass a vararg to open() so that it remains compatible with existing
code. The arg is only dereferenced when flags contain O_CREAT. The function
is generally not inlined anymore, causing an extra call (total 16 extra
bytes) but it's still optimized for constant propagation, limiting the
excess to no more than 16 bytes in practice when open() is called without
O_CREAT, and ~40 with O_CREAT, which remains reasonable.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/include/nolibc/sys.h