0917d32013-03-04Anders Johansson // $Id$
34367d2003-09-23Henrik Grubbström (Grubba) // // Detection and workaround for Redhat 9's New Posix Thread Library. // // 2003-09-23 Henrik Grubbström void run(object env) {
37f5b02005-10-31Henrik Grubbström (Grubba) #if !constant(Mysql.mysql) // The Mysql module when compiled on RedHat 7.3 contains the symbol // "errno@@GLIBC_2.0", which is not available in modern GLIBCs. write(" Broken Mysql -- Checking for NPTL... ");
34367d2003-09-23Henrik Grubbström (Grubba)  if (search(Process.popen("/usr/bin/getconf GNU_LIBPTHREAD_VERSION 2>/dev/null"), "NPTL") >= 0) { write("yes (%s)\n");
c224a42009-07-23Henrik Grubbström (Grubba)  write(" Checking if LD_ASSUME_KERNEL might work... "); // On recent releases of Linux, binaries often fail with // error while loading shared libraries: libc.so.6: cannot // open shared object file: No such file or directory // when LD_ASSUME_KERNEL is set. We test with a binary that // the start-script will attempt to use: sed. object in = Stdio.File(); object out = Stdio.File(); object err = Stdio.File(); Process.Process p =
92ced82011-09-12Henrik Grubbström (Grubba)  Process.Process(({ "sed", "-ed" }), ([ "stdin": in->pipe(Stdio.PROP_REVERSE), "stdout": out->pipe(), "stderr": err->pipe(), "env":getenv() + ([ "LD_ASSUME_KERNEL":"2.4.1", ]) ]));
c224a42009-07-23Henrik Grubbström (Grubba)  in->close(); out->close(); err->read(); err->close(); if (!p->wait()) { write("yes\n"); env->set("LD_ASSUME_KERNEL", "2.4.1"); return; }
34367d2003-09-23Henrik Grubbström (Grubba)  }
c224a42009-07-23Henrik Grubbström (Grubba)  write("no\n");
37f5b02005-10-31Henrik Grubbström (Grubba) #endif
34367d2003-09-23Henrik Grubbström (Grubba) }