1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Added check for LL suffix to long long ints needed by AIX 4.3.x compiler

to allow successful build.
Jeremy.
This commit is contained in:
Jeremy Allison 0001-01-01 00:00:00 +00:00
parent 1c9d2c016a
commit 567713a07c
5 changed files with 334 additions and 185 deletions

View File

@ -119,3 +119,4 @@
#undef NEED_SGI_SEMUN_HACK
#undef SYSCONF_SC_NGROUPS_MAX
#undef HAVE_UX_UT_SYSLEN
#undef COMPILER_SUPPORTS_LL

409
source/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -548,6 +548,18 @@ if test x"$samba_cv_have_longlong" = x"yes"; then
AC_DEFINE(HAVE_LONGLONG)
fi
#
# Check if the compiler supports the LL prefix on long long integers.
# AIX needs this.
AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
AC_DEFINE(COMPILER_SUPPORTS_LL)
fi
AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
AC_TRY_RUN([#include <stdio.h>
#include <sys/stat.h>

View File

@ -185,6 +185,7 @@
#undef NEED_SGI_SEMUN_HACK
#undef SYSCONF_SC_NGROUPS_MAX
#undef HAVE_UX_UT_SYSLEN
#undef COMPILER_SUPPORTS_LL
/* The number of bytes in a int. */
#undef SIZEOF_INT

View File

@ -0,0 +1,96 @@
/* test whether 64 bit fcntl locking really works on this system */
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#endif
#include <errno.h>
static int sys_waitpid(pid_t pid,int *status,int options)
{
#ifdef HAVE_WAITPID
return waitpid(pid,status,options);
#else /* USE_WAITPID */
return wait4(pid, status, options, NULL);
#endif /* USE_WAITPID */
}
#define DATA "conftest.fcntl64"
/* lock a byte range in a open file */
int main(int argc, char *argv[])
{
struct flock64 lock;
int fd, ret, status=1;
pid_t pid;
if (!(pid=fork())) {
sleep(2);
fd = open64(DATA, O_RDONLY);
if (fd == -1) exit(1);
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 4;
lock.l_pid = getpid();
lock.l_type = F_WRLCK;
/* check if a lock applies */
ret = fcntl(fd,F_GETLK64,&lock);
if ((ret == -1) ||
(lock.l_type == F_UNLCK)) {
/* printf("No lock conflict\n"); */
exit(1);
} else {
/* printf("lock conflict\n"); */
exit(0);
}
}
fd = open64(DATA, O_RDWR|O_CREAT|O_TRUNC, 0600);
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
#if defined(COMPILER_SUPPORTS_LL)
lock.l_start = 0x100000000LL;
#else
lock.l_start = 0x100000000;
#endif
lock.l_len = 4;
lock.l_pid = getpid();
/* set a 4 byte write lock */
fcntl(fd,F_SETLK64,&lock);
sys_waitpid(pid, &status, 0);
#if defined(WIFEXITED) && defined(WEXITSTATUS)
if(WIFEXITED(status)) {
status = WEXITSTATUS(status);
} else {
status = 1;
}
#else /* defined(WIFEXITED) && defined(WEXITSTATUS) */
status = (status == 0) ? 0 : 1;
#endif /* defined(WIFEXITED) && defined(WEXITSTATUS) */
unlink(DATA);
exit(status);
}