All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH 0/4] Add headers in lapi
Date: Thu, 9 Nov 2017 15:54:43 +0100	[thread overview]
Message-ID: <20171109145443.GA30136@rei> (raw)
In-Reply-To: <20171109113947.24609-1-pvorel@suse.cz>

Hi!
> 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...

> 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.

> 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.

-- 
Cyril Hrubis
chrubis@suse.cz

  parent reply	other threads:[~2017-11-09 14:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09 11:39 [LTP] [RFC PATCH 0/4] Add headers in lapi Petr Vorel
2017-11-09 11:39 ` [LTP] [RFC PATCH 1/4] lapi: Add lapi/tcp.h with definitions moved from netstress.c Petr Vorel
2017-11-09 11:39 ` [LTP] [RFC PATCH 2/4] lapi/socket.h: Move definitions " Petr Vorel
2017-11-09 15:17   ` Cyril Hrubis
2017-11-10 13:14   ` Alexey Kodanev
2017-11-21 11:45     ` Petr Vorel
2017-11-09 11:39 ` [LTP] [RFC PATCH 3/4] lapi: Add lapi/in.h with definition moved " Petr Vorel
2017-11-09 15:18   ` Cyril Hrubis
2017-11-09 16:05     ` Petr Vorel
2017-11-21 11:51       ` Petr Vorel
2017-11-09 11:39 ` [LTP] [RFC PATCH 4/4] lapi: Add lapi/dccp.h " Petr Vorel
2017-11-09 14:54 ` Cyril Hrubis [this message]
2017-11-09 15:49   ` [LTP] [RFC PATCH 0/4] Add headers in lapi Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171109145443.GA30136@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.