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

Bug#641868: alpha: fallocate() in libc6.1 but no declaration in fcntl.h



Package: libc6.1
Version: 2.13-18

The fallocate() interface is present in libc6.1 on Alpha as is easily
verified by:

mjc@aleph:~$ readelf --headers --dynamic --symbols
/lib/alpha-linux-gnu/libc.so.6.1  | grep fallocate
   623: 00000000000e55b0   528 FUNC    GLOBAL DEFAULT [<other>: 88]
11 posix_fallocate64@@GLIBC_2.2
   698: 00000000000e9720    88 FUNC    GLOBAL DEFAULT [<other>: 88]
11 fallocate@@GLIBC_2.10
  1124: 00000000000e9720    88 FUNC    GLOBAL DEFAULT [<other>: 88]
11 fallocate64@@GLIBC_2.10
  2405: 00000000000e55b0   528 FUNC    GLOBAL DEFAULT [<other>: 88]
11 posix_fallocate@@GLIBC_2.2


Only the posix_fallocate() interface is declared in the headers as
verified by:

mjc@aleph:~$ find /usr/include -name \*.h -exec grep -H fallocate {} \;
/usr/include/alpha-linux-gnu/bits/syscall.h:#define SYS_fallocate
__NR_fallocate
/usr/include/asm-generic/unistd.h:#define __NR_fallocate 47
/usr/include/asm-generic/unistd.h:__SYSCALL(__NR_fallocate, sys_fallocate)
/usr/include/fcntl.h:extern int posix_fallocate (int __fd, __off_t
__offset, __off_t __len);
/usr/include/fcntl.h:extern int __REDIRECT (posix_fallocate, (int __fd,
__off64_t __offset,
/usr/include/fcntl.h:		       posix_fallocate64);
/usr/include/fcntl.h:#   define posix_fallocate posix_fallocate64
/usr/include/fcntl.h:extern int posix_fallocate64 (int __fd, __off64_t
__offset, __off64_t __len);
/usr/include/asm/unistd.h:#define __NR_fallocate			480


Source package libtorrent FTBFS because of this.  The configure script
finds fallocate() because it can link to it, sets HAVE_FALLOCATE in the
config.h file, then compilation fails because fallocate() is not
declared in the system headers.  See log:
http://buildd.debian-ports.org/status/fetch.php?pkg=libtorrent&arch=alpha&ver=0.12.7-6&stamp=1312035809

It would seem to me that either one of the two following situations
should hold:

1) It is only intended to provide the posix_fallocate() interface in
which case fallocate() should not be in the library.

2) It is intended to provide both the posix_fallocate() and fallocate()
interfaces therefore they both should be declared in fcntl.h.

Cheers
Michael.



Reply to: