Skip to content

RFC Add headers in lapi

Cyril Hrubis ltp 1 version New

Get series with b4
b4 am 20171109145443.GA30136@rei

Versions newest first

  1. v1 RFC Latest2 of 4 patches 0 repliesNew

2 of 4 patches are in this archive. The cover letter announces 4.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
2/4lapi/socket.h: Move definitions from netstress.c+0 -00 replies
3/4lapi: Add lapi/in.h with definition moved from netstress.c+0 -02 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [LTP] [RFC PATCH 0/4] Add headers in lapi

Hi!

Quoted 6 lines

I posted this originally in "netstress: Add imports for TCP_FASTOPEN definition" [1], got reply from Alexey [2].

Do we want to include system headers which originaly define definitions in lapi headers? (e.g. include <linux/falloc.h> in include/lapi/fallocate.h as it defines FALLOC_FL_KEEP_SIZE from linux/falloc.h)?
Some of them do it, some not.

I think that it's a bit cleaner to include the system header before we define the fallback definitions, since that way we are sure to pick the system ones even if test writer forgets to include the system header in the test.

But be wary of combining the linux and glibc headers, sometimes that causes collisions and all kinds of problems.

In the case of fallocate the bits/fcntl-linux.h which is included by bits/fcntl.h which is included from fcntl.h defines these constants (on older glibcs, newer include linux/fallocate.h in bits/fcntl-linux.h), so including both fcntl.h and linux/falloc.h will cause macro redefinitions in certain cases...

Quoted 1 line

If yes, do we want to check presence of them with autotools?

Most of the time we do not have to, since these headers are present everywhere. I do not think that we should be adding autoconf checks just in case. So until there is a breakage we should assume that check is not needed.

Quoted 3 lines

What is the purpose of lapi anyway? I suppose just to backport missing features added in recent glibc to older versions or missing in other libc (musl, uclibc, binder).

The purpose is to have fallback definitions in a single place, previously these were repeated over and over in each testcase, and expecially with syscall wrappers that sometimes differ sublty between architectures this was quite complicated to maintain.

Signature · 2 lines
Cyril Hrubis
[email protected]