The bitwise arithmetic is possibly converting to a signed int, and doesn't have the fchmod function prototype time, but on BSD platforms mode_t is an unsigned short int.
I have been curious, as using the standard C integer promoting rules should suffice here.
The problem is not missing prototype of fchmod(), but of fstat(). The package is built using "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64", and when the <sys/stat.h> is included, the fstat is (correctly) redirected into fstat64. With <fcntl.h> included, and without <sys/stat.h> included, the "struct stat" is 64bit aware, but (implicit) fstat() expects only 32bit structure. As a result, the tStat.st_mode in "fchmod (fileno(ptCreateFile), tStat.st_mode | ((tStat.st_mode & (S_IRUSR | S_IRGRP | S_IROTH)) >> 2))" is not original file mode, but original link count (=1). It does not happen in squeeze, the <fcntl.h> contains /* For XPG all symbols from <sys/stat.h> should also be available. */ #ifdef __USE_XOPEN # include <sys/stat.h> #endif but it happens in sid, as the current <fcntl.h> contains only /* For XPG all symbols from <sys/stat.h> should also be available. */ #if defined __USE_XOPEN || defined __USE_XOPEN2K8 # include <bits/types.h> /* For __mode_t and __dev_t. */ # define __need_timespec # include <time.h> # include <bits/stat.h> Petr -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org