RFC Add headers in lapi
Get series with b4
b4 am 20171109145443.GA30136@reiVersions newest first
- 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 files | Size | Replies | Applied |
|---|---|---|---|---|
| 2/4 | lapi/socket.h: Move definitions from netstress.c | +0 | 0 replies | |
| 3/4 | lapi: Add lapi/in.h with definition moved from netstress.c | +0 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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_FASTOPENdefinition" [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> ininclude/lapi/fallocate.has it definesFALLOC_FL_KEEP_SIZEfromlinux/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]