[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#633402: Bug#674260: RM: aspectc++ [kfreebsd-i386 kfreebsd-amd64] -- ROM; FTBFS on kfreebsd



2012/5/29 Reinhard Tartler <siretart@tauware.de>:
> What I find a bit irritating is that while using the same glibc version,
> Debian/kFreeBSD ships a different /usr/include/bits/fnctl.h to the other
> Debian architectures.
>
> The kFreeBSD Version reads:
>
> struct flock
>  {
>    __off_t l_start;    /* Offset where the lock begins.  */
>    __off_t l_len;      /* Size of the locked area; zero means until EOF.  */
>    __pid_t l_pid;      /* Process holding the lock.  */
>    short int l_type;   /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
>    short int l_whence; /* Where `l_start' is relative to (like `lseek').  */
>    int __l_sysid;      /* remote system id or zero for local */
>  };
>
> While the Linux version reads:
>
> struct flock
>  {
>    short int l_type;   /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
>    short int l_whence; /* Where `l_start' is relative to (like `lseek').  */
> #ifndef __USE_FILE_OFFSET64
>    __off_t l_start;    /* Offset where the lock begins.  */
>    __off_t l_len;      /* Size of the locked area; zero means until EOF.  */
> #else
>    __off64_t l_start;  /* Offset where the lock begins.  */
>    __off64_t l_len;    /* Size of the locked area; zero means until EOF.  */
> #endif
>    __pid_t l_pid;      /* Process holding the lock.  */
>  };
>
>
> Why on earth has the kFreeBSD version of glibc decided to shuffle around
> the members of the flock struct?

Kernel ABI is different.  Not all of glibc are user structures....

> While discussing the order in detail,
> the POSIX spec [1] does mention 'struct flock' having a order of members
> that matches the Linux version.
>
> [1] http://pubs.opengroup.org/onlinepubs/009695399/basedefs/fcntl.h.html
>
> The FreeBSD *kernel* on the other hand does not seem to obey this
> ordering [2]. Obviously, glibc has to model the flock structure after
> what is being passed down from the kernel. *sigh*
>
> [2] http://fxr.watson.org/fxr/source/sys/fcntl.h

...but it seems you already knew that.  Why did you ask? :-)

If kernel ABI violates POSIX in some way, this should be discussed
with upstream (freebsd-arch@freebsd.org).  Even if we agreed with you,
we couldn't change it on our own.

-- 
Robert Millan


Reply to: