[Bug 1739300] Re: The header files fcntl.h and linux/fcntl.h are incompatible

Hans Joachim Desserud 1739300 at bugs.launchpad.net
Wed Dec 20 12:38:24 UTC 2017


>packages linux-libc-dev and libc6-dev (..) these are not packages in
ubuntu?!

They are, but they are part of the linux and glibc source packages,
respectively. Marked both these as affected now. :)


When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. That will add the report in the right place and also include additional information like version numbers automatically. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

** Package changed: build-essential (Ubuntu) => linux (Ubuntu)

** Also affects: glibc (Ubuntu)
   Importance: Undecided
       Status: New

** Tags added: artful

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to build-essential in Ubuntu.
https://bugs.launchpad.net/bugs/1739300

Title:
  The header files fcntl.h and linux/fcntl.h are incompatible

Status in glibc package in Ubuntu:
  New
Status in linux package in Ubuntu:
  New

Bug description:
  The program try.c, below, does not compile.
  Though with HAVE_ARCH_STRUCT_FLOCK and HAVE_ARCH_STRUCT_FLOCK64 defined, it compiles.
  But then fails again to compile, when _GNU_SOURCE is also defined.
  I expect this to compile in all three cases.

  $ cat try.c
  //#define _GNU_SOURCE
  //#define HAVE_ARCH_STRUCT_FLOCK
  //#define HAVE_ARCH_STRUCT_FLOCK64
  #include <fcntl.h>
  #include <linux/fcntl.h>
  int main(int argc, char *argv[]){}

  $ gcc try.c 
  In file included from /usr/include/x86_64-linux-gnu/asm/fcntl.h:1:0,
                   from /usr/include/linux/fcntl.h:4,
                   from try.c:5:
  /usr/include/asm-generic/fcntl.h:195:8: error: redefinition of ‘struct flock’
   struct flock {
          ^~~~~
  In file included from /usr/include/fcntl.h:35:0,
                   from try.c:4:
  /usr/include/x86_64-linux-gnu/bits/fcntl.h:35:8: note: originally defined here
   struct flock
          ^~~~~
  $ gcc -DHAVE_ARCH_STRUCT_FLOCK -DHAVE_ARCH_STRUCT_FLOCK64 try.c ## this is ok

  $ gcc -D_GNU_SOURCE -DHAVE_ARCH_STRUCT_FLOCK -DHAVE_ARCH_STRUCT_FLOCK64 try.c 
  In file included from /usr/include/x86_64-linux-gnu/asm/fcntl.h:1:0,
                   from /usr/include/linux/fcntl.h:4,
                   from try.c:5:
  /usr/include/asm-generic/fcntl.h:155:8: error: redefinition of ‘struct f_owner_ex’
   struct f_owner_ex {
          ^~~~~~~~~~
  In file included from /usr/include/x86_64-linux-gnu/bits/fcntl.h:61:0,
                   from /usr/include/fcntl.h:35,
                   from try.c:4:
  /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h:267:8: note: originally defined here
   struct f_owner_ex
          ^~~~~~~~~~

  $ gcc --version | head -1
  gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0

  $ lsb_release -rd
  Description:	Ubuntu 17.10
  Release:	17.10

  $ dpkg -S /usr/include/x86_64-linux-gnu/bits/fcntl.h
  libc6-dev:amd64: /usr/include/x86_64-linux-gnu/bits/fcntl.h
  # Package: libc6-dev
  # Version: 2.26-0ubuntu2

  $ dpkg -S /usr/include/x86_64-linux-gnu/asm/fcntl.h
  linux-libc-dev:amd64: /usr/include/x86_64-linux-gnu/asm/fcntl.h
  # Package: linux-libc-dev
  # Version: 4.13.0-19.22

  Regards, Mike

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1739300/+subscriptions



More information about the foundations-bugs mailing list